|
|
@@ -1,15 +1,13 @@
|
|
|
package com.inspur.customer.service.inform.handler;
|
|
|
|
|
|
import com.inspur.customer.object.inform.CommonMessageCO;
|
|
|
+import com.inspur.inform.client.wechat.applet.IWxAppletUserMessageService;
|
|
|
import com.inspur.inform.constants.UserMsgType;
|
|
|
+import com.inspur.inform.constants.applet.WxAppletMessageTemplate;
|
|
|
import com.inspur.inform.object.applet.message.WxAppletUserMessageDto;
|
|
|
-import org.apache.commons.io.IOUtils;
|
|
|
-import org.springframework.core.io.ClassPathResource;
|
|
|
+import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.io.IOException;
|
|
|
-import java.io.InputStream;
|
|
|
-import java.nio.charset.StandardCharsets;
|
|
|
import java.util.Iterator;
|
|
|
|
|
|
/**
|
|
|
@@ -20,14 +18,12 @@ import java.util.Iterator;
|
|
|
@Component
|
|
|
public class WeChatAppletMessageHandler extends AbstractMessageHandler {
|
|
|
|
|
|
- private static final String FILE_PATH_PRE = "appletMessage/";
|
|
|
+ @DubboReference
|
|
|
+ private IWxAppletUserMessageService wxAppletUserMessageService;
|
|
|
|
|
|
- private static final String FILE_PATH_SUF = ".RTF";
|
|
|
-
|
|
|
- public WxAppletUserMessageDto makeWeChatAppletMessage(CommonMessageCO commonMessageCo, String fileName) throws IOException {
|
|
|
+ public WxAppletUserMessageDto makeWeChatAppletMessage(CommonMessageCO commonMessageCo, String fileName) {
|
|
|
// get content
|
|
|
- String filePath = FILE_PATH_PRE + fileName + FILE_PATH_SUF;
|
|
|
- String content = getTemplate(filePath);
|
|
|
+ String content = wxAppletUserMessageService.getTemplate(WxAppletMessageTemplate.getTemplateByFilePath(fileName));
|
|
|
Iterator<String> integer = commonMessageCo.getMessageMap().keySet().iterator();
|
|
|
String key;
|
|
|
while (integer.hasNext()) {
|