message.proto 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  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. bool isfilterActive = 16; //是否过滤
  183. }
  184. message UserMsgListRes {
  185. int64 code = 1; //状态码
  186. string message = 2; //响应消息
  187. repeated Messages list = 3; //
  188. Messages last = 4; //
  189. repeated AllSortData column = 5; //
  190. int64 count = 6; //总数
  191. int64 unread = 7; //未读总数
  192. }
  193. message UserMsgList {
  194. repeated Messages data = 1; //
  195. repeated AllSortData sortData = 2; //
  196. int64 count = 3; //总数
  197. int64 unread = 4; //未读总数
  198. }
  199. message AllSortData {
  200. int64 unreadMessages = 1 ;
  201. string name = 2;
  202. string img = 3;
  203. int64 msgType = 4; //是否区分类型;
  204. repeated Messages data = 5; //
  205. bool isClassSearch = 6;// 是否是消息细化分类查询
  206. }
  207. message WxTmplResponse {
  208. int64 sendTotal = 1; //发送数量
  209. string message = 2; //信息
  210. }
  211. /*message UserUnreadMsgListReq {
  212. string userId = 1; //用户id
  213. string appid = 3; //应用标识
  214. int64 offSet = 4; //当前
  215. int64 pageSize = 5; //大小
  216. int64 isNeedData = 6; //是否需要未读的消息数据,0 不需要 1需要
  217. }*/
  218. /*message UserUnreadMsgListRes {
  219. int64 code = 1; //状态码
  220. string message = 2; //响应消息
  221. repeated Messages list = 3;
  222. int64 count = 4; //总数
  223. }*/
  224. // 剑鱼系统通用模版
  225. message WxTmplMsgRequest {
  226. string userIds = 1; //接受人 mongo_userId(多个用,分割)
  227. string positionIds = 2; //接受人 职位id(多个用,分割)
  228. int64 msgType = 3; //数据库中switch字段
  229. string title = 4; //课程名称
  230. string detail = 5; //课程时间
  231. string date = 6; //课程地点
  232. string row4 = 7;
  233. string url = 8; //消息跳转连接
  234. }
  235. message SendMsgResponse {
  236. int64 total = 1; //发送数量
  237. string message = 2; //响应消息
  238. }
  239. message MsgOpenLogReq{
  240. int64 msgLogId = 1;
  241. int64 platform = 2;
  242. string userId = 3;
  243. string appId = 4;
  244. }
  245. //新用户消息调用接口
  246. message NewUserInsertMsgReq{
  247. string userIds = 1;
  248. string title = 5; //主题
  249. string content = 6; //内容
  250. int64 msgType = 7; //消息类型 1:客服 2:系统通知 3:营销 4:用户会话
  251. string link = 8; //跳转链接
  252. string appid = 10; //应用标识
  253. int64 msgLogId = 11;//消息记录表id
  254. string positionIds = 14;// 职位id 逗号分割
  255. string row4 = 15;
  256. string productName = 16;
  257. string orderId = 17;
  258. string orderMoney = 18;
  259. string identity = 19;
  260. string appPushUrl = 20;
  261. string wxPushUrl = 21;
  262. string iosPushUrl = 22;
  263. }
  264. message UpdateMsgSummaryReq{
  265. int64 msgLogId = 1;
  266. int64 groupId = 2;
  267. int64 msgType = 3;
  268. }
  269. message BitmapSaveMsgReq{
  270. string userIds = 1;
  271. string title = 5; //主题
  272. string content = 6; //内容
  273. int64 msgType = 7; //消息类型 1:客服 2:系统通知 3:营销 4:用户会话
  274. string link = 8; //跳转链接
  275. string appid = 10; //应用标识
  276. int64 msgLogId = 11;//消息记录表id
  277. string positionIds = 14;// 职位id 逗号分割
  278. string row4 = 15;
  279. string productName = 16;
  280. string orderId = 17;
  281. string orderMoney = 18;
  282. string identity = 19;
  283. string appPushUrl = 20;
  284. string wxPushUrl = 21;
  285. string iosPushUrl = 22;
  286. string baseUserIds = 23;
  287. string sendUserId = 24;
  288. }
  289. message WorkingDesktopReq{
  290. string userId = 1; //用户id
  291. string appid = 3; //应用标识
  292. int64 offSet = 4; //当前
  293. int64 pageSize = 5; //大小
  294. int64 msgType = 6;
  295. bool needDealtWithCount = 7;
  296. }
  297. message WorkingDesktopResp{
  298. int64 code = 1; //状态码
  299. string message = 2; //响应消息
  300. repeated Messages busMsgList = 3;
  301. repeated Messages needDo = 4;
  302. }
  303. service Message {
  304. //工作桌面列表
  305. rpc WorkingDesktopList (WorkingDesktopReq) returns (WorkingDesktopResp);
  306. //发送消息更新一次消息汇总表
  307. rpc UpdateMsgSummary (UpdateMsgSummaryReq) returns (Response);
  308. //新用户发送消息
  309. rpc NewUserMsg (NewUserInsertMsgReq) returns (Response);
  310. //bitmap保存消息
  311. rpc bitmapSaveMsg (multipleSaveMsgReq) returns (multipleSaveMsgResp);
  312. //批量保存消息
  313. rpc multipleSaveMsg (multipleSaveMsgReq) returns (multipleSaveMsgResp);
  314. // 修改消息阅读状态
  315. rpc ChangeReadStatus (ChangeReadStatusReq) returns (Response);
  316. // 查询指定用户的历史消息记录
  317. rpc FindUserMsg (FindUserMsgReq) returns (FindUserMsgRes);
  318. //查看详细详情
  319. rpc FindMessageDetail (MessageDetailReq) returns (MessageDetailResp);
  320. // 消息的分类
  321. // rpc GetMsgType (GetMsgTypeReq) returns (GetMsgTypeRes);
  322. // 查询指定用户的浮标消息
  323. rpc FindUserBuoyMsg (FindUserBuoyMsgReq) returns (FindUserBuoyMsgRes);
  324. // 一键清空未读消息
  325. rpc ClearUnreadMsg (ClearUnreadMsgReq) returns (Response);
  326. // new用户消息列表
  327. rpc UserMsgList (UserMsgListReq) returns (UserMsgListRes);
  328. // 发送剑鱼微信模版消息
  329. rpc SendWxTmplMsg (WxTmplMsgRequest) returns(SendMsgResponse);
  330. // 官网、移动端首页、工作桌面消息滚动
  331. // rpc UserUnreadMsgList (UserUnreadMsgListReq) returns (UserUnreadMsgListRes);
  332. // 点击消息-存查看记录
  333. rpc MsgOpenLog (MsgOpenLogReq) returns (Response);
  334. // 发送剑鱼微信模版消息
  335. rpc AppLetterPush (WxTmplMsgRequest) returns(SendMsgResponse);
  336. }