message.proto 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  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. string userId = 4;
  9. }
  10. message ResCount {
  11. int64 msgType = 1; // 类型及未读数量
  12. int64 count = 2; // 类型及未读数量
  13. }
  14. message Response {
  15. int64 code = 1; //状态码
  16. string message = 2; //响应消息
  17. }
  18. message FindUserMsgReq {
  19. string userId = 1; //用户id
  20. string receiveUserId = 2; //聊天方用户id
  21. string appid = 3; //应用标识
  22. int64 offSet = 4; //当前
  23. int64 pageSize = 5; //大小
  24. int64 msgType = 6; //是否区分类型
  25. int64 read = 7; // 是否区分已读未读 -1 不区分已读未读 0 未读 1 已读
  26. }
  27. message Messages {
  28. string receiveUserId = 1; //接收方用户ID
  29. string receiveName = 2; //接收方用户名
  30. string sendUserId = 3; //发送方用户ID
  31. string sendName = 4; //发送方用户名
  32. string title = 5; //主题
  33. string content = 6; //内容
  34. int64 msgType = 7; //消息类型 1:客服 2:系统通知 3:营销 4:用户会话
  35. string link = 8; //跳转链接
  36. int64 citeId = 9; //引用id
  37. int64 isRead = 10; //已读未读 0:未读 1:已读
  38. string createtime = 11;
  39. string appid = 12; //应用标识
  40. string id = 13; //消息id
  41. int64 msgLogId = 14;
  42. map<string, string> url = 15;
  43. }
  44. message FindUserMsgRes {
  45. int64 code = 1; //状态码
  46. string message = 2; //响应消息
  47. repeated Messages data = 3; //
  48. int64 count = 4; //总数
  49. }
  50. message GetClassUnreadCountReq {
  51. string userId = 1; // 用户id
  52. int64 msgType = 2; //分类 1:客服 2:系统通知 3:营销 4:用户会话
  53. string appid = 3; //应用标识
  54. }
  55. //查看消息内容
  56. message MessageDetailReq {
  57. int64 id = 1; //消息id
  58. int64 msgLogId = 2;
  59. string userId = 3;
  60. }
  61. message MessageDetailResp {
  62. int64 code = 1; //状态码
  63. string message = 2; //响应消息
  64. Messages data = 3; //
  65. }
  66. message GetLastMessageReq {
  67. string userId = 1; // 用户id
  68. int64 msgType = 2; //分类 1:客服 2:系统通知 3:营销 4:用户会话
  69. string appid = 3; //应用标识
  70. int64 isRead = 4; // 0:未读 1:已读 -1 不区分
  71. }
  72. message GetLastMessageRes {
  73. int64 code = 1; //状态码
  74. string message = 2; //响应消息
  75. Messages data = 3; //
  76. }
  77. // 获取用户分类的的未读消息分类及数量 及分类下最新的消息
  78. message GetUnreadClassCountReq {
  79. string userId = 1; // 用户id
  80. string appid = 2; //应用标识
  81. bool needMsg = 3; //是否需要分类下的最新一条消息
  82. }
  83. message GetUnreadClassCountRes {
  84. int64 code = 1; //状态码
  85. string message = 2; //响应消息
  86. repeated ResCount data = 3; //
  87. repeated Messages info = 4; // 每个类型最新消息列表
  88. }
  89. /*message GetMsgTypeReq {
  90. string userId = 1; // 用户id
  91. string appid = 2; //应用标识
  92. }*/
  93. message MsgTypes{
  94. int64 msgType =1;
  95. string img = 2;
  96. string name =3;
  97. string code = 4;
  98. string displayPlatform = 5;
  99. }
  100. /*message GetMsgTypeRes {
  101. int64 code = 1; //状态码
  102. string message = 2; //响应消息
  103. repeated MsgTypes data = 3; //
  104. }*/
  105. message user {
  106. string userId = 1;
  107. string userName = 2;
  108. }
  109. message multipleSaveMsgReq {
  110. string userIds = 1;
  111. string sendUserId = 3; //发送方用户ID
  112. string title = 5; //主题
  113. string content = 6; //内容
  114. int64 msgType = 7; //消息类型 1:客服 2:系统通知 3:营销 4:用户会话
  115. string link = 8; //跳转链接
  116. string appid = 10; //应用标识
  117. int64 msgLogId = 11;//消息记录表id
  118. string positionIds = 14;// 职位id 逗号分割
  119. string row4 = 15;
  120. string productName = 16;
  121. string orderId = 17;
  122. string orderMoney = 18;
  123. string identity = 19;
  124. string appPushUrl = 20;
  125. string wxPushUrl = 21;
  126. string iosPushUrl = 22;
  127. string baseUserIds = 23;
  128. }
  129. message CustomWxTpl {
  130. string TplId = 1;
  131. map<string, TmplItem> tmplData = 2;
  132. }
  133. message TmplItem {
  134. string value = 1;
  135. string color = 2;
  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. int64 NewUserId =5;//私信相关
  166. }
  167. message UserMsgListReq {
  168. string userId = 1; //用户id
  169. string appid = 3; //应用标识
  170. int64 offSet = 4; //当前
  171. int64 pageSize = 5; //大小
  172. int64 msgType = 6; //是否区分类型
  173. int64 read = 7; // 是否区分已读未读 -1 不区分已读未读 0 未读 1 已读
  174. int64 SortSize = 8; //分类 每类数
  175. bool isColumn =9; //是否需要获取栏目
  176. bool isColumnNewMsg = 10; //是否需各栏目获取最新消息
  177. bool isMsgList =11; //是否需要列表信息
  178. int64 NewUserId =12;//私信相关
  179. int64 PositionId =13;//私信相关
  180. bool isContainLetter =14;//是否包含私信未读数
  181. bool isClassSearch =15;// 是否是消息细化分类查询
  182. }
  183. message UserMsgListRes {
  184. int64 code = 1; //状态码
  185. string message = 2; //响应消息
  186. repeated Messages list = 3; //
  187. Messages last = 4; //
  188. repeated AllSortData column = 5; //
  189. int64 count = 6; //总数
  190. int64 unread = 7; //未读总数
  191. int64 toDoUnread = 8; //待办未读数量
  192. }
  193. message UserMsgList {
  194. repeated Messages data = 1; //
  195. repeated AllSortData sortData = 2; //
  196. int64 count = 3; //总数
  197. int64 unread = 4; //未读总数
  198. int64 toDoUnread = 5; //待办未读数量
  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. bool isClassSearch =6;// 是否是消息细化分类查询
  207. }
  208. message WxTmplResponse {
  209. int64 sendTotal = 1; //发送数量
  210. string message = 2; //信息
  211. }
  212. /*message UserUnreadMsgListReq {
  213. string userId = 1; //用户id
  214. string appid = 3; //应用标识
  215. int64 offSet = 4; //当前
  216. int64 pageSize = 5; //大小
  217. int64 isNeedData = 6; //是否需要未读的消息数据,0 不需要 1需要
  218. }*/
  219. /*message UserUnreadMsgListRes {
  220. int64 code = 1; //状态码
  221. string message = 2; //响应消息
  222. repeated Messages list = 3;
  223. int64 count = 4; //总数
  224. }*/
  225. // 剑鱼系统通用模版
  226. message WxTmplMsgRequest {
  227. string userIds = 1; //接受人 mongo_userId(多个用,分割)
  228. string positionIds = 2; //接受人 职位id(多个用,分割)
  229. int64 msgType =3; //数据库中switch字段
  230. string title = 4; //课程名称
  231. string detail = 5; //课程时间
  232. string date = 6; //课程地点
  233. string row4 =7;
  234. string url = 8; //消息跳转连接
  235. }
  236. message SendMsgResponse {
  237. int64 total = 1; //发送数量
  238. string message = 2; //响应消息
  239. }
  240. message MsgOpenLogReq{
  241. int64 msgLogId =1;
  242. int64 platform =2;
  243. string userId = 3;
  244. string appId = 4;
  245. }
  246. //新用户消息调用接口
  247. message NewUserInsertMsgReq{
  248. string userIds = 1;
  249. string title = 5; //主题
  250. string content = 6; //内容
  251. int64 msgType = 7; //消息类型 1:客服 2:系统通知 3:营销 4:用户会话
  252. string link = 8; //跳转链接
  253. string appid = 10; //应用标识
  254. int64 msgLogId = 11;//消息记录表id
  255. string positionIds = 14;// 职位id 逗号分割
  256. string row4 = 15;
  257. string productName = 16;
  258. string orderId = 17;
  259. string orderMoney = 18;
  260. string identity = 19;
  261. string appPushUrl = 20;
  262. string wxPushUrl = 21;
  263. string iosPushUrl = 22;
  264. }
  265. message UpdateMsgSummaryReq{
  266. int64 msgLogId = 1;
  267. int64 groupId = 2;
  268. int64 msgType = 3;
  269. }
  270. message BitmapSaveMsgReq{
  271. string userIds = 1;
  272. string title = 5; //主题
  273. string content = 6; //内容
  274. int64 msgType = 7; //消息类型 1:客服 2:系统通知 3:营销 4:用户会话
  275. string link = 8; //跳转链接
  276. string appid = 10; //应用标识
  277. int64 msgLogId = 11;//消息记录表id
  278. string positionIds = 14;// 职位id 逗号分割
  279. string row4 = 15;
  280. string productName = 16;
  281. string orderId = 17;
  282. string orderMoney = 18;
  283. string identity = 19;
  284. string appPushUrl = 20;
  285. string wxPushUrl = 21;
  286. string iosPushUrl = 22;
  287. string baseUserIds = 23;
  288. string sendUserId = 24;
  289. }
  290. service Message {
  291. //发送消息更新一次消息汇总表
  292. rpc UpdateMsgSummary (UpdateMsgSummaryReq) returns (Response);
  293. //新用户发送消息
  294. rpc NewUserMsg (NewUserInsertMsgReq) returns (Response);
  295. //bitmap保存消息
  296. rpc bitmapSaveMsg (multipleSaveMsgReq) returns (multipleSaveMsgResp);
  297. //批量保存消息
  298. rpc multipleSaveMsg (multipleSaveMsgReq) returns (multipleSaveMsgResp);
  299. // 修改消息阅读状态
  300. rpc ChangeReadStatus (ChangeReadStatusReq) returns (Response);
  301. // 查询指定用户的历史消息记录
  302. rpc FindUserMsg (FindUserMsgReq) returns (FindUserMsgRes);
  303. //查看详细详情
  304. rpc FindMessageDetail (MessageDetailReq) returns (MessageDetailResp);
  305. // 消息的分类
  306. // rpc GetMsgType (GetMsgTypeReq) returns (GetMsgTypeRes);
  307. // 查询指定用户的浮标消息
  308. rpc FindUserBuoyMsg (FindUserBuoyMsgReq) returns (FindUserBuoyMsgRes);
  309. // 一键清空未读消息
  310. rpc ClearUnreadMsg (ClearUnreadMsgReq) returns (Response);
  311. // new用户消息列表
  312. rpc UserMsgList (UserMsgListReq) returns (UserMsgListRes);
  313. // 发送剑鱼微信模版消息
  314. rpc SendWxTmplMsg (WxTmplMsgRequest) returns(SendMsgResponse);
  315. // 官网、移动端首页、工作桌面消息滚动
  316. // rpc UserUnreadMsgList (UserUnreadMsgListReq) returns (UserUnreadMsgListRes);
  317. // 点击消息-存查看记录
  318. rpc MsgOpenLog (MsgOpenLogReq) returns (Response);
  319. // 发送剑鱼微信模版消息
  320. rpc AppLetterPush (WxTmplMsgRequest) returns(SendMsgResponse);
  321. }