You've already forked FrameTour-BE
perf(notify): 优化微信订阅消息配置查询性能
- 为微信订阅消息配置接口添加 Redis 缓存支持 - 在 WechatSubscribeNotifyConfigRepository 中实现缓存读写和清除机制 - 修改 Controller 层接口添加 @IgnoreToken 注解支持匿名访问 - 优化查询逻辑,添加 memberId 为空时的提前返回处理 - 在管理服务中添加缓存清除逻辑,确保配置变更时缓存同步更新 - 实现批量缓存清除功能,支持按景区和全局范围清除缓存
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.ycwl.basic.controller.mobile.notify;
|
||||
|
||||
import com.ycwl.basic.annotation.IgnoreToken;
|
||||
import com.ycwl.basic.model.mobile.notify.resp.WechatSubscribeSceneTemplatesResp;
|
||||
import com.ycwl.basic.model.pc.notify.entity.WechatSubscribeTemplateConfigEntity;
|
||||
import com.ycwl.basic.service.notify.WechatSubscribeNotifyConfigService;
|
||||
@@ -41,6 +42,7 @@ public class WechatSubscribeNotifyController {
|
||||
* 获取“场景”下可申请授权的模板列表(支持按 scenicId 覆盖模板ID/开关/文案)
|
||||
*/
|
||||
@GetMapping("/scenic/{scenicId}/scenes/{sceneKey}/templates")
|
||||
@IgnoreToken
|
||||
public ApiResponse<WechatSubscribeSceneTemplatesResp> listSceneTemplates(@PathVariable("scenicId") Long scenicId,
|
||||
@PathVariable("sceneKey") String sceneKey) {
|
||||
if (scenicId == null) {
|
||||
@@ -56,6 +58,9 @@ public class WechatSubscribeNotifyController {
|
||||
WechatSubscribeSceneTemplatesResp resp = new WechatSubscribeSceneTemplatesResp();
|
||||
resp.setScenicId(scenicId);
|
||||
resp.setSceneKey(sceneKey);
|
||||
if (memberId == null) {
|
||||
return ApiResponse.success(resp);
|
||||
}
|
||||
|
||||
List<WechatSubscribeSceneTemplatesResp.TemplateInfo> templates = new ArrayList<>();
|
||||
for (WechatSubscribeTemplateConfigEntity cfg : configs) {
|
||||
|
||||
Reference in New Issue
Block a user