messagecenter.api 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. syntax = "v1"
  2. type CountReq {
  3. UserType int64 `json:"userType"`
  4. NewUserId int64 `header:"newUserId,optional"`
  5. EntUserId int64 `header:"entUserId,optional"`
  6. }
  7. type CountResp {
  8. Count int64 `json:"count"`
  9. ErrorCode int64 `json:"error_code"`
  10. ErrorMsg string `json:"error_msg"`
  11. }
  12. type UserReq {
  13. Phone string `json:"phone,optional"`
  14. UserType int64 `json:"userType"`
  15. StartTime string `json:"startTime,optional"`
  16. EndTime string `json:"endTime,optional"`
  17. NewUserId int64 `header:"newUserId"`
  18. EntId int64 `header:"entId,optional"`
  19. EntUserId int64 `header:"entUserId,optional"`
  20. Page int64 `json:"page,optional"`
  21. Size int64 `json:"size,optional"`
  22. IsArtificial int64 `json:"isArtificial,optional"`
  23. FiltrationId string `json:"filtrationId,optional"`
  24. QueryType int64 `json:"queryType,optional"`
  25. NameSearch string `json:"nameSearch,optional"`
  26. }
  27. type MessageEntity {
  28. OwnType int64 `json:"ownType"`
  29. Title string `json:"title"`
  30. Content string `json:"content"`
  31. Item int64 `json:"item"`
  32. Type int64 `json:"type"`
  33. Link string `json:"link"`
  34. Appid string `header:"appId"`
  35. ItemType int64 `json:"itemType"`
  36. SendId string `json:"sendId,optional"`
  37. EntUserId int64 `header:"entUserId,optional"`
  38. NewUserId int64 `header:"newUserId"`
  39. ReceiveId string `json:"receiveId,optional"`
  40. ReceiverIds []int64 `json:"receiverIds,optional"` //个人[可多个]
  41. GroupIds []int64 `json:"groupIds,optional"` //群聊[可多个]
  42. }
  43. type MessageReq {
  44. MsgType int64 `json:"msgType"`
  45. UserType int64 `json:"userType"`
  46. SendId string `json:"sendId,optional"`
  47. LastId string `json:"lastId,optional"`
  48. PageSize int64 `json:"pageSize"`
  49. NewUserId int64 `header:"newUserId"`
  50. EntUserId int64 `header:"entUserId,optional"`
  51. EntId int64 `header:"entId,optional"`
  52. Sort string `json:"sort,optional"`
  53. ChatGroupId int64 `json:"chatGroupId,optional"`
  54. }
  55. type CommonRes {
  56. Error_code int `json:"error_code"`
  57. Error_msg string `json:"error_msg"`
  58. Data interface{} `json:"data"`
  59. Count int64 `json:"count"`
  60. }
  61. type ChatSessionReq {
  62. MsgType int64 `json:"msgType"`
  63. UserType int64 `json:"userType"`
  64. EntId int64 `header:"entId,optional"`
  65. AppId string `header:"appId"`
  66. ReceiveEntId string `json:"receiveEntId,optional"`
  67. EntUserId int64 `header:"entUserId,optional"`
  68. NewUserId int64 `header:"newUserId"`
  69. ReceiveAppId string `json:"receiveAppId,optional"`
  70. ReceiveId string `json:"receiveId,optional"`
  71. CustomerserviceName string `json:"customerserviceName,optional"`
  72. }
  73. type CloseSessionReq {
  74. SessionId string `json:"sessionId"`
  75. }
  76. type ShuntReq {
  77. Type string `json:"type"`
  78. }
  79. type ReadStateReq {
  80. MessageId string `json:"messageId"`
  81. EntUserId int64 `header:"entUserId,optional"`
  82. NewUserId int64 `header:"newUserId"`
  83. }
  84. type ChatGroupListReq {
  85. EntId int64 `header:"entId,optional"`
  86. UserName string `json:"userName"`
  87. GroupName string `json:"groupName"`
  88. PositionId int64 `header:"positionId,optional"`
  89. Appid string `header:"appId"`
  90. }
  91. type ChatGroupAddReq {
  92. EntId int64 `header:"entId,optional"`
  93. PositionId int64 `header:"positionId,optional"`
  94. UserIdArr []string `json:"userIdArr"`
  95. Appid string `header:"appId"`
  96. }
  97. type ChatGroupPersonReq {
  98. ChatGroupId string `json:"chatGroupId"`
  99. EntId int64 `header:"entId,optional"`
  100. Appid string `header:"appId"`
  101. }
  102. type ChatGroupJoinReq {
  103. ChatGroupId string `json:"chatGroupId"`
  104. PositionId int64 `json:"positionId"`
  105. Appid string `header:"appId"`
  106. UserIdArr []string `json:"userIdArr"`
  107. }
  108. type GroupNameUpdateReq {
  109. ChatGroupId string `json:"chatGroupId"`
  110. PositionId int64 `header:"positionId,optional"`
  111. GroupName string `json:"groupName"`
  112. Appid string `header:"appId"`
  113. }
  114. type GroupNoticeAddReq {
  115. ChatGroupId string `json:"chatGroupId"`
  116. Content string `json:"content"`
  117. Appid string `header:"appId"`
  118. }
  119. type GroupNoticeUpdateReq {
  120. Content string `json:"content"`
  121. GroupNoticeId string `json:"groupNoticeId"`
  122. Appid string `header:"appId"`
  123. }
  124. type ReadWithdrawReq {
  125. MessageId string `json:"messageId"`
  126. Appid string `header:"appid"`
  127. UserType int64 `json:"userType"` //用户与客服聊天 发送人类型区分 用户类型:2用户1客服
  128. EntId int64 `header:"entId,optional"`
  129. SenderId int64 `json:"senderId,optional"` //发送人id
  130. RecipientId int64 `json:"recipientId,optional"` //接收人id
  131. ConversationType int64 `json:"conversationType,optional"` //会话类型 1:一对一用户聊天 2 用户与客服 3 一对群
  132. ChatGroupId int64 `json:"chatGroupId,optional"` //群id
  133. }
  134. type AppraiseMessageReq {
  135. EntId int64 `header:"entId,optional"`
  136. AppId string `header:"appId"`
  137. NewUserId int64 `header:"newUserId"`
  138. MessageId string `json:"messageId"`
  139. Appraise int64 `json:"appraise,options=-1|1"`
  140. }
  141. service messagecenter-api {
  142. @handler messageCount
  143. post /message/messageCount (CountReq) returns (CommonRes);
  144. @handler messageAdd
  145. post /message/messageAdd (MessageEntity) returns (CommonRes);
  146. @handler findMessage
  147. post /message/findMessage (MessageReq) returns (CommonRes);
  148. @handler userList
  149. post /message/userList (UserReq) returns (CommonRes);
  150. @handler createChatSession
  151. post /message/createChatSession (ChatSessionReq) returns (CommonRes);
  152. @handler closeChatSession
  153. post /message/closeChatSession (CloseSessionReq) returns (CommonRes);
  154. @handler obtainShunt
  155. post /message/obtainShunt (ShuntReq) returns (CommonRes);
  156. @handler updateReadById
  157. post /message/updateReadById (ReadStateReq) returns (CommonRes);
  158. @handler chatGroupList
  159. post /message/chatGroupList (ChatGroupListReq) returns (CommonRes);
  160. @handler chatGroupAdd
  161. post /message/chatGroupAdd (ChatGroupAddReq) returns (CommonRes);
  162. @handler chatGroupPerson
  163. post /message/chatGroupPerson (ChatGroupPersonReq) returns (CommonRes);
  164. @handler chatGroupJoin
  165. post /message/chatGroupJoin (ChatGroupJoinReq) returns (CommonRes);
  166. @handler groupNameUpdate
  167. post /message/groupNameUpdate (GroupNameUpdateReq) returns (CommonRes);
  168. @handler groupNoticeAdd
  169. post /message/groupNoticeAdd (GroupNoticeAddReq) returns (CommonRes);
  170. @handler groupNoticeUpdate
  171. post /message/groupNoticeUpdate (GroupNoticeUpdateReq) returns (CommonRes);
  172. @handler groupNoticeGet
  173. post /message/groupNoticeGet (ChatGroupPersonReq) returns (CommonRes);
  174. @handler withdrawMessage //撤回消息
  175. post /message/withdrawMessage (ReadWithdrawReq) returns (CommonRes);
  176. @handler AppraiseMessage // 消息评价
  177. post /message/appraiseMessage (AppraiseMessageReq) returns (CommonRes);
  178. @handler ConversationList // 会话列表
  179. post /message/conversationList (UserReq) returns (CommonRes);
  180. }