123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- import "../base.api"
- type (
- // The data of chat records information | ChatRecords信息
- ChatRecordsInfo {
- BaseIDInfo
- // 内容
- Content *string `json:"content,optional"`
- // 内容类型:1-提问 2-回答
- ContentType *uint8 `json:"contentType,optional"`
- // 角色类型:1-用户 2-智能体
- RoleType *string `json:"roleType,optional"`
- // 会话ID
- SessionId *uint64 `json:"sessionId,optional"`
- // 用户ID
- UserId *uint64 `json:"userId,optional"`
- // 聊天ID
- BotId *uint64 `json:"botId,optional"`
- // 类型:1-微信 2-小程序card 3-智能体
- BotType *uint8 `json:"botType,optional,options=1|2|3"`
- Finish bool `json:"finish,optional"`
- }
- // The response data of chat records list | ChatRecords列表数据
- ChatRecordsListResp {
- BaseDataInfo
- // ChatRecords list data | ChatRecords列表数据
- Data ChatRecordsListInfo `json:"data"`
- }
- // ChatRecords list data | ChatRecords列表数据
- ChatRecordsListInfo {
- BaseListInfo
- // The API list data | ChatRecords列表数据
- Data []ChatRecordsInfo `json:"data"`
- }
- // Get chat records list request params | ChatRecords列表请求参数
- ChatRecordsListReq {
- PageInfo
- SessionId *uint64 `json:"sessionId"`
- BotId *uint64 `json:"botId,optional"`
- BotType *uint8 `json:"botType,optional"`
- }
- // ChatRecords information response | ChatRecords信息返回体
- ChatRecordsInfoResp {
- BaseDataInfo
- // ChatRecords information | ChatRecords数据
- Data ChatRecordsInfo `json:"data"`
- }
- ChatRecommendReq {
- SessionId *uint64 `json:"sessionId"`
- }
- ChatRecommendResp {
- BaseDataInfo
- // The API list data | ChatRecords列表数据
- Data ChatRecommend `json:"data"`
- }
- ChatRecommend {
- Data []string `json:"data"`
- SessionId uint64 `json:"sessionId"`
- }
- ChatAskReq {
- CardId *uint64 `json:"cardId"`
- Question *string `json:"question"`
- SessionId *int `json:"sessionId"`
- }
- ChatAskResp {
- BaseDataInfo
- Data *string `json:"data"`
- }
- )
- @server(
- jwt: Auth
- group: chatrecords
- middleware: Miniprogram
- )
- service Wechat {
- // Create chat records information | 创建ChatRecords
- @handler submitApiChat
- post /api/chat/create (ChatRecordsInfo)
- // Create chat records information | 创建ChatRecords
- @handler answerApiChat
- post /api/chat/answer (ChatAskReq) returns (ChatAskResp)
- // Get chat records list | 获取ChatRecords列表
- @handler getApiChatList
- post /api/chat/list (ChatRecordsListReq) returns (ChatRecordsListResp)
- // Get chat records list | 获取ChatRecords列表
- @handler getApiRecommendChat
- post /api/chat/recommmend (ChatRecommendReq) returns (ChatRecommendResp)
- }
- @server(
- jwt: Auth
- group: chatrecords
- middleware: Authority
- )
- service Wechat {
- // Create chat records information | 创建ChatRecords
- @handler createChatRecords
- post /chat_records/create (ChatRecordsInfo) returns (BaseMsgResp)
- // Update chat records information | 更新ChatRecords
- @handler updateChatRecords
- post /chat_records/update (ChatRecordsInfo) returns (BaseMsgResp)
- // Delete chat records information | 删除ChatRecords信息
- @handler deleteChatRecords
- post /chat_records/delete (IDsReq) returns (BaseMsgResp)
- // Get chat records list | 获取ChatRecords列表
- @handler getChatRecordsList
- post /chat_records/list (ChatRecordsListReq) returns (ChatRecordsListResp)
- // Get chat records by ID | 通过ID获取ChatRecords
- @handler getChatRecordsById
- post /chat_records (IDReq) returns (ChatRecordsInfoResp)
- }
|