messagecenter.api 5.2 KB

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