message.api 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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 response {
  9. Code int64 `json:"code"`
  10. Message string `json:"message"`
  11. }
  12. //查询消息详情
  13. type MessageDetailReq {
  14. Id string `json:"id"`
  15. }
  16. type MessageDetailResp {
  17. Code int64 `json:"code"`
  18. Message string `json:"message"`
  19. Data map[string]interface{} `json:"data"`
  20. }
  21. type MessageUnreadCountReq {
  22. UserId string `header:"mgoUserId"`
  23. AppId string `header:"appId"`
  24. }
  25. type MessageUnreadCountRes {
  26. Code int64 `json:"code"`
  27. Message string `json:"message"`
  28. Data map[string]interface{} `json:"data"`
  29. }
  30. type GetMsgTypeReq {
  31. UserId string `header:"userId"`
  32. AppId string `header:"appId"`
  33. }
  34. type GetMsgTypeRes {
  35. Code int64 `json:"code"`
  36. Message string `json:"message"`
  37. Data []map[string]interface{} `json:"data"`
  38. }
  39. //修改指定用户某个分类的消息为已读
  40. type MsgReadStatusReq {
  41. UserId string `form:"userId"`
  42. AppId string `form:"appId"`
  43. MsgType int `form:"msgType"`
  44. }
  45. type MsgReadStatusResp {
  46. Code int64 `json:"code"`
  47. Message string `json:"message"`
  48. Status int64 `json:"status"`
  49. }
  50. type MarkReadReq {
  51. MsgId string `form:"msgId"`
  52. AppId string `form:"appId"`
  53. }
  54. type MarkReadRes {
  55. Code int64 `json:"code"`
  56. Message string `json:"message"`
  57. Data int64 `json:"data"`
  58. }
  59. //批量保存消息
  60. type MultipleSaveMsgReq {
  61. MsgInfo map[string]interface{} `json:"msgInfo"`
  62. UserIds string `json:"userIds"`
  63. UserNames string `json:"userNames"`
  64. PositionIds string `json:"positionIds,optional"` // 职位id 如果是多个就逗号分割 和用户id一一对应
  65. }
  66. type MultipleSaveMsgResp {
  67. Code int64 `json:"code"`
  68. Message string `json:"message"`
  69. ErrCount int64 `json:"errCount"`
  70. }
  71. type GetBuoyMsgReq {
  72. UserId string `header:"mgoUserId"`
  73. AppId string `header:"appId"`
  74. Size int64 `json:"size,optional"`
  75. }
  76. type GetBuoyMsgResp {
  77. Code int64 `json:"error_code"`
  78. Message string `json:"error_msg"`
  79. Data []map[string]interface{} `json:"data"`
  80. }
  81. type ClearUnreadMsgReq {
  82. UserId string `header:"mgoUserId"`
  83. AppId string `header:"appId"`
  84. EntId int64 `header:"entId,optional"`
  85. PositionId int64 `header:"positionId,optional"`
  86. }
  87. type MessageListReq {
  88. UserId string `header:"mgoUserId"`
  89. AppId string `header:"appId"`
  90. EntId int64 `header:"entId,optional"`
  91. SortSize int64 `json:"sortSize,optional"` //分类获取数
  92. Offset int64 `json:"offset"` //
  93. Size int64 `json:"size,optional"`
  94. MsgType int64 `json:"msgType,optional"`
  95. IsRead int64 `json:"isRead,optional"`
  96. NewUserId int64 `header:"newUserId,optional"` //私信相关
  97. PositionId int64 `header:"positionId,optional"` //私信相关
  98. IsColumn bool `json:"isColumn"` //是否需要获取栏目
  99. IsColumnNewMsg bool `json:"isColumnNewMsg"` //是否需各栏目获取最新消息
  100. IsMsgList bool `json:"isMsgList"` //是否需要列表信息
  101. }
  102. type MessageListResp {
  103. Code int64 `json:"code"`
  104. Message string `json:"message"`
  105. Data []map[string]interface{} `json:"data"`
  106. Last map[string]interface{} `json:"last"`
  107. Total int64 `json:"total"`
  108. Column []map[string]interface{} `json:"column"`
  109. Unread int64 `json:"unread"`
  110. }
  111. type UnreadMessageReq {
  112. UserId string `header:"mgoUserId"`
  113. AppId string `header:"appId"`
  114. Offset int64 `json:"offset"` //
  115. PageSize int64 `json:"pageSize"`
  116. }
  117. type UnreadMessageResp {
  118. Code int64 `json:"code"`
  119. Message string `json:"message"`
  120. Data []map[string]interface{} `json:"data"`
  121. Total int64 `json:"total"`
  122. }
  123. type WxTmplMessageReq {
  124. UserIds string `json:"userIds,optional"` // 用户id如果是多个就逗号分割
  125. PositionIds string `json:"positionIds,optional"` //用户职位id
  126. Title string `json:"title"`
  127. Date string `json:"date"`
  128. Detail string `json:"detail"`
  129. Class string `json:"class"`
  130. Url string `json:"url"`
  131. }
  132. type WxTmplMessageResponse {
  133. Code int64 `json:"code"`
  134. Total int64 `json:"total"`
  135. Message string `json:"message"`
  136. }
  137. service message-api {
  138. //查询消息详情
  139. @handler MessageDetailHandler
  140. get /messageCenter/messageDetail (MessageDetailReq) returns (MessageDetailResp)
  141. // 获取用户未读消息总量
  142. @handler MessageUnreadCountHandler
  143. post /messageCenter/messageUnreadCount (MessageUnreadCountReq) returns (MessageUnreadCountRes)
  144. // 获取用户接收到的消息分类
  145. @handler GetMsgTypeHandler
  146. get /messageCenter/getMsgType (GetMsgTypeReq) returns (GetMsgTypeRes)
  147. // 标记为已读
  148. @handler MarkReadHandler
  149. post /messageCenter/markRead (MarkReadReq) returns (MarkReadRes)
  150. // 发送消息
  151. @handler MultipleSaveMsgHandler
  152. post /messageCenter/MultipleSaveMsg (MultipleSaveMsgReq) returns (MultipleSaveMsgResp)
  153. // 查询浮标信息
  154. @handler GetBuoyMsgHandler
  155. post /messageCenter/GetBuoyMsg (GetBuoyMsgReq) returns (GetBuoyMsgResp)
  156. // 一键清空未读消息
  157. @handler ClearUnreadMessages
  158. post /messageCenter/ClearUnreadMsg (ClearUnreadMsgReq) returns (response)
  159. @handler MessageList
  160. post /messageCenter/MessageList (MessageListReq) returns (MessageListResp)
  161. @handler UnreadMessages
  162. post /messageCenter/unreadMessages (UnreadMessageReq) returns (UnreadMessageResp)
  163. // 发送微信模版消息
  164. @handler SendWxTmplMsg
  165. post /messageCenter/sendWxTmplMsg (WxTmplMessageReq) returns (WxTmplMessageResponse)
  166. }