|
@@ -27,6 +27,8 @@ import org.springframework.stereotype.Service;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
|
+import java.net.URLEncoder;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -185,20 +187,26 @@ public class ReportDingServiceImpl {
|
|
//消息标题
|
|
//消息标题
|
|
body.setTitle(commentUserNickName + "评论了你「" + dateRange + "」的" + reportType);
|
|
body.setTitle(commentUserNickName + "评论了你「" + dateRange + "」的" + reportType);
|
|
|
|
|
|
- //消息内容
|
|
|
|
- List<Form> formList = new ArrayList<>();
|
|
|
|
- Form formContent = new Form();
|
|
|
|
- formContent.setKey("评论内容:\n");
|
|
|
|
- formContent.setValue(reportCommentCreateReqVO.getCommentContent());
|
|
|
|
- formList.add(formContent);
|
|
|
|
- body.setForm(formList);
|
|
|
|
|
|
|
|
- oa.setBody(body);
|
|
|
|
|
|
+ try {
|
|
|
|
+ //消息内容
|
|
|
|
+ List<Form> formList = new ArrayList<>();
|
|
|
|
+ Form formContent = new Form();
|
|
|
|
+ formContent.setKey("评论内容:\n");
|
|
|
|
+ formContent.setValue(URLEncoder.encode(reportCommentCreateReqVO.getCommentContent(),"UTF-8"));
|
|
|
|
+ formList.add(formContent);
|
|
|
|
+ body.setForm(formList);
|
|
|
|
+
|
|
|
|
+ oa.setBody(body);
|
|
|
|
+
|
|
|
|
+ DingMessageDto message = new DingMessageDto(messageUserId);
|
|
|
|
+ message.setMsgType(DingMsg.OA);
|
|
|
|
+ message.setOa(oa);
|
|
|
|
+ dingApi.sendMessage(message);
|
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
|
|
- DingMessageDto message = new DingMessageDto(messageUserId);
|
|
|
|
- message.setMsgType(DingMsg.OA);
|
|
|
|
- message.setOa(oa);
|
|
|
|
- dingApi.sendMessage(message);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//回复评论
|
|
//回复评论
|