messagecenter.api 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. MessageId string `json:"messageId"`
  85. EntUserId int64 `header:"entUserId,optional"`
  86. NewUserId int64 `header:"newUserId"`
  87. }
  88. type ReadWithdrawReq {
  89. MessageId string `json:"messageId"`
  90. Appid string `header:"appid"`
  91. UserType int64 `json:"userType"` //用户与客服聊天 发送人类型区分 用户类型:2用户1客服
  92. EntId int64 `header:"entId,optional"`
  93. SenderId int64 `json:"senderId,optional"` //发送人id
  94. RecipientId int64 `json:"recipientId,optional"` //接收人id
  95. ConversationType int64 `json:"conversationType,optional"` //会话类型 1:一对一用户聊天 2 用户与客服 3 一对群
  96. ChatGroupId int64 `json:"chatGroupId,optional"` //群id
  97. }
  98. type AppraiseMessageReq {
  99. EntId int64 `header:"entId,optional"`
  100. AppId string `header:"appId"`
  101. NewUserId int64 `header:"newUserId"`
  102. MessageId string `json:"messageId"`
  103. Appraise int64 `json:"appraise,options=-1|1"`
  104. }
  105. type OneUserPositionReq {
  106. PositionId string `json:"positionId"`
  107. EntId int64 `header:"entId,optional"`
  108. Appid string `header:"appId"`
  109. }
  110. service messagecenter-api {
  111. @handler messageCount
  112. post /message/messageCount (CountReq) returns (CommonRes);
  113. @handler messageAdd
  114. post /message/messageAdd (MessageEntity) returns (CommonRes);
  115. @handler findMessage
  116. post /message/findMessage (MessageReq) returns (CommonRes);
  117. @handler userList
  118. post /message/userList (UserReq) returns (CommonRes);
  119. @handler createChatSession
  120. post /message/createChatSession (ChatSessionReq) returns (CommonRes);
  121. @handler closeChatSession
  122. post /message/closeChatSession (CloseSessionReq) returns (CommonRes);
  123. @handler obtainShunt
  124. post /message/obtainShunt (ShuntReq) returns (CommonRes);
  125. @handler updateReadById
  126. post /message/updateReadById (ReadStateReq) returns (CommonRes);
  127. @handler withdrawMessage //撤回消息
  128. post /message/withdrawMessage (ReadWithdrawReq) returns (CommonRes);
  129. @handler AppraiseMessage // 消息评价
  130. post /message/appraiseMessage (AppraiseMessageReq) returns (CommonRes);
  131. @handler ConversationList // 会话列表
  132. post /message/conversationList (UserReq) returns (CommonRes);
  133. @handler oneUserPosition // 1v1会话职位
  134. post /message/oneUserPosition (OneUserPositionReq) returns (CommonRes);
  135. }