44 lines
1.3 KiB
Go
44 lines
1.3 KiB
Go
package model
|
||
|
||
// ImageScanRequest 图片审核请求结构(2.0版本)
|
||
type ImageScanRequest struct {
|
||
Tasks []ImageTask `json:"tasks"`
|
||
Services []string `json:"services"` // 2.0版本使用services而不是scenes
|
||
}
|
||
|
||
// ImageTask 图片任务结构
|
||
type ImageTask struct {
|
||
DataID string `json:"dataId"`
|
||
URL string `json:"url,omitempty"`
|
||
Content string `json:"content,omitempty"` // base64编码的图片内容
|
||
}
|
||
|
||
// ImageScanResponse 图片审核响应结构(2.0版本)
|
||
type ImageScanResponse struct {
|
||
Code int `json:"code"`
|
||
Message string `json:"message"`
|
||
Data []struct {
|
||
Code int `json:"code"`
|
||
Message string `json:"message"`
|
||
DataID string `json:"dataId"`
|
||
Results []struct {
|
||
Scene string `json:"scene"`
|
||
Label string `json:"label"`
|
||
Suggestion string `json:"suggestion"`
|
||
Rate float64 `json:"rate"`
|
||
// 2.0版本新增字段
|
||
SubLabel string `json:"subLabel,omitempty"` // 子标签
|
||
Details []ImageDetail `json:"details,omitempty"` // 详细信息
|
||
Extras map[string]interface{} `json:"extras,omitempty"` // 扩展信息
|
||
} `json:"results"`
|
||
} `json:"data"`
|
||
}
|
||
|
||
// ImageDetail 图片审核详细信息
|
||
type ImageDetail struct {
|
||
Context struct {
|
||
Context string `json:"context"`
|
||
Pos []int `json:"pos"`
|
||
} `json:"context"`
|
||
}
|