|
|
@@ -2,6 +2,7 @@ package com.train.service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.train.config.WechatProperties;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.http.HttpEntity;
|
|
|
@@ -111,10 +112,11 @@ public class SubscribeMessageService {
|
|
|
* 从配置读取 messageKey 对应的模板 ID(缺省为空字符串)。
|
|
|
* 配置形如:wechat.message-template.followup-t1: <templateId>
|
|
|
*/
|
|
|
- @Value("${wechat.message-template}")
|
|
|
- private Map<String, String> messageTemplates;
|
|
|
+ @Resource
|
|
|
+ private WechatProperties wechatProperties;
|
|
|
|
|
|
private String templateIdByKey(String messageKey) {
|
|
|
+ Map<String, String> messageTemplates = wechatProperties.getMessageTemplate();
|
|
|
if (messageTemplates == null) {
|
|
|
return "";
|
|
|
}
|