message.api 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. }
  78. type MessageListReq {
  79. UserId string `header:"mgoUserId"`
  80. AppId string `header:"appId"`
  81. EntId int64 `header:"entId,optional"`
  82. SortSize int64 `json:"sortSize,optional"` //分类获取数
  83. Offset int64 `json:"offset"` //
  84. Size int64 `json:"size,optional"`
  85. MsgType int64 `json:"msgType,optional"`
  86. IsRead int64 `json:"isRead,optional"`
  87. NewUserId int64 `header:"newUserId,optional"` //私信相关
  88. PositionId int64 `header:"positionId,optional"` //私信相关
  89. IsColumn bool `json:"isColumn"` //是否需要获取栏目
  90. IsColumnNewMsg bool `json:"isColumnNewMsg"` //是否需各栏目获取最新消息
  91. IsMsgList bool `json:"isMsgList"` //是否需要列表信息
  92. }
  93. type MessageListResp {
  94. Code int64 `json:"code"`
  95. Message string `json:"message"`
  96. Data []map[string]interface{} `json:"data"`
  97. Last map[string]interface{} `json:"last"`
  98. Total int64 `json:"total"`
  99. Column []map[string]interface{} `json:"column"`
  100. Unread int64 `json:"unread"`
  101. RollingTiming int64 `json:"rollingTiming"`
  102. }
  103. type UnreadMessageReq {
  104. UserId string `header:"mgoUserId"`
  105. AppId string `header:"appId"`
  106. Offset int64 `json:"offset"` //
  107. PageSize int64 `json:"pageSize"`
  108. IsNeedData int64 `json:"isNeedData"` //是否需要未读消息数据 0 不需要 1 需要
  109. }
  110. type UnreadMessageResp {
  111. Code int64 `json:"code"`
  112. Message string `json:"message"`
  113. Data []map[string]interface{} `json:"data"`
  114. Total int64 `json:"total"`
  115. }
  116. type WxTmplMessageReq {
  117. UserIds string `json:"userIds,optional"` // 用户id如果是多个就逗号分割
  118. PositionIds string `json:"positionIds,optional"` //用户职位id
  119. Title string `json:"title"`
  120. Date string `json:"date"`
  121. Detail string `json:"detail"`
  122. Class string `json:"class"`
  123. Url string `json:"url"`
  124. }
  125. type WxTmplMessageResponse {
  126. Code int64 `json:"code"`
  127. Total int64 `json:"total"`
  128. Message string `json:"message"`
  129. }
  130. type MsgOpenLogReq {
  131. MsgLogId int64 `json:"msgLogId"`
  132. Platform int64 `json:"platform"` //1pc 2 app 3 微信
  133. UserId string `header:"mgoUserId"`
  134. AppId string `header:"appId"`
  135. }
  136. service message-api {
  137. //查询消息详情
  138. @handler MessageDetailHandler
  139. get /messageCenter/messageDetail (MessageDetailReq) returns (MessageDetailResp)
  140. // 获取消息分类
  141. @handler GetMsgTypeHandler
  142. post /messageCenter/getMsgType (GetMsgTypeReq) returns (GetMsgTypeRes)
  143. // 标记为已读
  144. @handler MarkReadHandler
  145. post /messageCenter/markRead (MarkReadReq) returns (MarkReadRes)
  146. // 发送消息
  147. @handler MultipleSaveMsgHandler
  148. post /messageCenter/MultipleSaveMsg (MultipleSaveMsgReq) returns (MultipleSaveMsgResp)
  149. // 查询浮标信息
  150. @handler GetBuoyMsgHandler
  151. post /messageCenter/GetBuoyMsg (GetBuoyMsgReq) returns (GetBuoyMsgResp)
  152. // 一键清空未读消息
  153. @handler ClearUnreadMessages
  154. post /messageCenter/ClearUnreadMsg (ClearUnreadMsgReq) returns (response)
  155. @handler MessageList
  156. post /messageCenter/MessageList (MessageListReq) returns (MessageListResp)
  157. //未读消息列表
  158. @handler UnreadMessages
  159. post /messageCenter/unreadMessages (UnreadMessageReq) returns (UnreadMessageResp)
  160. // 发送微信模版消息
  161. @handler SendWxTmplMsg
  162. post /messageCenter/sendWxTmplMsg (WxTmplMessageReq) returns (WxTmplMessageResponse)
  163. // 消息打开记录
  164. @handler MsgOpenLog
  165. post /messageCenter/msgOpenLog (MsgOpenLogReq) returns (response)
  166. }