message.proto 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. syntax = "proto3";
  2. package message;
  3. message SendMsgRequest {
  4. string receiveUserId = 1; //接收方用户ID
  5. string receiveName = 2; //接收方用户名
  6. string sendUserId = 3; //发送方用户ID
  7. string sendName = 4; //发送方用户名
  8. string title = 5; //主题
  9. string content = 6; //内容
  10. int64 msgType = 7; //消息类型 1:客服 2:系统通知 3:营销 4:用户会话
  11. string link = 8; //跳转链接
  12. int64 citeId = 9; //引用id
  13. string appid = 10; //应用标识
  14. }
  15. message ChangeReadStatusRequest {
  16. int64 id = 1; // 消息id
  17. int64 readStatus = 2; // 阅读状态 0-未读 1-已读
  18. string appid = 3; //应用标识
  19. }
  20. // 删除单一消息
  21. message DeleteSingleMessageRequest {
  22. int64 id = 1; // 消息id
  23. string appid = 3; //应用标识
  24. }
  25. // 批量删除消息
  26. message DeleteMultipleMessageRequest {
  27. string id = 1; // 多条消息id, 逗号分隔
  28. string appid = 3; //应用标识
  29. }
  30. // 查询指定用户未读消息合计
  31. message GetUnreadCountRequest {
  32. string userId = 1; // 用户id
  33. string appid = 2; //应用标识
  34. }
  35. message Response {
  36. int64 code = 1; //状态码
  37. string message = 2; //响应消息
  38. }
  39. message GetUnreadCountResponse {
  40. int64 code = 1; //状态码
  41. string message = 2; //响应消息
  42. int64 count = 3; //
  43. }
  44. message FindUserMsgReq {
  45. string userId = 1; //用户id
  46. string receiveUserId = 2; //聊天方用户id
  47. string appid = 3; //应用标识
  48. int64 offSet = 4; //当前
  49. int64 pageSize = 5; //大小
  50. int64 msgType = 6; //是否区分类型
  51. int64 read = 7; // 是否区分已读未读 -1 不区分已读未读 0 未读 1 已读
  52. }
  53. message Messages {
  54. string receiveUserId = 1; //接收方用户ID
  55. string receiveName = 2; //接收方用户名
  56. string sendUserId = 3; //发送方用户ID
  57. string sendName = 4; //发送方用户名
  58. string title = 5; //主题
  59. string content = 6; //内容
  60. int64 msgType = 7; //消息类型 1:客服 2:系统通知 3:营销 4:用户会话
  61. string link = 8; //跳转链接
  62. int64 citeId = 9; //引用id
  63. int64 isRead = 10; //已读未读 0:未读 1:已读
  64. string createtime = 11;
  65. string appid = 12; //应用标识
  66. }
  67. message FindUserMsgRes {
  68. int64 code = 1; //状态码
  69. string message = 2; //响应消息
  70. repeated Messages data = 3; //
  71. int64 count = 4; //总数
  72. }
  73. message GetClassUnreadCountReq {
  74. string userId = 1; // 用户id
  75. int64 msgType = 2; //分类 1:客服 2:系统通知 3:营销 4:用户会话
  76. string appid = 3; //应用标识
  77. }
  78. //查看消息内容
  79. message MessageDetailReq {
  80. int64 id = 1; //消息id
  81. }
  82. message MessageDetailResp {
  83. int64 id = 1;
  84. string receiveUserId = 2; //接收方用户ID
  85. string receiveName = 3; //接收方用户名
  86. string sendUserId = 4; //发送方用户ID
  87. string sendName = 5; //发送方用户名
  88. string title = 6; //主题
  89. string content = 7; //内容
  90. int64 msgType = 8; //消息类型 1:客服 2:系统通知 3:营销 4:用户会话
  91. string link = 9; //跳转链接
  92. int64 citeId = 10; //引用id
  93. int64 isRead = 11; //已读未读 0:未读 1:已读
  94. string createtime = 12;
  95. string appid = 13; //应用标识
  96. }
  97. message GetLastMessageReq {
  98. string userId = 1; // 用户id
  99. int64 msgType = 2; //分类 1:客服 2:系统通知 3:营销 4:用户会话
  100. string appid = 3; //应用标识
  101. }
  102. message GetLastMessageRes {
  103. int64 code = 1; //状态码
  104. string message = 2; //响应消息
  105. Messages data = 3; //
  106. }
  107. service Message {
  108. // 修改消息阅读状态
  109. rpc ChangeReadStatus (ChangeReadStatusRequest) returns (Response);
  110. //指定用户发消息
  111. rpc SendUserMsg (SendMsgRequest) returns (Response);
  112. // 删除单一消息
  113. rpc DeleteSingleMessage (DeleteSingleMessageRequest) returns (Response);
  114. // 删除多条消息
  115. rpc DeleteMultipleMessage (DeleteMultipleMessageRequest) returns (Response);
  116. // 查询指定用户未读消息合计
  117. rpc GetUnreadCount (GetUnreadCountRequest) returns (GetUnreadCountResponse);
  118. // 查询指定用户的历史消息记录
  119. rpc FindUserMsg (FindUserMsgReq) returns (FindUserMsgRes);
  120. // 查询指定用户指定分类的未读消息合计
  121. rpc GetClassUnreadCount (GetClassUnreadCountReq) returns (GetUnreadCountResponse);
  122. // 获取指定用户指定分类的最新一条未读消息
  123. rpc GetLastMessage (GetLastMessageReq) returns (GetLastMessageRes);
  124. //查看详细详情
  125. rpc FindMessageDetail (MessageDetailReq) returns (MessageDetailResp);
  126. }