MessageService.java 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. package jnpf.message.service;
  2. import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
  3. import jnpf.base.Pagination;
  4. import jnpf.base.UserInfo;
  5. import jnpf.base.entity.MessageTemplateEntity;
  6. import jnpf.base.service.SuperService;
  7. import jnpf.message.entity.MessageEntity;
  8. import jnpf.message.entity.MessageReceiveEntity;
  9. import jnpf.message.model.NoticePagination;
  10. import jnpf.message.model.SentMessageForm;
  11. import jnpf.message.model.message.MessageInfoVO;
  12. import jnpf.message.model.message.NoticeVO;
  13. import jnpf.message.model.message.PaginationMessage;
  14. import java.util.List;
  15. import java.util.Map;
  16. /**
  17. * 消息实例
  18. *
  19. * @author JNPF开发平台组
  20. * @version V3.1.0
  21. * @copyright 引迈信息技术有限公司
  22. * @date 2019年9月27日 上午9:18
  23. */
  24. public interface MessageService extends SuperService<MessageEntity> {
  25. /**
  26. * 列表(通知公告)
  27. *
  28. * @param pagination
  29. * @return
  30. */
  31. List<MessageEntity> getNoticeList(NoticePagination pagination);
  32. /**
  33. * 列表(通知公告)
  34. *
  35. * @return
  36. */
  37. List<MessageEntity> getNoticeList();
  38. /**
  39. * 列表(通知公告)
  40. * 门户专用
  41. *
  42. * @return
  43. */
  44. List<MessageEntity> getDashboardNoticeList(List<String> typeList);
  45. /**
  46. * 获取全部数据
  47. *
  48. * @param pagination
  49. * @return
  50. */
  51. List<MessageReceiveEntity> getMessageList3(PaginationMessage pagination);
  52. /**
  53. * 获取消息列表(可选字段)
  54. *
  55. * @param pagination
  56. * @return
  57. */
  58. List<MessageReceiveEntity> getMessageColumnList(PaginationMessage pagination, SFunction<MessageReceiveEntity, ?>... columns);
  59. /**
  60. * 列表(通知公告/系统消息/私信消息)
  61. *
  62. * @param pagination
  63. * @return
  64. */
  65. List<MessageReceiveEntity> getMessageList(Pagination pagination);
  66. /**
  67. * 信息
  68. *
  69. * @param id 主键值
  70. * @return
  71. */
  72. MessageEntity getInfo(String id);
  73. /**
  74. * 默认消息
  75. *
  76. * @param type 类别:1-通知公告/2-系统消息
  77. * @return
  78. */
  79. MessageEntity getInfoDefault(int type);
  80. /**
  81. * 删除
  82. *
  83. * @param entity 实体对象
  84. */
  85. void delete(MessageEntity entity);
  86. /**
  87. * 创建
  88. *
  89. * @param entity 实体对象
  90. */
  91. void create(MessageEntity entity);
  92. /**
  93. * 更新
  94. *
  95. * @param entity 实体对象
  96. */
  97. boolean update(String id, MessageEntity entity);
  98. /**
  99. * 消息已读(单条)
  100. *
  101. * @param messageId 消息主键
  102. */
  103. MessageReceiveEntity messageRead(String messageId);
  104. /**
  105. * 消息已读(全部)
  106. */
  107. void messageRead(List<String> idList);
  108. /**
  109. * 删除记录
  110. *
  111. * @param messageIds 消息Id
  112. */
  113. void deleteRecord(List<String> messageIds);
  114. /**
  115. * 获取消息未读数量
  116. *
  117. * @param userId 用户主键
  118. * @return
  119. */
  120. int getUnreadCount(String userId, Integer type);
  121. /**
  122. * 发送公告
  123. *
  124. * @param toUserIds 发送用户
  125. * @param entity 消息信息
  126. */
  127. boolean sentNotice(List<String> toUserIds, MessageEntity entity);
  128. /**
  129. * 发送消息
  130. *
  131. * @param toUserIds 发送用户
  132. * @param title 标题
  133. */
  134. void sentMessage(List<String> toUserIds, String title);
  135. /**
  136. * 发送消息
  137. *
  138. * @param toUserIds 发送用户
  139. * @param title 标题
  140. * @param bodyText 内容
  141. */
  142. void sentMessage(List<String> toUserIds, String title, String bodyText);
  143. /**
  144. * 发送消息
  145. *
  146. * @param toUserIds 发送用户
  147. * @param title 标题
  148. * @param bodyText 内容
  149. * @param contentMsg 站内信息
  150. */
  151. void sentMessage(List<String> toUserIds, String title, String bodyText, Map<String, String> contentMsg, UserInfo userInfo);
  152. /**
  153. * 发送消息
  154. *
  155. * @param toUserIds 发送用户
  156. * @param title 标题
  157. * @param bodyText 内容
  158. */
  159. void sentMessage(List<String> toUserIds, String title, String bodyText, UserInfo userInfo, Integer source, Integer type);
  160. /**
  161. * 发送消息
  162. *
  163. * @param toUserIds 发送用户
  164. * @param title 标题
  165. * @param bodyText 内容
  166. * @param testMessage 是否为测试消息
  167. */
  168. void sentMessage(List<String> toUserIds, String title, String bodyText, UserInfo userInfo, Integer source, Integer type, boolean testMessage);
  169. /**
  170. * 发送消息
  171. *
  172. * @param toUserIds 发送用户
  173. * @param entity 消息实体
  174. * @param content 内容
  175. */
  176. void sentFlowMessage(List<String> toUserIds, MessageTemplateEntity entity, String content);
  177. /**
  178. * 退出在线的WebSocket 可选参数
  179. *
  180. * @param token Token 精准退出用户
  181. * @param userId 退出用户的全部会话
  182. */
  183. void logoutWebsocketByToken(String token, String userId);
  184. /**
  185. * 日程发送消息
  186. */
  187. List<String> sentScheduleMessage(SentMessageForm sentMessageForm, String type);
  188. /**
  189. * 通过过期时间刷新状态
  190. *
  191. * @return
  192. */
  193. Boolean updateEnabledMark();
  194. List<NoticeVO> getNoticeList(List<String> list);
  195. /**
  196. * 首页获取当前用户信息列表
  197. * @return
  198. */
  199. List<MessageInfoVO> getUserMessageList();
  200. }