mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-12 12:26:51 +08:00
群发消息接口
This commit is contained in:
@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
|
|
||||||
import com.xboe.common.PageList;
|
import com.xboe.common.PageList;
|
||||||
import com.xboe.common.Pagination;
|
import com.xboe.common.Pagination;
|
||||||
|
import com.xboe.common.utils.IDGenerator;
|
||||||
import com.xboe.common.utils.StringUtil;
|
import com.xboe.common.utils.StringUtil;
|
||||||
import com.xboe.core.JsonResponse;
|
import com.xboe.core.JsonResponse;
|
||||||
import com.xboe.core.api.ApiBaseController;
|
import com.xboe.core.api.ApiBaseController;
|
||||||
@@ -134,10 +135,24 @@ public class MessageApi extends ApiBaseController {
|
|||||||
return badRequest("内容不能为空");
|
return badRequest("内容不能为空");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
//message.setIsRead(false);
|
Message msg=new Message();
|
||||||
// message.setMsgType(1);
|
msg.setId(IDGenerator.generate());
|
||||||
// message.setMsgTime(LocalDateTime.now());
|
// msg.setAcceptId(aid);
|
||||||
//MessageSender.send(message);
|
// msg.setAcceptName(aname);
|
||||||
|
msg.setContent(message.getContent());
|
||||||
|
msg.setConType("0");
|
||||||
|
msg.setIsRead(false);
|
||||||
|
msg.setMsgType(1);
|
||||||
|
msg.setPageParams(message.getPageParams());
|
||||||
|
msg.setPageType(message.getPageType());
|
||||||
|
msg.setRefId(message.getRefId());
|
||||||
|
msg.setRefType(message.getRefType());
|
||||||
|
msg.setSendAid(message.getSendAid());
|
||||||
|
msg.setSendName(message.getSendName());
|
||||||
|
msg.setSendType(1);
|
||||||
|
msg.setSource(message.getSource());
|
||||||
|
msg.setTitle(message.getTitle());
|
||||||
|
MessageSender.batchSend(message.getAcceptIds(),message.getAcceptNames(),msg);
|
||||||
return success(true);
|
return success(true);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("发布消息失败",e);
|
log.error("发布消息失败",e);
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ public class MessageSender {
|
|||||||
msg.setSendType(1);
|
msg.setSendType(1);
|
||||||
msg.setSource(data.getSource());
|
msg.setSource(data.getSource());
|
||||||
msg.setTitle(data.getTitle());
|
msg.setTitle(data.getTitle());
|
||||||
msg.setContent(data.getContent());
|
|
||||||
msgList.add(msg);
|
msgList.add(msg);
|
||||||
}
|
}
|
||||||
messageService.batchSave(msgList);
|
messageService.batchSave(msgList);
|
||||||
|
|||||||
Reference in New Issue
Block a user