messagecenter.api 5.9 KB

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