feat(notification):临时绕过授权检查逻辑

- 注释掉原有的授权次数检查和消费逻辑
- 直接返回 true 用于测试目的
- 保留原逻辑代码以备后续恢复
This commit is contained in:
2025-10-20 13:11:28 +08:00
parent 27f356519e
commit 927c4955f8

View File

@@ -92,21 +92,23 @@ 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;
Integer remainingCount = userNotificationAuthorizationService.getRemainingCount(memberId, templateId, scenicId); // try {
if (remainingCount == null || remainingCount <= 0) { // // 先检查剩余次数
log.debug("用户剩余授权次数不足: memberId={}, templateId={}, scenicId={}, remainingCount={}", // Integer remainingCount = userNotificationAuthorizationService.getRemainingCount(memberId, templateId, scenicId);
memberId, templateId, scenicId, remainingCount); // if (remainingCount == null || remainingCount <= 0) {
return false; // 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 consumeAuthorization(memberId, templateId, scenicId);
return false; // } catch (Exception e) {
} // log.error("检查并消费授权异常: memberId={}, templateId={}, scenicId={}", memberId, templateId, scenicId, e);
// return false;
// }
} }
/** /**