message.api 7.6 KB

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