message.api 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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 int64 `json:"id,optional"`
  15. MsgLogId int64 `json:"msgLogId,optional"`
  16. UserId string `header:"mgoUserId,optional"`
  17. }
  18. type MessageDetailResp {
  19. Code int64 `json:"code"`
  20. Message string `json:"message"`
  21. Data map[string]interface{} `json:"data"`
  22. }
  23. type GetMsgTypeReq {
  24. UserId string `header:"mgoUserId"`
  25. AppId string `header:"appId"`
  26. }
  27. type GetMsgTypeRes {
  28. Code int64 `json:"code"`
  29. Message string `json:"message"`
  30. Data []map[string]interface{} `json:"data"`
  31. }
  32. //修改指定用户某个分类的消息为已读
  33. type MsgReadStatusReq {
  34. UserId string `form:"userId"`
  35. AppId string `form:"appId"`
  36. MsgType int `form:"msgType"`
  37. }
  38. type MsgReadStatusResp {
  39. Code int64 `json:"code"`
  40. Message string `json:"message"`
  41. Status int64 `json:"status"`
  42. }
  43. type MarkReadReq {
  44. MsgId int64 `json:"msgId"`
  45. AppId string `header:"appId"`
  46. }
  47. type MarkReadRes {
  48. Code int64 `json:"code"`
  49. Message string `json:"message"`
  50. Data int64 `json:"data"`
  51. }
  52. //批量保存消息
  53. type MultipleSaveMsgReq {
  54. MsgInfo map[string]interface{} `json:"msgInfo"`
  55. UserIds string `json:"userIds"`
  56. UserNames string `json:"userNames"`
  57. PositionIds string `json:"positionIds,optional"` // 职位id 如果是多个就逗号分割 和用户id一一对应
  58. }
  59. type MultipleSaveMsgResp {
  60. Code int64 `json:"code"`
  61. Message string `json:"message"`
  62. ErrCount int64 `json:"errCount"`
  63. }
  64. type GetBuoyMsgReq {
  65. UserId string `header:"mgoUserId"`
  66. AppId string `header:"appId"`
  67. Size int64 `json:"size,optional"`
  68. }
  69. type GetBuoyMsgResp {
  70. Code int64 `json:"error_code"`
  71. Message string `json:"error_msg"`
  72. Data []map[string]interface{} `json:"data"`
  73. }
  74. type ClearUnreadMsgReq {
  75. UserId string `header:"mgoUserId"`
  76. AppId string `header:"appId"`
  77. EntId int64 `header:"entId,optional"`
  78. PositionId int64 `header:"positionId,optional"`
  79. NewUserId int64 `header:"newUserId,optional"`
  80. }
  81. type MessageListReq {
  82. UserId string `header:"mgoUserId"`
  83. AppId string `header:"appId"`
  84. EntId int64 `header:"entId,optional"`
  85. SortSize int64 `json:"sortSize,optional"` //分类获取数
  86. Offset int64 `json:"offset,optional"` //
  87. Size int64 `json:"size,optional"`
  88. MsgType int64 `json:"msgType,optional"`
  89. IsRead int64 `json:"isRead,optional"`
  90. NewUserId int64 `header:"newUserId,optional"` //私信相关
  91. PositionId int64 `header:"positionId,optional"` //私信相关
  92. IsColumn bool `json:"isColumn"` //是否需要获取栏目
  93. IsColumnNewMsg bool `json:"isColumnNewMsg"` //是否需各栏目获取最新消息
  94. IsMsgList bool `json:"isMsgList"` //是否需要列表信息
  95. IsContainLetter bool `json:"isContainLetter,optional,default=true"` //是否未读数包含私信
  96. IsClassSearch bool `json:"isClassSearch,optional"` // 是否为具体分类查询
  97. }
  98. type MessageListResp {
  99. Code int64 `json:"code"`
  100. Message string `json:"message"`
  101. Data []map[string]interface{} `json:"data"`
  102. Last map[string]interface{} `json:"last"`
  103. Total int64 `json:"total"`
  104. Column []map[string]interface{} `json:"column"`
  105. Unread int64 `json:"unread"`
  106. RollingTiming int64 `json:"rollingTiming"`
  107. }
  108. type UnreadMessageReq {
  109. UserId string `header:"mgoUserId"`
  110. AppId string `header:"appId"`
  111. Offset int64 `json:"offset"` //
  112. PageSize int64 `json:"pageSize"`
  113. IsNeedData int64 `json:"isNeedData"` //是否需要未读消息数据 0 不需要 1 需要
  114. }
  115. type UnreadMessageResp {
  116. Code int64 `json:"code"`
  117. Message string `json:"message"`
  118. Data []map[string]interface{} `json:"data"`
  119. Total int64 `json:"total"`
  120. }
  121. type WxTmplMessageReq {
  122. UserIds string `json:"userIds,optional"` // 用户id如果是多个就逗号分割
  123. PositionIds string `json:"positionIds,optional"` //用户职位id
  124. Title string `json:"title"`
  125. Date string `json:"date"`
  126. Detail string `json:"detail"`
  127. Row4 string `json:"row4"`
  128. Class int64 `json:"class"` //msg_type
  129. Url string `json:"url"`
  130. }
  131. type WxTmplMessageResponse {
  132. Code int64 `json:"code"`
  133. Total int64 `json:"total"`
  134. Message string `json:"message"`
  135. }
  136. type MsgOpenLogReq {
  137. MsgLogId int64 `json:"msgLogId"`
  138. Platform int64 `json:"platform"` //1pc 2 app 3 微信
  139. UserId string `header:"mgoUserId"`
  140. AppId string `header:"appId"`
  141. }
  142. type NewUserSaveMsgReq {
  143. MsgInfo map[string]interface{} `json:"msgInfo"`
  144. UserIds string `json:"userIds"`
  145. PositionIds string `json:"positionIds,optional"` // 职位id 如果是多个就逗号分割 和用户id一一对应
  146. }
  147. type NewUserSaveMsgResp {
  148. Code int64 `json:"code"`
  149. Message string `json:"message"`
  150. }
  151. type UpdateMsgSummaryReq {
  152. MsgLogId int64 `json:"msgLogId"`
  153. GroupId int64 `json:"groupId"`
  154. MsgType int64 `json:"msgType"`
  155. }
  156. type BitmapSaveMsgReq {
  157. MsgInfo map[string]interface{} `json:"msgInfo"`
  158. UserIds string `json:"userIds"`
  159. PositionIds string `json:"positionIds,optional"` // 职位id 如果是多个就逗号分割 和用户id一一对应
  160. }
  161. service message-api {
  162. // 更新用户all_msg bitmap
  163. @handler BitmapSaveMsgHandler
  164. post /messageCenter/BitmapSaveMsg (BitmapSaveMsgReq) returns (MultipleSaveMsgResp)
  165. // 更新消息汇总表
  166. @handler UpdateMsgSummaryHandler
  167. post /messageCenter/UpdateMsgSummary (UpdateMsgSummaryReq) returns (response)
  168. // 新用户发送消息
  169. @handler NewUserSaveMsgHandler
  170. post /messageCenter/NewUserSaveMsg (NewUserSaveMsgReq) returns (NewUserSaveMsgResp)
  171. //查询消息详情
  172. @handler MessageDetailHandler
  173. post /messageCenter/messageDetail (MessageDetailReq) returns (MessageDetailResp)
  174. // 获取消息分类
  175. @handler GetMsgTypeHandler
  176. post /messageCenter/getMsgType (GetMsgTypeReq) returns (GetMsgTypeRes)
  177. // 标记为已读
  178. @handler MarkReadHandler
  179. post /messageCenter/markRead (MarkReadReq) returns (MarkReadRes)
  180. // 发送消息
  181. @handler MultipleSaveMsgHandler
  182. post /messageCenter/MultipleSaveMsg (MultipleSaveMsgReq) returns (MultipleSaveMsgResp)
  183. // 查询浮标信息
  184. @handler GetBuoyMsgHandler
  185. post /messageCenter/GetBuoyMsg (GetBuoyMsgReq) returns (GetBuoyMsgResp)
  186. // 一键清空未读消息
  187. @handler ClearUnreadMessages
  188. post /messageCenter/ClearUnreadMsg (ClearUnreadMsgReq) returns (response)
  189. @handler MessageList
  190. post /messageCenter/MessageList (MessageListReq) returns (MessageListResp)
  191. //未读消息列表
  192. @handler UnreadMessages
  193. post /messageCenter/unreadMessages (UnreadMessageReq) returns (UnreadMessageResp)
  194. // 发送微信模版消息
  195. @handler SendWxTmplMsg
  196. post /messageCenter/sendWxTmplMsg (WxTmplMessageReq) returns (WxTmplMessageResponse)
  197. // 消息打开记录
  198. @handler MsgOpenLog
  199. post /messageCenter/msgOpenLog (MsgOpenLogReq) returns (response)
  200. }