message.proto 8.4 KB

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