message.api 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. syntax = "v1"
  2. info(
  3. title: // TODO: add title
  4. desc: // TODO: add description
  5. author: "jiaojiao7"
  6. email: "renjiaojiao@topnet.net.cn"
  7. )
  8. type MessageDeleteReq {
  9. Id string `form:"id"`
  10. AppId string `form:"appId"`
  11. }
  12. type response {
  13. Code int64 `json:"code"`
  14. Message string `json:"message"`
  15. }
  16. //查询消息详情
  17. type MessageDetailReq {
  18. Id string `form:"id"`
  19. }
  20. type MessageDetailResp {
  21. Code int64 `json:"code"`
  22. Message string `json:"message"`
  23. Data map[string]interface{} `json:"data"`
  24. }
  25. type MessageGetLastReq {
  26. UserId string `form:"userId"`
  27. AppId string `form:"appId"`
  28. MsgType int64 `form:"msgType"`
  29. IsRead int64 `form:"isRead"` // 1 0 -1
  30. }
  31. type MessageGetLastRes {
  32. Code int64 `json:"code"`
  33. Message string `json:"message"`
  34. Data map[string]interface{} `json:"data"`
  35. }
  36. type MessageFindReq {
  37. UserId string `form:"userId"`
  38. AppId string `form:"appId"`
  39. // MsgType int64 `form:"msgType"`
  40. ReceiveUserId string `form:"receiveUserId"`
  41. MsgType int64 `form:"msgType"` // 是否限制消息类型 -1 不限制
  42. IsRead int64 `form:"isRead"` // 是否限制未读 -1 不限制
  43. Offset int64 `form:"offset"` // 页数
  44. PageSize int64 `form:"pageSize"` //
  45. }
  46. type MessageFindRes {
  47. Code int64 `json:"code"`
  48. Message string `json:"message"`
  49. Data []map[string]interface{} `json:"data"`
  50. Total int64 `json:"total"`
  51. }
  52. type MessageUnreadClassCountReq {
  53. UserId string `form:"userId"`
  54. AppId string `form:"appId"`
  55. }
  56. type MessageUnreadClassCountRes {
  57. Code int64 `json:"code"`
  58. Message string `json:"message"`
  59. Data []map[string]interface{} `json:"data"`
  60. }
  61. type MessageUnreadCountReq {
  62. UserId string `header:"mgoUserId"`
  63. AppId string `header:"appId"`
  64. }
  65. type MessageUnreadCountRes {
  66. Code int64 `json:"code"`
  67. Message string `json:"message"`
  68. Data map[string]interface{} `json:"data"`
  69. }
  70. type MessageTypeReq {
  71. UserId string `form:"userId"`
  72. AppId string `form:"appId"`
  73. }
  74. type MessageTypeRes {
  75. Code int64 `json:"code"`
  76. Message string `json:"message"`
  77. Data []int64 `json:"data"`
  78. }
  79. //修改指定用户某个分类的消息为已读
  80. type MsgReadStatusReq {
  81. UserId string `form:"userId"`
  82. AppId string `form:"appId"`
  83. MsgType int `form:"msgType"`
  84. }
  85. type MsgReadStatusResp {
  86. Code int64 `json:"code"`
  87. Message string `json:"message"`
  88. Status int64 `json:"status"`
  89. }
  90. type MarkReadReq {
  91. MsgId string `form:"msgId"`
  92. AppId string `form:"appId"`
  93. }
  94. type MarkReadRes {
  95. Code int64 `json:"code"`
  96. Message string `json:"message"`
  97. Data int64 `json:"data"`
  98. }
  99. //批量保存消息
  100. type MultipleSaveMsgReq {
  101. MsgInfo map[string]interface{} `json:"msgInfo"`
  102. UserIds string `json:"userIds"`
  103. UserNames string `json:"userNames"`
  104. PositionIds string `json:"positionIds,optional"` // 职位id 如果是多个就逗号分割 和用户id一一对应
  105. }
  106. type MultipleSaveMsgResp {
  107. Code int64 `json:"code"`
  108. Message string `json:"message"`
  109. ErrCount int64 `json:"errCount"`
  110. }
  111. type GetBuoyMsgReq {
  112. UserId string `header:"mgoUserId"`
  113. AppId string `header:"appId"`
  114. Size int64 `json:"size,optional"`
  115. }
  116. type GetBuoyMsgResp {
  117. Code int64 `json:"error_code"`
  118. Message string `json:"error_msg"`
  119. Data []map[string]interface{} `json:"data"`
  120. }
  121. type ClearUnreadMsgReq {
  122. UserId string `header:"mgoUserId"`
  123. AppId string `header:"appId"`
  124. EntId int64 `header:"entId,optional"`
  125. PositionId int64 `header:"positionId,optional"`
  126. }
  127. type MessageListReq {
  128. UserId string `header:"mgoUserId"`
  129. AppId string `header:"appId"`
  130. EntId int64 `header:"entId,optional"`
  131. SortSize int64 `json:"sortSize,optional"` //分类获取数
  132. Offset int64 `json:"offset"` //
  133. Size int64 `json:"size,optional"`
  134. MsgType int64 `json:"msgType,optional"`
  135. IsRead int64 `json:"isRead,optional"`
  136. IsColumn bool `json:"isColumn"` //是否需要获取栏目
  137. IsColumnNewMsg bool `json:"isColumnNewMsg"` //是否需各栏目获取最新消息
  138. IsMsgList bool `json:"isMsgList"` //是否需要列表信息
  139. }
  140. type MessageListResp {
  141. Code int64 `json:"code"`
  142. Message string `json:"message"`
  143. Data []map[string]interface{} `json:"data"`
  144. Last map[string]interface{} `json:"last"`
  145. Total int64 `json:"total"`
  146. Column []map[string]interface{} `json:"column"`
  147. Unread int64 `json:"unread"`
  148. }
  149. type UnreadMessageReq {
  150. UserId string `header:"mgoUserId"`
  151. AppId string `header:"appId"`
  152. Offset int64 `json:"offset"` //
  153. PageSize int64 `json:"pageSize"`
  154. }
  155. type UnreadMessageResp {
  156. Code int64 `json:"code"`
  157. Message string `json:"message"`
  158. Data []map[string]interface{} `json:"data"`
  159. Total int64 `json:"total"`
  160. }
  161. service message-api {
  162. //查询消息详情
  163. @handler MessageDetailHandler
  164. get /messageCenter/messageDetail (MessageDetailReq) returns (MessageDetailResp)
  165. // 获取指定类型的最新一条未读消息
  166. @handler MessageGetLastHandler
  167. post /messageCenter/messageGetLast (MessageGetLastReq) returns (MessageGetLastRes)
  168. // 获取指定用户的历史消息 条件可选 消息类型 是否未读
  169. @handler MessageFindHandler
  170. post /messageCenter/messageFind (MessageFindReq) returns (MessageFindRes)
  171. // 获取用户收到的消息分类及未读消息数量
  172. @handler MessageUnreadClassCountHandler
  173. post /messageCenter/messageUnreadClassCount (MessageUnreadClassCountReq) returns (MessageUnreadClassCountRes)
  174. // 获取用户未读消息总量
  175. @handler MessageUnreadCountHandler
  176. post /messageCenter/messageUnreadCount (MessageUnreadCountReq) returns (MessageUnreadCountRes)
  177. // 获取用户接收到的消息分类
  178. @handler MessageTypeHandler
  179. get /messageCenter/messageType (MessageTypeReq) returns (MessageTypeRes)
  180. // 标记为已读
  181. @handler MarkReadHandler
  182. post /messageCenter/markRead (MarkReadReq) returns (MarkReadRes)
  183. // 发送消息
  184. @handler MultipleSaveMsgHandler
  185. post /messageCenter/MultipleSaveMsg (MultipleSaveMsgReq) returns (MultipleSaveMsgResp)
  186. // 查询浮标信息
  187. @handler GetBuoyMsgHandler
  188. post /messageCenter/GetBuoyMsg (GetBuoyMsgReq) returns (GetBuoyMsgResp)
  189. // 一键清空未读消息
  190. @handler ClearUnreadMessages
  191. post /messageCenter/ClearUnreadMsg (ClearUnreadMsgReq) returns (response)
  192. @handler MessageList
  193. post /messageCenter/MessageList (MessageListReq) returns (MessageListResp)
  194. @handler UnreadMessages
  195. post /messageCenter/unreadMessages (UnreadMessageReq) returns (UnreadMessageResp)
  196. }