message.proto 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. syntax = "proto3";
  2. package message;
  3. option go_package = "message/";
  4. message ChangeReadStatusReq {
  5. string id = 1; // 消息id
  6. int64 readStatus = 2; // 阅读状态 0-未读 1-已读
  7. string appid = 3; //应用标识
  8. }
  9. message ResCount {
  10. int64 msgType = 1; // 类型及未读数量
  11. int64 count = 2; // 类型及未读数量
  12. }
  13. // 查询指定用户未读消息合计
  14. message GetUnreadCountRequest {
  15. string userId = 1; // 用户id
  16. string appid = 2; //应用标识
  17. }
  18. message Response {
  19. int64 code = 1; //状态码
  20. string message = 2; //响应消息
  21. }
  22. message GetUnreadCountResponse {
  23. int64 code = 1; //状态码
  24. string message = 2; //响应消息
  25. int64 count = 3; //
  26. }
  27. message FindUserMsgReq {
  28. string userId = 1; //用户id
  29. string receiveUserId = 2; //聊天方用户id
  30. string appid = 3; //应用标识
  31. int64 offSet = 4; //当前
  32. int64 pageSize = 5; //大小
  33. int64 msgType = 6; //是否区分类型
  34. int64 read = 7; // 是否区分已读未读 -1 不区分已读未读 0 未读 1 已读
  35. }
  36. message Messages {
  37. string receiveUserId = 1; //接收方用户ID
  38. string receiveName = 2; //接收方用户名
  39. string sendUserId = 3; //发送方用户ID
  40. string sendName = 4; //发送方用户名
  41. string title = 5; //主题
  42. string content = 6; //内容
  43. int64 msgType = 7; //消息类型 1:客服 2:系统通知 3:营销 4:用户会话
  44. string link = 8; //跳转链接
  45. int64 citeId = 9; //引用id
  46. int64 isRead = 10; //已读未读 0:未读 1:已读
  47. string createtime = 11;
  48. string appid = 12; //应用标识
  49. string id = 13; //消息id
  50. int64 msgLogId = 14;
  51. map<string, string> url = 15;
  52. }
  53. message FindUserMsgRes {
  54. int64 code = 1; //状态码
  55. string message = 2; //响应消息
  56. repeated Messages data = 3; //
  57. int64 count = 4; //总数
  58. }
  59. message GetClassUnreadCountReq {
  60. string userId = 1; // 用户id
  61. int64 msgType = 2; //分类 1:客服 2:系统通知 3:营销 4:用户会话
  62. string appid = 3; //应用标识
  63. }
  64. //查看消息内容
  65. message MessageDetailReq {
  66. string id = 1; //消息id
  67. }
  68. message MessageDetailResp {
  69. int64 code = 1; //状态码
  70. string message = 2; //响应消息
  71. Messages data = 3; //
  72. }
  73. message GetLastMessageReq {
  74. string userId = 1; // 用户id
  75. int64 msgType = 2; //分类 1:客服 2:系统通知 3:营销 4:用户会话
  76. string appid = 3; //应用标识
  77. int64 isRead = 4; // 0:未读 1:已读 -1 不区分
  78. }
  79. message GetLastMessageRes {
  80. int64 code = 1; //状态码
  81. string message = 2; //响应消息
  82. Messages data = 3; //
  83. }
  84. // 获取用户分类的的未读消息分类及数量 及分类下最新的消息
  85. message GetUnreadClassCountReq {
  86. string userId = 1; // 用户id
  87. string appid = 2; //应用标识
  88. bool needMsg = 3; //是否需要分类下的最新一条消息
  89. }
  90. message GetUnreadClassCountRes {
  91. int64 code = 1; //状态码
  92. string message = 2; //响应消息
  93. repeated ResCount data = 3; //
  94. repeated Messages info = 4; // 每个类型最新消息列表
  95. }
  96. message GetMsgTypeReq {
  97. string userId = 1; // 用户id
  98. string appid = 2; //应用标识
  99. }
  100. message MsgTypes{
  101. int64 msgType =1;
  102. string img = 2;
  103. string name =3;
  104. string code = 4;
  105. string displayPlatform = 5;
  106. }
  107. message GetMsgTypeRes {
  108. int64 code = 1; //状态码
  109. string message = 2; //响应消息
  110. repeated MsgTypes data = 3; //
  111. }
  112. message user {
  113. string userId = 1;
  114. string userName = 2;
  115. }
  116. message multipleSaveMsgReq {
  117. string userIds = 1;
  118. string userNames = 2;
  119. string sendUserId = 3; //发送方用户ID
  120. string sendName = 4; //发送方用户名
  121. string title = 5; //主题
  122. string content = 6; //内容
  123. int64 msgType = 7; //消息类型 1:客服 2:系统通知 3:营销 4:用户会话
  124. string link = 8; //跳转链接
  125. int64 citeId = 9; //引用id
  126. string appid = 10; //应用标识
  127. int64 msgLogId = 11;//消息记录表id
  128. int64 showBuoy = 12;//是否展示为浮标
  129. string showContent =13;//展示文案
  130. string positionIds = 14;// 职位id 逗号分割
  131. }
  132. message multipleSaveMsgResp {
  133. int64 code = 1; //状态码
  134. string message = 2; //响应消息
  135. int64 errCount = 3; // 保存出错数量
  136. }
  137. message FindUserBuoyMsgReq {
  138. string userId = 1; //用户id
  139. string appid = 2; //应用标识
  140. int64 pageSize = 3; //大小
  141. }
  142. message FindUserBuoyMsgRes {
  143. int64 code = 1; //状态码
  144. string message = 2; //响应消息
  145. repeated BuoyMessages data = 3; //
  146. }
  147. message BuoyMessages {
  148. string id = 1; //消息id
  149. string buoy_detail = 2; //浮标内容
  150. string pcUrl =3;
  151. string androidUrl = 4;
  152. string iosUrl = 5;
  153. string weChatUrl =6;
  154. }
  155. message ClearUnreadMsgReq {
  156. string userid = 1; //mgoId
  157. int64 entId = 2;
  158. int64 positionId = 3; //职位id
  159. string appId = 4;
  160. }
  161. message UserMsgListReq {
  162. string userId = 1; //用户id
  163. string appid = 3; //应用标识
  164. int64 offSet = 4; //当前
  165. int64 pageSize = 5; //大小
  166. int64 msgType = 6; //是否区分类型
  167. int64 read = 7; // 是否区分已读未读 -1 不区分已读未读 0 未读 1 已读
  168. int64 SortSize = 8; //分类 每类数
  169. bool isColumn =9; //是否需要获取栏目
  170. bool isColumnNewMsg = 10; //是否需各栏目获取最新消息
  171. bool isMsgList =11; //是否需要列表信息
  172. int64 NewUserId =12;//私信相关
  173. int64 PositionId =13;//私信相关
  174. }
  175. message UserMsgListRes {
  176. int64 code = 1; //状态码
  177. string message = 2; //响应消息
  178. repeated Messages list = 3; //
  179. Messages last = 4; //
  180. repeated AllSortData column = 5; //
  181. int64 count = 6; //总数
  182. int64 unread = 7; //未读总数
  183. }
  184. message UserMsgList {
  185. repeated Messages data = 1; //
  186. repeated AllSortData sortData = 2; //
  187. int64 count = 3; //总数
  188. int64 unread = 4; //未读总数
  189. }
  190. message AllSortData {
  191. int64 unreadMessages =1 ;
  192. string name =2;
  193. string img = 3;
  194. int64 msgType = 4; //是否区分类型;
  195. repeated Messages data = 5; //
  196. }
  197. message WxTmplResponse {
  198. int64 sendTotal = 1; //发送数量
  199. string message = 2; //信息
  200. }
  201. message UserUnreadMsgListReq {
  202. string userId = 1; //用户id
  203. string appid = 3; //应用标识
  204. int64 offSet = 4; //当前
  205. int64 pageSize = 5; //大小
  206. }
  207. message UserUnreadMsgListRes {
  208. int64 code = 1; //状态码
  209. string message = 2; //响应消息
  210. repeated Messages list = 3;
  211. int64 count = 4; //总数
  212. }
  213. // 剑鱼学堂模版消息
  214. message JySchoolMsg {
  215. string userIds = 1; //接受人 mongo_userId(多个用,分割)
  216. string title = 2; //课程名称
  217. string date = 3; //课程时间
  218. string address = 4; //课程地点
  219. string url = 5; //消息跳转连接
  220. }
  221. // 剑鱼系统通用模版
  222. message SystemDefaultMsg {
  223. string userIds = 1; //接受人 mongo_userId(多个用,分割)
  224. string positionIds = 2; //接受人 职位id(多个用,分割)
  225. string messageClass =3; //数据库中switch字段
  226. string title = 4; //课程名称
  227. string detail = 5; //课程时间
  228. string date = 6; //课程地点
  229. string url = 7; //消息跳转连接
  230. }
  231. message SendMsgResponse {
  232. int64 total = 1; //发送数量
  233. string message = 2; //响应消息
  234. }
  235. service Message {
  236. //批量保存消息
  237. rpc multipleSaveMsg (multipleSaveMsgReq) returns (multipleSaveMsgResp);
  238. // 修改消息阅读状态
  239. rpc ChangeReadStatus (ChangeReadStatusReq) returns (Response);
  240. // 查询指定用户未读消息合计
  241. rpc GetUnreadCount (GetUnreadCountRequest) returns (GetUnreadCountResponse);
  242. // 查询指定用户的历史消息记录
  243. rpc FindUserMsg (FindUserMsgReq) returns (FindUserMsgRes);
  244. //查看详细详情
  245. rpc FindMessageDetail (MessageDetailReq) returns (MessageDetailResp);
  246. // 消息的分类
  247. rpc GetMsgType (GetMsgTypeReq) returns (GetMsgTypeRes);
  248. // 查询指定用户的浮标消息
  249. rpc FindUserBuoyMsg (FindUserBuoyMsgReq) returns (FindUserBuoyMsgRes);
  250. // 一键清空未读消息
  251. rpc ClearUnreadMsg (ClearUnreadMsgReq) returns (Response);
  252. // new用户消息列表
  253. rpc UserMsgList (UserMsgListReq) returns (UserMsgListRes);
  254. // 发送剑鱼学堂微信模版消息
  255. // rpc SendWxTmplJySchoolMsg (JySchoolMsg) returns(SendMsgResponse);
  256. // 发送剑鱼系统通用模版消息
  257. rpc SendWxTmplSystemDefaultMsg (SystemDefaultMsg) returns(SendMsgResponse);
  258. // 官网、移动端首页、工作桌面消息滚动
  259. rpc UserUnreadMsgList (UserUnreadMsgListReq) returns (UserUnreadMsgListRes);
  260. }