Browse Source

配置文件修改

master
luoweijian 1 month ago
parent
commit
bb3ae74a7c
  1. 9
      src/main/java/com/project/exam/domain/service/impl/NotifyExamRecordDomainServiceImpl.java

9
src/main/java/com/project/exam/domain/service/impl/NotifyExamRecordDomainServiceImpl.java

@ -4,6 +4,7 @@ import com.github.tingyugetc520.ali.dingtalk.api.DtService;
import com.github.tingyugetc520.ali.dingtalk.bean.message.DtCorpConversationMessage; import com.github.tingyugetc520.ali.dingtalk.bean.message.DtCorpConversationMessage;
import com.github.tingyugetc520.ali.dingtalk.bean.message.DtCorpConversationMsgSendResult; import com.github.tingyugetc520.ali.dingtalk.bean.message.DtCorpConversationMsgSendResult;
import com.github.tingyugetc520.ali.dingtalk.bean.message.DtMessage; import com.github.tingyugetc520.ali.dingtalk.bean.message.DtMessage;
import com.project.ding.config.DingProperties;
import com.project.ding.utils.SecurityUtils; import com.project.ding.utils.SecurityUtils;
import com.project.exam.domain.dto.ExamRecordDTO; import com.project.exam.domain.dto.ExamRecordDTO;
import com.project.exam.domain.service.NotifyExamRecordDomainService; import com.project.exam.domain.service.NotifyExamRecordDomainService;
@ -20,6 +21,9 @@ public class NotifyExamRecordDomainServiceImpl implements NotifyExamRecordDomain
@Autowired @Autowired
private DtService dtService; private DtService dtService;
@Autowired
private DingProperties dingProperties;
@Override @Override
public void notifyExamRecord(ExamRecordDTO dto) { public void notifyExamRecord(ExamRecordDTO dto) {
String userId = SecurityUtils.getUserId(); String userId = SecurityUtils.getUserId();
@ -39,7 +43,10 @@ public class NotifyExamRecordDomainServiceImpl implements NotifyExamRecordDomain
.markdown(markdown) .markdown(markdown)
.singleTitle("查看详情") .singleTitle("查看详情")
// todo 修改为对应页面 // todo 修改为对应页面
.singleUrl("https://www.baidu.com/").build()) .singleUrl(dingProperties.getNoticeUrlPrefix() +
"examResult/?" + "dd_nav_translucent=true&dd_full_screen=true&dd_nav_bgcolor=33E0EEFF" +
"&corpid=" + dingProperties.getCorpId() + "&id=" + dto.getId() + "&index=1"
).build())
.build(); .build();
DtCorpConversationMsgSendResult result = dtService.getCorpConversationMsgService().send(message); DtCorpConversationMsgSendResult result = dtService.getCorpConversationMsgService().send(message);
if (result.getErrCode() == 0) { if (result.getErrCode() == 0) {

Loading…
Cancel
Save