diff --git a/api/collect.go b/api/collect.go index ef765d0..f726bfd 100644 --- a/api/collect.go +++ b/api/collect.go @@ -22,7 +22,7 @@ type Collection struct { ID int `json:"id" gorm:"primaryKey"` Title string `json:"title"` Content string `json:"content"` - Type int `json:"type"` + Type string `json:"type"` Thumbnail string `json:"thumbnail"` Num int `json:"num"` Fans int `json:"fans"` @@ -127,7 +127,7 @@ var CollectionItems = &graphql.Field{ for index, item := range collects { var data []Cover var t string = "article" - if item.Type == 1 { + if item.Type == "1" { t = "image" }