message.api 5.4 KB

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