message.proto 8.6 KB

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