sendFeiShuNotice
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dto.message.SendCardMessageDTO;
|
||||
import com.cool.store.enums.FeiShuNoticeMsgEnum;
|
||||
import com.cool.store.enums.MessageTypeEnum;
|
||||
import com.cool.store.http.ISVHttpRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -26,13 +28,17 @@ public class NoticeService {
|
||||
private ISVHttpRequest isvHttpRequest;
|
||||
public void sendFeiShuNotice(FeiShuNoticeMsgEnum feiShuNoticeMsgEnum, List<String> userIds,Object... objects) {
|
||||
try{
|
||||
SendCardMessageDTO sendCardMessageDTO = new SendCardMessageDTO();
|
||||
sendCardMessageDTO.setUserIds(userIds);
|
||||
sendCardMessageDTO.setMessageType(MessageTypeEnum.SCHEDULE_REMINDER);
|
||||
sendCardMessageDTO.setMessageUrl(linkUrl);
|
||||
sendCardMessageDTO.setTitle(feiShuNoticeMsgEnum.getTitle());
|
||||
sendCardMessageDTO.setContent(MessageFormat.format(feiShuNoticeMsgEnum.getContent(),objects));
|
||||
isvHttpRequest.sendFeiShuCardMessage(sendCardMessageDTO);
|
||||
if (CollectionUtils.isEmpty(userIds)){
|
||||
log.info("sendFeiShuNotice_feiShuNoticeMsgEnum:{} userIds:{},objects:{}",feiShuNoticeMsgEnum.getTitle(), JSONObject.toJSONString(userIds),JSONObject.toJSONString(objects));
|
||||
return;
|
||||
}
|
||||
SendCardMessageDTO sendCardMessageDTO = new SendCardMessageDTO();
|
||||
sendCardMessageDTO.setUserIds(userIds);
|
||||
sendCardMessageDTO.setMessageType(MessageTypeEnum.SCHEDULE_REMINDER);
|
||||
sendCardMessageDTO.setMessageUrl(linkUrl);
|
||||
sendCardMessageDTO.setTitle(feiShuNoticeMsgEnum.getTitle());
|
||||
sendCardMessageDTO.setContent(MessageFormat.format(feiShuNoticeMsgEnum.getContent(),objects));
|
||||
isvHttpRequest.sendFeiShuCardMessage(sendCardMessageDTO);
|
||||
}catch (Exception e){
|
||||
log.info("发送飞书通知失败");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user