contentSecurity/internal/model/image.go
2025-10-15 17:01:31 +08:00

44 lines
1.3 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 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"`
}