feat(notify): 添加批量查询用户授权余额功能

- 新增批量查询用户授权余额接口 /api/mobile/notify/auth/batch-remaining
- 实现批量检查用户对多个模板的授权记录功能
- 添加景区所有场景及模板列表查询接口并支持缓存
- 优化授权记录查询性能,使用批量查询替代逐个查询
- 新增批量查询请求对象 BatchRemainingCountReq 和响应对象 WechatSubscribeAllScenesResp
- 在数据层添加批量查询用户授权记录的 SQL 映射
- 实现缓存管理机制,支持所有场景模板配置的缓存读写与清理
This commit is contained in:
2026-01-10 17:30:48 +08:00
parent 02f1392355
commit c9cc90c842
9 changed files with 316 additions and 15 deletions

View File

@@ -78,7 +78,7 @@ public interface UserNotificationAuthorizationMapper extends BaseMapper<UserNoti
/**
* 检查用户是否还有剩余授权次数
*
*
* @param memberId 用户ID
* @param templateId 模板ID
* @param scenicId 景区ID
@@ -89,4 +89,18 @@ public interface UserNotificationAuthorizationMapper extends BaseMapper<UserNoti
@Param("templateId") String templateId,
@Param("scenicId") Long scenicId
);
/**
* 批量查询用户对多个模板的授权记录
*
* @param memberId 用户ID
* @param templateIds 模板ID列表
* @param scenicId 景区ID
* @return 授权记录列表
*/
List<UserNotificationAuthorizationEntity> selectBatchByTemplateIds(
@Param("memberId") Long memberId,
@Param("templateIds") List<String> templateIds,
@Param("scenicId") Long scenicId
);
}