From e4837a22dcadd7e73598e00a66cb85c7252b8e9a Mon Sep 17 00:00:00 2001 From: satori Date: Sat, 28 Dec 2024 04:32:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E8=97=8F=E7=B1=BB=E5=9E=8B=E5=88=A4?= =?UTF-8?q?=E6=96=AD:=20type=E4=B8=BA=20string?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/collect.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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" }