message.proto 8.2 KB

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