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