23 lines
982 B
Go
23 lines
982 B
Go
package response
|
||
|
||
// BaikeInfo 植物百科信息(baike_info子对象)
|
||
type BaikeInfo struct {
|
||
BaikeUrl string `json:"baike_url"` // 百度百科链接
|
||
ImageUrl string `json:"image_url"` // 植物图片链接
|
||
Description string `json:"description"` // 植物百科描述文本
|
||
}
|
||
|
||
// ResultItem 识别结果项(result数组中的单个元素)
|
||
type ResultItem struct {
|
||
Score float64 `json:"score"` // 匹配相似度得分(0-1)
|
||
Name string `json:"name"` // 植物名称
|
||
BaikeInfo *BaikeInfo `json:"baike_info"` // 植物百科信息(部分结果可能无此字段,用指针避免空值解析问题)
|
||
}
|
||
|
||
// PlantRecognitionResponse 植物识别接口的HTTP响应结构体
|
||
// 字段标签仅保留 json,严格匹配返回的JSON字段名
|
||
type PlantRecognitionResponse struct {
|
||
LogId uint64 `json:"log_id"` // 识别请求日志ID(唯一标识)
|
||
Result []ResultItem `json:"result"` // 植物识别结果列表
|
||
}
|