add: cn proxy
This commit is contained in:
+35
-36
@@ -6,38 +6,41 @@ type (
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
|
||||
CreateGroupReq {
|
||||
Name string `json:"name"`
|
||||
Participants []int64 `json:"participants,optional"`
|
||||
}
|
||||
|
||||
CreateDMReq {
|
||||
TargetId int64 `json:"targetId"`
|
||||
}
|
||||
|
||||
ChatSession {
|
||||
Id int64 `json:"id"`
|
||||
Type string `json:"type"` // order, consultation
|
||||
OrderId string `json:"orderId,optional"`
|
||||
Participants []SimpleUser `json:"participants"`
|
||||
LastMessage string `json:"lastMessage"`
|
||||
UnreadCount int `json:"unreadCount"`
|
||||
Id int64 `json:"id"`
|
||||
Type string `json:"type"`
|
||||
Name string `json:"name"`
|
||||
CreatorId int64 `json:"creatorId"`
|
||||
Participants []int64 `json:"participants"`
|
||||
LastMessage string `json:"lastMessage"`
|
||||
LastMessageAt int64 `json:"lastMessageAt"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
}
|
||||
|
||||
ChatSessionListResp {
|
||||
Items []ChatSession `json:"items"`
|
||||
Meta PageMeta `json:"meta"`
|
||||
}
|
||||
|
||||
ChatMessage {
|
||||
Id int64 `json:"id"`
|
||||
SessionId string `json:"sessionId"`
|
||||
SenderId string `json:"senderId"`
|
||||
Type string `json:"type"` // text, image, system
|
||||
Content string `json:"content"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
Id int64 `json:"id"`
|
||||
SessionId int64 `json:"sessionId"`
|
||||
SenderId int64 `json:"senderId"`
|
||||
Type string `json:"type"`
|
||||
Content string `json:"content"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
}
|
||||
|
||||
ChatMessageListResp {
|
||||
Items []ChatMessage `json:"items"`
|
||||
Meta PageMeta `json:"meta"`
|
||||
}
|
||||
|
||||
SendMessageReq {
|
||||
SessionIdReq
|
||||
Type string `json:"type"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
ListMessageReq {
|
||||
@@ -51,27 +54,23 @@ type (
|
||||
group: chat
|
||||
)
|
||||
service chat-api {
|
||||
@doc "获取会话列表"
|
||||
@doc "create group session"
|
||||
@handler CreateGroup
|
||||
post /sessions/group (CreateGroupReq) returns (ChatSession)
|
||||
|
||||
@doc "create dm session"
|
||||
@handler CreateDM
|
||||
post /sessions/dm (CreateDMReq) returns (ChatSession)
|
||||
|
||||
@doc "list user sessions"
|
||||
@handler ListSessions
|
||||
get /sessions (PageReq) returns (ChatSessionListResp)
|
||||
|
||||
@doc "获取会话详情"
|
||||
@doc "get session detail"
|
||||
@handler GetSession
|
||||
get /sessions/:id (SessionIdReq) returns (ChatSession)
|
||||
|
||||
@doc "获取消息历史"
|
||||
@doc "get message history"
|
||||
@handler ListMessages
|
||||
get /sessions/:id/messages (ListMessageReq) returns (ChatMessageListResp)
|
||||
|
||||
@doc "发送消息"
|
||||
@handler SendMessage
|
||||
post /sessions/:id/messages (SendMessageReq) returns (ChatMessage)
|
||||
|
||||
@doc "创建/获取订单会话"
|
||||
@handler EnsureOrderSession
|
||||
post /sessions/order (EmptyResp) returns (ChatSession)
|
||||
|
||||
@doc "创建咨询会话"
|
||||
@handler CreateConsultation
|
||||
post /sessions/consultation (EmptyResp) returns (ChatSession)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user