Files
team-api/api/admin/v1/channel_testing_api.go
T
2026-05-10 12:21:27 +08:00

29 lines
1.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package v1
import "github.com/gogf/gf/v2/frame/g"
// ChannelTestReq 渠道测试请求
type ChannelTestReq struct {
g.Meta `path:"/channels/{id}/test" method:"post" mime:"json" tags:"管理后台-渠道" summary:"测试渠道可用性"`
ID int64 `json:"id" in:"path" v:"required" dc:"渠道ID"`
ModelName string `json:"model_name" dc:"测试模型名(可选,默认使用渠道的 test_model)"`
}
// ChannelTestRes 渠道测试响应
type ChannelTestRes struct {
Success bool `json:"success"`
Latency int64 `json:"latency_ms"`
ModelName string `json:"model_name"`
Error string `json:"error,omitempty"`
Request *ChannelTestReqDetail `json:"request,omitempty"`
Response string `json:"response,omitempty"`
}
// ChannelTestReqDetail 测试请求详情
type ChannelTestReqDetail struct {
Method string `json:"method"`
URL string `json:"url"`
Headers map[string]string `json:"headers"`
Body string `json:"body"`
}