【代码评审】SYSTEM:订阅消息

This commit is contained in:
YunaiV
2024-07-29 19:18:23 +08:00
parent f46d47a966
commit 345f41b153
5 changed files with 8 additions and 0 deletions

View File

@ -75,6 +75,7 @@ public class SocialClientApiImpl implements SocialClientApi {
public void sendSubscribeMessage(String templateTitle, Map<String, String> messages, Integer userType, Long userId,
Integer socialType, String path) {
// TODO @puhui999建议是先不拆小方法。因为逻辑的复杂度其实不高哈。合在一个方法里因为咱写了 1.1 1.2 2. 这样的逻辑,也能一下子看懂。
// 1.1 获得订阅模版
SocialWxSubscribeTemplateRespDTO template = getTemplate(templateTitle, userType);
if (template == null) {
@ -104,6 +105,7 @@ public class SocialClientApiImpl implements SocialClientApi {
.setTemplateId(template.getId()).setToUser(openId).setPage(path);
}
// TODO @puhui999建议下沉到 service 实现。
/**
* 获得小程序订阅消息模版
*
@ -120,6 +122,7 @@ public class SocialClientApiImpl implements SocialClientApi {
return CollectionUtil.findOne(templateList, item -> ObjUtil.equal(item.getTitle(), templateTitle));
}
// TODO @puhui999建议下沉到 service 实现。
/**
* 获得用户 openId
*