From 927c4955f844a17ad5b99da7374cd748c7444069 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Mon, 20 Oct 2025 13:11:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(notification):=E4=B8=B4=E6=97=B6=E7=BB=95?= =?UTF-8?q?=E8=BF=87=E6=8E=88=E6=9D=83=E6=A3=80=E6=9F=A5=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 注释掉原有的授权次数检查和消费逻辑 - 直接返回 true 用于测试目的 - 保留原逻辑代码以备后续恢复 --- .../basic/utils/NotificationAuthUtils.java | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/ycwl/basic/utils/NotificationAuthUtils.java b/src/main/java/com/ycwl/basic/utils/NotificationAuthUtils.java index 873e2ad6..ca69db13 100644 --- a/src/main/java/com/ycwl/basic/utils/NotificationAuthUtils.java +++ b/src/main/java/com/ycwl/basic/utils/NotificationAuthUtils.java @@ -92,21 +92,23 @@ public class NotificationAuthUtils { * @return 是否检查并消费成功 */ public boolean checkAndConsumeAuthorization(Long memberId, String templateId, Long scenicId) { - 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; - } + // 测试 + 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; +// } } /**