message.api 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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. IsfilterActive bool `json:"isfilterActive,optional"` //是否过滤活动通知消息
  99. }
  100. type MessageListResp {
  101. Code int64 `json:"code"`
  102. Message string `json:"message"`
  103. Data []map[string]interface{} `json:"data"`
  104. Last map[string]interface{} `json:"last"`
  105. Total int64 `json:"total"`
  106. Column []map[string]interface{} `json:"column"`
  107. Unread int64 `json:"unread"`
  108. RollingTiming int64 `json:"rollingTiming"`
  109. ToDoUnread int64 `json:"toDoUnread"`
  110. }
  111. //type UnreadMessageReq {
  112. // UserId string `header:"mgoUserId"`
  113. // AppId string `header:"appId"`
  114. // Offset int64 `json:"offset"` //
  115. // PageSize int64 `json:"pageSize"`
  116. // IsNeedData int64 `json:"isNeedData"` //是否需要未读消息数据 0 不需要 1 需要
  117. //}
  118. //type UnreadMessageResp {
  119. // Code int64 `json:"code"`
  120. // Message string `json:"message"`
  121. // Data []map[string]interface{} `json:"data"`
  122. // Total int64 `json:"total"`
  123. //}
  124. type WxTmplMessageReq {
  125. UserIds string `json:"userIds,optional"` // 用户id如果是多个就逗号分割
  126. PositionIds string `json:"positionIds,optional"` //用户职位id
  127. Title string `json:"title"`
  128. Date string `json:"date"`
  129. Detail string `json:"detail"`
  130. Row4 string `json:"row4"`
  131. Class int64 `json:"class"` //msg_type
  132. Url string `json:"url"`
  133. }
  134. type WxTmplMessageResponse {
  135. Code int64 `json:"code"`
  136. Total int64 `json:"total"`
  137. Message string `json:"message"`
  138. }
  139. type MsgOpenLogReq {
  140. MsgLogId int64 `json:"msgLogId"`
  141. Platform int64 `json:"platform"` //1pc 2 app 3 微信
  142. UserId string `header:"mgoUserId"`
  143. AppId string `header:"appId"`
  144. }
  145. type NewUserSaveMsgReq {
  146. MsgInfo map[string]interface{} `json:"msgInfo"`
  147. UserIds string `json:"userIds"`
  148. PositionIds string `json:"positionIds,optional"` // 职位id 如果是多个就逗号分割 和用户id一一对应
  149. }
  150. type NewUserSaveMsgResp {
  151. Code int64 `json:"code"`
  152. Message string `json:"message"`
  153. }
  154. type UpdateMsgSummaryReq {
  155. MsgLogId int64 `json:"msgLogId"`
  156. GroupId int64 `json:"groupId"`
  157. MsgType int64 `json:"msgType"`
  158. }
  159. type BitmapSaveMsgReq {
  160. MsgInfo map[string]interface{} `json:"msgInfo"`
  161. UserIds string `json:"userIds"`
  162. PositionIds string `json:"positionIds,optional"` // 职位id 如果是多个就逗号分割 和用户id一一对应
  163. }
  164. type WorkDeskListReq {
  165. UserId string `header:"mgoUserId"`
  166. AppId string `header:"appId"`
  167. Offset int64 `json:"offset"`
  168. PageSize int64 `json:"size"`
  169. MsgType int64 `json:"msgType"`
  170. NeedDealtWithCount bool `json:"needDealtWithCount"`
  171. }
  172. type WorkDeskListResp {
  173. Code int64 `json:"code"`
  174. Message string `json:"message"`
  175. BusData []map[string]interface{} `json:"busData"`
  176. NeedDoData []map[string]interface{} `json:"needDoData"`
  177. }
  178. type MaterialDetailReq {
  179. Id int64 `json:"id"`
  180. UserId string `header:"mgoUserId,optional"`
  181. PositionId int64 `header:"positionId,optional"`
  182. PositionType int64 `header:"positionType,optional"`
  183. }
  184. type MaterialDetailResp {
  185. Code int64 `json:"code"`
  186. Err_msg string `json:"errMsg"`
  187. Data map[string]interface{} `json:"data"`
  188. }
  189. service message-api {
  190. // 工作桌面商机情报
  191. @handler WorkDeskListHandler
  192. post /messageCenter/WorkDeskList (WorkDeskListReq) returns (WorkDeskListResp)
  193. // 更新用户all_msg bitmap
  194. @handler BitmapSaveMsgHandler
  195. post /messageCenter/BitmapSaveMsg (BitmapSaveMsgReq) returns (MultipleSaveMsgResp)
  196. // 更新消息汇总表
  197. @handler UpdateMsgSummaryHandler
  198. post /messageCenter/UpdateMsgSummary (UpdateMsgSummaryReq) returns (response)
  199. // 新用户发送消息
  200. @handler NewUserSaveMsgHandler
  201. post /messageCenter/NewUserSaveMsg (NewUserSaveMsgReq) returns (NewUserSaveMsgResp)
  202. //查询消息详情
  203. @handler MessageDetailHandler
  204. post /messageCenter/messageDetail (MessageDetailReq) returns (MessageDetailResp)
  205. // 获取消息分类
  206. // @handler GetMsgTypeHandler
  207. // post /messageCenter/getMsgType (GetMsgTypeReq) returns (GetMsgTypeRes)
  208. // 标记为已读
  209. @handler MarkReadHandler
  210. post /messageCenter/markRead (MarkReadReq) returns (MarkReadRes)
  211. // 发送消息
  212. @handler MultipleSaveMsgHandler
  213. post /messageCenter/MultipleSaveMsg (MultipleSaveMsgReq) returns (MultipleSaveMsgResp)
  214. // 查询浮标信息
  215. @handler GetBuoyMsgHandler
  216. post /messageCenter/GetBuoyMsg (GetBuoyMsgReq) returns (GetBuoyMsgResp)
  217. // 一键清空未读消息
  218. @handler ClearUnreadMessages
  219. post /messageCenter/ClearUnreadMsg (ClearUnreadMsgReq) returns (response)
  220. @handler MessageList
  221. post /messageCenter/MessageList (MessageListReq) returns (MessageListResp)
  222. //未读消息列表
  223. // @handler UnreadMessages
  224. // post /messageCenter/unreadMessages (UnreadMessageReq) returns (UnreadMessageResp)
  225. // 发送微信模版消息
  226. @handler SendWxTmplMsg
  227. post /messageCenter/sendWxTmplMsg (WxTmplMessageReq) returns (WxTmplMessageResponse)
  228. // 消息打开记录
  229. @handler MsgOpenLog
  230. post /messageCenter/msgOpenLog (MsgOpenLogReq) returns (response)
  231. @handler MaterialDetail
  232. post /messageCenter/materialDetail (MaterialDetailReq) returns (MaterialDetailResp)
  233. }