43 lines
1.2 KiB
Go
43 lines
1.2 KiB
Go
package model
|
||
|
||
// TextScanRequest 文本审核请求结构(2.0版本)
|
||
type TextScanRequest struct {
|
||
Tasks []TextTask `json:"tasks"`
|
||
Services []string `json:"services"` // 2.0版本使用services而不是scenes
|
||
}
|
||
|
||
// TextTask 文本任务结构
|
||
type TextTask struct {
|
||
DataID string `json:"dataId"`
|
||
Content string `json:"content"`
|
||
}
|
||
|
||
// TextScanResponse 文本审核响应结构(2.0版本)
|
||
type TextScanResponse 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 []TextDetail `json:"details,omitempty"` // 详细信息
|
||
Extras map[string]interface{} `json:"extras,omitempty"` // 扩展信息
|
||
} `json:"results"`
|
||
} `json:"data"`
|
||
}
|
||
|
||
// TextDetail 文本审核详细信息
|
||
type TextDetail struct {
|
||
Context struct {
|
||
Context string `json:"context"`
|
||
Pos []int `json:"pos"`
|
||
} `json:"context"`
|
||
}
|