diff --git a/api/struct.go b/api/struct.go index 46216af..5c57328 100644 --- a/api/struct.go +++ b/api/struct.go @@ -126,18 +126,18 @@ type Article struct { } type Category struct { - ID int - Title string - Keyword string - ParentID int - CreateTime time.Time - UpdateTime time.Time - Status int - Content string - Sort int - Image string - ImageNum int - ArticleNum int + ID int `json:"id"` + Title string `json:"title"` + Keyword string `json:"keyword"` + ParentID int `json:"parent_id"` + Status int `json:"status"` + Content string `json:"content"` + Sort int `json:"sort"` + Image string `json:"image"` + ImageNum int `json:"image_num"` + ArticleNum int `json:"article_num"` + CreateTime time.Time `json:"create_time"` + UpdateTime time.Time `json:"update_time"` } // TableName 方法用于自定义表名