输出text
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -13,7 +14,6 @@ type Image struct {
|
||||
Description string `json:"description" db:"description"`
|
||||
Tags string `json:"tags" db:"tags"`
|
||||
Rank string `json:"rank" db:"rank"`
|
||||
Text string `json:"text" db:"text"`
|
||||
CommentNum int `json:"comment_num" db:"comment_num"`
|
||||
ArticleCategoryTopId int `json:"article_category_top_id" db:"article_category_top_id"`
|
||||
PraiseCount int `json:"praise_count" db:"praise_count"`
|
||||
@@ -24,6 +24,17 @@ type Image struct {
|
||||
Article Article `json:"article" db:"-"`
|
||||
CreateTime time.Time `json:"create_time" db:"create_time"`
|
||||
UpdateTime time.Time `json:"update_time" db:"update_time"`
|
||||
Text TextList `json:"text" db:"text"`
|
||||
}
|
||||
|
||||
type TextList []struct {
|
||||
Text string `json:"text"`
|
||||
Confidence float64 `json:"confidence"`
|
||||
Coordinate [][]float64 `json:"coordinate"`
|
||||
}
|
||||
|
||||
func (a *TextList) Scan(value interface{}) error {
|
||||
return json.Unmarshal(value.([]byte), a)
|
||||
}
|
||||
|
||||
type User struct {
|
||||
|
Reference in New Issue
Block a user