123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- import "../base.api"
- type (
- AvatarInfo {
- RequestId *string `json:"requestId"`
- SessionId *string `json:"SessionId"`
- Token *string `json:"token"`
- Channel Channel `json:"channel"`
- }
- Channel {
- ChannelId *string `json:"channelId"`
- Token *string `json:"token"`
- Type *string `json:"type"`
- ExpiredTime *string `json:"expiredTime"`
- Nonce *string `json:"nonce"`
- UserId *string `json:"userId"`
- AppId *string `json:"appId"`
- UserInfoInChannel *string `json:"userInfoInChannel"`
- Gslb []*string `json:"gslb"`
- }
- // start avatar request | 启动数字人
- AvatarConfigReq {
- // 名片 ID
- CardId *uint64 `json:"card_id,optional"`
- }
- // start avatar response | 启动数字人
- AvatarConfigResp {
- BaseDataInfo
- // Agent information | Agent数据
- Data AvatarInfo `json:"data"`
-
- Extra Extra `json:"extra"`
- }
- Extra {
- Live int64 `json:"live"`
- Total int64 `json:"total"`
- }
- AvatarStsResp {
- BaseDataInfo
- // Sts information | Sts 数据
- Data StsInfo `json:"data"`
- }
- StsInfo {
- Expiration *string `json:"expiration"`
- AccessKeyId *string `json:"accessKeyId"`
- AccessKeySecret *string `json:"accessKeySecret"`
- SecurityToken *string `json:"securityToken"`
- RequestId *string `json:"requestId"`
- }
- AvatarSignatureResp {
- BaseDataInfo
- // Sts information | Sts 数据
- Data SignatureInfo `json:"data"`
- }
- SignatureInfo {
- Key *string `json:"key"`
- OSSAccessKeyId *string `json:"OSSAccessKeyId"`
- Policy *string `json:"policy"`
- Signature *string `json:"signature"`
- }
- // send text | 数字人-发送消息
- SendTextReq {
- CardId *uint64 `json:"cardId"`
- SessionId *string `json:"sessionId"`
- Text *string `json:"text"`
- IsStream *bool `json:"isStream,optional"`
- Index *int32 `json:"index,optional"`
- Position *string `json:"position,optional"`
- }
- SendTextResp {
- BaseDataInfo
- Data SendText `json:"data"`
- }
- SendText {
- SessionId *string `json:"sessionId"`
- UniqueCode *string `json:"uniqueCode"`
- }
- // stop instance | 数字人-停止实例
- StopInstanceReq {
- CardId *uint64 `json:"cardId"`
- SessionId *string `json:"sessionId"`
- }
- StopInstanceResp {
- BaseDataInfo
- Data StopInstance `json:"data"`
- }
- StopInstance {
- SessionId *string `json:"sessionId"`
- RequestId *string `json:"requestId"`
- }
- )
- @server(
- jwt: Auth
- group: avatar
- middleware: Miniprogram
- )
- service Wechat {
- // get avatar configuration | 获取数字人配置信息
- @handler getApiAvatarConfig
- post /api/avatar/config (AvatarConfigReq) returns (AvatarConfigResp)
- // send text | 发送消息
- @handler sendApiAvatarText
- post /api/avatar/sendText (SendTextReq) returns (SendTextResp)
- // stop avatar instance | 停止数字人实例
- @handler stopApiAvatar
- post /api/avatar/stop (StopInstanceReq) returns (StopInstanceResp)
- // get avatar configuration | 阿里云sts
- @handler getAcsResponse
- post /api/avatar/sts () returns (AvatarStsResp)
- // get avatar configuration | 阿里云oss服务签名
- @handler getSignatureResponse
- post /api/avatar/signature () returns (AvatarSignatureResp)
- }
|