You've already forked FrameTour-BE
feat(notification):临时绕过授权检查逻辑
- 注释掉原有的授权次数检查和消费逻辑 - 直接返回 true 用于测试目的 - 保留原逻辑代码以备后续恢复
This commit is contained in:
@@ -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;
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user