messagecenter.api 5.8 KB

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