message.api 6.2 KB

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