Compare commits

...

2 Commits

Author SHA1 Message Date
6242a346ce feat(device): 更新设备响应字段
All checks were successful
ZhenTu-BE/pipeline/head This commit looks good
- 将 deviceNo 和 channelNo 字段替换为 previewUrl 和 previewCoverUrl
- 修改 DeviceRespVO 类中的字段定义- 在 AppScenicServiceImpl 中更新设备配置信息的设置逻辑
2025-10-22 12:19:22 +08:00
2d2ed6fc1b Revert "feat(notification):临时绕过授权检查逻辑"
This reverts commit 927c4955f8.
2025-10-21 22:35:08 +08:00
3 changed files with 19 additions and 21 deletions

View File

@@ -38,6 +38,6 @@ public class DeviceRespVO {
private String scenicName; private String scenicName;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date keepaliveAt; private Date keepaliveAt;
private String deviceNo; private String previewUrl;
private String channelNo; private String previewCoverUrl;
} }

View File

@@ -285,8 +285,8 @@ public class AppScenicServiceImpl implements AppScenicService {
deviceRespVO.setNo(device.getNo()); deviceRespVO.setNo(device.getNo());
DeviceConfigManager config = deviceRepository.getDeviceConfigManager(device.getId()); DeviceConfigManager config = deviceRepository.getDeviceConfigManager(device.getId());
deviceRespVO.setDeviceNo(device.getNo()); deviceRespVO.setPreviewUrl(config.getString("preview_url"));
deviceRespVO.setChannelNo(config.getString("channel_no")); deviceRespVO.setPreviewCoverUrl(config.getString("preview_cover_url"));
return deviceRespVO; return deviceRespVO;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
for (DeviceRespVO deviceRespVO : deviceRespVOList) { for (DeviceRespVO deviceRespVO : deviceRespVOList) {

View File

@@ -92,23 +92,21 @@ public class NotificationAuthUtils {
* @return 是否检查并消费成功 * @return 是否检查并消费成功
*/ */
public boolean checkAndConsumeAuthorization(Long memberId, String templateId, Long scenicId) { public boolean checkAndConsumeAuthorization(Long memberId, String templateId, Long scenicId) {
// 测试 try {
return true; // 先检查剩余次数
// try { Integer remainingCount = userNotificationAuthorizationService.getRemainingCount(memberId, templateId, scenicId);
// // 先检查剩余次数 if (remainingCount == null || remainingCount <= 0) {
// Integer remainingCount = userNotificationAuthorizationService.getRemainingCount(memberId, templateId, scenicId); log.debug("用户剩余授权次数不足: memberId={}, templateId={}, scenicId={}, remainingCount={}",
// if (remainingCount == null || remainingCount <= 0) { memberId, templateId, scenicId, remainingCount);
// log.debug("用户剩余授权次数不足: memberId={}, templateId={}, scenicId={}, remainingCount={}", return false;
// memberId, templateId, scenicId, remainingCount); }
// return false;
// } // 尝试消费
// return consumeAuthorization(memberId, templateId, scenicId);
// // 尝试消费 } catch (Exception e) {
// return consumeAuthorization(memberId, templateId, scenicId); log.error("检查并消费授权异常: memberId={}, templateId={}, scenicId={}", memberId, templateId, scenicId, e);
// } catch (Exception e) { return false;
// log.error("检查并消费授权异常: memberId={}, templateId={}, scenicId={}", memberId, templateId, scenicId, e); }
// return false;
// }
} }
/** /**