Files
sundynix-plant-be/model/plant/response/ocr.go
T
2026-02-06 14:44:06 +08:00

23 lines
982 B
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 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"` // 植物识别结果列表
}