From 3fbc9a3eaea5e7ea54fd0fd7797eaf5a34994882 Mon Sep 17 00:00:00 2001 From: satori Date: Mon, 13 Jan 2025 14:34:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=B8=E6=88=8F=E7=AD=9B=E9=80=89:=E6=8C=89?= =?UTF-8?q?=E7=B2=BE=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/game.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/game.go b/api/game.go index 8c8d489..f7eb9fd 100644 --- a/api/game.go +++ b/api/game.go @@ -22,6 +22,7 @@ type Game struct { Device string `json:"device"` Orientation string `json:"orientation"` Tags string `json:"tags"` + Rank string `json:"rank"` UserId int `json:"user_id"` Content string `json:"content"` CategoryID int `json:"category_id"` @@ -58,6 +59,7 @@ var gameType = graphql.NewObject(graphql.ObjectConfig{ "title": &graphql.Field{Type: graphql.String, Description: "游戏标题"}, "era": &graphql.Field{Type: graphql.String, Description: "游戏上线年份"}, "tags": &graphql.Field{Type: graphql.String, Description: "游戏标签"}, + "rank": &graphql.Field{Type: graphql.String, Description: "游戏精选"}, "style": &graphql.Field{Type: graphql.String, Description: "游戏风格"}, "device": &graphql.Field{Type: graphql.String, Description: "游戏平台"}, "orientation": &graphql.Field{Type: graphql.String, Description: "屏幕方向"}, @@ -123,7 +125,7 @@ var GameItems = &graphql.Field{ var query = goqu.Dialect("mysql").From("web_article").Where(goqu.Ex{"category_top_id": 22}) // 筛选条件 - for _, format := range []string{"id", "title", "style", "device", "orientation", "era", "category_id", "tags"} { + for _, format := range []string{"id", "title", "style", "device", "orientation", "era", "category_id", "tags", "rank"} { if p.Args[format] != nil { query = query.Where(goqu.C(format).Eq(p.Args[format])) }