fix: api descript

This commit is contained in:
wwweww
2026-02-28 05:33:16 +08:00
parent 5930fb0dde
commit d2f33b4b96
243 changed files with 37065 additions and 780 deletions
+14 -5
View File
@@ -2,8 +2,12 @@ syntax = "v1"
import "common.api"
type (
SessionIdReq {
Id int64 `path:"id"`
}
ChatSession {
Id string `json:"id"`
Id int64 `json:"id"`
Type string `json:"type"` // order, consultation
OrderId string `json:"orderId,optional"`
Participants []SimpleUser `json:"participants"`
@@ -17,7 +21,7 @@ type (
}
ChatMessage {
Id string `json:"id"`
Id int64 `json:"id"`
SessionId string `json:"sessionId"`
SenderId string `json:"senderId"`
Type string `json:"type"` // text, image, system
@@ -31,15 +35,20 @@ type (
}
SendMessageReq {
SessionIdReq
Type string `json:"type"`
Content string `json:"content"`
}
ListMessageReq {
SessionIdReq
PageReq
}
)
@server(
prefix: api/v1/chat
group: chat
jwt: Auth
)
service juwan-api {
@doc "获取会话列表"
@@ -48,11 +57,11 @@ service juwan-api {
@doc "获取会话详情"
@handler GetSession
get /sessions/:id (EmptyResp) returns (ChatSession)
get /sessions/:id (SessionIdReq) returns (ChatSession)
@doc "获取消息历史"
@handler ListMessages
get /sessions/:id/messages (PageReq) returns (ChatMessageListResp)
get /sessions/:id/messages (ListMessageReq) returns (ChatMessageListResp)
@doc "发送消息"
@handler SendMessage