You've already forked FrameTour-BE
@@ -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;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user