From 9fcb472717ace5bf065b05314b19ef46abfd7ca5 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Mon, 20 Oct 2025 14:58:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(notify):=20=E5=A2=9E=E5=8A=A0=E6=99=AF?= =?UTF-8?q?=E5=8C=BA=E9=80=9A=E7=9F=A5=E6=A8=A1=E6=9D=BF=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E5=92=8C=E6=8F=8F=E8=BF=B0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在记录用户通知授权接口中将日志级别从 info 调整为 debug - 在获取景区通知模板及用户授权余额接口中将日志级别从 info 调整为 debug - 根据不同模板 ID 设置对应的标题和描述信息: - 视频生成通知 - 视频下载通知- 视频即将过期通知 -未知模板类型兜底处理 - 在 ScenicTemplateAuthResp 类中新增 title 和 description 字段用于返回模板信息 --- .../notify/UserNotificationAuthController.java | 18 ++++++++++++++++-- .../notify/resp/ScenicTemplateAuthResp.java | 10 ++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/ycwl/basic/controller/mobile/notify/UserNotificationAuthController.java b/src/main/java/com/ycwl/basic/controller/mobile/notify/UserNotificationAuthController.java index f855c288..01796844 100644 --- a/src/main/java/com/ycwl/basic/controller/mobile/notify/UserNotificationAuthController.java +++ b/src/main/java/com/ycwl/basic/controller/mobile/notify/UserNotificationAuthController.java @@ -41,7 +41,7 @@ public class UserNotificationAuthController { @PostMapping("/record") public ApiResponse recordAuthorization( @RequestBody NotificationAuthRecordReq req) { - log.info("记录用户通知授权: templateIds={}, scenicId={}", req.getTemplateIds(), req.getScenicId()); + log.debug("记录用户通知授权: templateIds={}, scenicId={}", req.getTemplateIds(), req.getScenicId()); try { // 获取当前用户ID @@ -98,7 +98,7 @@ public class UserNotificationAuthController { */ @GetMapping("/{scenicId}/templates") public ApiResponse getScenicTemplatesWithAuth(@PathVariable("scenicId") Long scenicId) { - log.info("获取景区通知模板ID及用户授权余额: scenicId={}", scenicId); + log.debug("获取景区通知模板ID及用户授权余额: scenicId={}", scenicId); try { // 获取当前用户ID @@ -130,6 +130,20 @@ public class UserNotificationAuthController { ScenicTemplateAuthResp.TemplateAuthInfo templateAuthInfo = new ScenicTemplateAuthResp.TemplateAuthInfo(); templateAuthInfo.setTemplateId(templateId); + + if (templateId.equals(scenicRepository.getVideoGeneratedTemplateId(scenicId))) { + templateAuthInfo.setTitle("视频生成通知"); + templateAuthInfo.setDescription("当视频生成完成时,我们将通过此方式提醒您"); + } else if (templateId.equals(scenicRepository.getVideoDownloadTemplateId(scenicId))) { + templateAuthInfo.setTitle("视频下载通知"); + templateAuthInfo.setDescription("当您的视频未购买时,我们将通过此方式提醒您"); + } else if (templateId.equals(scenicRepository.getVideoPreExpireTemplateId(scenicId))) { + templateAuthInfo.setTitle("视频即将过期通知"); + templateAuthInfo.setDescription("当您的视频即将过期时,我们将通过此方式提醒您,请及时下载"); + } else { + templateAuthInfo.setTitle("未知模板类型"); + templateAuthInfo.setDescription("未知的模板类型"); + } // 获取授权详情 try { diff --git a/src/main/java/com/ycwl/basic/model/mobile/notify/resp/ScenicTemplateAuthResp.java b/src/main/java/com/ycwl/basic/model/mobile/notify/resp/ScenicTemplateAuthResp.java index 1dd8fcb4..5c287cf6 100644 --- a/src/main/java/com/ycwl/basic/model/mobile/notify/resp/ScenicTemplateAuthResp.java +++ b/src/main/java/com/ycwl/basic/model/mobile/notify/resp/ScenicTemplateAuthResp.java @@ -33,6 +33,16 @@ public class ScenicTemplateAuthResp { */ private String templateId; + /** + * 模板标题 + */ + private String title; + + /** + * 模板描述 + */ + private String description; + /** * 剩余授权次数 */