You've already forked FrameTour-BE
Compare commits
2 Commits
37033f1b16
...
6242a346ce
| Author | SHA1 | Date | |
|---|---|---|---|
| 6242a346ce | |||
| 2d2ed6fc1b |
@@ -38,6 +38,6 @@ public class DeviceRespVO {
|
||||
private String scenicName;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date keepaliveAt;
|
||||
private String deviceNo;
|
||||
private String channelNo;
|
||||
private String previewUrl;
|
||||
private String previewCoverUrl;
|
||||
}
|
||||
|
||||
@@ -285,8 +285,8 @@ public class AppScenicServiceImpl implements AppScenicService {
|
||||
deviceRespVO.setNo(device.getNo());
|
||||
|
||||
DeviceConfigManager config = deviceRepository.getDeviceConfigManager(device.getId());
|
||||
deviceRespVO.setDeviceNo(device.getNo());
|
||||
deviceRespVO.setChannelNo(config.getString("channel_no"));
|
||||
deviceRespVO.setPreviewUrl(config.getString("preview_url"));
|
||||
deviceRespVO.setPreviewCoverUrl(config.getString("preview_cover_url"));
|
||||
return deviceRespVO;
|
||||
}).collect(Collectors.toList());
|
||||
for (DeviceRespVO deviceRespVO : deviceRespVOList) {
|
||||
|
||||
@@ -92,23 +92,21 @@ public class NotificationAuthUtils {
|
||||
* @return 是否检查并消费成功
|
||||
*/
|
||||
public boolean checkAndConsumeAuthorization(Long memberId, String templateId, Long scenicId) {
|
||||
// 测试
|
||||
return true;
|
||||
// try {
|
||||
// // 先检查剩余次数
|
||||
// Integer remainingCount = userNotificationAuthorizationService.getRemainingCount(memberId, templateId, scenicId);
|
||||
// if (remainingCount == null || remainingCount <= 0) {
|
||||
// log.debug("用户剩余授权次数不足: memberId={}, templateId={}, scenicId={}, remainingCount={}",
|
||||
// memberId, templateId, scenicId, remainingCount);
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// // 尝试消费
|
||||
// return consumeAuthorization(memberId, templateId, scenicId);
|
||||
// } catch (Exception e) {
|
||||
// log.error("检查并消费授权异常: memberId={}, templateId={}, scenicId={}", memberId, templateId, scenicId, e);
|
||||
// return false;
|
||||
// }
|
||||
try {
|
||||
// 先检查剩余次数
|
||||
Integer remainingCount = userNotificationAuthorizationService.getRemainingCount(memberId, templateId, scenicId);
|
||||
if (remainingCount == null || remainingCount <= 0) {
|
||||
log.debug("用户剩余授权次数不足: memberId={}, templateId={}, scenicId={}, remainingCount={}",
|
||||
memberId, templateId, scenicId, remainingCount);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 尝试消费
|
||||
return consumeAuthorization(memberId, templateId, scenicId);
|
||||
} catch (Exception e) {
|
||||
log.error("检查并消费授权异常: memberId={}, templateId={}, scenicId={}", memberId, templateId, scenicId, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user