From 0a271d125534db2b24b7a20ee1c259db4bba2097 Mon Sep 17 00:00:00 2001 From: Kichiyaki Date: Wed, 5 May 2021 19:32:45 +0200 Subject: [PATCH] bump github.com/tribalwarshelp/shared and github.com/tribalwarshelp/map-generator --- Makefile | 2 - dailyplayerstats/repository.go | 7 +- dailyplayerstats/repository/pg_repository.go | 30 +- dailyplayerstats/usecase.go | 5 +- .../usecase/dailyplayerstats_usecase.go | 8 +- dailytribestats/repository.go | 7 +- dailytribestats/repository/pg_repository.go | 24 +- dailytribestats/usecase.go | 5 +- .../usecase/dailytribestats_usecase.go | 9 +- ennoblement/repository.go | 7 +- ennoblement/repository/pg_repository.go | 30 +- ennoblement/usecase.go | 5 +- ennoblement/usecase/ennoblement_usecase.go | 10 +- go.mod | 7 +- go.sum | 26 +- graphql/dataloaders/data_loaders.go | 18 +- graphql/dataloaders/playerloader_gen.go | 41 +- .../playernamechangesloader_gen.go | 43 +- graphql/dataloaders/server_data_loaders.go | 39 +- graphql/dataloaders/tribeloader_gen.go | 41 +- graphql/dataloaders/version_data_loaders.go | 8 +- graphql/dataloaders/versionloader_gen.go | 41 +- graphql/dataloaders/villageloader_gen.go | 41 +- graphql/generated/generated.go | 1283 +++++++++-------- graphql/generated/models.go | 58 +- graphql/gqlgen.yml | 104 +- graphql/querycomplexity/query_complexity.go | 57 +- graphql/resolvers/daily_player_stats.go | 12 +- graphql/resolvers/daily_tribe_stats.go | 12 +- graphql/resolvers/ennoblement.go | 20 +- graphql/resolvers/helpers.go | 9 +- graphql/resolvers/player.go | 33 +- graphql/resolvers/player_history.go | 14 +- graphql/resolvers/server.go | 14 +- graphql/resolvers/server_stats.go | 10 +- graphql/resolvers/tribe.go | 16 +- graphql/resolvers/tribe_change.go | 16 +- graphql/resolvers/tribe_history.go | 12 +- graphql/resolvers/version.go | 12 +- graphql/resolvers/village.go | 14 +- main.go | 27 +- middleware/dataloaders_to_context.go | 18 +- middleware/limit_whitelist.go | 4 +- player/repository.go | 13 +- player/repository/pg_repository.go | 59 +- player/usecase.go | 9 +- player/usecase/player_usecase.go | 21 +- playerhistory/repository.go | 7 +- playerhistory/repository/pg_repository.go | 30 +- playerhistory/usecase.go | 5 +- .../usecase/playerhistory_usecase.go | 9 +- scripts/dev.sh | 5 - server/repository.go | 7 +- server/repository/pg_repository.go | 21 +- server/usecase.go | 7 +- server/usecase/server_usecase.go | 12 +- servermap/delivery/http/http_delivery.go | 13 +- servermap/usecase/map_usecase.go | 18 +- serverstats/repository.go | 7 +- serverstats/repository/pg_repository.go | 19 +- serverstats/usecase.go | 5 +- serverstats/usecase/serverstats_usecase.go | 9 +- tribe/repository.go | 9 +- tribe/repository/pg_repository.go | 30 +- tribe/usecase.go | 9 +- tribe/usecase/tribe_usecase.go | 16 +- tribechange/repository.go | 7 +- tribechange/repository/helpers.go | 22 - tribechange/repository/pg_repository.go | 24 +- tribechange/usecase.go | 5 +- ...nge_usecase.go => tribe_change_usecase.go} | 9 +- tribehistory/repository.go | 7 +- tribehistory/repository/pg_repository.go | 24 +- tribehistory/usecase.go | 5 +- tribehistory/usecase/tribehistory_usecase.go | 9 +- utils/find_string_with_prefix.go | 12 - utils/safe_pointer.go | 22 - utils/sanitize_sort.go | 41 - utils/underscore.go | 61 - version/repository.go | 7 +- version/repository/pg_repository.go | 21 +- version/usecase.go | 7 +- version/usecase/version_usecase.go | 16 +- village/repository.go | 7 +- village/repository/pg_repository.go | 24 +- village/usecase.go | 7 +- village/usecase/village_usecase.go | 13 +- 87 files changed, 1334 insertions(+), 1555 deletions(-) delete mode 100755 scripts/dev.sh delete mode 100644 tribechange/repository/helpers.go rename tribechange/usecase/{tribechange_usecase.go => tribe_change_usecase.go} (70%) delete mode 100644 utils/find_string_with_prefix.go delete mode 100644 utils/safe_pointer.go delete mode 100644 utils/sanitize_sort.go delete mode 100644 utils/underscore.go diff --git a/Makefile b/Makefile index e923895..42255a2 100755 --- a/Makefile +++ b/Makefile @@ -1,4 +1,2 @@ gqlgen: bash ./scripts/gqlgen-generate.sh -dev: - bash ./scripts/dev.sh \ No newline at end of file diff --git a/dailyplayerstats/repository.go b/dailyplayerstats/repository.go index ec5276d..a3f27d8 100644 --- a/dailyplayerstats/repository.go +++ b/dailyplayerstats/repository.go @@ -2,13 +2,12 @@ package dailyplayerstats import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type FetchConfig struct { Server string - Filter *models.DailyPlayerStatsFilter + Filter *twmodel.DailyPlayerStatsFilter Select bool Count bool Sort []string @@ -17,5 +16,5 @@ type FetchConfig struct { } type Repository interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.DailyPlayerStats, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.DailyPlayerStats, int, error) } diff --git a/dailyplayerstats/repository/pg_repository.go b/dailyplayerstats/repository/pg_repository.go index e251d9e..bdfe65c 100644 --- a/dailyplayerstats/repository/pg_repository.go +++ b/dailyplayerstats/repository/pg_repository.go @@ -2,12 +2,14 @@ package repository import ( "context" - "fmt" + "github.com/Kichiyaki/gopgutil/v10" + "github.com/pkg/errors" + "github.com/tribalwarshelp/shared/tw/twmodel" "strings" "github.com/go-pg/pg/v10" + "github.com/tribalwarshelp/api/dailyplayerstats" - "github.com/tribalwarshelp/shared/models" ) type pgRepository struct { @@ -18,25 +20,21 @@ func NewPGRepository(db *pg.DB) dailyplayerstats.Repository { return &pgRepository{db} } -func (repo *pgRepository) Fetch(ctx context.Context, cfg dailyplayerstats.FetchConfig) ([]*models.DailyPlayerStats, int, error) { +func (repo *pgRepository) Fetch(ctx context.Context, cfg dailyplayerstats.FetchConfig) ([]*twmodel.DailyPlayerStats, int, error) { var err error - data := []*models.DailyPlayerStats{} + var data []*twmodel.DailyPlayerStats total := 0 query := repo. WithParam("SERVER", pg.Safe(cfg.Server)). Model(&data). Context(ctx). Limit(cfg.Limit). - Offset(cfg.Offset) - relationshipAndSortAppender := &models.DailyPlayerStatsRelationshipAndSortAppender{ - Filter: &models.DailyPlayerStatsFilter{}, - Sort: cfg.Sort, - } - if cfg.Filter != nil { - query = query.Apply(cfg.Filter.Where) - relationshipAndSortAppender.Filter = cfg.Filter - } - query = query.Apply(relationshipAndSortAppender.Append) + Offset(cfg.Offset). + Apply(cfg.Filter.WhereWithRelations). + Apply(gopgutil.OrderAppender{ + Orders: cfg.Sort, + MaxDepth: 4, + }.Apply) if cfg.Count && cfg.Select { total, err = query.SelectAndCount() @@ -47,9 +45,9 @@ func (repo *pgRepository) Fetch(ctx context.Context, cfg dailyplayerstats.FetchC } if err != nil && err != pg.ErrNoRows { if strings.Contains(err.Error(), `relation "`+cfg.Server) { - return nil, 0, fmt.Errorf("Server not found") + return nil, 0, errors.New("Server not found") } - return nil, 0, fmt.Errorf("Internal server error") + return nil, 0, errors.New("Internal server error") } return data, total, nil diff --git a/dailyplayerstats/usecase.go b/dailyplayerstats/usecase.go index 24cf1ec..7109628 100644 --- a/dailyplayerstats/usecase.go +++ b/dailyplayerstats/usecase.go @@ -2,10 +2,9 @@ package dailyplayerstats import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type Usecase interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.DailyPlayerStats, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.DailyPlayerStats, int, error) } diff --git a/dailyplayerstats/usecase/dailyplayerstats_usecase.go b/dailyplayerstats/usecase/dailyplayerstats_usecase.go index 1a9229b..4e9197f 100644 --- a/dailyplayerstats/usecase/dailyplayerstats_usecase.go +++ b/dailyplayerstats/usecase/dailyplayerstats_usecase.go @@ -2,11 +2,10 @@ package usecase import ( "context" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/dailyplayerstats" "github.com/tribalwarshelp/api/middleware" - "github.com/tribalwarshelp/api/utils" - "github.com/tribalwarshelp/shared/models" ) type usecase struct { @@ -17,13 +16,12 @@ func New(repo dailyplayerstats.Repository) dailyplayerstats.Usecase { return &usecase{repo} } -func (ucase *usecase) Fetch(ctx context.Context, cfg dailyplayerstats.FetchConfig) ([]*models.DailyPlayerStats, int, error) { +func (ucase *usecase) Fetch(ctx context.Context, cfg dailyplayerstats.FetchConfig) ([]*twmodel.DailyPlayerStats, int, error) { if cfg.Filter == nil { - cfg.Filter = &models.DailyPlayerStatsFilter{} + cfg.Filter = &twmodel.DailyPlayerStatsFilter{} } if !middleware.CanExceedLimit(ctx) && (cfg.Limit > dailyplayerstats.FetchLimit || cfg.Limit <= 0) { cfg.Limit = dailyplayerstats.FetchLimit } - cfg.Sort = utils.SanitizeSorts(cfg.Sort) return ucase.repo.Fetch(ctx, cfg) } diff --git a/dailytribestats/repository.go b/dailytribestats/repository.go index d816e86..b6973a9 100644 --- a/dailytribestats/repository.go +++ b/dailytribestats/repository.go @@ -2,13 +2,12 @@ package dailytribestats import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type FetchConfig struct { Server string - Filter *models.DailyTribeStatsFilter + Filter *twmodel.DailyTribeStatsFilter Select bool Count bool Sort []string @@ -17,5 +16,5 @@ type FetchConfig struct { } type Repository interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.DailyTribeStats, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.DailyTribeStats, int, error) } diff --git a/dailytribestats/repository/pg_repository.go b/dailytribestats/repository/pg_repository.go index d67eec6..2664ab4 100644 --- a/dailytribestats/repository/pg_repository.go +++ b/dailytribestats/repository/pg_repository.go @@ -3,11 +3,13 @@ package repository import ( "context" "fmt" + "github.com/Kichiyaki/gopgutil/v10" + "github.com/tribalwarshelp/shared/tw/twmodel" "strings" "github.com/go-pg/pg/v10" + "github.com/tribalwarshelp/api/dailytribestats" - "github.com/tribalwarshelp/shared/models" ) type pgRepository struct { @@ -18,25 +20,21 @@ func NewPGRepository(db *pg.DB) dailytribestats.Repository { return &pgRepository{db} } -func (repo *pgRepository) Fetch(ctx context.Context, cfg dailytribestats.FetchConfig) ([]*models.DailyTribeStats, int, error) { +func (repo *pgRepository) Fetch(ctx context.Context, cfg dailytribestats.FetchConfig) ([]*twmodel.DailyTribeStats, int, error) { var err error - data := []*models.DailyTribeStats{} + data := []*twmodel.DailyTribeStats{} total := 0 query := repo. WithParam("SERVER", pg.Safe(cfg.Server)). Model(&data). Context(ctx). Limit(cfg.Limit). - Offset(cfg.Offset) - relationshipAndSortAppender := &models.DailyTribeStatsRelationshipAndSortAppender{ - Filter: &models.DailyTribeStatsFilter{}, - Sort: cfg.Sort, - } - if cfg.Filter != nil { - query = query.Apply(cfg.Filter.Where) - relationshipAndSortAppender.Filter = cfg.Filter - } - query = query.Apply(relationshipAndSortAppender.Append) + Offset(cfg.Offset). + Apply(cfg.Filter.WhereWithRelations). + Apply(gopgutil.OrderAppender{ + Orders: cfg.Sort, + MaxDepth: 4, + }.Apply) if cfg.Count && cfg.Select { total, err = query.SelectAndCount() diff --git a/dailytribestats/usecase.go b/dailytribestats/usecase.go index 3f4d215..f3d89dd 100644 --- a/dailytribestats/usecase.go +++ b/dailytribestats/usecase.go @@ -2,10 +2,9 @@ package dailytribestats import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type Usecase interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.DailyTribeStats, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.DailyTribeStats, int, error) } diff --git a/dailytribestats/usecase/dailytribestats_usecase.go b/dailytribestats/usecase/dailytribestats_usecase.go index 29e2de0..22e1429 100644 --- a/dailytribestats/usecase/dailytribestats_usecase.go +++ b/dailytribestats/usecase/dailytribestats_usecase.go @@ -2,11 +2,10 @@ package usecase import ( "context" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/dailytribestats" "github.com/tribalwarshelp/api/middleware" - "github.com/tribalwarshelp/api/utils" - "github.com/tribalwarshelp/shared/models" ) type usecase struct { @@ -17,14 +16,12 @@ func New(repo dailytribestats.Repository) dailytribestats.Usecase { return &usecase{repo} } -func (ucase *usecase) Fetch(ctx context.Context, cfg dailytribestats.FetchConfig) ([]*models.DailyTribeStats, int, error) { +func (ucase *usecase) Fetch(ctx context.Context, cfg dailytribestats.FetchConfig) ([]*twmodel.DailyTribeStats, int, error) { if cfg.Filter == nil { - cfg.Filter = &models.DailyTribeStatsFilter{} + cfg.Filter = &twmodel.DailyTribeStatsFilter{} } - if !middleware.CanExceedLimit(ctx) && (cfg.Limit > dailytribestats.FetchLimit || cfg.Limit <= 0) { cfg.Limit = dailytribestats.FetchLimit } - cfg.Sort = utils.SanitizeSorts(cfg.Sort) return ucase.repo.Fetch(ctx, cfg) } diff --git a/ennoblement/repository.go b/ennoblement/repository.go index 3e4f1e7..b29f6ff 100644 --- a/ennoblement/repository.go +++ b/ennoblement/repository.go @@ -2,13 +2,12 @@ package ennoblement import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type FetchConfig struct { Server string - Filter *models.EnnoblementFilter + Filter *twmodel.EnnoblementFilter Select bool Count bool Sort []string @@ -17,5 +16,5 @@ type FetchConfig struct { } type Repository interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.Ennoblement, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.Ennoblement, int, error) } diff --git a/ennoblement/repository/pg_repository.go b/ennoblement/repository/pg_repository.go index 4ba4dd7..8f1141b 100644 --- a/ennoblement/repository/pg_repository.go +++ b/ennoblement/repository/pg_repository.go @@ -2,12 +2,14 @@ package repository import ( "context" - "fmt" + "github.com/Kichiyaki/gopgutil/v10" + "github.com/pkg/errors" + "github.com/tribalwarshelp/shared/tw/twmodel" "strings" "github.com/go-pg/pg/v10" + "github.com/tribalwarshelp/api/ennoblement" - "github.com/tribalwarshelp/shared/models" ) type pgRepository struct { @@ -18,25 +20,21 @@ func NewPGRepository(db *pg.DB) ennoblement.Repository { return &pgRepository{db} } -func (repo *pgRepository) Fetch(ctx context.Context, cfg ennoblement.FetchConfig) ([]*models.Ennoblement, int, error) { +func (repo *pgRepository) Fetch(ctx context.Context, cfg ennoblement.FetchConfig) ([]*twmodel.Ennoblement, int, error) { var err error total := 0 - data := []*models.Ennoblement{} + data := []*twmodel.Ennoblement{} query := repo. WithParam("SERVER", pg.Safe(cfg.Server)). Model(&data). Context(ctx). Limit(cfg.Limit). - Offset(cfg.Offset) - relationshipAndSortAppender := &models.EnnoblementRelationshipAndSortAppender{ - Filter: &models.EnnoblementFilter{}, - Sort: cfg.Sort, - } - if cfg.Filter != nil { - query = query.Apply(cfg.Filter.Where) - relationshipAndSortAppender.Filter = cfg.Filter - } - query = query.Apply(relationshipAndSortAppender.Append) + Offset(cfg.Offset). + Apply(cfg.Filter.WhereWithRelations). + Apply(gopgutil.OrderAppender{ + Orders: cfg.Sort, + MaxDepth: 4, + }.Apply) if cfg.Count && cfg.Select { total, err = query.SelectAndCount() @@ -47,9 +45,9 @@ func (repo *pgRepository) Fetch(ctx context.Context, cfg ennoblement.FetchConfig } if err != nil && err != pg.ErrNoRows { if strings.Contains(err.Error(), `relation "`+cfg.Server) { - return nil, 0, fmt.Errorf("Server not found") + return nil, 0, errors.New("Server not found") } - return nil, 0, fmt.Errorf("Internal server error") + return nil, 0, errors.New("Internal server error") } return data, total, nil diff --git a/ennoblement/usecase.go b/ennoblement/usecase.go index 9d27671..aacc3cf 100644 --- a/ennoblement/usecase.go +++ b/ennoblement/usecase.go @@ -2,10 +2,9 @@ package ennoblement import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type Usecase interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.Ennoblement, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.Ennoblement, int, error) } diff --git a/ennoblement/usecase/ennoblement_usecase.go b/ennoblement/usecase/ennoblement_usecase.go index 98d64a6..dfae704 100644 --- a/ennoblement/usecase/ennoblement_usecase.go +++ b/ennoblement/usecase/ennoblement_usecase.go @@ -2,10 +2,10 @@ package usecase import ( "context" + "github.com/tribalwarshelp/shared/tw/twmodel" + "github.com/tribalwarshelp/api/ennoblement" "github.com/tribalwarshelp/api/middleware" - "github.com/tribalwarshelp/api/utils" - "github.com/tribalwarshelp/shared/models" ) type usecase struct { @@ -16,14 +16,12 @@ func New(repo ennoblement.Repository) ennoblement.Usecase { return &usecase{repo} } -func (ucase *usecase) Fetch(ctx context.Context, cfg ennoblement.FetchConfig) ([]*models.Ennoblement, int, error) { +func (ucase *usecase) Fetch(ctx context.Context, cfg ennoblement.FetchConfig) ([]*twmodel.Ennoblement, int, error) { if cfg.Filter == nil { - cfg.Filter = &models.EnnoblementFilter{} + cfg.Filter = &twmodel.EnnoblementFilter{} } - if !middleware.CanExceedLimit(ctx) && (cfg.Limit > ennoblement.FetchLimit || cfg.Limit <= 0) { cfg.Limit = ennoblement.FetchLimit } - cfg.Sort = utils.SanitizeSorts(cfg.Sort) return ucase.repo.Fetch(ctx, cfg) } diff --git a/go.mod b/go.mod index 319c06d..d58120a 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,11 @@ go 1.16 require ( github.com/99designs/gqlgen v0.13.0 + github.com/Kichiyaki/appmode v0.0.0-20210502105643-0a26207c548d github.com/Kichiyaki/gin-logrus v0.0.0-20210428175948-4f47ab6231a6 github.com/Kichiyaki/go-pg-logrus-query-logger/v10 v10.0.0-20210428180109-fb97298564d9 + github.com/Kichiyaki/gopgutil/v10 v10.0.0-20210505101614-8a71f17a0466 + github.com/Kichiyaki/goutil v0.0.0-20210504132659-3d843a787db7 github.com/agnivade/levenshtein v1.1.0 // indirect github.com/gin-contrib/cors v1.3.1 github.com/gin-gonic/gin v1.6.3 @@ -16,8 +19,8 @@ require ( github.com/onsi/gomega v1.10.4 // indirect github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.8.1 - github.com/tribalwarshelp/map-generator v0.0.0-20210423190517-1da85d9287dc - github.com/tribalwarshelp/shared v0.0.0-20210423190057-03d8445d35dc + github.com/tribalwarshelp/map-generator v0.0.0-20210505172714-6520104d1450 + github.com/tribalwarshelp/shared v0.0.0-20210505172413-bf85190fd66d github.com/vektah/gqlparser/v2 v2.1.0 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect diff --git a/go.sum b/go.sum index f69f06b..a325cd0 100644 --- a/go.sum +++ b/go.sum @@ -2,14 +2,19 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT github.com/99designs/gqlgen v0.13.0 h1:haLTcUp3Vwp80xMVEg5KRNwzfUrgFdRmtBY8fuB8scA= github.com/99designs/gqlgen v0.13.0/go.mod h1:NV130r6f4tpRWuAI+zsrSdooO/eWUv+Gyyoi3rEfXIk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/Kichiyaki/gin-logrus v0.0.0-20210424132338-4ac67b4af979 h1:IgLHMjg5lAVpJ0zNcInVR8Q6WloI55v8rOoTXSHGx/A= -github.com/Kichiyaki/gin-logrus v0.0.0-20210424132338-4ac67b4af979/go.mod h1:6ieK3YHhyNxjkbBUR3B1IsfXi+A+LeS0SEPV10iH/cg= +github.com/Kichiyaki/appmode v0.0.0-20210502105643-0a26207c548d h1:ApX13STtfJc2YPH5D2JnBa6+4AM2vt7a81so/MPr/bA= +github.com/Kichiyaki/appmode v0.0.0-20210502105643-0a26207c548d/go.mod h1:41p1KTy/fiVocPnJR2h/iXh2NvWWVBdNoZrN8TWVXUI= github.com/Kichiyaki/gin-logrus v0.0.0-20210428175948-4f47ab6231a6 h1:abarqFzXWxx4VElTTVWJch1u01Kf6T/zLip+Uv2yUf4= github.com/Kichiyaki/gin-logrus v0.0.0-20210428175948-4f47ab6231a6/go.mod h1:6ieK3YHhyNxjkbBUR3B1IsfXi+A+LeS0SEPV10iH/cg= -github.com/Kichiyaki/go-pg-logrus-query-logger/v10 v10.0.0-20210423175217-c83fa01c60d7 h1:7IdSzhdupqm4AC3UDH9b5gdCDE2SlX6qkVC0zwqAuLA= -github.com/Kichiyaki/go-pg-logrus-query-logger/v10 v10.0.0-20210423175217-c83fa01c60d7/go.mod h1:ADHVWnGlWcRn1aGthuh7I1Lrn6zzsjkVJju151dXyDw= github.com/Kichiyaki/go-pg-logrus-query-logger/v10 v10.0.0-20210428180109-fb97298564d9 h1:S/08K0AD4bXYeSPJKei8ZbumDy1JNARZsgYbNZgr9Tk= github.com/Kichiyaki/go-pg-logrus-query-logger/v10 v10.0.0-20210428180109-fb97298564d9/go.mod h1:ADHVWnGlWcRn1aGthuh7I1Lrn6zzsjkVJju151dXyDw= +github.com/Kichiyaki/go-php-serialize v0.0.0-20200601110855-47b6982acf83/go.mod h1:+iGkf5HfOVeRVd9K7qQDucIl+/Kt3MyenMa90b/O/c4= +github.com/Kichiyaki/gopgutil/v10 v10.0.0-20210505093434-655fa2df248f/go.mod h1:MSAEhr8oeK+Rhjhqyl31/8/AI88thYky80OyD8mheDA= +github.com/Kichiyaki/gopgutil/v10 v10.0.0-20210505101614-8a71f17a0466 h1:fK7dClaaUN/WV5IZgD/GbdD3YDoolNZ5oaLeNtVnfIc= +github.com/Kichiyaki/gopgutil/v10 v10.0.0-20210505101614-8a71f17a0466/go.mod h1:MSAEhr8oeK+Rhjhqyl31/8/AI88thYky80OyD8mheDA= +github.com/Kichiyaki/goutil v0.0.0-20210502095630-318d17091eab/go.mod h1:+HhI932Xb0xrCodNcCv5GPiCjLYhDxWhCtlEqMIJhB4= +github.com/Kichiyaki/goutil v0.0.0-20210504132659-3d843a787db7 h1:OU3ZA5H8fHTzaYIw9UBfH3gtWRL0XmnczlhH3E2PjV4= +github.com/Kichiyaki/goutil v0.0.0-20210504132659-3d843a787db7/go.mod h1:+HhI932Xb0xrCodNcCv5GPiCjLYhDxWhCtlEqMIJhB4= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/agnivade/levenshtein v1.0.3/go.mod h1:4SFRZbbXWLF4MU1T9Qg0pGgH3Pjs+t6ie5efyrwRJXs= github.com/agnivade/levenshtein v1.1.0 h1:n6qGwyHG61v3ABce1rPVZklEYRT8NFpCMrpZdBUbYGM= @@ -150,7 +155,6 @@ github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNX github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/vfsgen v0.0.0-20180121065927-ffb13db8def0/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -164,10 +168,14 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs= -github.com/tribalwarshelp/map-generator v0.0.0-20210423190517-1da85d9287dc h1:gNr9Tu5ujQH7wvgmapJXtyaQe+fhXCvfz+m6qYhiO1U= -github.com/tribalwarshelp/map-generator v0.0.0-20210423190517-1da85d9287dc/go.mod h1:odB3ZTsbWK+BbW4bEmOTmase97w9Xu3OqBiR+7+7JBA= -github.com/tribalwarshelp/shared v0.0.0-20210423190057-03d8445d35dc h1:giWPsD/6WTOrQl9KT5AXrrf3KLkHSGuNpWa2CyyaM6w= -github.com/tribalwarshelp/shared v0.0.0-20210423190057-03d8445d35dc/go.mod h1:CDQvesBYmSyGDl5X37xfa+ub55ZbikrHDuIZ4AcfM8I= +github.com/tribalwarshelp/map-generator v0.0.0-20210505171633-0ec559e0ee90 h1:9KG3hWBaGae1e8/+Ny7jEdwXKATnqyhipRMbZL8QsgQ= +github.com/tribalwarshelp/map-generator v0.0.0-20210505171633-0ec559e0ee90/go.mod h1:WYM9nyZLWJIpfZu1DGjTQhraUN0lwVT2fnJ1DFWMDcI= +github.com/tribalwarshelp/map-generator v0.0.0-20210505172714-6520104d1450 h1:Ej1AvIVPxPno6s4tr4MTg0pNlFA4E/aOxJE7uhYV3NI= +github.com/tribalwarshelp/map-generator v0.0.0-20210505172714-6520104d1450/go.mod h1:ND7ZOyvb9Kp/Mg8z58ZZlL8JPJFk0lsP1XnzFDuvtnk= +github.com/tribalwarshelp/shared v0.0.0-20210505171518-9aa09097fd04 h1:phczaKfpeiQt+JGnlVCuInrlv0etMk0f9RSJ9GmsgzQ= +github.com/tribalwarshelp/shared v0.0.0-20210505171518-9aa09097fd04/go.mod h1:GBnSKQrxL8Nmi3MViIzZVbyP9+ugd28gWArsSvw1iVU= +github.com/tribalwarshelp/shared v0.0.0-20210505172413-bf85190fd66d h1:aMlYOsJbYwKqHx7wAt526eIutV1Q5EnYK6b7lOzvPmk= +github.com/tribalwarshelp/shared v0.0.0-20210505172413-bf85190fd66d/go.mod h1:GBnSKQrxL8Nmi3MViIzZVbyP9+ugd28gWArsSvw1iVU= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go v1.2.5 h1:NozRHfUeEta89taVkyfsDVSy2f7v89Frft4pjnWuGuc= github.com/ugorji/go v1.2.5/go.mod h1:gat2tIT8KJG8TVI8yv77nEO/KYT6dV7JE1gfUa8Xuls= diff --git a/graphql/dataloaders/data_loaders.go b/graphql/dataloaders/data_loaders.go index 64f40e3..efa0907 100644 --- a/graphql/dataloaders/data_loaders.go +++ b/graphql/dataloaders/data_loaders.go @@ -2,13 +2,13 @@ package dataloaders import ( "context" + "github.com/tribalwarshelp/shared/tw/twmodel" "time" "github.com/tribalwarshelp/api/player" "github.com/tribalwarshelp/api/tribe" "github.com/tribalwarshelp/api/version" "github.com/tribalwarshelp/api/village" - "github.com/tribalwarshelp/shared/models" ) const ( @@ -31,13 +31,13 @@ func NewDataLoaders(cfg Config) *DataLoaders { VersionByCode: &VersionLoader{ wait: wait, maxBatch: 0, - fetch: func(keys []string) ([]*models.Version, []error) { - codes := []models.VersionCode{} + fetch: func(keys []string) ([]*twmodel.Version, []error) { + codes := []twmodel.VersionCode{} for _, code := range keys { - codes = append(codes, models.VersionCode(code)) + codes = append(codes, twmodel.VersionCode(code)) } versions, _, err := cfg.VersionRepo.Fetch(context.Background(), version.FetchConfig{ - Filter: &models.VersionFilter{ + Filter: &twmodel.VersionFilter{ Code: codes, }, Select: true, @@ -46,12 +46,12 @@ func NewDataLoaders(cfg Config) *DataLoaders { return nil, []error{err} } - versionByCode := make(map[models.VersionCode]*models.Version) - for _, version := range versions { - versionByCode[version.Code] = version + versionByCode := make(map[twmodel.VersionCode]*twmodel.Version) + for _, v := range versions { + versionByCode[v.Code] = v } - inOrder := make([]*models.Version, len(keys)) + inOrder := make([]*twmodel.Version, len(keys)) for i, code := range codes { inOrder[i] = versionByCode[code] } diff --git a/graphql/dataloaders/playerloader_gen.go b/graphql/dataloaders/playerloader_gen.go index 00e3013..6086f7f 100644 --- a/graphql/dataloaders/playerloader_gen.go +++ b/graphql/dataloaders/playerloader_gen.go @@ -3,16 +3,15 @@ package dataloaders import ( + "github.com/tribalwarshelp/shared/tw/twmodel" "sync" "time" - - "github.com/tribalwarshelp/shared/models" ) // PlayerLoaderConfig captures the config to create a new PlayerLoader type PlayerLoaderConfig struct { // Fetch is a method that provides the data for the loader - Fetch func(keys []int) ([]*models.Player, []error) + Fetch func(keys []int) ([]*twmodel.Player, []error) // Wait is how long wait before sending a batch Wait time.Duration @@ -33,7 +32,7 @@ func NewPlayerLoader(config PlayerLoaderConfig) *PlayerLoader { // PlayerLoader batches and caches requests type PlayerLoader struct { // this method provides the data for the loader - fetch func(keys []int) ([]*models.Player, []error) + fetch func(keys []int) ([]*twmodel.Player, []error) // how long to done before sending a batch wait time.Duration @@ -44,7 +43,7 @@ type PlayerLoader struct { // INTERNAL // lazily created cache - cache map[int]*models.Player + cache map[int]*twmodel.Player // the current batch. keys will continue to be collected until timeout is hit, // then everything will be sent to the fetch method and out to the listeners @@ -56,25 +55,25 @@ type PlayerLoader struct { type playerLoaderBatch struct { keys []int - data []*models.Player + data []*twmodel.Player error []error closing bool done chan struct{} } // Load a Player by key, batching and caching will be applied automatically -func (l *PlayerLoader) Load(key int) (*models.Player, error) { +func (l *PlayerLoader) Load(key int) (*twmodel.Player, error) { return l.LoadThunk(key)() } // LoadThunk returns a function that when called will block waiting for a Player. // This method should be used if you want one goroutine to make requests to many // different data loaders without blocking until the thunk is called. -func (l *PlayerLoader) LoadThunk(key int) func() (*models.Player, error) { +func (l *PlayerLoader) LoadThunk(key int) func() (*twmodel.Player, error) { l.mu.Lock() if it, ok := l.cache[key]; ok { l.mu.Unlock() - return func() (*models.Player, error) { + return func() (*twmodel.Player, error) { return it, nil } } @@ -85,10 +84,10 @@ func (l *PlayerLoader) LoadThunk(key int) func() (*models.Player, error) { pos := batch.keyIndex(l, key) l.mu.Unlock() - return func() (*models.Player, error) { + return func() (*twmodel.Player, error) { <-batch.done - var data *models.Player + var data *twmodel.Player if pos < len(batch.data) { data = batch.data[pos] } @@ -113,14 +112,14 @@ func (l *PlayerLoader) LoadThunk(key int) func() (*models.Player, error) { // LoadAll fetches many keys at once. It will be broken into appropriate sized // sub batches depending on how the loader is configured -func (l *PlayerLoader) LoadAll(keys []int) ([]*models.Player, []error) { - results := make([]func() (*models.Player, error), len(keys)) +func (l *PlayerLoader) LoadAll(keys []int) ([]*twmodel.Player, []error) { + results := make([]func() (*twmodel.Player, error), len(keys)) for i, key := range keys { results[i] = l.LoadThunk(key) } - players := make([]*models.Player, len(keys)) + players := make([]*twmodel.Player, len(keys)) errors := make([]error, len(keys)) for i, thunk := range results { players[i], errors[i] = thunk() @@ -131,13 +130,13 @@ func (l *PlayerLoader) LoadAll(keys []int) ([]*models.Player, []error) { // LoadAllThunk returns a function that when called will block waiting for a Players. // This method should be used if you want one goroutine to make requests to many // different data loaders without blocking until the thunk is called. -func (l *PlayerLoader) LoadAllThunk(keys []int) func() ([]*models.Player, []error) { - results := make([]func() (*models.Player, error), len(keys)) +func (l *PlayerLoader) LoadAllThunk(keys []int) func() ([]*twmodel.Player, []error) { + results := make([]func() (*twmodel.Player, error), len(keys)) for i, key := range keys { results[i] = l.LoadThunk(key) } - return func() ([]*models.Player, []error) { - players := make([]*models.Player, len(keys)) + return func() ([]*twmodel.Player, []error) { + players := make([]*twmodel.Player, len(keys)) errors := make([]error, len(keys)) for i, thunk := range results { players[i], errors[i] = thunk() @@ -149,7 +148,7 @@ func (l *PlayerLoader) LoadAllThunk(keys []int) func() ([]*models.Player, []erro // Prime the cache with the provided key and value. If the key already exists, no change is made // and false is returned. // (To forcefully prime the cache, clear the key first with loader.clear(key).prime(key, value).) -func (l *PlayerLoader) Prime(key int, value *models.Player) bool { +func (l *PlayerLoader) Prime(key int, value *twmodel.Player) bool { l.mu.Lock() var found bool if _, found = l.cache[key]; !found { @@ -169,9 +168,9 @@ func (l *PlayerLoader) Clear(key int) { l.mu.Unlock() } -func (l *PlayerLoader) unsafeSet(key int, value *models.Player) { +func (l *PlayerLoader) unsafeSet(key int, value *twmodel.Player) { if l.cache == nil { - l.cache = map[int]*models.Player{} + l.cache = map[int]*twmodel.Player{} } l.cache[key] = value } diff --git a/graphql/dataloaders/playernamechangesloader_gen.go b/graphql/dataloaders/playernamechangesloader_gen.go index 9ae96d3..ae99df9 100644 --- a/graphql/dataloaders/playernamechangesloader_gen.go +++ b/graphql/dataloaders/playernamechangesloader_gen.go @@ -3,16 +3,15 @@ package dataloaders import ( + "github.com/tribalwarshelp/shared/tw/twmodel" "sync" "time" - - "github.com/tribalwarshelp/shared/models" ) // PlayerNameChangesLoaderConfig captures the config to create a new PlayerNameChangesLoader type PlayerNameChangesLoaderConfig struct { // Fetch is a method that provides the data for the loader - Fetch func(keys []int) ([][]*models.PlayerNameChange, []error) + Fetch func(keys []int) ([][]*twmodel.PlayerNameChange, []error) // Wait is how long wait before sending a batch Wait time.Duration @@ -33,7 +32,7 @@ func NewPlayerNameChangesLoader(config PlayerNameChangesLoaderConfig) *PlayerNam // PlayerNameChangesLoader batches and caches requests type PlayerNameChangesLoader struct { // this method provides the data for the loader - fetch func(keys []int) ([][]*models.PlayerNameChange, []error) + fetch func(keys []int) ([][]*twmodel.PlayerNameChange, []error) // how long to done before sending a batch wait time.Duration @@ -44,7 +43,7 @@ type PlayerNameChangesLoader struct { // INTERNAL // lazily created cache - cache map[int][]*models.PlayerNameChange + cache map[int][]*twmodel.PlayerNameChange // the current batch. keys will continue to be collected until timeout is hit, // then everything will be sent to the fetch method and out to the listeners @@ -56,25 +55,25 @@ type PlayerNameChangesLoader struct { type playerNameChangesLoaderBatch struct { keys []int - data [][]*models.PlayerNameChange + data [][]*twmodel.PlayerNameChange error []error closing bool done chan struct{} } // Load a PlayerNameChange by key, batching and caching will be applied automatically -func (l *PlayerNameChangesLoader) Load(key int) ([]*models.PlayerNameChange, error) { +func (l *PlayerNameChangesLoader) Load(key int) ([]*twmodel.PlayerNameChange, error) { return l.LoadThunk(key)() } // LoadThunk returns a function that when called will block waiting for a PlayerNameChange. // This method should be used if you want one goroutine to make requests to many // different data loaders without blocking until the thunk is called. -func (l *PlayerNameChangesLoader) LoadThunk(key int) func() ([]*models.PlayerNameChange, error) { +func (l *PlayerNameChangesLoader) LoadThunk(key int) func() ([]*twmodel.PlayerNameChange, error) { l.mu.Lock() if it, ok := l.cache[key]; ok { l.mu.Unlock() - return func() ([]*models.PlayerNameChange, error) { + return func() ([]*twmodel.PlayerNameChange, error) { return it, nil } } @@ -85,10 +84,10 @@ func (l *PlayerNameChangesLoader) LoadThunk(key int) func() ([]*models.PlayerNam pos := batch.keyIndex(l, key) l.mu.Unlock() - return func() ([]*models.PlayerNameChange, error) { + return func() ([]*twmodel.PlayerNameChange, error) { <-batch.done - var data []*models.PlayerNameChange + var data []*twmodel.PlayerNameChange if pos < len(batch.data) { data = batch.data[pos] } @@ -113,14 +112,14 @@ func (l *PlayerNameChangesLoader) LoadThunk(key int) func() ([]*models.PlayerNam // LoadAll fetches many keys at once. It will be broken into appropriate sized // sub batches depending on how the loader is configured -func (l *PlayerNameChangesLoader) LoadAll(keys []int) ([][]*models.PlayerNameChange, []error) { - results := make([]func() ([]*models.PlayerNameChange, error), len(keys)) +func (l *PlayerNameChangesLoader) LoadAll(keys []int) ([][]*twmodel.PlayerNameChange, []error) { + results := make([]func() ([]*twmodel.PlayerNameChange, error), len(keys)) for i, key := range keys { results[i] = l.LoadThunk(key) } - playerNameChanges := make([][]*models.PlayerNameChange, len(keys)) + playerNameChanges := make([][]*twmodel.PlayerNameChange, len(keys)) errors := make([]error, len(keys)) for i, thunk := range results { playerNameChanges[i], errors[i] = thunk() @@ -131,13 +130,13 @@ func (l *PlayerNameChangesLoader) LoadAll(keys []int) ([][]*models.PlayerNameCha // LoadAllThunk returns a function that when called will block waiting for a PlayerNameChanges. // This method should be used if you want one goroutine to make requests to many // different data loaders without blocking until the thunk is called. -func (l *PlayerNameChangesLoader) LoadAllThunk(keys []int) func() ([][]*models.PlayerNameChange, []error) { - results := make([]func() ([]*models.PlayerNameChange, error), len(keys)) +func (l *PlayerNameChangesLoader) LoadAllThunk(keys []int) func() ([][]*twmodel.PlayerNameChange, []error) { + results := make([]func() ([]*twmodel.PlayerNameChange, error), len(keys)) for i, key := range keys { results[i] = l.LoadThunk(key) } - return func() ([][]*models.PlayerNameChange, []error) { - playerNameChanges := make([][]*models.PlayerNameChange, len(keys)) + return func() ([][]*twmodel.PlayerNameChange, []error) { + playerNameChanges := make([][]*twmodel.PlayerNameChange, len(keys)) errors := make([]error, len(keys)) for i, thunk := range results { playerNameChanges[i], errors[i] = thunk() @@ -149,13 +148,13 @@ func (l *PlayerNameChangesLoader) LoadAllThunk(keys []int) func() ([][]*models.P // Prime the cache with the provided key and value. If the key already exists, no change is made // and false is returned. // (To forcefully prime the cache, clear the key first with loader.clear(key).prime(key, value).) -func (l *PlayerNameChangesLoader) Prime(key int, value []*models.PlayerNameChange) bool { +func (l *PlayerNameChangesLoader) Prime(key int, value []*twmodel.PlayerNameChange) bool { l.mu.Lock() var found bool if _, found = l.cache[key]; !found { // make a copy when writing to the cache, its easy to pass a pointer in from a loop var // and end up with the whole cache pointing to the same value. - cpy := make([]*models.PlayerNameChange, len(value)) + cpy := make([]*twmodel.PlayerNameChange, len(value)) copy(cpy, value) l.unsafeSet(key, cpy) } @@ -170,9 +169,9 @@ func (l *PlayerNameChangesLoader) Clear(key int) { l.mu.Unlock() } -func (l *PlayerNameChangesLoader) unsafeSet(key int, value []*models.PlayerNameChange) { +func (l *PlayerNameChangesLoader) unsafeSet(key int, value []*twmodel.PlayerNameChange) { if l.cache == nil { - l.cache = map[int][]*models.PlayerNameChange{} + l.cache = map[int][]*twmodel.PlayerNameChange{} } l.cache[key] = value } diff --git a/graphql/dataloaders/server_data_loaders.go b/graphql/dataloaders/server_data_loaders.go index d1ac6a7..b1e880f 100644 --- a/graphql/dataloaders/server_data_loaders.go +++ b/graphql/dataloaders/server_data_loaders.go @@ -2,10 +2,11 @@ package dataloaders import ( "context" + "github.com/tribalwarshelp/shared/tw/twmodel" + "github.com/tribalwarshelp/api/player" "github.com/tribalwarshelp/api/tribe" "github.com/tribalwarshelp/api/village" - "github.com/tribalwarshelp/shared/models" ) type ServerDataLoaders struct { @@ -19,9 +20,9 @@ func NewServerDataLoaders(server string, cfg Config) *ServerDataLoaders { PlayerByID: &PlayerLoader{ wait: wait, maxBatch: 0, - fetch: func(ids []int) ([]*models.Player, []error) { + fetch: func(ids []int) ([]*twmodel.Player, []error) { players, _, err := cfg.PlayerRepo.Fetch(context.Background(), player.FetchConfig{ - Filter: &models.PlayerFilter{ + Filter: &twmodel.PlayerFilter{ ID: ids, }, Select: true, @@ -31,12 +32,12 @@ func NewServerDataLoaders(server string, cfg Config) *ServerDataLoaders { return nil, []error{err} } - playerByID := make(map[int]*models.Player) - for _, player := range players { - playerByID[player.ID] = player + playerByID := make(map[int]*twmodel.Player) + for _, p := range players { + playerByID[p.ID] = p } - inOrder := make([]*models.Player, len(ids)) + inOrder := make([]*twmodel.Player, len(ids)) for i, id := range ids { inOrder[i] = playerByID[id] } @@ -47,10 +48,10 @@ func NewServerDataLoaders(server string, cfg Config) *ServerDataLoaders { TribeByID: &TribeLoader{ wait: wait, maxBatch: 0, - fetch: func(ids []int) ([]*models.Tribe, []error) { + fetch: func(ids []int) ([]*twmodel.Tribe, []error) { tribes, _, err := cfg.TribeRepo.Fetch(context.Background(), tribe.FetchConfig{ Server: server, - Filter: &models.TribeFilter{ + Filter: &twmodel.TribeFilter{ ID: ids, }, Select: true, @@ -59,12 +60,12 @@ func NewServerDataLoaders(server string, cfg Config) *ServerDataLoaders { return nil, []error{err} } - tribeByID := make(map[int]*models.Tribe) - for _, tribe := range tribes { - tribeByID[tribe.ID] = tribe + tribeByID := make(map[int]*twmodel.Tribe) + for _, t := range tribes { + tribeByID[t.ID] = t } - inOrder := make([]*models.Tribe, len(ids)) + inOrder := make([]*twmodel.Tribe, len(ids)) for i, id := range ids { inOrder[i] = tribeByID[id] } @@ -75,11 +76,11 @@ func NewServerDataLoaders(server string, cfg Config) *ServerDataLoaders { VillageByID: &VillageLoader{ wait: wait, maxBatch: 0, - fetch: func(ids []int) ([]*models.Village, []error) { + fetch: func(ids []int) ([]*twmodel.Village, []error) { villages, _, err := cfg.VillageRepo.Fetch(context.Background(), village.FetchConfig{ Server: server, Count: false, - Filter: &models.VillageFilter{ + Filter: &twmodel.VillageFilter{ ID: ids, }, Select: true, @@ -88,12 +89,12 @@ func NewServerDataLoaders(server string, cfg Config) *ServerDataLoaders { return nil, []error{err} } - villageByID := make(map[int]*models.Village) - for _, village := range villages { - villageByID[village.ID] = village + villageByID := make(map[int]*twmodel.Village) + for _, v := range villages { + villageByID[v.ID] = v } - inOrder := make([]*models.Village, len(ids)) + inOrder := make([]*twmodel.Village, len(ids)) for i, id := range ids { inOrder[i] = villageByID[id] } diff --git a/graphql/dataloaders/tribeloader_gen.go b/graphql/dataloaders/tribeloader_gen.go index 480d353..1c07b00 100644 --- a/graphql/dataloaders/tribeloader_gen.go +++ b/graphql/dataloaders/tribeloader_gen.go @@ -3,16 +3,15 @@ package dataloaders import ( + "github.com/tribalwarshelp/shared/tw/twmodel" "sync" "time" - - "github.com/tribalwarshelp/shared/models" ) // TribeLoaderConfig captures the config to create a new TribeLoader type TribeLoaderConfig struct { // Fetch is a method that provides the data for the loader - Fetch func(keys []int) ([]*models.Tribe, []error) + Fetch func(keys []int) ([]*twmodel.Tribe, []error) // Wait is how long wait before sending a batch Wait time.Duration @@ -33,7 +32,7 @@ func NewTribeLoader(config TribeLoaderConfig) *TribeLoader { // TribeLoader batches and caches requests type TribeLoader struct { // this method provides the data for the loader - fetch func(keys []int) ([]*models.Tribe, []error) + fetch func(keys []int) ([]*twmodel.Tribe, []error) // how long to done before sending a batch wait time.Duration @@ -44,7 +43,7 @@ type TribeLoader struct { // INTERNAL // lazily created cache - cache map[int]*models.Tribe + cache map[int]*twmodel.Tribe // the current batch. keys will continue to be collected until timeout is hit, // then everything will be sent to the fetch method and out to the listeners @@ -56,25 +55,25 @@ type TribeLoader struct { type tribeLoaderBatch struct { keys []int - data []*models.Tribe + data []*twmodel.Tribe error []error closing bool done chan struct{} } // Load a Tribe by key, batching and caching will be applied automatically -func (l *TribeLoader) Load(key int) (*models.Tribe, error) { +func (l *TribeLoader) Load(key int) (*twmodel.Tribe, error) { return l.LoadThunk(key)() } // LoadThunk returns a function that when called will block waiting for a Tribe. // This method should be used if you want one goroutine to make requests to many // different data loaders without blocking until the thunk is called. -func (l *TribeLoader) LoadThunk(key int) func() (*models.Tribe, error) { +func (l *TribeLoader) LoadThunk(key int) func() (*twmodel.Tribe, error) { l.mu.Lock() if it, ok := l.cache[key]; ok { l.mu.Unlock() - return func() (*models.Tribe, error) { + return func() (*twmodel.Tribe, error) { return it, nil } } @@ -85,10 +84,10 @@ func (l *TribeLoader) LoadThunk(key int) func() (*models.Tribe, error) { pos := batch.keyIndex(l, key) l.mu.Unlock() - return func() (*models.Tribe, error) { + return func() (*twmodel.Tribe, error) { <-batch.done - var data *models.Tribe + var data *twmodel.Tribe if pos < len(batch.data) { data = batch.data[pos] } @@ -113,14 +112,14 @@ func (l *TribeLoader) LoadThunk(key int) func() (*models.Tribe, error) { // LoadAll fetches many keys at once. It will be broken into appropriate sized // sub batches depending on how the loader is configured -func (l *TribeLoader) LoadAll(keys []int) ([]*models.Tribe, []error) { - results := make([]func() (*models.Tribe, error), len(keys)) +func (l *TribeLoader) LoadAll(keys []int) ([]*twmodel.Tribe, []error) { + results := make([]func() (*twmodel.Tribe, error), len(keys)) for i, key := range keys { results[i] = l.LoadThunk(key) } - tribes := make([]*models.Tribe, len(keys)) + tribes := make([]*twmodel.Tribe, len(keys)) errors := make([]error, len(keys)) for i, thunk := range results { tribes[i], errors[i] = thunk() @@ -131,13 +130,13 @@ func (l *TribeLoader) LoadAll(keys []int) ([]*models.Tribe, []error) { // LoadAllThunk returns a function that when called will block waiting for a Tribes. // This method should be used if you want one goroutine to make requests to many // different data loaders without blocking until the thunk is called. -func (l *TribeLoader) LoadAllThunk(keys []int) func() ([]*models.Tribe, []error) { - results := make([]func() (*models.Tribe, error), len(keys)) +func (l *TribeLoader) LoadAllThunk(keys []int) func() ([]*twmodel.Tribe, []error) { + results := make([]func() (*twmodel.Tribe, error), len(keys)) for i, key := range keys { results[i] = l.LoadThunk(key) } - return func() ([]*models.Tribe, []error) { - tribes := make([]*models.Tribe, len(keys)) + return func() ([]*twmodel.Tribe, []error) { + tribes := make([]*twmodel.Tribe, len(keys)) errors := make([]error, len(keys)) for i, thunk := range results { tribes[i], errors[i] = thunk() @@ -149,7 +148,7 @@ func (l *TribeLoader) LoadAllThunk(keys []int) func() ([]*models.Tribe, []error) // Prime the cache with the provided key and value. If the key already exists, no change is made // and false is returned. // (To forcefully prime the cache, clear the key first with loader.clear(key).prime(key, value).) -func (l *TribeLoader) Prime(key int, value *models.Tribe) bool { +func (l *TribeLoader) Prime(key int, value *twmodel.Tribe) bool { l.mu.Lock() var found bool if _, found = l.cache[key]; !found { @@ -169,9 +168,9 @@ func (l *TribeLoader) Clear(key int) { l.mu.Unlock() } -func (l *TribeLoader) unsafeSet(key int, value *models.Tribe) { +func (l *TribeLoader) unsafeSet(key int, value *twmodel.Tribe) { if l.cache == nil { - l.cache = map[int]*models.Tribe{} + l.cache = map[int]*twmodel.Tribe{} } l.cache[key] = value } diff --git a/graphql/dataloaders/version_data_loaders.go b/graphql/dataloaders/version_data_loaders.go index 6e5101f..21b91f7 100644 --- a/graphql/dataloaders/version_data_loaders.go +++ b/graphql/dataloaders/version_data_loaders.go @@ -2,7 +2,7 @@ package dataloaders import ( "context" - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type VersionDataLoaders struct { @@ -10,7 +10,7 @@ type VersionDataLoaders struct { PlayerNameChangesByID *PlayerNameChangesLoader } -func NewVersionDataLoaders(versionCode models.VersionCode, cfg Config) *VersionDataLoaders { +func NewVersionDataLoaders(versionCode twmodel.VersionCode, cfg Config) *VersionDataLoaders { return &VersionDataLoaders{ PlayerServersByID: &PlayerServersLoader{ wait: wait, @@ -30,12 +30,12 @@ func NewVersionDataLoaders(versionCode models.VersionCode, cfg Config) *VersionD PlayerNameChangesByID: &PlayerNameChangesLoader{ wait: wait, maxBatch: 0, - fetch: func(keys []int) ([][]*models.PlayerNameChange, []error) { + fetch: func(keys []int) ([][]*twmodel.PlayerNameChange, []error) { playerNameChangesByID, err := cfg.PlayerRepo.FetchNameChanges(context.Background(), versionCode, keys...) if err != nil { return nil, []error{err} } - inOrder := make([][]*models.PlayerNameChange, len(keys)) + inOrder := make([][]*twmodel.PlayerNameChange, len(keys)) for i, id := range keys { inOrder[i] = playerNameChangesByID[id] } diff --git a/graphql/dataloaders/versionloader_gen.go b/graphql/dataloaders/versionloader_gen.go index 0584365..4c14756 100644 --- a/graphql/dataloaders/versionloader_gen.go +++ b/graphql/dataloaders/versionloader_gen.go @@ -3,16 +3,15 @@ package dataloaders import ( + "github.com/tribalwarshelp/shared/tw/twmodel" "sync" "time" - - "github.com/tribalwarshelp/shared/models" ) // VersionLoaderConfig captures the config to create a new VersionLoader type VersionLoaderConfig struct { // Fetch is a method that provides the data for the loader - Fetch func(keys []string) ([]*models.Version, []error) + Fetch func(keys []string) ([]*twmodel.Version, []error) // Wait is how long wait before sending a batch Wait time.Duration @@ -33,7 +32,7 @@ func NewVersionLoader(config VersionLoaderConfig) *VersionLoader { // VersionLoader batches and caches requests type VersionLoader struct { // this method provides the data for the loader - fetch func(keys []string) ([]*models.Version, []error) + fetch func(keys []string) ([]*twmodel.Version, []error) // how long to done before sending a batch wait time.Duration @@ -44,7 +43,7 @@ type VersionLoader struct { // INTERNAL // lazily created cache - cache map[string]*models.Version + cache map[string]*twmodel.Version // the current batch. keys will continue to be collected until timeout is hit, // then everything will be sent to the fetch method and out to the listeners @@ -56,25 +55,25 @@ type VersionLoader struct { type versionLoaderBatch struct { keys []string - data []*models.Version + data []*twmodel.Version error []error closing bool done chan struct{} } // Load a Version by key, batching and caching will be applied automatically -func (l *VersionLoader) Load(key string) (*models.Version, error) { +func (l *VersionLoader) Load(key string) (*twmodel.Version, error) { return l.LoadThunk(key)() } // LoadThunk returns a function that when called will block waiting for a Version. // This method should be used if you want one goroutine to make requests to many // different data loaders without blocking until the thunk is called. -func (l *VersionLoader) LoadThunk(key string) func() (*models.Version, error) { +func (l *VersionLoader) LoadThunk(key string) func() (*twmodel.Version, error) { l.mu.Lock() if it, ok := l.cache[key]; ok { l.mu.Unlock() - return func() (*models.Version, error) { + return func() (*twmodel.Version, error) { return it, nil } } @@ -85,10 +84,10 @@ func (l *VersionLoader) LoadThunk(key string) func() (*models.Version, error) { pos := batch.keyIndex(l, key) l.mu.Unlock() - return func() (*models.Version, error) { + return func() (*twmodel.Version, error) { <-batch.done - var data *models.Version + var data *twmodel.Version if pos < len(batch.data) { data = batch.data[pos] } @@ -113,14 +112,14 @@ func (l *VersionLoader) LoadThunk(key string) func() (*models.Version, error) { // LoadAll fetches many keys at once. It will be broken into appropriate sized // sub batches depending on how the loader is configured -func (l *VersionLoader) LoadAll(keys []string) ([]*models.Version, []error) { - results := make([]func() (*models.Version, error), len(keys)) +func (l *VersionLoader) LoadAll(keys []string) ([]*twmodel.Version, []error) { + results := make([]func() (*twmodel.Version, error), len(keys)) for i, key := range keys { results[i] = l.LoadThunk(key) } - versions := make([]*models.Version, len(keys)) + versions := make([]*twmodel.Version, len(keys)) errors := make([]error, len(keys)) for i, thunk := range results { versions[i], errors[i] = thunk() @@ -131,13 +130,13 @@ func (l *VersionLoader) LoadAll(keys []string) ([]*models.Version, []error) { // LoadAllThunk returns a function that when called will block waiting for a Versions. // This method should be used if you want one goroutine to make requests to many // different data loaders without blocking until the thunk is called. -func (l *VersionLoader) LoadAllThunk(keys []string) func() ([]*models.Version, []error) { - results := make([]func() (*models.Version, error), len(keys)) +func (l *VersionLoader) LoadAllThunk(keys []string) func() ([]*twmodel.Version, []error) { + results := make([]func() (*twmodel.Version, error), len(keys)) for i, key := range keys { results[i] = l.LoadThunk(key) } - return func() ([]*models.Version, []error) { - versions := make([]*models.Version, len(keys)) + return func() ([]*twmodel.Version, []error) { + versions := make([]*twmodel.Version, len(keys)) errors := make([]error, len(keys)) for i, thunk := range results { versions[i], errors[i] = thunk() @@ -149,7 +148,7 @@ func (l *VersionLoader) LoadAllThunk(keys []string) func() ([]*models.Version, [ // Prime the cache with the provided key and value. If the key already exists, no change is made // and false is returned. // (To forcefully prime the cache, clear the key first with loader.clear(key).prime(key, value).) -func (l *VersionLoader) Prime(key string, value *models.Version) bool { +func (l *VersionLoader) Prime(key string, value *twmodel.Version) bool { l.mu.Lock() var found bool if _, found = l.cache[key]; !found { @@ -169,9 +168,9 @@ func (l *VersionLoader) Clear(key string) { l.mu.Unlock() } -func (l *VersionLoader) unsafeSet(key string, value *models.Version) { +func (l *VersionLoader) unsafeSet(key string, value *twmodel.Version) { if l.cache == nil { - l.cache = map[string]*models.Version{} + l.cache = map[string]*twmodel.Version{} } l.cache[key] = value } diff --git a/graphql/dataloaders/villageloader_gen.go b/graphql/dataloaders/villageloader_gen.go index 592e1ab..55aaa1e 100644 --- a/graphql/dataloaders/villageloader_gen.go +++ b/graphql/dataloaders/villageloader_gen.go @@ -3,16 +3,15 @@ package dataloaders import ( + "github.com/tribalwarshelp/shared/tw/twmodel" "sync" "time" - - "github.com/tribalwarshelp/shared/models" ) // VillageLoaderConfig captures the config to create a new VillageLoader type VillageLoaderConfig struct { // Fetch is a method that provides the data for the loader - Fetch func(keys []int) ([]*models.Village, []error) + Fetch func(keys []int) ([]*twmodel.Village, []error) // Wait is how long wait before sending a batch Wait time.Duration @@ -33,7 +32,7 @@ func NewVillageLoader(config VillageLoaderConfig) *VillageLoader { // VillageLoader batches and caches requests type VillageLoader struct { // this method provides the data for the loader - fetch func(keys []int) ([]*models.Village, []error) + fetch func(keys []int) ([]*twmodel.Village, []error) // how long to done before sending a batch wait time.Duration @@ -44,7 +43,7 @@ type VillageLoader struct { // INTERNAL // lazily created cache - cache map[int]*models.Village + cache map[int]*twmodel.Village // the current batch. keys will continue to be collected until timeout is hit, // then everything will be sent to the fetch method and out to the listeners @@ -56,25 +55,25 @@ type VillageLoader struct { type villageLoaderBatch struct { keys []int - data []*models.Village + data []*twmodel.Village error []error closing bool done chan struct{} } // Load a Village by key, batching and caching will be applied automatically -func (l *VillageLoader) Load(key int) (*models.Village, error) { +func (l *VillageLoader) Load(key int) (*twmodel.Village, error) { return l.LoadThunk(key)() } // LoadThunk returns a function that when called will block waiting for a Village. // This method should be used if you want one goroutine to make requests to many // different data loaders without blocking until the thunk is called. -func (l *VillageLoader) LoadThunk(key int) func() (*models.Village, error) { +func (l *VillageLoader) LoadThunk(key int) func() (*twmodel.Village, error) { l.mu.Lock() if it, ok := l.cache[key]; ok { l.mu.Unlock() - return func() (*models.Village, error) { + return func() (*twmodel.Village, error) { return it, nil } } @@ -85,10 +84,10 @@ func (l *VillageLoader) LoadThunk(key int) func() (*models.Village, error) { pos := batch.keyIndex(l, key) l.mu.Unlock() - return func() (*models.Village, error) { + return func() (*twmodel.Village, error) { <-batch.done - var data *models.Village + var data *twmodel.Village if pos < len(batch.data) { data = batch.data[pos] } @@ -113,14 +112,14 @@ func (l *VillageLoader) LoadThunk(key int) func() (*models.Village, error) { // LoadAll fetches many keys at once. It will be broken into appropriate sized // sub batches depending on how the loader is configured -func (l *VillageLoader) LoadAll(keys []int) ([]*models.Village, []error) { - results := make([]func() (*models.Village, error), len(keys)) +func (l *VillageLoader) LoadAll(keys []int) ([]*twmodel.Village, []error) { + results := make([]func() (*twmodel.Village, error), len(keys)) for i, key := range keys { results[i] = l.LoadThunk(key) } - villages := make([]*models.Village, len(keys)) + villages := make([]*twmodel.Village, len(keys)) errors := make([]error, len(keys)) for i, thunk := range results { villages[i], errors[i] = thunk() @@ -131,13 +130,13 @@ func (l *VillageLoader) LoadAll(keys []int) ([]*models.Village, []error) { // LoadAllThunk returns a function that when called will block waiting for a Villages. // This method should be used if you want one goroutine to make requests to many // different data loaders without blocking until the thunk is called. -func (l *VillageLoader) LoadAllThunk(keys []int) func() ([]*models.Village, []error) { - results := make([]func() (*models.Village, error), len(keys)) +func (l *VillageLoader) LoadAllThunk(keys []int) func() ([]*twmodel.Village, []error) { + results := make([]func() (*twmodel.Village, error), len(keys)) for i, key := range keys { results[i] = l.LoadThunk(key) } - return func() ([]*models.Village, []error) { - villages := make([]*models.Village, len(keys)) + return func() ([]*twmodel.Village, []error) { + villages := make([]*twmodel.Village, len(keys)) errors := make([]error, len(keys)) for i, thunk := range results { villages[i], errors[i] = thunk() @@ -149,7 +148,7 @@ func (l *VillageLoader) LoadAllThunk(keys []int) func() ([]*models.Village, []er // Prime the cache with the provided key and value. If the key already exists, no change is made // and false is returned. // (To forcefully prime the cache, clear the key first with loader.clear(key).prime(key, value).) -func (l *VillageLoader) Prime(key int, value *models.Village) bool { +func (l *VillageLoader) Prime(key int, value *twmodel.Village) bool { l.mu.Lock() var found bool if _, found = l.cache[key]; !found { @@ -169,9 +168,9 @@ func (l *VillageLoader) Clear(key int) { l.mu.Unlock() } -func (l *VillageLoader) unsafeSet(key int, value *models.Village) { +func (l *VillageLoader) unsafeSet(key int, value *twmodel.Village) { if l.cache == nil { - l.cache = map[int]*models.Village{} + l.cache = map[int]*twmodel.Village{} } l.cache[key] = value } diff --git a/graphql/generated/generated.go b/graphql/generated/generated.go index 602a55f..496795f 100644 --- a/graphql/generated/generated.go +++ b/graphql/generated/generated.go @@ -6,6 +6,7 @@ import ( "bytes" "context" "errors" + "github.com/tribalwarshelp/shared/tw/twmodel" "strconv" "sync" "sync/atomic" @@ -13,7 +14,7 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" - "github.com/tribalwarshelp/shared/models" + gqlparser "github.com/vektah/gqlparser/v2" "github.com/vektah/gqlparser/v2/ast" ) @@ -239,25 +240,25 @@ type ComplexityRoot struct { } Query struct { - DailyPlayerStats func(childComplexity int, server string, filter *models.DailyPlayerStatsFilter, limit *int, offset *int, sort []string) int - DailyTribeStats func(childComplexity int, server string, filter *models.DailyTribeStatsFilter, limit *int, offset *int, sort []string) int - Ennoblements func(childComplexity int, server string, filter *models.EnnoblementFilter, limit *int, offset *int, sort []string) int + DailyPlayerStats func(childComplexity int, server string, filter *twmodel.DailyPlayerStatsFilter, limit *int, offset *int, sort []string) int + DailyTribeStats func(childComplexity int, server string, filter *twmodel.DailyTribeStatsFilter, limit *int, offset *int, sort []string) int + Ennoblements func(childComplexity int, server string, filter *twmodel.EnnoblementFilter, limit *int, offset *int, sort []string) int Player func(childComplexity int, server string, id int) int - PlayerHistory func(childComplexity int, server string, filter *models.PlayerHistoryFilter, limit *int, offset *int, sort []string) int - Players func(childComplexity int, server string, filter *models.PlayerFilter, limit *int, offset *int, sort []string) int + PlayerHistory func(childComplexity int, server string, filter *twmodel.PlayerHistoryFilter, limit *int, offset *int, sort []string) int + Players func(childComplexity int, server string, filter *twmodel.PlayerFilter, limit *int, offset *int, sort []string) int SearchPlayer func(childComplexity int, version string, name *string, id *int, limit *int, offset *int, sort []string) int SearchTribe func(childComplexity int, version string, query string, limit *int, offset *int, sort []string) int Server func(childComplexity int, key string) int - ServerStats func(childComplexity int, server string, filter *models.ServerStatsFilter, limit *int, offset *int, sort []string) int - Servers func(childComplexity int, filter *models.ServerFilter, limit *int, offset *int, sort []string) int + ServerStats func(childComplexity int, server string, filter *twmodel.ServerStatsFilter, limit *int, offset *int, sort []string) int + Servers func(childComplexity int, filter *twmodel.ServerFilter, limit *int, offset *int, sort []string) int Tribe func(childComplexity int, server string, id int) int - TribeChanges func(childComplexity int, server string, filter *models.TribeChangeFilter, limit *int, offset *int, sort []string) int - TribeHistory func(childComplexity int, server string, filter *models.TribeHistoryFilter, limit *int, offset *int, sort []string) int - Tribes func(childComplexity int, server string, filter *models.TribeFilter, limit *int, offset *int, sort []string) int - Version func(childComplexity int, code models.VersionCode) int - Versions func(childComplexity int, filter *models.VersionFilter, limit *int, offset *int, sort []string) int + TribeChanges func(childComplexity int, server string, filter *twmodel.TribeChangeFilter, limit *int, offset *int, sort []string) int + TribeHistory func(childComplexity int, server string, filter *twmodel.TribeHistoryFilter, limit *int, offset *int, sort []string) int + Tribes func(childComplexity int, server string, filter *twmodel.TribeFilter, limit *int, offset *int, sort []string) int + Version func(childComplexity int, code twmodel.VersionCode) int + Versions func(childComplexity int, filter *twmodel.VersionFilter, limit *int, offset *int, sort []string) int Village func(childComplexity int, server string, id int) int - Villages func(childComplexity int, server string, filter *models.VillageFilter, limit *int, offset *int, sort []string) int + Villages func(childComplexity int, server string, filter *twmodel.VillageFilter, limit *int, offset *int, sort []string) int } Server struct { @@ -571,62 +572,62 @@ type ComplexityRoot struct { } type DailyPlayerStatsRecordResolver interface { - Player(ctx context.Context, obj *models.DailyPlayerStats) (*models.Player, error) + Player(ctx context.Context, obj *twmodel.DailyPlayerStats) (*twmodel.Player, error) } type DailyTribeStatsRecordResolver interface { - Tribe(ctx context.Context, obj *models.DailyTribeStats) (*models.Tribe, error) + Tribe(ctx context.Context, obj *twmodel.DailyTribeStats) (*twmodel.Tribe, error) } type EnnoblementResolver interface { - Village(ctx context.Context, obj *models.Ennoblement) (*models.Village, error) - NewOwner(ctx context.Context, obj *models.Ennoblement) (*models.Player, error) - NewOwnerTribe(ctx context.Context, obj *models.Ennoblement) (*models.Tribe, error) - OldOwner(ctx context.Context, obj *models.Ennoblement) (*models.Player, error) - OldOwnerTribe(ctx context.Context, obj *models.Ennoblement) (*models.Tribe, error) + Village(ctx context.Context, obj *twmodel.Ennoblement) (*twmodel.Village, error) + NewOwner(ctx context.Context, obj *twmodel.Ennoblement) (*twmodel.Player, error) + NewOwnerTribe(ctx context.Context, obj *twmodel.Ennoblement) (*twmodel.Tribe, error) + OldOwner(ctx context.Context, obj *twmodel.Ennoblement) (*twmodel.Player, error) + OldOwnerTribe(ctx context.Context, obj *twmodel.Ennoblement) (*twmodel.Tribe, error) } type PlayerResolver interface { - Tribe(ctx context.Context, obj *models.Player) (*models.Tribe, error) - Servers(ctx context.Context, obj *models.Player) ([]string, error) - NameChanges(ctx context.Context, obj *models.Player) ([]*models.PlayerNameChange, error) + Tribe(ctx context.Context, obj *twmodel.Player) (*twmodel.Tribe, error) + Servers(ctx context.Context, obj *twmodel.Player) ([]string, error) + NameChanges(ctx context.Context, obj *twmodel.Player) ([]*twmodel.PlayerNameChange, error) } type PlayerHistoryRecordResolver interface { - Player(ctx context.Context, obj *models.PlayerHistory) (*models.Player, error) + Player(ctx context.Context, obj *twmodel.PlayerHistory) (*twmodel.Player, error) - Tribe(ctx context.Context, obj *models.PlayerHistory) (*models.Tribe, error) + Tribe(ctx context.Context, obj *twmodel.PlayerHistory) (*twmodel.Tribe, error) } type QueryResolver interface { - DailyPlayerStats(ctx context.Context, server string, filter *models.DailyPlayerStatsFilter, limit *int, offset *int, sort []string) (*DailyPlayerStats, error) - DailyTribeStats(ctx context.Context, server string, filter *models.DailyTribeStatsFilter, limit *int, offset *int, sort []string) (*DailyTribeStats, error) - Ennoblements(ctx context.Context, server string, filter *models.EnnoblementFilter, limit *int, offset *int, sort []string) (*EnnoblementList, error) - Players(ctx context.Context, server string, filter *models.PlayerFilter, limit *int, offset *int, sort []string) (*PlayerList, error) - Player(ctx context.Context, server string, id int) (*models.Player, error) + DailyPlayerStats(ctx context.Context, server string, filter *twmodel.DailyPlayerStatsFilter, limit *int, offset *int, sort []string) (*DailyPlayerStats, error) + DailyTribeStats(ctx context.Context, server string, filter *twmodel.DailyTribeStatsFilter, limit *int, offset *int, sort []string) (*DailyTribeStats, error) + Ennoblements(ctx context.Context, server string, filter *twmodel.EnnoblementFilter, limit *int, offset *int, sort []string) (*EnnoblementList, error) + Players(ctx context.Context, server string, filter *twmodel.PlayerFilter, limit *int, offset *int, sort []string) (*PlayerList, error) + Player(ctx context.Context, server string, id int) (*twmodel.Player, error) SearchPlayer(ctx context.Context, version string, name *string, id *int, limit *int, offset *int, sort []string) (*FoundPlayerList, error) - PlayerHistory(ctx context.Context, server string, filter *models.PlayerHistoryFilter, limit *int, offset *int, sort []string) (*PlayerHistory, error) - Servers(ctx context.Context, filter *models.ServerFilter, limit *int, offset *int, sort []string) (*ServerList, error) - Server(ctx context.Context, key string) (*models.Server, error) - ServerStats(ctx context.Context, server string, filter *models.ServerStatsFilter, limit *int, offset *int, sort []string) (*ServerStats, error) - Tribes(ctx context.Context, server string, filter *models.TribeFilter, limit *int, offset *int, sort []string) (*TribeList, error) - Tribe(ctx context.Context, server string, id int) (*models.Tribe, error) + PlayerHistory(ctx context.Context, server string, filter *twmodel.PlayerHistoryFilter, limit *int, offset *int, sort []string) (*PlayerHistory, error) + Servers(ctx context.Context, filter *twmodel.ServerFilter, limit *int, offset *int, sort []string) (*ServerList, error) + Server(ctx context.Context, key string) (*twmodel.Server, error) + ServerStats(ctx context.Context, server string, filter *twmodel.ServerStatsFilter, limit *int, offset *int, sort []string) (*ServerStats, error) + Tribes(ctx context.Context, server string, filter *twmodel.TribeFilter, limit *int, offset *int, sort []string) (*TribeList, error) + Tribe(ctx context.Context, server string, id int) (*twmodel.Tribe, error) SearchTribe(ctx context.Context, version string, query string, limit *int, offset *int, sort []string) (*FoundTribeList, error) - TribeChanges(ctx context.Context, server string, filter *models.TribeChangeFilter, limit *int, offset *int, sort []string) (*TribeChanges, error) - TribeHistory(ctx context.Context, server string, filter *models.TribeHistoryFilter, limit *int, offset *int, sort []string) (*TribeHistory, error) - Versions(ctx context.Context, filter *models.VersionFilter, limit *int, offset *int, sort []string) (*VersionList, error) - Version(ctx context.Context, code models.VersionCode) (*models.Version, error) - Villages(ctx context.Context, server string, filter *models.VillageFilter, limit *int, offset *int, sort []string) (*VillageList, error) - Village(ctx context.Context, server string, id int) (*models.Village, error) + TribeChanges(ctx context.Context, server string, filter *twmodel.TribeChangeFilter, limit *int, offset *int, sort []string) (*TribeChanges, error) + TribeHistory(ctx context.Context, server string, filter *twmodel.TribeHistoryFilter, limit *int, offset *int, sort []string) (*TribeHistory, error) + Versions(ctx context.Context, filter *twmodel.VersionFilter, limit *int, offset *int, sort []string) (*VersionList, error) + Version(ctx context.Context, code twmodel.VersionCode) (*twmodel.Version, error) + Villages(ctx context.Context, server string, filter *twmodel.VillageFilter, limit *int, offset *int, sort []string) (*VillageList, error) + Village(ctx context.Context, server string, id int) (*twmodel.Village, error) } type ServerResolver interface { - Version(ctx context.Context, obj *models.Server) (*models.Version, error) + Version(ctx context.Context, obj *twmodel.Server) (*twmodel.Version, error) } type TribeChangeRecordResolver interface { - Player(ctx context.Context, obj *models.TribeChange) (*models.Player, error) - OldTribe(ctx context.Context, obj *models.TribeChange) (*models.Tribe, error) - NewTribe(ctx context.Context, obj *models.TribeChange) (*models.Tribe, error) + Player(ctx context.Context, obj *twmodel.TribeChange) (*twmodel.Player, error) + OldTribe(ctx context.Context, obj *twmodel.TribeChange) (*twmodel.Tribe, error) + NewTribe(ctx context.Context, obj *twmodel.TribeChange) (*twmodel.Tribe, error) } type TribeHistoryRecordResolver interface { - Tribe(ctx context.Context, obj *models.TribeHistory) (*models.Tribe, error) + Tribe(ctx context.Context, obj *twmodel.TribeHistory) (*twmodel.Tribe, error) } type VillageResolver interface { - Player(ctx context.Context, obj *models.Village) (*models.Player, error) + Player(ctx context.Context, obj *twmodel.Village) (*twmodel.Player, error) } type executableSchema struct { @@ -1599,7 +1600,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.DailyPlayerStats(childComplexity, args["server"].(string), args["filter"].(*models.DailyPlayerStatsFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true + return e.complexity.Query.DailyPlayerStats(childComplexity, args["server"].(string), args["filter"].(*twmodel.DailyPlayerStatsFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true case "Query.dailyTribeStats": if e.complexity.Query.DailyTribeStats == nil { @@ -1611,7 +1612,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.DailyTribeStats(childComplexity, args["server"].(string), args["filter"].(*models.DailyTribeStatsFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true + return e.complexity.Query.DailyTribeStats(childComplexity, args["server"].(string), args["filter"].(*twmodel.DailyTribeStatsFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true case "Query.ennoblements": if e.complexity.Query.Ennoblements == nil { @@ -1623,7 +1624,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.Ennoblements(childComplexity, args["server"].(string), args["filter"].(*models.EnnoblementFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true + return e.complexity.Query.Ennoblements(childComplexity, args["server"].(string), args["filter"].(*twmodel.EnnoblementFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true case "Query.player": if e.complexity.Query.Player == nil { @@ -1647,7 +1648,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.PlayerHistory(childComplexity, args["server"].(string), args["filter"].(*models.PlayerHistoryFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true + return e.complexity.Query.PlayerHistory(childComplexity, args["server"].(string), args["filter"].(*twmodel.PlayerHistoryFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true case "Query.players": if e.complexity.Query.Players == nil { @@ -1659,7 +1660,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.Players(childComplexity, args["server"].(string), args["filter"].(*models.PlayerFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true + return e.complexity.Query.Players(childComplexity, args["server"].(string), args["filter"].(*twmodel.PlayerFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true case "Query.searchPlayer": if e.complexity.Query.SearchPlayer == nil { @@ -1707,7 +1708,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.ServerStats(childComplexity, args["server"].(string), args["filter"].(*models.ServerStatsFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true + return e.complexity.Query.ServerStats(childComplexity, args["server"].(string), args["filter"].(*twmodel.ServerStatsFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true case "Query.servers": if e.complexity.Query.Servers == nil { @@ -1719,7 +1720,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.Servers(childComplexity, args["filter"].(*models.ServerFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true + return e.complexity.Query.Servers(childComplexity, args["filter"].(*twmodel.ServerFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true case "Query.tribe": if e.complexity.Query.Tribe == nil { @@ -1743,7 +1744,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.TribeChanges(childComplexity, args["server"].(string), args["filter"].(*models.TribeChangeFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true + return e.complexity.Query.TribeChanges(childComplexity, args["server"].(string), args["filter"].(*twmodel.TribeChangeFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true case "Query.tribeHistory": if e.complexity.Query.TribeHistory == nil { @@ -1755,7 +1756,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.TribeHistory(childComplexity, args["server"].(string), args["filter"].(*models.TribeHistoryFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true + return e.complexity.Query.TribeHistory(childComplexity, args["server"].(string), args["filter"].(*twmodel.TribeHistoryFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true case "Query.tribes": if e.complexity.Query.Tribes == nil { @@ -1767,7 +1768,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.Tribes(childComplexity, args["server"].(string), args["filter"].(*models.TribeFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true + return e.complexity.Query.Tribes(childComplexity, args["server"].(string), args["filter"].(*twmodel.TribeFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true case "Query.version": if e.complexity.Query.Version == nil { @@ -1779,7 +1780,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.Version(childComplexity, args["code"].(models.VersionCode)), true + return e.complexity.Query.Version(childComplexity, args["code"].(twmodel.VersionCode)), true case "Query.versions": if e.complexity.Query.Versions == nil { @@ -1791,7 +1792,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.Versions(childComplexity, args["filter"].(*models.VersionFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true + return e.complexity.Query.Versions(childComplexity, args["filter"].(*twmodel.VersionFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true case "Query.village": if e.complexity.Query.Village == nil { @@ -1815,7 +1816,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.Villages(childComplexity, args["server"].(string), args["filter"].(*models.VillageFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true + return e.complexity.Query.Villages(childComplexity, args["server"].(string), args["filter"].(*twmodel.VillageFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true case "Server.buildingConfig": if e.complexity.Server.BuildingConfig == nil { @@ -4518,7 +4519,7 @@ func (ec *executionContext) field_Query_dailyPlayerStats_args(ctx context.Contex } } args["server"] = arg0 - var arg1 *models.DailyPlayerStatsFilter + var arg1 *twmodel.DailyPlayerStatsFilter if tmp, ok := rawArgs["filter"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) arg1, err = ec.unmarshalODailyPlayerStatsFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐDailyPlayerStatsFilter(ctx, tmp) @@ -4569,7 +4570,7 @@ func (ec *executionContext) field_Query_dailyTribeStats_args(ctx context.Context } } args["server"] = arg0 - var arg1 *models.DailyTribeStatsFilter + var arg1 *twmodel.DailyTribeStatsFilter if tmp, ok := rawArgs["filter"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) arg1, err = ec.unmarshalODailyTribeStatsFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐDailyTribeStatsFilter(ctx, tmp) @@ -4620,7 +4621,7 @@ func (ec *executionContext) field_Query_ennoblements_args(ctx context.Context, r } } args["server"] = arg0 - var arg1 *models.EnnoblementFilter + var arg1 *twmodel.EnnoblementFilter if tmp, ok := rawArgs["filter"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) arg1, err = ec.unmarshalOEnnoblementFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐEnnoblementFilter(ctx, tmp) @@ -4671,7 +4672,7 @@ func (ec *executionContext) field_Query_playerHistory_args(ctx context.Context, } } args["server"] = arg0 - var arg1 *models.PlayerHistoryFilter + var arg1 *twmodel.PlayerHistoryFilter if tmp, ok := rawArgs["filter"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) arg1, err = ec.unmarshalOPlayerHistoryFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayerHistoryFilter(ctx, tmp) @@ -4746,7 +4747,7 @@ func (ec *executionContext) field_Query_players_args(ctx context.Context, rawArg } } args["server"] = arg0 - var arg1 *models.PlayerFilter + var arg1 *twmodel.PlayerFilter if tmp, ok := rawArgs["filter"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) arg1, err = ec.unmarshalOPlayerFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayerFilter(ctx, tmp) @@ -4908,7 +4909,7 @@ func (ec *executionContext) field_Query_serverStats_args(ctx context.Context, ra } } args["server"] = arg0 - var arg1 *models.ServerStatsFilter + var arg1 *twmodel.ServerStatsFilter if tmp, ok := rawArgs["filter"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) arg1, err = ec.unmarshalOServerStatsFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerStatsFilter(ctx, tmp) @@ -4965,7 +4966,7 @@ func (ec *executionContext) field_Query_server_args(ctx context.Context, rawArgs func (ec *executionContext) field_Query_servers_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *models.ServerFilter + var arg0 *twmodel.ServerFilter if tmp, ok := rawArgs["filter"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) arg0, err = ec.unmarshalOServerFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerFilter(ctx, tmp) @@ -5016,7 +5017,7 @@ func (ec *executionContext) field_Query_tribeChanges_args(ctx context.Context, r } } args["server"] = arg0 - var arg1 *models.TribeChangeFilter + var arg1 *twmodel.TribeChangeFilter if tmp, ok := rawArgs["filter"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) arg1, err = ec.unmarshalOTribeChangeFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeChangeFilter(ctx, tmp) @@ -5067,7 +5068,7 @@ func (ec *executionContext) field_Query_tribeHistory_args(ctx context.Context, r } } args["server"] = arg0 - var arg1 *models.TribeHistoryFilter + var arg1 *twmodel.TribeHistoryFilter if tmp, ok := rawArgs["filter"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) arg1, err = ec.unmarshalOTribeHistoryFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeHistoryFilter(ctx, tmp) @@ -5142,7 +5143,7 @@ func (ec *executionContext) field_Query_tribes_args(ctx context.Context, rawArgs } } args["server"] = arg0 - var arg1 *models.TribeFilter + var arg1 *twmodel.TribeFilter if tmp, ok := rawArgs["filter"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) arg1, err = ec.unmarshalOTribeFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeFilter(ctx, tmp) @@ -5184,7 +5185,7 @@ func (ec *executionContext) field_Query_tribes_args(ctx context.Context, rawArgs func (ec *executionContext) field_Query_version_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 models.VersionCode + var arg0 twmodel.VersionCode if tmp, ok := rawArgs["code"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("code")) arg0, err = ec.unmarshalNVersionCode2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersionCode(ctx, tmp) @@ -5199,7 +5200,7 @@ func (ec *executionContext) field_Query_version_args(ctx context.Context, rawArg func (ec *executionContext) field_Query_versions_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *models.VersionFilter + var arg0 *twmodel.VersionFilter if tmp, ok := rawArgs["filter"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) arg0, err = ec.unmarshalOVersionFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersionFilter(ctx, tmp) @@ -5274,7 +5275,7 @@ func (ec *executionContext) field_Query_villages_args(ctx context.Context, rawAr } } args["server"] = arg0 - var arg1 *models.VillageFilter + var arg1 *twmodel.VillageFilter if tmp, ok := rawArgs["filter"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) arg1, err = ec.unmarshalOVillageFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVillageFilter(ctx, tmp) @@ -5351,7 +5352,7 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg // region **************************** field.gotpl ***************************** -func (ec *executionContext) _Building_maxLevel(ctx context.Context, field graphql.CollectedField, obj *models.Building) (ret graphql.Marshaler) { +func (ec *executionContext) _Building_maxLevel(ctx context.Context, field graphql.CollectedField, obj *twmodel.Building) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5386,7 +5387,7 @@ func (ec *executionContext) _Building_maxLevel(ctx context.Context, field graphq return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Building_minLevel(ctx context.Context, field graphql.CollectedField, obj *models.Building) (ret graphql.Marshaler) { +func (ec *executionContext) _Building_minLevel(ctx context.Context, field graphql.CollectedField, obj *twmodel.Building) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5421,7 +5422,7 @@ func (ec *executionContext) _Building_minLevel(ctx context.Context, field graphq return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Building_wood(ctx context.Context, field graphql.CollectedField, obj *models.Building) (ret graphql.Marshaler) { +func (ec *executionContext) _Building_wood(ctx context.Context, field graphql.CollectedField, obj *twmodel.Building) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5456,7 +5457,7 @@ func (ec *executionContext) _Building_wood(ctx context.Context, field graphql.Co return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Building_stone(ctx context.Context, field graphql.CollectedField, obj *models.Building) (ret graphql.Marshaler) { +func (ec *executionContext) _Building_stone(ctx context.Context, field graphql.CollectedField, obj *twmodel.Building) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5491,7 +5492,7 @@ func (ec *executionContext) _Building_stone(ctx context.Context, field graphql.C return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Building_iron(ctx context.Context, field graphql.CollectedField, obj *models.Building) (ret graphql.Marshaler) { +func (ec *executionContext) _Building_iron(ctx context.Context, field graphql.CollectedField, obj *twmodel.Building) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5526,7 +5527,7 @@ func (ec *executionContext) _Building_iron(ctx context.Context, field graphql.Co return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Building_pop(ctx context.Context, field graphql.CollectedField, obj *models.Building) (ret graphql.Marshaler) { +func (ec *executionContext) _Building_pop(ctx context.Context, field graphql.CollectedField, obj *twmodel.Building) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5561,7 +5562,7 @@ func (ec *executionContext) _Building_pop(ctx context.Context, field graphql.Col return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Building_woodFactor(ctx context.Context, field graphql.CollectedField, obj *models.Building) (ret graphql.Marshaler) { +func (ec *executionContext) _Building_woodFactor(ctx context.Context, field graphql.CollectedField, obj *twmodel.Building) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5596,7 +5597,7 @@ func (ec *executionContext) _Building_woodFactor(ctx context.Context, field grap return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _Building_stoneFactor(ctx context.Context, field graphql.CollectedField, obj *models.Building) (ret graphql.Marshaler) { +func (ec *executionContext) _Building_stoneFactor(ctx context.Context, field graphql.CollectedField, obj *twmodel.Building) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5631,7 +5632,7 @@ func (ec *executionContext) _Building_stoneFactor(ctx context.Context, field gra return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _Building_ironFactor(ctx context.Context, field graphql.CollectedField, obj *models.Building) (ret graphql.Marshaler) { +func (ec *executionContext) _Building_ironFactor(ctx context.Context, field graphql.CollectedField, obj *twmodel.Building) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5666,7 +5667,7 @@ func (ec *executionContext) _Building_ironFactor(ctx context.Context, field grap return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _Building_popFactor(ctx context.Context, field graphql.CollectedField, obj *models.Building) (ret graphql.Marshaler) { +func (ec *executionContext) _Building_popFactor(ctx context.Context, field graphql.CollectedField, obj *twmodel.Building) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5701,7 +5702,7 @@ func (ec *executionContext) _Building_popFactor(ctx context.Context, field graph return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _Building_buildTime(ctx context.Context, field graphql.CollectedField, obj *models.Building) (ret graphql.Marshaler) { +func (ec *executionContext) _Building_buildTime(ctx context.Context, field graphql.CollectedField, obj *twmodel.Building) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5736,7 +5737,7 @@ func (ec *executionContext) _Building_buildTime(ctx context.Context, field graph return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _Building_buildTimeFactor(ctx context.Context, field graphql.CollectedField, obj *models.Building) (ret graphql.Marshaler) { +func (ec *executionContext) _Building_buildTimeFactor(ctx context.Context, field graphql.CollectedField, obj *twmodel.Building) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5771,7 +5772,7 @@ func (ec *executionContext) _Building_buildTimeFactor(ctx context.Context, field return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _BuildingConfig_main(ctx context.Context, field graphql.CollectedField, obj *models.BuildingConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _BuildingConfig_main(ctx context.Context, field graphql.CollectedField, obj *twmodel.BuildingConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5801,12 +5802,12 @@ func (ec *executionContext) _BuildingConfig_main(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(models.Building) + res := resTmp.(twmodel.Building) fc.Result = res return ec.marshalNBuilding2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuilding(ctx, field.Selections, res) } -func (ec *executionContext) _BuildingConfig_barracks(ctx context.Context, field graphql.CollectedField, obj *models.BuildingConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _BuildingConfig_barracks(ctx context.Context, field graphql.CollectedField, obj *twmodel.BuildingConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5836,12 +5837,12 @@ func (ec *executionContext) _BuildingConfig_barracks(ctx context.Context, field } return graphql.Null } - res := resTmp.(models.Building) + res := resTmp.(twmodel.Building) fc.Result = res return ec.marshalNBuilding2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuilding(ctx, field.Selections, res) } -func (ec *executionContext) _BuildingConfig_stable(ctx context.Context, field graphql.CollectedField, obj *models.BuildingConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _BuildingConfig_stable(ctx context.Context, field graphql.CollectedField, obj *twmodel.BuildingConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5871,12 +5872,12 @@ func (ec *executionContext) _BuildingConfig_stable(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(models.Building) + res := resTmp.(twmodel.Building) fc.Result = res return ec.marshalNBuilding2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuilding(ctx, field.Selections, res) } -func (ec *executionContext) _BuildingConfig_garage(ctx context.Context, field graphql.CollectedField, obj *models.BuildingConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _BuildingConfig_garage(ctx context.Context, field graphql.CollectedField, obj *twmodel.BuildingConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5906,12 +5907,12 @@ func (ec *executionContext) _BuildingConfig_garage(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(models.Building) + res := resTmp.(twmodel.Building) fc.Result = res return ec.marshalNBuilding2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuilding(ctx, field.Selections, res) } -func (ec *executionContext) _BuildingConfig_watchtower(ctx context.Context, field graphql.CollectedField, obj *models.BuildingConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _BuildingConfig_watchtower(ctx context.Context, field graphql.CollectedField, obj *twmodel.BuildingConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5941,12 +5942,12 @@ func (ec *executionContext) _BuildingConfig_watchtower(ctx context.Context, fiel } return graphql.Null } - res := resTmp.(models.Building) + res := resTmp.(twmodel.Building) fc.Result = res return ec.marshalNBuilding2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuilding(ctx, field.Selections, res) } -func (ec *executionContext) _BuildingConfig_snob(ctx context.Context, field graphql.CollectedField, obj *models.BuildingConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _BuildingConfig_snob(ctx context.Context, field graphql.CollectedField, obj *twmodel.BuildingConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5976,12 +5977,12 @@ func (ec *executionContext) _BuildingConfig_snob(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(models.Building) + res := resTmp.(twmodel.Building) fc.Result = res return ec.marshalNBuilding2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuilding(ctx, field.Selections, res) } -func (ec *executionContext) _BuildingConfig_smith(ctx context.Context, field graphql.CollectedField, obj *models.BuildingConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _BuildingConfig_smith(ctx context.Context, field graphql.CollectedField, obj *twmodel.BuildingConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6011,12 +6012,12 @@ func (ec *executionContext) _BuildingConfig_smith(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(models.Building) + res := resTmp.(twmodel.Building) fc.Result = res return ec.marshalNBuilding2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuilding(ctx, field.Selections, res) } -func (ec *executionContext) _BuildingConfig_place(ctx context.Context, field graphql.CollectedField, obj *models.BuildingConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _BuildingConfig_place(ctx context.Context, field graphql.CollectedField, obj *twmodel.BuildingConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6046,12 +6047,12 @@ func (ec *executionContext) _BuildingConfig_place(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(models.Building) + res := resTmp.(twmodel.Building) fc.Result = res return ec.marshalNBuilding2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuilding(ctx, field.Selections, res) } -func (ec *executionContext) _BuildingConfig_statue(ctx context.Context, field graphql.CollectedField, obj *models.BuildingConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _BuildingConfig_statue(ctx context.Context, field graphql.CollectedField, obj *twmodel.BuildingConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6081,12 +6082,12 @@ func (ec *executionContext) _BuildingConfig_statue(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(models.Building) + res := resTmp.(twmodel.Building) fc.Result = res return ec.marshalNBuilding2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuilding(ctx, field.Selections, res) } -func (ec *executionContext) _BuildingConfig_market(ctx context.Context, field graphql.CollectedField, obj *models.BuildingConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _BuildingConfig_market(ctx context.Context, field graphql.CollectedField, obj *twmodel.BuildingConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6116,12 +6117,12 @@ func (ec *executionContext) _BuildingConfig_market(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(models.Building) + res := resTmp.(twmodel.Building) fc.Result = res return ec.marshalNBuilding2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuilding(ctx, field.Selections, res) } -func (ec *executionContext) _BuildingConfig_wood(ctx context.Context, field graphql.CollectedField, obj *models.BuildingConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _BuildingConfig_wood(ctx context.Context, field graphql.CollectedField, obj *twmodel.BuildingConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6151,12 +6152,12 @@ func (ec *executionContext) _BuildingConfig_wood(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(models.Building) + res := resTmp.(twmodel.Building) fc.Result = res return ec.marshalNBuilding2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuilding(ctx, field.Selections, res) } -func (ec *executionContext) _BuildingConfig_stone(ctx context.Context, field graphql.CollectedField, obj *models.BuildingConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _BuildingConfig_stone(ctx context.Context, field graphql.CollectedField, obj *twmodel.BuildingConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6186,12 +6187,12 @@ func (ec *executionContext) _BuildingConfig_stone(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(models.Building) + res := resTmp.(twmodel.Building) fc.Result = res return ec.marshalNBuilding2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuilding(ctx, field.Selections, res) } -func (ec *executionContext) _BuildingConfig_iron(ctx context.Context, field graphql.CollectedField, obj *models.BuildingConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _BuildingConfig_iron(ctx context.Context, field graphql.CollectedField, obj *twmodel.BuildingConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6221,12 +6222,12 @@ func (ec *executionContext) _BuildingConfig_iron(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(models.Building) + res := resTmp.(twmodel.Building) fc.Result = res return ec.marshalNBuilding2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuilding(ctx, field.Selections, res) } -func (ec *executionContext) _BuildingConfig_farm(ctx context.Context, field graphql.CollectedField, obj *models.BuildingConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _BuildingConfig_farm(ctx context.Context, field graphql.CollectedField, obj *twmodel.BuildingConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6256,12 +6257,12 @@ func (ec *executionContext) _BuildingConfig_farm(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(models.Building) + res := resTmp.(twmodel.Building) fc.Result = res return ec.marshalNBuilding2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuilding(ctx, field.Selections, res) } -func (ec *executionContext) _BuildingConfig_storage(ctx context.Context, field graphql.CollectedField, obj *models.BuildingConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _BuildingConfig_storage(ctx context.Context, field graphql.CollectedField, obj *twmodel.BuildingConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6291,12 +6292,12 @@ func (ec *executionContext) _BuildingConfig_storage(ctx context.Context, field g } return graphql.Null } - res := resTmp.(models.Building) + res := resTmp.(twmodel.Building) fc.Result = res return ec.marshalNBuilding2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuilding(ctx, field.Selections, res) } -func (ec *executionContext) _BuildingConfig_hide(ctx context.Context, field graphql.CollectedField, obj *models.BuildingConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _BuildingConfig_hide(ctx context.Context, field graphql.CollectedField, obj *twmodel.BuildingConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6326,12 +6327,12 @@ func (ec *executionContext) _BuildingConfig_hide(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(models.Building) + res := resTmp.(twmodel.Building) fc.Result = res return ec.marshalNBuilding2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuilding(ctx, field.Selections, res) } -func (ec *executionContext) _BuildingConfig_wall(ctx context.Context, field graphql.CollectedField, obj *models.BuildingConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _BuildingConfig_wall(ctx context.Context, field graphql.CollectedField, obj *twmodel.BuildingConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6361,7 +6362,7 @@ func (ec *executionContext) _BuildingConfig_wall(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(models.Building) + res := resTmp.(twmodel.Building) fc.Result = res return ec.marshalNBuilding2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuilding(ctx, field.Selections, res) } @@ -6428,12 +6429,12 @@ func (ec *executionContext) _DailyPlayerStats_items(ctx context.Context, field g if resTmp == nil { return graphql.Null } - res := resTmp.([]*models.DailyPlayerStats) + res := resTmp.([]*twmodel.DailyPlayerStats) fc.Result = res return ec.marshalODailyPlayerStatsRecord2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐDailyPlayerStatsᚄ(ctx, field.Selections, res) } -func (ec *executionContext) _DailyPlayerStatsRecord_player(ctx context.Context, field graphql.CollectedField, obj *models.DailyPlayerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyPlayerStatsRecord_player(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyPlayerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6460,12 +6461,12 @@ func (ec *executionContext) _DailyPlayerStatsRecord_player(ctx context.Context, if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Player) + res := resTmp.(*twmodel.Player) fc.Result = res return ec.marshalOPlayer2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayer(ctx, field.Selections, res) } -func (ec *executionContext) _DailyPlayerStatsRecord_villages(ctx context.Context, field graphql.CollectedField, obj *models.DailyPlayerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyPlayerStatsRecord_villages(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyPlayerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6500,7 +6501,7 @@ func (ec *executionContext) _DailyPlayerStatsRecord_villages(ctx context.Context return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyPlayerStatsRecord_points(ctx context.Context, field graphql.CollectedField, obj *models.DailyPlayerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyPlayerStatsRecord_points(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyPlayerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6535,7 +6536,7 @@ func (ec *executionContext) _DailyPlayerStatsRecord_points(ctx context.Context, return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyPlayerStatsRecord_rank(ctx context.Context, field graphql.CollectedField, obj *models.DailyPlayerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyPlayerStatsRecord_rank(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyPlayerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6570,7 +6571,7 @@ func (ec *executionContext) _DailyPlayerStatsRecord_rank(ctx context.Context, fi return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyPlayerStatsRecord_rankAtt(ctx context.Context, field graphql.CollectedField, obj *models.DailyPlayerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyPlayerStatsRecord_rankAtt(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyPlayerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6605,7 +6606,7 @@ func (ec *executionContext) _DailyPlayerStatsRecord_rankAtt(ctx context.Context, return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyPlayerStatsRecord_scoreAtt(ctx context.Context, field graphql.CollectedField, obj *models.DailyPlayerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyPlayerStatsRecord_scoreAtt(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyPlayerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6640,7 +6641,7 @@ func (ec *executionContext) _DailyPlayerStatsRecord_scoreAtt(ctx context.Context return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyPlayerStatsRecord_rankDef(ctx context.Context, field graphql.CollectedField, obj *models.DailyPlayerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyPlayerStatsRecord_rankDef(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyPlayerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6675,7 +6676,7 @@ func (ec *executionContext) _DailyPlayerStatsRecord_rankDef(ctx context.Context, return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyPlayerStatsRecord_scoreDef(ctx context.Context, field graphql.CollectedField, obj *models.DailyPlayerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyPlayerStatsRecord_scoreDef(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyPlayerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6710,7 +6711,7 @@ func (ec *executionContext) _DailyPlayerStatsRecord_scoreDef(ctx context.Context return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyPlayerStatsRecord_rankSup(ctx context.Context, field graphql.CollectedField, obj *models.DailyPlayerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyPlayerStatsRecord_rankSup(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyPlayerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6745,7 +6746,7 @@ func (ec *executionContext) _DailyPlayerStatsRecord_rankSup(ctx context.Context, return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyPlayerStatsRecord_scoreSup(ctx context.Context, field graphql.CollectedField, obj *models.DailyPlayerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyPlayerStatsRecord_scoreSup(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyPlayerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6780,7 +6781,7 @@ func (ec *executionContext) _DailyPlayerStatsRecord_scoreSup(ctx context.Context return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyPlayerStatsRecord_rankTotal(ctx context.Context, field graphql.CollectedField, obj *models.DailyPlayerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyPlayerStatsRecord_rankTotal(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyPlayerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6815,7 +6816,7 @@ func (ec *executionContext) _DailyPlayerStatsRecord_rankTotal(ctx context.Contex return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyPlayerStatsRecord_scoreTotal(ctx context.Context, field graphql.CollectedField, obj *models.DailyPlayerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyPlayerStatsRecord_scoreTotal(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyPlayerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6850,7 +6851,7 @@ func (ec *executionContext) _DailyPlayerStatsRecord_scoreTotal(ctx context.Conte return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyPlayerStatsRecord_createDate(ctx context.Context, field graphql.CollectedField, obj *models.DailyPlayerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyPlayerStatsRecord_createDate(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyPlayerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6947,12 +6948,12 @@ func (ec *executionContext) _DailyTribeStats_items(ctx context.Context, field gr if resTmp == nil { return graphql.Null } - res := resTmp.([]*models.DailyTribeStats) + res := resTmp.([]*twmodel.DailyTribeStats) fc.Result = res return ec.marshalODailyTribeStatsRecord2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐDailyTribeStatsᚄ(ctx, field.Selections, res) } -func (ec *executionContext) _DailyTribeStatsRecord_tribe(ctx context.Context, field graphql.CollectedField, obj *models.DailyTribeStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyTribeStatsRecord_tribe(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyTribeStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6979,12 +6980,12 @@ func (ec *executionContext) _DailyTribeStatsRecord_tribe(ctx context.Context, fi if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Tribe) + res := resTmp.(*twmodel.Tribe) fc.Result = res return ec.marshalOTribe2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribe(ctx, field.Selections, res) } -func (ec *executionContext) _DailyTribeStatsRecord_members(ctx context.Context, field graphql.CollectedField, obj *models.DailyTribeStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyTribeStatsRecord_members(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyTribeStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7019,7 +7020,7 @@ func (ec *executionContext) _DailyTribeStatsRecord_members(ctx context.Context, return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyTribeStatsRecord_villages(ctx context.Context, field graphql.CollectedField, obj *models.DailyTribeStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyTribeStatsRecord_villages(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyTribeStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7054,7 +7055,7 @@ func (ec *executionContext) _DailyTribeStatsRecord_villages(ctx context.Context, return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyTribeStatsRecord_points(ctx context.Context, field graphql.CollectedField, obj *models.DailyTribeStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyTribeStatsRecord_points(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyTribeStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7089,7 +7090,7 @@ func (ec *executionContext) _DailyTribeStatsRecord_points(ctx context.Context, f return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyTribeStatsRecord_allPoints(ctx context.Context, field graphql.CollectedField, obj *models.DailyTribeStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyTribeStatsRecord_allPoints(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyTribeStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7124,7 +7125,7 @@ func (ec *executionContext) _DailyTribeStatsRecord_allPoints(ctx context.Context return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyTribeStatsRecord_rank(ctx context.Context, field graphql.CollectedField, obj *models.DailyTribeStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyTribeStatsRecord_rank(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyTribeStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7159,7 +7160,7 @@ func (ec *executionContext) _DailyTribeStatsRecord_rank(ctx context.Context, fie return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyTribeStatsRecord_rankAtt(ctx context.Context, field graphql.CollectedField, obj *models.DailyTribeStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyTribeStatsRecord_rankAtt(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyTribeStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7194,7 +7195,7 @@ func (ec *executionContext) _DailyTribeStatsRecord_rankAtt(ctx context.Context, return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyTribeStatsRecord_scoreAtt(ctx context.Context, field graphql.CollectedField, obj *models.DailyTribeStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyTribeStatsRecord_scoreAtt(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyTribeStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7229,7 +7230,7 @@ func (ec *executionContext) _DailyTribeStatsRecord_scoreAtt(ctx context.Context, return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyTribeStatsRecord_rankDef(ctx context.Context, field graphql.CollectedField, obj *models.DailyTribeStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyTribeStatsRecord_rankDef(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyTribeStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7264,7 +7265,7 @@ func (ec *executionContext) _DailyTribeStatsRecord_rankDef(ctx context.Context, return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyTribeStatsRecord_scoreDef(ctx context.Context, field graphql.CollectedField, obj *models.DailyTribeStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyTribeStatsRecord_scoreDef(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyTribeStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7299,7 +7300,7 @@ func (ec *executionContext) _DailyTribeStatsRecord_scoreDef(ctx context.Context, return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyTribeStatsRecord_rankTotal(ctx context.Context, field graphql.CollectedField, obj *models.DailyTribeStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyTribeStatsRecord_rankTotal(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyTribeStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7334,7 +7335,7 @@ func (ec *executionContext) _DailyTribeStatsRecord_rankTotal(ctx context.Context return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyTribeStatsRecord_scoreTotal(ctx context.Context, field graphql.CollectedField, obj *models.DailyTribeStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyTribeStatsRecord_scoreTotal(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyTribeStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7369,7 +7370,7 @@ func (ec *executionContext) _DailyTribeStatsRecord_scoreTotal(ctx context.Contex return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _DailyTribeStatsRecord_dominance(ctx context.Context, field graphql.CollectedField, obj *models.DailyTribeStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyTribeStatsRecord_dominance(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyTribeStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7404,7 +7405,7 @@ func (ec *executionContext) _DailyTribeStatsRecord_dominance(ctx context.Context return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _DailyTribeStatsRecord_createDate(ctx context.Context, field graphql.CollectedField, obj *models.DailyTribeStats) (ret graphql.Marshaler) { +func (ec *executionContext) _DailyTribeStatsRecord_createDate(ctx context.Context, field graphql.CollectedField, obj *twmodel.DailyTribeStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7439,7 +7440,7 @@ func (ec *executionContext) _DailyTribeStatsRecord_createDate(ctx context.Contex return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _Ennoblement_village(ctx context.Context, field graphql.CollectedField, obj *models.Ennoblement) (ret graphql.Marshaler) { +func (ec *executionContext) _Ennoblement_village(ctx context.Context, field graphql.CollectedField, obj *twmodel.Ennoblement) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7466,12 +7467,12 @@ func (ec *executionContext) _Ennoblement_village(ctx context.Context, field grap if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Village) + res := resTmp.(*twmodel.Village) fc.Result = res return ec.marshalOVillage2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVillage(ctx, field.Selections, res) } -func (ec *executionContext) _Ennoblement_newOwner(ctx context.Context, field graphql.CollectedField, obj *models.Ennoblement) (ret graphql.Marshaler) { +func (ec *executionContext) _Ennoblement_newOwner(ctx context.Context, field graphql.CollectedField, obj *twmodel.Ennoblement) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7498,12 +7499,12 @@ func (ec *executionContext) _Ennoblement_newOwner(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Player) + res := resTmp.(*twmodel.Player) fc.Result = res return ec.marshalOPlayer2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayer(ctx, field.Selections, res) } -func (ec *executionContext) _Ennoblement_newOwnerTribe(ctx context.Context, field graphql.CollectedField, obj *models.Ennoblement) (ret graphql.Marshaler) { +func (ec *executionContext) _Ennoblement_newOwnerTribe(ctx context.Context, field graphql.CollectedField, obj *twmodel.Ennoblement) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7530,12 +7531,12 @@ func (ec *executionContext) _Ennoblement_newOwnerTribe(ctx context.Context, fiel if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Tribe) + res := resTmp.(*twmodel.Tribe) fc.Result = res return ec.marshalOTribe2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribe(ctx, field.Selections, res) } -func (ec *executionContext) _Ennoblement_oldOwner(ctx context.Context, field graphql.CollectedField, obj *models.Ennoblement) (ret graphql.Marshaler) { +func (ec *executionContext) _Ennoblement_oldOwner(ctx context.Context, field graphql.CollectedField, obj *twmodel.Ennoblement) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7562,12 +7563,12 @@ func (ec *executionContext) _Ennoblement_oldOwner(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Player) + res := resTmp.(*twmodel.Player) fc.Result = res return ec.marshalOPlayer2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayer(ctx, field.Selections, res) } -func (ec *executionContext) _Ennoblement_oldOwnerTribe(ctx context.Context, field graphql.CollectedField, obj *models.Ennoblement) (ret graphql.Marshaler) { +func (ec *executionContext) _Ennoblement_oldOwnerTribe(ctx context.Context, field graphql.CollectedField, obj *twmodel.Ennoblement) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7594,12 +7595,12 @@ func (ec *executionContext) _Ennoblement_oldOwnerTribe(ctx context.Context, fiel if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Tribe) + res := resTmp.(*twmodel.Tribe) fc.Result = res return ec.marshalOTribe2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribe(ctx, field.Selections, res) } -func (ec *executionContext) _Ennoblement_ennobledAt(ctx context.Context, field graphql.CollectedField, obj *models.Ennoblement) (ret graphql.Marshaler) { +func (ec *executionContext) _Ennoblement_ennobledAt(ctx context.Context, field graphql.CollectedField, obj *twmodel.Ennoblement) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7661,7 +7662,7 @@ func (ec *executionContext) _EnnoblementList_items(ctx context.Context, field gr if resTmp == nil { return graphql.Null } - res := resTmp.([]*models.Ennoblement) + res := resTmp.([]*twmodel.Ennoblement) fc.Result = res return ec.marshalOEnnoblement2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐEnnoblementᚄ(ctx, field.Selections, res) } @@ -7701,7 +7702,7 @@ func (ec *executionContext) _EnnoblementList_total(ctx context.Context, field gr return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _FoundPlayer_server(ctx context.Context, field graphql.CollectedField, obj *models.FoundPlayer) (ret graphql.Marshaler) { +func (ec *executionContext) _FoundPlayer_server(ctx context.Context, field graphql.CollectedField, obj *twmodel.FoundPlayer) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7736,7 +7737,7 @@ func (ec *executionContext) _FoundPlayer_server(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _FoundPlayer_id(ctx context.Context, field graphql.CollectedField, obj *models.FoundPlayer) (ret graphql.Marshaler) { +func (ec *executionContext) _FoundPlayer_id(ctx context.Context, field graphql.CollectedField, obj *twmodel.FoundPlayer) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7771,7 +7772,7 @@ func (ec *executionContext) _FoundPlayer_id(ctx context.Context, field graphql.C return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _FoundPlayer_name(ctx context.Context, field graphql.CollectedField, obj *models.FoundPlayer) (ret graphql.Marshaler) { +func (ec *executionContext) _FoundPlayer_name(ctx context.Context, field graphql.CollectedField, obj *twmodel.FoundPlayer) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7806,7 +7807,7 @@ func (ec *executionContext) _FoundPlayer_name(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _FoundPlayer_bestRank(ctx context.Context, field graphql.CollectedField, obj *models.FoundPlayer) (ret graphql.Marshaler) { +func (ec *executionContext) _FoundPlayer_bestRank(ctx context.Context, field graphql.CollectedField, obj *twmodel.FoundPlayer) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7841,7 +7842,7 @@ func (ec *executionContext) _FoundPlayer_bestRank(ctx context.Context, field gra return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _FoundPlayer_mostPoints(ctx context.Context, field graphql.CollectedField, obj *models.FoundPlayer) (ret graphql.Marshaler) { +func (ec *executionContext) _FoundPlayer_mostPoints(ctx context.Context, field graphql.CollectedField, obj *twmodel.FoundPlayer) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7876,7 +7877,7 @@ func (ec *executionContext) _FoundPlayer_mostPoints(ctx context.Context, field g return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _FoundPlayer_mostVillages(ctx context.Context, field graphql.CollectedField, obj *models.FoundPlayer) (ret graphql.Marshaler) { +func (ec *executionContext) _FoundPlayer_mostVillages(ctx context.Context, field graphql.CollectedField, obj *twmodel.FoundPlayer) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7911,7 +7912,7 @@ func (ec *executionContext) _FoundPlayer_mostVillages(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _FoundPlayer_tribeID(ctx context.Context, field graphql.CollectedField, obj *models.FoundPlayer) (ret graphql.Marshaler) { +func (ec *executionContext) _FoundPlayer_tribeID(ctx context.Context, field graphql.CollectedField, obj *twmodel.FoundPlayer) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7946,7 +7947,7 @@ func (ec *executionContext) _FoundPlayer_tribeID(ctx context.Context, field grap return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _FoundPlayer_tribeTag(ctx context.Context, field graphql.CollectedField, obj *models.FoundPlayer) (ret graphql.Marshaler) { +func (ec *executionContext) _FoundPlayer_tribeTag(ctx context.Context, field graphql.CollectedField, obj *twmodel.FoundPlayer) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8008,7 +8009,7 @@ func (ec *executionContext) _FoundPlayerList_items(ctx context.Context, field gr if resTmp == nil { return graphql.Null } - res := resTmp.([]*models.FoundPlayer) + res := resTmp.([]*twmodel.FoundPlayer) fc.Result = res return ec.marshalOFoundPlayer2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐFoundPlayerᚄ(ctx, field.Selections, res) } @@ -8048,7 +8049,7 @@ func (ec *executionContext) _FoundPlayerList_total(ctx context.Context, field gr return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _FoundTribe_server(ctx context.Context, field graphql.CollectedField, obj *models.FoundTribe) (ret graphql.Marshaler) { +func (ec *executionContext) _FoundTribe_server(ctx context.Context, field graphql.CollectedField, obj *twmodel.FoundTribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8083,7 +8084,7 @@ func (ec *executionContext) _FoundTribe_server(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _FoundTribe_id(ctx context.Context, field graphql.CollectedField, obj *models.FoundTribe) (ret graphql.Marshaler) { +func (ec *executionContext) _FoundTribe_id(ctx context.Context, field graphql.CollectedField, obj *twmodel.FoundTribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8118,7 +8119,7 @@ func (ec *executionContext) _FoundTribe_id(ctx context.Context, field graphql.Co return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _FoundTribe_tag(ctx context.Context, field graphql.CollectedField, obj *models.FoundTribe) (ret graphql.Marshaler) { +func (ec *executionContext) _FoundTribe_tag(ctx context.Context, field graphql.CollectedField, obj *twmodel.FoundTribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8153,7 +8154,7 @@ func (ec *executionContext) _FoundTribe_tag(ctx context.Context, field graphql.C return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _FoundTribe_name(ctx context.Context, field graphql.CollectedField, obj *models.FoundTribe) (ret graphql.Marshaler) { +func (ec *executionContext) _FoundTribe_name(ctx context.Context, field graphql.CollectedField, obj *twmodel.FoundTribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8188,7 +8189,7 @@ func (ec *executionContext) _FoundTribe_name(ctx context.Context, field graphql. return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _FoundTribe_bestRank(ctx context.Context, field graphql.CollectedField, obj *models.FoundTribe) (ret graphql.Marshaler) { +func (ec *executionContext) _FoundTribe_bestRank(ctx context.Context, field graphql.CollectedField, obj *twmodel.FoundTribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8223,7 +8224,7 @@ func (ec *executionContext) _FoundTribe_bestRank(ctx context.Context, field grap return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _FoundTribe_mostPoints(ctx context.Context, field graphql.CollectedField, obj *models.FoundTribe) (ret graphql.Marshaler) { +func (ec *executionContext) _FoundTribe_mostPoints(ctx context.Context, field graphql.CollectedField, obj *twmodel.FoundTribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8258,7 +8259,7 @@ func (ec *executionContext) _FoundTribe_mostPoints(ctx context.Context, field gr return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _FoundTribe_mostVillages(ctx context.Context, field graphql.CollectedField, obj *models.FoundTribe) (ret graphql.Marshaler) { +func (ec *executionContext) _FoundTribe_mostVillages(ctx context.Context, field graphql.CollectedField, obj *twmodel.FoundTribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8320,7 +8321,7 @@ func (ec *executionContext) _FoundTribeList_items(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.([]*models.FoundTribe) + res := resTmp.([]*twmodel.FoundTribe) fc.Result = res return ec.marshalOFoundTribe2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐFoundTribeᚄ(ctx, field.Selections, res) } @@ -8360,7 +8361,7 @@ func (ec *executionContext) _FoundTribeList_total(ctx context.Context, field gra return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Player_id(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_id(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8395,7 +8396,7 @@ func (ec *executionContext) _Player_id(ctx context.Context, field graphql.Collec return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Player_name(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_name(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8430,7 +8431,7 @@ func (ec *executionContext) _Player_name(ctx context.Context, field graphql.Coll return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Player_totalVillages(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_totalVillages(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8465,7 +8466,7 @@ func (ec *executionContext) _Player_totalVillages(ctx context.Context, field gra return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Player_points(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_points(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8500,7 +8501,7 @@ func (ec *executionContext) _Player_points(ctx context.Context, field graphql.Co return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Player_rank(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_rank(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8535,7 +8536,7 @@ func (ec *executionContext) _Player_rank(ctx context.Context, field graphql.Coll return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Player_exists(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_exists(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8570,7 +8571,7 @@ func (ec *executionContext) _Player_exists(ctx context.Context, field graphql.Co return ec.marshalNBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) _Player_rankAtt(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_rankAtt(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8605,7 +8606,7 @@ func (ec *executionContext) _Player_rankAtt(ctx context.Context, field graphql.C return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Player_scoreAtt(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_scoreAtt(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8640,7 +8641,7 @@ func (ec *executionContext) _Player_scoreAtt(ctx context.Context, field graphql. return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Player_rankDef(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_rankDef(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8675,7 +8676,7 @@ func (ec *executionContext) _Player_rankDef(ctx context.Context, field graphql.C return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Player_scoreDef(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_scoreDef(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8710,7 +8711,7 @@ func (ec *executionContext) _Player_scoreDef(ctx context.Context, field graphql. return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Player_rankSup(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_rankSup(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8745,7 +8746,7 @@ func (ec *executionContext) _Player_rankSup(ctx context.Context, field graphql.C return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Player_scoreSup(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_scoreSup(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8780,7 +8781,7 @@ func (ec *executionContext) _Player_scoreSup(ctx context.Context, field graphql. return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Player_rankTotal(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_rankTotal(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8815,7 +8816,7 @@ func (ec *executionContext) _Player_rankTotal(ctx context.Context, field graphql return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Player_scoreTotal(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_scoreTotal(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8850,7 +8851,7 @@ func (ec *executionContext) _Player_scoreTotal(ctx context.Context, field graphq return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Player_dailyGrowth(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_dailyGrowth(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8885,7 +8886,7 @@ func (ec *executionContext) _Player_dailyGrowth(ctx context.Context, field graph return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Player_bestRank(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_bestRank(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8920,7 +8921,7 @@ func (ec *executionContext) _Player_bestRank(ctx context.Context, field graphql. return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Player_bestRankAt(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_bestRankAt(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8955,7 +8956,7 @@ func (ec *executionContext) _Player_bestRankAt(ctx context.Context, field graphq return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _Player_mostPoints(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_mostPoints(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8990,7 +8991,7 @@ func (ec *executionContext) _Player_mostPoints(ctx context.Context, field graphq return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Player_mostPointsAt(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_mostPointsAt(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9025,7 +9026,7 @@ func (ec *executionContext) _Player_mostPointsAt(ctx context.Context, field grap return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _Player_mostVillages(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_mostVillages(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9060,7 +9061,7 @@ func (ec *executionContext) _Player_mostVillages(ctx context.Context, field grap return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Player_mostVillagesAt(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_mostVillagesAt(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9095,7 +9096,7 @@ func (ec *executionContext) _Player_mostVillagesAt(ctx context.Context, field gr return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _Player_joinedAt(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_joinedAt(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9130,7 +9131,7 @@ func (ec *executionContext) _Player_joinedAt(ctx context.Context, field graphql. return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _Player_lastActivityAt(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_lastActivityAt(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9165,7 +9166,7 @@ func (ec *executionContext) _Player_lastActivityAt(ctx context.Context, field gr return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _Player_deletedAt(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_deletedAt(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9197,7 +9198,7 @@ func (ec *executionContext) _Player_deletedAt(ctx context.Context, field graphql return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _Player_tribe(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_tribe(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9224,12 +9225,12 @@ func (ec *executionContext) _Player_tribe(ctx context.Context, field graphql.Col if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Tribe) + res := resTmp.(*twmodel.Tribe) fc.Result = res return ec.marshalOTribe2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribe(ctx, field.Selections, res) } -func (ec *executionContext) _Player_servers(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_servers(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9264,7 +9265,7 @@ func (ec *executionContext) _Player_servers(ctx context.Context, field graphql.C return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) _Player_nameChanges(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) { +func (ec *executionContext) _Player_nameChanges(ctx context.Context, field graphql.CollectedField, obj *twmodel.Player) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9294,7 +9295,7 @@ func (ec *executionContext) _Player_nameChanges(ctx context.Context, field graph } return graphql.Null } - res := resTmp.([]*models.PlayerNameChange) + res := resTmp.([]*twmodel.PlayerNameChange) fc.Result = res return ec.marshalNPlayerNameChange2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayerNameChangeᚄ(ctx, field.Selections, res) } @@ -9361,12 +9362,12 @@ func (ec *executionContext) _PlayerHistory_items(ctx context.Context, field grap if resTmp == nil { return graphql.Null } - res := resTmp.([]*models.PlayerHistory) + res := resTmp.([]*twmodel.PlayerHistory) fc.Result = res return ec.marshalOPlayerHistoryRecord2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayerHistoryᚄ(ctx, field.Selections, res) } -func (ec *executionContext) _PlayerHistoryRecord_player(ctx context.Context, field graphql.CollectedField, obj *models.PlayerHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _PlayerHistoryRecord_player(ctx context.Context, field graphql.CollectedField, obj *twmodel.PlayerHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9393,12 +9394,12 @@ func (ec *executionContext) _PlayerHistoryRecord_player(ctx context.Context, fie if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Player) + res := resTmp.(*twmodel.Player) fc.Result = res return ec.marshalOPlayer2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayer(ctx, field.Selections, res) } -func (ec *executionContext) _PlayerHistoryRecord_totalVillages(ctx context.Context, field graphql.CollectedField, obj *models.PlayerHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _PlayerHistoryRecord_totalVillages(ctx context.Context, field graphql.CollectedField, obj *twmodel.PlayerHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9433,7 +9434,7 @@ func (ec *executionContext) _PlayerHistoryRecord_totalVillages(ctx context.Conte return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _PlayerHistoryRecord_points(ctx context.Context, field graphql.CollectedField, obj *models.PlayerHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _PlayerHistoryRecord_points(ctx context.Context, field graphql.CollectedField, obj *twmodel.PlayerHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9468,7 +9469,7 @@ func (ec *executionContext) _PlayerHistoryRecord_points(ctx context.Context, fie return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _PlayerHistoryRecord_rank(ctx context.Context, field graphql.CollectedField, obj *models.PlayerHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _PlayerHistoryRecord_rank(ctx context.Context, field graphql.CollectedField, obj *twmodel.PlayerHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9503,7 +9504,7 @@ func (ec *executionContext) _PlayerHistoryRecord_rank(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _PlayerHistoryRecord_rankAtt(ctx context.Context, field graphql.CollectedField, obj *models.PlayerHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _PlayerHistoryRecord_rankAtt(ctx context.Context, field graphql.CollectedField, obj *twmodel.PlayerHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9538,7 +9539,7 @@ func (ec *executionContext) _PlayerHistoryRecord_rankAtt(ctx context.Context, fi return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _PlayerHistoryRecord_scoreAtt(ctx context.Context, field graphql.CollectedField, obj *models.PlayerHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _PlayerHistoryRecord_scoreAtt(ctx context.Context, field graphql.CollectedField, obj *twmodel.PlayerHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9573,7 +9574,7 @@ func (ec *executionContext) _PlayerHistoryRecord_scoreAtt(ctx context.Context, f return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _PlayerHistoryRecord_rankDef(ctx context.Context, field graphql.CollectedField, obj *models.PlayerHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _PlayerHistoryRecord_rankDef(ctx context.Context, field graphql.CollectedField, obj *twmodel.PlayerHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9608,7 +9609,7 @@ func (ec *executionContext) _PlayerHistoryRecord_rankDef(ctx context.Context, fi return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _PlayerHistoryRecord_scoreDef(ctx context.Context, field graphql.CollectedField, obj *models.PlayerHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _PlayerHistoryRecord_scoreDef(ctx context.Context, field graphql.CollectedField, obj *twmodel.PlayerHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9643,7 +9644,7 @@ func (ec *executionContext) _PlayerHistoryRecord_scoreDef(ctx context.Context, f return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _PlayerHistoryRecord_rankSup(ctx context.Context, field graphql.CollectedField, obj *models.PlayerHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _PlayerHistoryRecord_rankSup(ctx context.Context, field graphql.CollectedField, obj *twmodel.PlayerHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9678,7 +9679,7 @@ func (ec *executionContext) _PlayerHistoryRecord_rankSup(ctx context.Context, fi return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _PlayerHistoryRecord_scoreSup(ctx context.Context, field graphql.CollectedField, obj *models.PlayerHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _PlayerHistoryRecord_scoreSup(ctx context.Context, field graphql.CollectedField, obj *twmodel.PlayerHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9713,7 +9714,7 @@ func (ec *executionContext) _PlayerHistoryRecord_scoreSup(ctx context.Context, f return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _PlayerHistoryRecord_rankTotal(ctx context.Context, field graphql.CollectedField, obj *models.PlayerHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _PlayerHistoryRecord_rankTotal(ctx context.Context, field graphql.CollectedField, obj *twmodel.PlayerHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9748,7 +9749,7 @@ func (ec *executionContext) _PlayerHistoryRecord_rankTotal(ctx context.Context, return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _PlayerHistoryRecord_scoreTotal(ctx context.Context, field graphql.CollectedField, obj *models.PlayerHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _PlayerHistoryRecord_scoreTotal(ctx context.Context, field graphql.CollectedField, obj *twmodel.PlayerHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9783,7 +9784,7 @@ func (ec *executionContext) _PlayerHistoryRecord_scoreTotal(ctx context.Context, return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _PlayerHistoryRecord_tribe(ctx context.Context, field graphql.CollectedField, obj *models.PlayerHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _PlayerHistoryRecord_tribe(ctx context.Context, field graphql.CollectedField, obj *twmodel.PlayerHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9810,12 +9811,12 @@ func (ec *executionContext) _PlayerHistoryRecord_tribe(ctx context.Context, fiel if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Tribe) + res := resTmp.(*twmodel.Tribe) fc.Result = res return ec.marshalOTribe2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribe(ctx, field.Selections, res) } -func (ec *executionContext) _PlayerHistoryRecord_createDate(ctx context.Context, field graphql.CollectedField, obj *models.PlayerHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _PlayerHistoryRecord_createDate(ctx context.Context, field graphql.CollectedField, obj *twmodel.PlayerHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9877,7 +9878,7 @@ func (ec *executionContext) _PlayerList_items(ctx context.Context, field graphql if resTmp == nil { return graphql.Null } - res := resTmp.([]*models.Player) + res := resTmp.([]*twmodel.Player) fc.Result = res return ec.marshalOPlayer2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayerᚄ(ctx, field.Selections, res) } @@ -9917,7 +9918,7 @@ func (ec *executionContext) _PlayerList_total(ctx context.Context, field graphql return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _PlayerNameChange_oldName(ctx context.Context, field graphql.CollectedField, obj *models.PlayerNameChange) (ret graphql.Marshaler) { +func (ec *executionContext) _PlayerNameChange_oldName(ctx context.Context, field graphql.CollectedField, obj *twmodel.PlayerNameChange) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9952,7 +9953,7 @@ func (ec *executionContext) _PlayerNameChange_oldName(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _PlayerNameChange_newName(ctx context.Context, field graphql.CollectedField, obj *models.PlayerNameChange) (ret graphql.Marshaler) { +func (ec *executionContext) _PlayerNameChange_newName(ctx context.Context, field graphql.CollectedField, obj *twmodel.PlayerNameChange) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9987,7 +9988,7 @@ func (ec *executionContext) _PlayerNameChange_newName(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _PlayerNameChange_changeDate(ctx context.Context, field graphql.CollectedField, obj *models.PlayerNameChange) (ret graphql.Marshaler) { +func (ec *executionContext) _PlayerNameChange_changeDate(ctx context.Context, field graphql.CollectedField, obj *twmodel.PlayerNameChange) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -10047,7 +10048,7 @@ func (ec *executionContext) _Query_dailyPlayerStats(ctx context.Context, field g fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().DailyPlayerStats(rctx, args["server"].(string), args["filter"].(*models.DailyPlayerStatsFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) + return ec.resolvers.Query().DailyPlayerStats(rctx, args["server"].(string), args["filter"].(*twmodel.DailyPlayerStatsFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) }) if err != nil { ec.Error(ctx, err) @@ -10089,7 +10090,7 @@ func (ec *executionContext) _Query_dailyTribeStats(ctx context.Context, field gr fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().DailyTribeStats(rctx, args["server"].(string), args["filter"].(*models.DailyTribeStatsFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) + return ec.resolvers.Query().DailyTribeStats(rctx, args["server"].(string), args["filter"].(*twmodel.DailyTribeStatsFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) }) if err != nil { ec.Error(ctx, err) @@ -10131,7 +10132,7 @@ func (ec *executionContext) _Query_ennoblements(ctx context.Context, field graph fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Ennoblements(rctx, args["server"].(string), args["filter"].(*models.EnnoblementFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) + return ec.resolvers.Query().Ennoblements(rctx, args["server"].(string), args["filter"].(*twmodel.EnnoblementFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) }) if err != nil { ec.Error(ctx, err) @@ -10173,7 +10174,7 @@ func (ec *executionContext) _Query_players(ctx context.Context, field graphql.Co fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Players(rctx, args["server"].(string), args["filter"].(*models.PlayerFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) + return ec.resolvers.Query().Players(rctx, args["server"].(string), args["filter"].(*twmodel.PlayerFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) }) if err != nil { ec.Error(ctx, err) @@ -10224,7 +10225,7 @@ func (ec *executionContext) _Query_player(ctx context.Context, field graphql.Col if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Player) + res := resTmp.(*twmodel.Player) fc.Result = res return ec.marshalOPlayer2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayer(ctx, field.Selections, res) } @@ -10296,7 +10297,7 @@ func (ec *executionContext) _Query_playerHistory(ctx context.Context, field grap fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().PlayerHistory(rctx, args["server"].(string), args["filter"].(*models.PlayerHistoryFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) + return ec.resolvers.Query().PlayerHistory(rctx, args["server"].(string), args["filter"].(*twmodel.PlayerHistoryFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) }) if err != nil { ec.Error(ctx, err) @@ -10338,7 +10339,7 @@ func (ec *executionContext) _Query_servers(ctx context.Context, field graphql.Co fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Servers(rctx, args["filter"].(*models.ServerFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) + return ec.resolvers.Query().Servers(rctx, args["filter"].(*twmodel.ServerFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) }) if err != nil { ec.Error(ctx, err) @@ -10389,7 +10390,7 @@ func (ec *executionContext) _Query_server(ctx context.Context, field graphql.Col if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Server) + res := resTmp.(*twmodel.Server) fc.Result = res return ec.marshalOServer2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServer(ctx, field.Selections, res) } @@ -10419,7 +10420,7 @@ func (ec *executionContext) _Query_serverStats(ctx context.Context, field graphq fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ServerStats(rctx, args["server"].(string), args["filter"].(*models.ServerStatsFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) + return ec.resolvers.Query().ServerStats(rctx, args["server"].(string), args["filter"].(*twmodel.ServerStatsFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) }) if err != nil { ec.Error(ctx, err) @@ -10461,7 +10462,7 @@ func (ec *executionContext) _Query_tribes(ctx context.Context, field graphql.Col fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Tribes(rctx, args["server"].(string), args["filter"].(*models.TribeFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) + return ec.resolvers.Query().Tribes(rctx, args["server"].(string), args["filter"].(*twmodel.TribeFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) }) if err != nil { ec.Error(ctx, err) @@ -10512,7 +10513,7 @@ func (ec *executionContext) _Query_tribe(ctx context.Context, field graphql.Coll if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Tribe) + res := resTmp.(*twmodel.Tribe) fc.Result = res return ec.marshalOTribe2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribe(ctx, field.Selections, res) } @@ -10584,7 +10585,7 @@ func (ec *executionContext) _Query_tribeChanges(ctx context.Context, field graph fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().TribeChanges(rctx, args["server"].(string), args["filter"].(*models.TribeChangeFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) + return ec.resolvers.Query().TribeChanges(rctx, args["server"].(string), args["filter"].(*twmodel.TribeChangeFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) }) if err != nil { ec.Error(ctx, err) @@ -10626,7 +10627,7 @@ func (ec *executionContext) _Query_tribeHistory(ctx context.Context, field graph fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().TribeHistory(rctx, args["server"].(string), args["filter"].(*models.TribeHistoryFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) + return ec.resolvers.Query().TribeHistory(rctx, args["server"].(string), args["filter"].(*twmodel.TribeHistoryFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) }) if err != nil { ec.Error(ctx, err) @@ -10668,7 +10669,7 @@ func (ec *executionContext) _Query_versions(ctx context.Context, field graphql.C fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Versions(rctx, args["filter"].(*models.VersionFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) + return ec.resolvers.Query().Versions(rctx, args["filter"].(*twmodel.VersionFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) }) if err != nil { ec.Error(ctx, err) @@ -10710,7 +10711,7 @@ func (ec *executionContext) _Query_version(ctx context.Context, field graphql.Co fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Version(rctx, args["code"].(models.VersionCode)) + return ec.resolvers.Query().Version(rctx, args["code"].(twmodel.VersionCode)) }) if err != nil { ec.Error(ctx, err) @@ -10719,7 +10720,7 @@ func (ec *executionContext) _Query_version(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Version) + res := resTmp.(*twmodel.Version) fc.Result = res return ec.marshalOVersion2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersion(ctx, field.Selections, res) } @@ -10749,7 +10750,7 @@ func (ec *executionContext) _Query_villages(ctx context.Context, field graphql.C fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Villages(rctx, args["server"].(string), args["filter"].(*models.VillageFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) + return ec.resolvers.Query().Villages(rctx, args["server"].(string), args["filter"].(*twmodel.VillageFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)) }) if err != nil { ec.Error(ctx, err) @@ -10800,7 +10801,7 @@ func (ec *executionContext) _Query_village(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Village) + res := resTmp.(*twmodel.Village) fc.Result = res return ec.marshalOVillage2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVillage(ctx, field.Selections, res) } @@ -10876,7 +10877,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) } -func (ec *executionContext) _Server_key(ctx context.Context, field graphql.CollectedField, obj *models.Server) (ret graphql.Marshaler) { +func (ec *executionContext) _Server_key(ctx context.Context, field graphql.CollectedField, obj *twmodel.Server) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -10911,7 +10912,7 @@ func (ec *executionContext) _Server_key(ctx context.Context, field graphql.Colle return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Server_status(ctx context.Context, field graphql.CollectedField, obj *models.Server) (ret graphql.Marshaler) { +func (ec *executionContext) _Server_status(ctx context.Context, field graphql.CollectedField, obj *twmodel.Server) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -10941,12 +10942,12 @@ func (ec *executionContext) _Server_status(ctx context.Context, field graphql.Co } return graphql.Null } - res := resTmp.(models.ServerStatus) + res := resTmp.(twmodel.ServerStatus) fc.Result = res return ec.marshalNServerStatus2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerStatus(ctx, field.Selections, res) } -func (ec *executionContext) _Server_numberOfPlayers(ctx context.Context, field graphql.CollectedField, obj *models.Server) (ret graphql.Marshaler) { +func (ec *executionContext) _Server_numberOfPlayers(ctx context.Context, field graphql.CollectedField, obj *twmodel.Server) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -10981,7 +10982,7 @@ func (ec *executionContext) _Server_numberOfPlayers(ctx context.Context, field g return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Server_numberOfTribes(ctx context.Context, field graphql.CollectedField, obj *models.Server) (ret graphql.Marshaler) { +func (ec *executionContext) _Server_numberOfTribes(ctx context.Context, field graphql.CollectedField, obj *twmodel.Server) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11016,7 +11017,7 @@ func (ec *executionContext) _Server_numberOfTribes(ctx context.Context, field gr return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Server_numberOfVillages(ctx context.Context, field graphql.CollectedField, obj *models.Server) (ret graphql.Marshaler) { +func (ec *executionContext) _Server_numberOfVillages(ctx context.Context, field graphql.CollectedField, obj *twmodel.Server) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11051,7 +11052,7 @@ func (ec *executionContext) _Server_numberOfVillages(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Server_version(ctx context.Context, field graphql.CollectedField, obj *models.Server) (ret graphql.Marshaler) { +func (ec *executionContext) _Server_version(ctx context.Context, field graphql.CollectedField, obj *twmodel.Server) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11078,12 +11079,12 @@ func (ec *executionContext) _Server_version(ctx context.Context, field graphql.C if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Version) + res := resTmp.(*twmodel.Version) fc.Result = res return ec.marshalOVersion2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersion(ctx, field.Selections, res) } -func (ec *executionContext) _Server_config(ctx context.Context, field graphql.CollectedField, obj *models.Server) (ret graphql.Marshaler) { +func (ec *executionContext) _Server_config(ctx context.Context, field graphql.CollectedField, obj *twmodel.Server) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11113,12 +11114,12 @@ func (ec *executionContext) _Server_config(ctx context.Context, field graphql.Co } return graphql.Null } - res := resTmp.(models.ServerConfig) + res := resTmp.(twmodel.ServerConfig) fc.Result = res return ec.marshalNServerConfig2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfig(ctx, field.Selections, res) } -func (ec *executionContext) _Server_unitConfig(ctx context.Context, field graphql.CollectedField, obj *models.Server) (ret graphql.Marshaler) { +func (ec *executionContext) _Server_unitConfig(ctx context.Context, field graphql.CollectedField, obj *twmodel.Server) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11148,12 +11149,12 @@ func (ec *executionContext) _Server_unitConfig(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(models.UnitConfig) + res := resTmp.(twmodel.UnitConfig) fc.Result = res return ec.marshalNUnitConfig2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐUnitConfig(ctx, field.Selections, res) } -func (ec *executionContext) _Server_buildingConfig(ctx context.Context, field graphql.CollectedField, obj *models.Server) (ret graphql.Marshaler) { +func (ec *executionContext) _Server_buildingConfig(ctx context.Context, field graphql.CollectedField, obj *twmodel.Server) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11183,12 +11184,12 @@ func (ec *executionContext) _Server_buildingConfig(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(models.BuildingConfig) + res := resTmp.(twmodel.BuildingConfig) fc.Result = res return ec.marshalNBuildingConfig2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuildingConfig(ctx, field.Selections, res) } -func (ec *executionContext) _Server_dataUpdatedAt(ctx context.Context, field graphql.CollectedField, obj *models.Server) (ret graphql.Marshaler) { +func (ec *executionContext) _Server_dataUpdatedAt(ctx context.Context, field graphql.CollectedField, obj *twmodel.Server) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11223,7 +11224,7 @@ func (ec *executionContext) _Server_dataUpdatedAt(ctx context.Context, field gra return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _Server_historyUpdatedAt(ctx context.Context, field graphql.CollectedField, obj *models.Server) (ret graphql.Marshaler) { +func (ec *executionContext) _Server_historyUpdatedAt(ctx context.Context, field graphql.CollectedField, obj *twmodel.Server) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11258,7 +11259,7 @@ func (ec *executionContext) _Server_historyUpdatedAt(ctx context.Context, field return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _Server_statsUpdatedAt(ctx context.Context, field graphql.CollectedField, obj *models.Server) (ret graphql.Marshaler) { +func (ec *executionContext) _Server_statsUpdatedAt(ctx context.Context, field graphql.CollectedField, obj *twmodel.Server) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11293,7 +11294,7 @@ func (ec *executionContext) _Server_statsUpdatedAt(ctx context.Context, field gr return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfig_speed(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfig_speed(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11328,7 +11329,7 @@ func (ec *executionContext) _ServerConfig_speed(ctx context.Context, field graph return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfig_unitSpeed(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfig_unitSpeed(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11363,7 +11364,7 @@ func (ec *executionContext) _ServerConfig_unitSpeed(ctx context.Context, field g return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfig_moral(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfig_moral(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11398,7 +11399,7 @@ func (ec *executionContext) _ServerConfig_moral(ctx context.Context, field graph return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfig_build(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfig_build(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11428,12 +11429,12 @@ func (ec *executionContext) _ServerConfig_build(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(models.ServerConfigBuild) + res := resTmp.(twmodel.ServerConfigBuild) fc.Result = res return ec.marshalNServerConfigBuild2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigBuild(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfig_misc(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfig_misc(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11463,12 +11464,12 @@ func (ec *executionContext) _ServerConfig_misc(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(models.ServerConfigMisc) + res := resTmp.(twmodel.ServerConfigMisc) fc.Result = res return ec.marshalNServerConfigMisc2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigMisc(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfig_commands(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfig_commands(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11498,12 +11499,12 @@ func (ec *executionContext) _ServerConfig_commands(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(models.ServerConfigCommands) + res := resTmp.(twmodel.ServerConfigCommands) fc.Result = res return ec.marshalNServerConfigCommands2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigCommands(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfig_newbie(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfig_newbie(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11533,12 +11534,12 @@ func (ec *executionContext) _ServerConfig_newbie(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(models.ServerConfigNewbie) + res := resTmp.(twmodel.ServerConfigNewbie) fc.Result = res return ec.marshalNServerConfigNewbie2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigNewbie(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfig_game(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfig_game(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11568,12 +11569,12 @@ func (ec *executionContext) _ServerConfig_game(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(models.ServerConfigGame) + res := resTmp.(twmodel.ServerConfigGame) fc.Result = res return ec.marshalNServerConfigGame2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigGame(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfig_buildings(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfig_buildings(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11603,12 +11604,12 @@ func (ec *executionContext) _ServerConfig_buildings(ctx context.Context, field g } return graphql.Null } - res := resTmp.(models.ServerConfigBuildings) + res := resTmp.(twmodel.ServerConfigBuildings) fc.Result = res return ec.marshalNServerConfigBuildings2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigBuildings(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfig_snob(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfig_snob(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11638,12 +11639,12 @@ func (ec *executionContext) _ServerConfig_snob(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(models.ServerConfigSnob) + res := resTmp.(twmodel.ServerConfigSnob) fc.Result = res return ec.marshalNServerConfigSnob2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigSnob(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfig_ally(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfig_ally(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11673,12 +11674,12 @@ func (ec *executionContext) _ServerConfig_ally(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(models.ServerConfigAlly) + res := resTmp.(twmodel.ServerConfigAlly) fc.Result = res return ec.marshalNServerConfigAlly2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigAlly(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfig_coord(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfig_coord(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11708,12 +11709,12 @@ func (ec *executionContext) _ServerConfig_coord(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(models.ServerConfigCoord) + res := resTmp.(twmodel.ServerConfigCoord) fc.Result = res return ec.marshalNServerConfigCoord2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigCoord(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfig_sitter(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfig_sitter(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11743,12 +11744,12 @@ func (ec *executionContext) _ServerConfig_sitter(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(models.ServerConfigSitter) + res := resTmp.(twmodel.ServerConfigSitter) fc.Result = res return ec.marshalNServerConfigSitter2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigSitter(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfig_sleep(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfig_sleep(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11778,12 +11779,12 @@ func (ec *executionContext) _ServerConfig_sleep(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(models.ServerConfigSleep) + res := resTmp.(twmodel.ServerConfigSleep) fc.Result = res return ec.marshalNServerConfigSleep2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigSleep(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfig_night(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfig_night(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11813,12 +11814,12 @@ func (ec *executionContext) _ServerConfig_night(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(models.ServerConfigNight) + res := resTmp.(twmodel.ServerConfigNight) fc.Result = res return ec.marshalNServerConfigNight2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigNight(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfig_win(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfig_win(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11848,12 +11849,12 @@ func (ec *executionContext) _ServerConfig_win(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(models.ServerConfigWin) + res := resTmp.(twmodel.ServerConfigWin) fc.Result = res return ec.marshalNServerConfigWin2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigWin(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigAlly_noHarm(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigAlly) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigAlly_noHarm(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigAlly) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11888,7 +11889,7 @@ func (ec *executionContext) _ServerConfigAlly_noHarm(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigAlly_noOtherSupport(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigAlly) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigAlly_noOtherSupport(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigAlly) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11923,7 +11924,7 @@ func (ec *executionContext) _ServerConfigAlly_noOtherSupport(ctx context.Context return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigAlly_allytimeSupport(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigAlly) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigAlly_allytimeSupport(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigAlly) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11958,7 +11959,7 @@ func (ec *executionContext) _ServerConfigAlly_allytimeSupport(ctx context.Contex return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigAlly_noLeave(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigAlly) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigAlly_noLeave(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigAlly) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -11993,7 +11994,7 @@ func (ec *executionContext) _ServerConfigAlly_noLeave(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigAlly_noJoin(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigAlly) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigAlly_noJoin(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigAlly) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12028,7 +12029,7 @@ func (ec *executionContext) _ServerConfigAlly_noJoin(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigAlly_limit(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigAlly) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigAlly_limit(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigAlly) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12063,7 +12064,7 @@ func (ec *executionContext) _ServerConfigAlly_limit(ctx context.Context, field g return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigAlly_fixedAllies(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigAlly) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigAlly_fixedAllies(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigAlly) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12098,7 +12099,7 @@ func (ec *executionContext) _ServerConfigAlly_fixedAllies(ctx context.Context, f return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigAlly_pointsMemberCount(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigAlly) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigAlly_pointsMemberCount(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigAlly) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12133,7 +12134,7 @@ func (ec *executionContext) _ServerConfigAlly_pointsMemberCount(ctx context.Cont return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigAlly_warsMemberRequirement(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigAlly) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigAlly_warsMemberRequirement(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigAlly) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12168,7 +12169,7 @@ func (ec *executionContext) _ServerConfigAlly_warsMemberRequirement(ctx context. return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigAlly_warsPointsRequirement(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigAlly) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigAlly_warsPointsRequirement(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigAlly) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12203,7 +12204,7 @@ func (ec *executionContext) _ServerConfigAlly_warsPointsRequirement(ctx context. return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigAlly_warsAutoacceptDays(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigAlly) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigAlly_warsAutoacceptDays(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigAlly) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12238,7 +12239,7 @@ func (ec *executionContext) _ServerConfigAlly_warsAutoacceptDays(ctx context.Con return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigAlly_levels(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigAlly) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigAlly_levels(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigAlly) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12273,7 +12274,7 @@ func (ec *executionContext) _ServerConfigAlly_levels(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigAlly_xpRequirements(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigAlly) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigAlly_xpRequirements(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigAlly) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12308,7 +12309,7 @@ func (ec *executionContext) _ServerConfigAlly_xpRequirements(ctx context.Context return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigBuild_destroy(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigBuild) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigBuild_destroy(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigBuild) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12343,7 +12344,7 @@ func (ec *executionContext) _ServerConfigBuild_destroy(ctx context.Context, fiel return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigBuildings_customMain(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigBuildings) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigBuildings_customMain(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigBuildings) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12378,7 +12379,7 @@ func (ec *executionContext) _ServerConfigBuildings_customMain(ctx context.Contex return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigBuildings_customFarm(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigBuildings) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigBuildings_customFarm(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigBuildings) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12413,7 +12414,7 @@ func (ec *executionContext) _ServerConfigBuildings_customFarm(ctx context.Contex return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigBuildings_customStorage(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigBuildings) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigBuildings_customStorage(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigBuildings) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12448,7 +12449,7 @@ func (ec *executionContext) _ServerConfigBuildings_customStorage(ctx context.Con return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigBuildings_customPlace(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigBuildings) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigBuildings_customPlace(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigBuildings) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12483,7 +12484,7 @@ func (ec *executionContext) _ServerConfigBuildings_customPlace(ctx context.Conte return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigBuildings_customBarracks(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigBuildings) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigBuildings_customBarracks(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigBuildings) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12518,7 +12519,7 @@ func (ec *executionContext) _ServerConfigBuildings_customBarracks(ctx context.Co return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigBuildings_customChurch(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigBuildings) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigBuildings_customChurch(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigBuildings) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12553,7 +12554,7 @@ func (ec *executionContext) _ServerConfigBuildings_customChurch(ctx context.Cont return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigBuildings_customSmith(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigBuildings) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigBuildings_customSmith(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigBuildings) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12588,7 +12589,7 @@ func (ec *executionContext) _ServerConfigBuildings_customSmith(ctx context.Conte return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigBuildings_customWood(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigBuildings) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigBuildings_customWood(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigBuildings) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12623,7 +12624,7 @@ func (ec *executionContext) _ServerConfigBuildings_customWood(ctx context.Contex return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigBuildings_customStone(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigBuildings) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigBuildings_customStone(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigBuildings) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12658,7 +12659,7 @@ func (ec *executionContext) _ServerConfigBuildings_customStone(ctx context.Conte return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigBuildings_customIron(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigBuildings) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigBuildings_customIron(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigBuildings) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12693,7 +12694,7 @@ func (ec *executionContext) _ServerConfigBuildings_customIron(ctx context.Contex return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigBuildings_customMarket(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigBuildings) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigBuildings_customMarket(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigBuildings) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12728,7 +12729,7 @@ func (ec *executionContext) _ServerConfigBuildings_customMarket(ctx context.Cont return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigBuildings_customStable(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigBuildings) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigBuildings_customStable(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigBuildings) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12763,7 +12764,7 @@ func (ec *executionContext) _ServerConfigBuildings_customStable(ctx context.Cont return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigBuildings_customWall(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigBuildings) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigBuildings_customWall(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigBuildings) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12798,7 +12799,7 @@ func (ec *executionContext) _ServerConfigBuildings_customWall(ctx context.Contex return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigBuildings_customGarage(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigBuildings) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigBuildings_customGarage(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigBuildings) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12833,7 +12834,7 @@ func (ec *executionContext) _ServerConfigBuildings_customGarage(ctx context.Cont return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigBuildings_customHide(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigBuildings) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigBuildings_customHide(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigBuildings) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12868,7 +12869,7 @@ func (ec *executionContext) _ServerConfigBuildings_customHide(ctx context.Contex return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigBuildings_customSnob(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigBuildings) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigBuildings_customSnob(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigBuildings) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12903,7 +12904,7 @@ func (ec *executionContext) _ServerConfigBuildings_customSnob(ctx context.Contex return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigBuildings_customStatue(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigBuildings) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigBuildings_customStatue(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigBuildings) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12938,7 +12939,7 @@ func (ec *executionContext) _ServerConfigBuildings_customStatue(ctx context.Cont return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigBuildings_customWatchtower(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigBuildings) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigBuildings_customWatchtower(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigBuildings) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -12973,7 +12974,7 @@ func (ec *executionContext) _ServerConfigBuildings_customWatchtower(ctx context. return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigCommands_millisArrival(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigCommands) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigCommands_millisArrival(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigCommands) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13008,7 +13009,7 @@ func (ec *executionContext) _ServerConfigCommands_millisArrival(ctx context.Cont return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigCommands_commandCancelTime(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigCommands) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigCommands_commandCancelTime(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigCommands) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13043,7 +13044,7 @@ func (ec *executionContext) _ServerConfigCommands_commandCancelTime(ctx context. return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigCoord_mapSize(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigCoord) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigCoord_mapSize(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigCoord) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13078,7 +13079,7 @@ func (ec *executionContext) _ServerConfigCoord_mapSize(ctx context.Context, fiel return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigCoord_func(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigCoord) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigCoord_func(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigCoord) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13113,7 +13114,7 @@ func (ec *executionContext) _ServerConfigCoord_func(ctx context.Context, field g return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigCoord_emptyVillages(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigCoord) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigCoord_emptyVillages(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigCoord) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13148,7 +13149,7 @@ func (ec *executionContext) _ServerConfigCoord_emptyVillages(ctx context.Context return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigCoord_bonusVillages(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigCoord) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigCoord_bonusVillages(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigCoord) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13183,7 +13184,7 @@ func (ec *executionContext) _ServerConfigCoord_bonusVillages(ctx context.Context return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigCoord_bonusNew(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigCoord) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigCoord_bonusNew(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigCoord) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13218,7 +13219,7 @@ func (ec *executionContext) _ServerConfigCoord_bonusNew(ctx context.Context, fie return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigCoord_inner(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigCoord) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigCoord_inner(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigCoord) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13253,7 +13254,7 @@ func (ec *executionContext) _ServerConfigCoord_inner(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigCoord_selectStart(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigCoord) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigCoord_selectStart(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigCoord) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13288,7 +13289,7 @@ func (ec *executionContext) _ServerConfigCoord_selectStart(ctx context.Context, return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigCoord_villageMoveWait(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigCoord) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigCoord_villageMoveWait(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigCoord) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13323,7 +13324,7 @@ func (ec *executionContext) _ServerConfigCoord_villageMoveWait(ctx context.Conte return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigCoord_nobleRestart(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigCoord) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigCoord_nobleRestart(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigCoord) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13358,7 +13359,7 @@ func (ec *executionContext) _ServerConfigCoord_nobleRestart(ctx context.Context, return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigCoord_startVillages(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigCoord) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigCoord_startVillages(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigCoord) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13393,7 +13394,7 @@ func (ec *executionContext) _ServerConfigCoord_startVillages(ctx context.Context return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigGame_buildtimeFormula(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigGame) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigGame_buildtimeFormula(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigGame) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13428,7 +13429,7 @@ func (ec *executionContext) _ServerConfigGame_buildtimeFormula(ctx context.Conte return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigGame_knight(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigGame) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigGame_knight(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigGame) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13463,7 +13464,7 @@ func (ec *executionContext) _ServerConfigGame_knight(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigGame_knightNewItems(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigGame) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigGame_knightNewItems(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigGame) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13498,7 +13499,7 @@ func (ec *executionContext) _ServerConfigGame_knightNewItems(ctx context.Context return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigGame_archer(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigGame) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigGame_archer(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigGame) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13533,7 +13534,7 @@ func (ec *executionContext) _ServerConfigGame_archer(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigGame_tech(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigGame) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigGame_tech(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigGame) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13568,7 +13569,7 @@ func (ec *executionContext) _ServerConfigGame_tech(ctx context.Context, field gr return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigGame_farmLimit(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigGame) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigGame_farmLimit(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigGame) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13603,7 +13604,7 @@ func (ec *executionContext) _ServerConfigGame_farmLimit(ctx context.Context, fie return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigGame_church(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigGame) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigGame_church(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigGame) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13638,7 +13639,7 @@ func (ec *executionContext) _ServerConfigGame_church(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigGame_watchtower(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigGame) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigGame_watchtower(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigGame) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13673,7 +13674,7 @@ func (ec *executionContext) _ServerConfigGame_watchtower(ctx context.Context, fi return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigGame_stronghold(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigGame) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigGame_stronghold(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigGame) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13708,7 +13709,7 @@ func (ec *executionContext) _ServerConfigGame_stronghold(ctx context.Context, fi return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigGame_fakeLimit(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigGame) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigGame_fakeLimit(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigGame) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13743,7 +13744,7 @@ func (ec *executionContext) _ServerConfigGame_fakeLimit(ctx context.Context, fie return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigGame_barbarianRise(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigGame) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigGame_barbarianRise(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigGame) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13778,7 +13779,7 @@ func (ec *executionContext) _ServerConfigGame_barbarianRise(ctx context.Context, return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigGame_barbarianShrink(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigGame) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigGame_barbarianShrink(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigGame) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13813,7 +13814,7 @@ func (ec *executionContext) _ServerConfigGame_barbarianShrink(ctx context.Contex return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigGame_barbarianMaxPoints(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigGame) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigGame_barbarianMaxPoints(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigGame) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13848,7 +13849,7 @@ func (ec *executionContext) _ServerConfigGame_barbarianMaxPoints(ctx context.Con return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigGame_hauls(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigGame) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigGame_hauls(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigGame) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13883,7 +13884,7 @@ func (ec *executionContext) _ServerConfigGame_hauls(ctx context.Context, field g return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigGame_haulsBase(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigGame) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigGame_haulsBase(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigGame) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13918,7 +13919,7 @@ func (ec *executionContext) _ServerConfigGame_haulsBase(ctx context.Context, fie return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigGame_haulsMax(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigGame) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigGame_haulsMax(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigGame) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13953,7 +13954,7 @@ func (ec *executionContext) _ServerConfigGame_haulsMax(ctx context.Context, fiel return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigGame_baseProduction(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigGame) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigGame_baseProduction(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigGame) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -13988,7 +13989,7 @@ func (ec *executionContext) _ServerConfigGame_baseProduction(ctx context.Context return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigGame_event(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigGame) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigGame_event(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigGame) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14023,7 +14024,7 @@ func (ec *executionContext) _ServerConfigGame_event(ctx context.Context, field g return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigGame_suppressEvents(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigGame) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigGame_suppressEvents(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigGame) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14058,7 +14059,7 @@ func (ec *executionContext) _ServerConfigGame_suppressEvents(ctx context.Context return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigMisc_killRanking(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigMisc) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigMisc_killRanking(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigMisc) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14093,7 +14094,7 @@ func (ec *executionContext) _ServerConfigMisc_killRanking(ctx context.Context, f return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigMisc_tutorial(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigMisc) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigMisc_tutorial(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigMisc) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14128,7 +14129,7 @@ func (ec *executionContext) _ServerConfigMisc_tutorial(ctx context.Context, fiel return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigMisc_tradeCancelTime(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigMisc) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigMisc_tradeCancelTime(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigMisc) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14163,7 +14164,7 @@ func (ec *executionContext) _ServerConfigMisc_tradeCancelTime(ctx context.Contex return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigNewbie_days(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigNewbie) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigNewbie_days(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigNewbie) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14198,7 +14199,7 @@ func (ec *executionContext) _ServerConfigNewbie_days(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigNewbie_ratioDays(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigNewbie) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigNewbie_ratioDays(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigNewbie) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14233,7 +14234,7 @@ func (ec *executionContext) _ServerConfigNewbie_ratioDays(ctx context.Context, f return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigNewbie_ratio(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigNewbie) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigNewbie_ratio(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigNewbie) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14268,7 +14269,7 @@ func (ec *executionContext) _ServerConfigNewbie_ratio(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigNewbie_removeNewbieVillages(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigNewbie) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigNewbie_removeNewbieVillages(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigNewbie) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14303,7 +14304,7 @@ func (ec *executionContext) _ServerConfigNewbie_removeNewbieVillages(ctx context return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigNight_active(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigNight) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigNight_active(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigNight) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14338,7 +14339,7 @@ func (ec *executionContext) _ServerConfigNight_active(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigNight_startHour(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigNight) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigNight_startHour(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigNight) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14373,7 +14374,7 @@ func (ec *executionContext) _ServerConfigNight_startHour(ctx context.Context, fi return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigNight_endHour(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigNight) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigNight_endHour(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigNight) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14408,7 +14409,7 @@ func (ec *executionContext) _ServerConfigNight_endHour(ctx context.Context, fiel return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigNight_defFactor(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigNight) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigNight_defFactor(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigNight) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14443,7 +14444,7 @@ func (ec *executionContext) _ServerConfigNight_defFactor(ctx context.Context, fi return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigSitter_allow(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigSitter) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigSitter_allow(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigSitter) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14478,7 +14479,7 @@ func (ec *executionContext) _ServerConfigSitter_allow(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigSleep_active(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigSleep) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigSleep_active(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigSleep) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14513,7 +14514,7 @@ func (ec *executionContext) _ServerConfigSleep_active(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigSleep_delay(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigSleep) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigSleep_delay(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigSleep) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14548,7 +14549,7 @@ func (ec *executionContext) _ServerConfigSleep_delay(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigSleep_min(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigSleep) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigSleep_min(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigSleep) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14583,7 +14584,7 @@ func (ec *executionContext) _ServerConfigSleep_min(ctx context.Context, field gr return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigSleep_max(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigSleep) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigSleep_max(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigSleep) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14618,7 +14619,7 @@ func (ec *executionContext) _ServerConfigSleep_max(ctx context.Context, field gr return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigSleep_minAwake(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigSleep) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigSleep_minAwake(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigSleep) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14653,7 +14654,7 @@ func (ec *executionContext) _ServerConfigSleep_minAwake(ctx context.Context, fie return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigSleep_maxAwake(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigSleep) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigSleep_maxAwake(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigSleep) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14688,7 +14689,7 @@ func (ec *executionContext) _ServerConfigSleep_maxAwake(ctx context.Context, fie return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigSleep_warnTime(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigSleep) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigSleep_warnTime(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigSleep) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14723,7 +14724,7 @@ func (ec *executionContext) _ServerConfigSleep_warnTime(ctx context.Context, fie return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigSnob_gold(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigSnob) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigSnob_gold(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigSnob) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14758,7 +14759,7 @@ func (ec *executionContext) _ServerConfigSnob_gold(ctx context.Context, field gr return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigSnob_cheapRebuild(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigSnob) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigSnob_cheapRebuild(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigSnob) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14793,7 +14794,7 @@ func (ec *executionContext) _ServerConfigSnob_cheapRebuild(ctx context.Context, return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigSnob_rise(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigSnob) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigSnob_rise(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigSnob) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14828,7 +14829,7 @@ func (ec *executionContext) _ServerConfigSnob_rise(ctx context.Context, field gr return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigSnob_maxDist(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigSnob) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigSnob_maxDist(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigSnob) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14863,7 +14864,7 @@ func (ec *executionContext) _ServerConfigSnob_maxDist(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigSnob_factor(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigSnob) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigSnob_factor(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigSnob) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14898,7 +14899,7 @@ func (ec *executionContext) _ServerConfigSnob_factor(ctx context.Context, field return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigSnob_coinWood(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigSnob) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigSnob_coinWood(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigSnob) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14933,7 +14934,7 @@ func (ec *executionContext) _ServerConfigSnob_coinWood(ctx context.Context, fiel return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigSnob_coinStone(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigSnob) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigSnob_coinStone(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigSnob) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -14968,7 +14969,7 @@ func (ec *executionContext) _ServerConfigSnob_coinStone(ctx context.Context, fie return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigSnob_coinIron(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigSnob) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigSnob_coinIron(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigSnob) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15003,7 +15004,7 @@ func (ec *executionContext) _ServerConfigSnob_coinIron(ctx context.Context, fiel return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigSnob_noBarbConquer(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigSnob) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigSnob_noBarbConquer(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigSnob) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15038,7 +15039,7 @@ func (ec *executionContext) _ServerConfigSnob_noBarbConquer(ctx context.Context, return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) _ServerConfigWin_check(ctx context.Context, field graphql.CollectedField, obj *models.ServerConfigWin) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerConfigWin_check(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerConfigWin) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15100,7 +15101,7 @@ func (ec *executionContext) _ServerList_items(ctx context.Context, field graphql if resTmp == nil { return graphql.Null } - res := resTmp.([]*models.Server) + res := resTmp.([]*twmodel.Server) fc.Result = res return ec.marshalOServer2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerᚄ(ctx, field.Selections, res) } @@ -15167,7 +15168,7 @@ func (ec *executionContext) _ServerStats_items(ctx context.Context, field graphq if resTmp == nil { return graphql.Null } - res := resTmp.([]*models.ServerStats) + res := resTmp.([]*twmodel.ServerStats) fc.Result = res return ec.marshalOServerStatsRecord2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerStatsᚄ(ctx, field.Selections, res) } @@ -15207,7 +15208,7 @@ func (ec *executionContext) _ServerStats_total(ctx context.Context, field graphq return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerStatsRecord_activePlayers(ctx context.Context, field graphql.CollectedField, obj *models.ServerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerStatsRecord_activePlayers(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15242,7 +15243,7 @@ func (ec *executionContext) _ServerStatsRecord_activePlayers(ctx context.Context return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerStatsRecord_inactivePlayers(ctx context.Context, field graphql.CollectedField, obj *models.ServerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerStatsRecord_inactivePlayers(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15277,7 +15278,7 @@ func (ec *executionContext) _ServerStatsRecord_inactivePlayers(ctx context.Conte return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerStatsRecord_players(ctx context.Context, field graphql.CollectedField, obj *models.ServerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerStatsRecord_players(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15312,7 +15313,7 @@ func (ec *executionContext) _ServerStatsRecord_players(ctx context.Context, fiel return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerStatsRecord_activeTribes(ctx context.Context, field graphql.CollectedField, obj *models.ServerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerStatsRecord_activeTribes(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15347,7 +15348,7 @@ func (ec *executionContext) _ServerStatsRecord_activeTribes(ctx context.Context, return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerStatsRecord_inactiveTribes(ctx context.Context, field graphql.CollectedField, obj *models.ServerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerStatsRecord_inactiveTribes(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15382,7 +15383,7 @@ func (ec *executionContext) _ServerStatsRecord_inactiveTribes(ctx context.Contex return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerStatsRecord_tribes(ctx context.Context, field graphql.CollectedField, obj *models.ServerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerStatsRecord_tribes(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15417,7 +15418,7 @@ func (ec *executionContext) _ServerStatsRecord_tribes(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerStatsRecord_bonusVillages(ctx context.Context, field graphql.CollectedField, obj *models.ServerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerStatsRecord_bonusVillages(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15452,7 +15453,7 @@ func (ec *executionContext) _ServerStatsRecord_bonusVillages(ctx context.Context return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerStatsRecord_barbarianVillages(ctx context.Context, field graphql.CollectedField, obj *models.ServerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerStatsRecord_barbarianVillages(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15487,7 +15488,7 @@ func (ec *executionContext) _ServerStatsRecord_barbarianVillages(ctx context.Con return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerStatsRecord_playerVillages(ctx context.Context, field graphql.CollectedField, obj *models.ServerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerStatsRecord_playerVillages(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15522,7 +15523,7 @@ func (ec *executionContext) _ServerStatsRecord_playerVillages(ctx context.Contex return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerStatsRecord_villages(ctx context.Context, field graphql.CollectedField, obj *models.ServerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerStatsRecord_villages(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15557,7 +15558,7 @@ func (ec *executionContext) _ServerStatsRecord_villages(ctx context.Context, fie return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _ServerStatsRecord_createDate(ctx context.Context, field graphql.CollectedField, obj *models.ServerStats) (ret graphql.Marshaler) { +func (ec *executionContext) _ServerStatsRecord_createDate(ctx context.Context, field graphql.CollectedField, obj *twmodel.ServerStats) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15592,7 +15593,7 @@ func (ec *executionContext) _ServerStatsRecord_createDate(ctx context.Context, f return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_id(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_id(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15627,7 +15628,7 @@ func (ec *executionContext) _Tribe_id(ctx context.Context, field graphql.Collect return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_name(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_name(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15662,7 +15663,7 @@ func (ec *executionContext) _Tribe_name(ctx context.Context, field graphql.Colle return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_tag(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_tag(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15697,7 +15698,7 @@ func (ec *executionContext) _Tribe_tag(ctx context.Context, field graphql.Collec return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_totalMembers(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_totalMembers(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15732,7 +15733,7 @@ func (ec *executionContext) _Tribe_totalMembers(ctx context.Context, field graph return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_totalVillages(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_totalVillages(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15767,7 +15768,7 @@ func (ec *executionContext) _Tribe_totalVillages(ctx context.Context, field grap return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_points(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_points(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15802,7 +15803,7 @@ func (ec *executionContext) _Tribe_points(ctx context.Context, field graphql.Col return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_allPoints(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_allPoints(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15837,7 +15838,7 @@ func (ec *executionContext) _Tribe_allPoints(ctx context.Context, field graphql. return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_rank(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_rank(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15872,7 +15873,7 @@ func (ec *executionContext) _Tribe_rank(ctx context.Context, field graphql.Colle return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_exists(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_exists(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15907,7 +15908,7 @@ func (ec *executionContext) _Tribe_exists(ctx context.Context, field graphql.Col return ec.marshalNBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_rankAtt(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_rankAtt(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15942,7 +15943,7 @@ func (ec *executionContext) _Tribe_rankAtt(ctx context.Context, field graphql.Co return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_scoreAtt(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_scoreAtt(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -15977,7 +15978,7 @@ func (ec *executionContext) _Tribe_scoreAtt(ctx context.Context, field graphql.C return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_rankDef(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_rankDef(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16012,7 +16013,7 @@ func (ec *executionContext) _Tribe_rankDef(ctx context.Context, field graphql.Co return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_scoreDef(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_scoreDef(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16047,7 +16048,7 @@ func (ec *executionContext) _Tribe_scoreDef(ctx context.Context, field graphql.C return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_rankTotal(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_rankTotal(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16082,7 +16083,7 @@ func (ec *executionContext) _Tribe_rankTotal(ctx context.Context, field graphql. return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_scoreTotal(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_scoreTotal(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16117,7 +16118,7 @@ func (ec *executionContext) _Tribe_scoreTotal(ctx context.Context, field graphql return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_dominance(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_dominance(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16152,7 +16153,7 @@ func (ec *executionContext) _Tribe_dominance(ctx context.Context, field graphql. return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_bestRank(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_bestRank(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16187,7 +16188,7 @@ func (ec *executionContext) _Tribe_bestRank(ctx context.Context, field graphql.C return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_bestRankAt(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_bestRankAt(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16222,7 +16223,7 @@ func (ec *executionContext) _Tribe_bestRankAt(ctx context.Context, field graphql return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_mostPoints(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_mostPoints(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16257,7 +16258,7 @@ func (ec *executionContext) _Tribe_mostPoints(ctx context.Context, field graphql return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_mostPointsAt(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_mostPointsAt(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16292,7 +16293,7 @@ func (ec *executionContext) _Tribe_mostPointsAt(ctx context.Context, field graph return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_mostVillages(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_mostVillages(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16327,7 +16328,7 @@ func (ec *executionContext) _Tribe_mostVillages(ctx context.Context, field graph return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_mostVillagesAt(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_mostVillagesAt(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16362,7 +16363,7 @@ func (ec *executionContext) _Tribe_mostVillagesAt(ctx context.Context, field gra return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_createdAt(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_createdAt(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16397,7 +16398,7 @@ func (ec *executionContext) _Tribe_createdAt(ctx context.Context, field graphql. return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _Tribe_deletedAt(ctx context.Context, field graphql.CollectedField, obj *models.Tribe) (ret graphql.Marshaler) { +func (ec *executionContext) _Tribe_deletedAt(ctx context.Context, field graphql.CollectedField, obj *twmodel.Tribe) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16429,7 +16430,7 @@ func (ec *executionContext) _Tribe_deletedAt(ctx context.Context, field graphql. return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _TribeChangeRecord_player(ctx context.Context, field graphql.CollectedField, obj *models.TribeChange) (ret graphql.Marshaler) { +func (ec *executionContext) _TribeChangeRecord_player(ctx context.Context, field graphql.CollectedField, obj *twmodel.TribeChange) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16456,12 +16457,12 @@ func (ec *executionContext) _TribeChangeRecord_player(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Player) + res := resTmp.(*twmodel.Player) fc.Result = res return ec.marshalOPlayer2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayer(ctx, field.Selections, res) } -func (ec *executionContext) _TribeChangeRecord_oldTribe(ctx context.Context, field graphql.CollectedField, obj *models.TribeChange) (ret graphql.Marshaler) { +func (ec *executionContext) _TribeChangeRecord_oldTribe(ctx context.Context, field graphql.CollectedField, obj *twmodel.TribeChange) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16488,12 +16489,12 @@ func (ec *executionContext) _TribeChangeRecord_oldTribe(ctx context.Context, fie if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Tribe) + res := resTmp.(*twmodel.Tribe) fc.Result = res return ec.marshalOTribe2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribe(ctx, field.Selections, res) } -func (ec *executionContext) _TribeChangeRecord_newTribe(ctx context.Context, field graphql.CollectedField, obj *models.TribeChange) (ret graphql.Marshaler) { +func (ec *executionContext) _TribeChangeRecord_newTribe(ctx context.Context, field graphql.CollectedField, obj *twmodel.TribeChange) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16520,12 +16521,12 @@ func (ec *executionContext) _TribeChangeRecord_newTribe(ctx context.Context, fie if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Tribe) + res := resTmp.(*twmodel.Tribe) fc.Result = res return ec.marshalOTribe2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribe(ctx, field.Selections, res) } -func (ec *executionContext) _TribeChangeRecord_createdAt(ctx context.Context, field graphql.CollectedField, obj *models.TribeChange) (ret graphql.Marshaler) { +func (ec *executionContext) _TribeChangeRecord_createdAt(ctx context.Context, field graphql.CollectedField, obj *twmodel.TribeChange) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16622,7 +16623,7 @@ func (ec *executionContext) _TribeChanges_items(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.([]*models.TribeChange) + res := resTmp.([]*twmodel.TribeChange) fc.Result = res return ec.marshalOTribeChangeRecord2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeChangeᚄ(ctx, field.Selections, res) } @@ -16689,12 +16690,12 @@ func (ec *executionContext) _TribeHistory_items(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.([]*models.TribeHistory) + res := resTmp.([]*twmodel.TribeHistory) fc.Result = res return ec.marshalOTribeHistoryRecord2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeHistoryᚄ(ctx, field.Selections, res) } -func (ec *executionContext) _TribeHistoryRecord_tribe(ctx context.Context, field graphql.CollectedField, obj *models.TribeHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _TribeHistoryRecord_tribe(ctx context.Context, field graphql.CollectedField, obj *twmodel.TribeHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16721,12 +16722,12 @@ func (ec *executionContext) _TribeHistoryRecord_tribe(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Tribe) + res := resTmp.(*twmodel.Tribe) fc.Result = res return ec.marshalOTribe2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribe(ctx, field.Selections, res) } -func (ec *executionContext) _TribeHistoryRecord_totalVillages(ctx context.Context, field graphql.CollectedField, obj *models.TribeHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _TribeHistoryRecord_totalVillages(ctx context.Context, field graphql.CollectedField, obj *twmodel.TribeHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16761,7 +16762,7 @@ func (ec *executionContext) _TribeHistoryRecord_totalVillages(ctx context.Contex return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _TribeHistoryRecord_totalMembers(ctx context.Context, field graphql.CollectedField, obj *models.TribeHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _TribeHistoryRecord_totalMembers(ctx context.Context, field graphql.CollectedField, obj *twmodel.TribeHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16796,7 +16797,7 @@ func (ec *executionContext) _TribeHistoryRecord_totalMembers(ctx context.Context return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _TribeHistoryRecord_points(ctx context.Context, field graphql.CollectedField, obj *models.TribeHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _TribeHistoryRecord_points(ctx context.Context, field graphql.CollectedField, obj *twmodel.TribeHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16831,7 +16832,7 @@ func (ec *executionContext) _TribeHistoryRecord_points(ctx context.Context, fiel return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _TribeHistoryRecord_allPoints(ctx context.Context, field graphql.CollectedField, obj *models.TribeHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _TribeHistoryRecord_allPoints(ctx context.Context, field graphql.CollectedField, obj *twmodel.TribeHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16866,7 +16867,7 @@ func (ec *executionContext) _TribeHistoryRecord_allPoints(ctx context.Context, f return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _TribeHistoryRecord_rank(ctx context.Context, field graphql.CollectedField, obj *models.TribeHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _TribeHistoryRecord_rank(ctx context.Context, field graphql.CollectedField, obj *twmodel.TribeHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16901,7 +16902,7 @@ func (ec *executionContext) _TribeHistoryRecord_rank(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _TribeHistoryRecord_dominance(ctx context.Context, field graphql.CollectedField, obj *models.TribeHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _TribeHistoryRecord_dominance(ctx context.Context, field graphql.CollectedField, obj *twmodel.TribeHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16936,7 +16937,7 @@ func (ec *executionContext) _TribeHistoryRecord_dominance(ctx context.Context, f return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _TribeHistoryRecord_rankAtt(ctx context.Context, field graphql.CollectedField, obj *models.TribeHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _TribeHistoryRecord_rankAtt(ctx context.Context, field graphql.CollectedField, obj *twmodel.TribeHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -16971,7 +16972,7 @@ func (ec *executionContext) _TribeHistoryRecord_rankAtt(ctx context.Context, fie return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _TribeHistoryRecord_scoreAtt(ctx context.Context, field graphql.CollectedField, obj *models.TribeHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _TribeHistoryRecord_scoreAtt(ctx context.Context, field graphql.CollectedField, obj *twmodel.TribeHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17006,7 +17007,7 @@ func (ec *executionContext) _TribeHistoryRecord_scoreAtt(ctx context.Context, fi return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _TribeHistoryRecord_rankDef(ctx context.Context, field graphql.CollectedField, obj *models.TribeHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _TribeHistoryRecord_rankDef(ctx context.Context, field graphql.CollectedField, obj *twmodel.TribeHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17041,7 +17042,7 @@ func (ec *executionContext) _TribeHistoryRecord_rankDef(ctx context.Context, fie return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _TribeHistoryRecord_scoreDef(ctx context.Context, field graphql.CollectedField, obj *models.TribeHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _TribeHistoryRecord_scoreDef(ctx context.Context, field graphql.CollectedField, obj *twmodel.TribeHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17076,7 +17077,7 @@ func (ec *executionContext) _TribeHistoryRecord_scoreDef(ctx context.Context, fi return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _TribeHistoryRecord_rankTotal(ctx context.Context, field graphql.CollectedField, obj *models.TribeHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _TribeHistoryRecord_rankTotal(ctx context.Context, field graphql.CollectedField, obj *twmodel.TribeHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17111,7 +17112,7 @@ func (ec *executionContext) _TribeHistoryRecord_rankTotal(ctx context.Context, f return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _TribeHistoryRecord_scoreTotal(ctx context.Context, field graphql.CollectedField, obj *models.TribeHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _TribeHistoryRecord_scoreTotal(ctx context.Context, field graphql.CollectedField, obj *twmodel.TribeHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17146,7 +17147,7 @@ func (ec *executionContext) _TribeHistoryRecord_scoreTotal(ctx context.Context, return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _TribeHistoryRecord_createDate(ctx context.Context, field graphql.CollectedField, obj *models.TribeHistory) (ret graphql.Marshaler) { +func (ec *executionContext) _TribeHistoryRecord_createDate(ctx context.Context, field graphql.CollectedField, obj *twmodel.TribeHistory) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17208,7 +17209,7 @@ func (ec *executionContext) _TribeList_items(ctx context.Context, field graphql. if resTmp == nil { return graphql.Null } - res := resTmp.([]*models.Tribe) + res := resTmp.([]*twmodel.Tribe) fc.Result = res return ec.marshalOTribe2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeᚄ(ctx, field.Selections, res) } @@ -17248,7 +17249,7 @@ func (ec *executionContext) _TribeList_total(ctx context.Context, field graphql. return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Unit_buildTime(ctx context.Context, field graphql.CollectedField, obj *models.Unit) (ret graphql.Marshaler) { +func (ec *executionContext) _Unit_buildTime(ctx context.Context, field graphql.CollectedField, obj *twmodel.Unit) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17283,7 +17284,7 @@ func (ec *executionContext) _Unit_buildTime(ctx context.Context, field graphql.C return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _Unit_pop(ctx context.Context, field graphql.CollectedField, obj *models.Unit) (ret graphql.Marshaler) { +func (ec *executionContext) _Unit_pop(ctx context.Context, field graphql.CollectedField, obj *twmodel.Unit) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17318,7 +17319,7 @@ func (ec *executionContext) _Unit_pop(ctx context.Context, field graphql.Collect return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Unit_speed(ctx context.Context, field graphql.CollectedField, obj *models.Unit) (ret graphql.Marshaler) { +func (ec *executionContext) _Unit_speed(ctx context.Context, field graphql.CollectedField, obj *twmodel.Unit) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17353,7 +17354,7 @@ func (ec *executionContext) _Unit_speed(ctx context.Context, field graphql.Colle return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _Unit_attack(ctx context.Context, field graphql.CollectedField, obj *models.Unit) (ret graphql.Marshaler) { +func (ec *executionContext) _Unit_attack(ctx context.Context, field graphql.CollectedField, obj *twmodel.Unit) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17388,7 +17389,7 @@ func (ec *executionContext) _Unit_attack(ctx context.Context, field graphql.Coll return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Unit_defense(ctx context.Context, field graphql.CollectedField, obj *models.Unit) (ret graphql.Marshaler) { +func (ec *executionContext) _Unit_defense(ctx context.Context, field graphql.CollectedField, obj *twmodel.Unit) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17423,7 +17424,7 @@ func (ec *executionContext) _Unit_defense(ctx context.Context, field graphql.Col return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Unit_defenseCavalry(ctx context.Context, field graphql.CollectedField, obj *models.Unit) (ret graphql.Marshaler) { +func (ec *executionContext) _Unit_defenseCavalry(ctx context.Context, field graphql.CollectedField, obj *twmodel.Unit) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17458,7 +17459,7 @@ func (ec *executionContext) _Unit_defenseCavalry(ctx context.Context, field grap return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Unit_defenseArcher(ctx context.Context, field graphql.CollectedField, obj *models.Unit) (ret graphql.Marshaler) { +func (ec *executionContext) _Unit_defenseArcher(ctx context.Context, field graphql.CollectedField, obj *twmodel.Unit) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17493,7 +17494,7 @@ func (ec *executionContext) _Unit_defenseArcher(ctx context.Context, field graph return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Unit_carry(ctx context.Context, field graphql.CollectedField, obj *models.Unit) (ret graphql.Marshaler) { +func (ec *executionContext) _Unit_carry(ctx context.Context, field graphql.CollectedField, obj *twmodel.Unit) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17528,7 +17529,7 @@ func (ec *executionContext) _Unit_carry(ctx context.Context, field graphql.Colle return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _UnitConfig_spear(ctx context.Context, field graphql.CollectedField, obj *models.UnitConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _UnitConfig_spear(ctx context.Context, field graphql.CollectedField, obj *twmodel.UnitConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17558,12 +17559,12 @@ func (ec *executionContext) _UnitConfig_spear(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(models.Unit) + res := resTmp.(twmodel.Unit) fc.Result = res return ec.marshalNUnit2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐUnit(ctx, field.Selections, res) } -func (ec *executionContext) _UnitConfig_sword(ctx context.Context, field graphql.CollectedField, obj *models.UnitConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _UnitConfig_sword(ctx context.Context, field graphql.CollectedField, obj *twmodel.UnitConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17593,12 +17594,12 @@ func (ec *executionContext) _UnitConfig_sword(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(models.Unit) + res := resTmp.(twmodel.Unit) fc.Result = res return ec.marshalNUnit2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐUnit(ctx, field.Selections, res) } -func (ec *executionContext) _UnitConfig_axe(ctx context.Context, field graphql.CollectedField, obj *models.UnitConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _UnitConfig_axe(ctx context.Context, field graphql.CollectedField, obj *twmodel.UnitConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17628,12 +17629,12 @@ func (ec *executionContext) _UnitConfig_axe(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(models.Unit) + res := resTmp.(twmodel.Unit) fc.Result = res return ec.marshalNUnit2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐUnit(ctx, field.Selections, res) } -func (ec *executionContext) _UnitConfig_archer(ctx context.Context, field graphql.CollectedField, obj *models.UnitConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _UnitConfig_archer(ctx context.Context, field graphql.CollectedField, obj *twmodel.UnitConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17663,12 +17664,12 @@ func (ec *executionContext) _UnitConfig_archer(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(models.Unit) + res := resTmp.(twmodel.Unit) fc.Result = res return ec.marshalNUnit2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐUnit(ctx, field.Selections, res) } -func (ec *executionContext) _UnitConfig_spy(ctx context.Context, field graphql.CollectedField, obj *models.UnitConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _UnitConfig_spy(ctx context.Context, field graphql.CollectedField, obj *twmodel.UnitConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17698,12 +17699,12 @@ func (ec *executionContext) _UnitConfig_spy(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(models.Unit) + res := resTmp.(twmodel.Unit) fc.Result = res return ec.marshalNUnit2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐUnit(ctx, field.Selections, res) } -func (ec *executionContext) _UnitConfig_light(ctx context.Context, field graphql.CollectedField, obj *models.UnitConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _UnitConfig_light(ctx context.Context, field graphql.CollectedField, obj *twmodel.UnitConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17733,12 +17734,12 @@ func (ec *executionContext) _UnitConfig_light(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(models.Unit) + res := resTmp.(twmodel.Unit) fc.Result = res return ec.marshalNUnit2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐUnit(ctx, field.Selections, res) } -func (ec *executionContext) _UnitConfig_marcher(ctx context.Context, field graphql.CollectedField, obj *models.UnitConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _UnitConfig_marcher(ctx context.Context, field graphql.CollectedField, obj *twmodel.UnitConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17768,12 +17769,12 @@ func (ec *executionContext) _UnitConfig_marcher(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(models.Unit) + res := resTmp.(twmodel.Unit) fc.Result = res return ec.marshalNUnit2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐUnit(ctx, field.Selections, res) } -func (ec *executionContext) _UnitConfig_heavy(ctx context.Context, field graphql.CollectedField, obj *models.UnitConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _UnitConfig_heavy(ctx context.Context, field graphql.CollectedField, obj *twmodel.UnitConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17803,12 +17804,12 @@ func (ec *executionContext) _UnitConfig_heavy(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(models.Unit) + res := resTmp.(twmodel.Unit) fc.Result = res return ec.marshalNUnit2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐUnit(ctx, field.Selections, res) } -func (ec *executionContext) _UnitConfig_ram(ctx context.Context, field graphql.CollectedField, obj *models.UnitConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _UnitConfig_ram(ctx context.Context, field graphql.CollectedField, obj *twmodel.UnitConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17838,12 +17839,12 @@ func (ec *executionContext) _UnitConfig_ram(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(models.Unit) + res := resTmp.(twmodel.Unit) fc.Result = res return ec.marshalNUnit2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐUnit(ctx, field.Selections, res) } -func (ec *executionContext) _UnitConfig_catapult(ctx context.Context, field graphql.CollectedField, obj *models.UnitConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _UnitConfig_catapult(ctx context.Context, field graphql.CollectedField, obj *twmodel.UnitConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17873,12 +17874,12 @@ func (ec *executionContext) _UnitConfig_catapult(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(models.Unit) + res := resTmp.(twmodel.Unit) fc.Result = res return ec.marshalNUnit2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐUnit(ctx, field.Selections, res) } -func (ec *executionContext) _UnitConfig_knight(ctx context.Context, field graphql.CollectedField, obj *models.UnitConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _UnitConfig_knight(ctx context.Context, field graphql.CollectedField, obj *twmodel.UnitConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17908,12 +17909,12 @@ func (ec *executionContext) _UnitConfig_knight(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(models.Unit) + res := resTmp.(twmodel.Unit) fc.Result = res return ec.marshalNUnit2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐUnit(ctx, field.Selections, res) } -func (ec *executionContext) _UnitConfig_snob(ctx context.Context, field graphql.CollectedField, obj *models.UnitConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _UnitConfig_snob(ctx context.Context, field graphql.CollectedField, obj *twmodel.UnitConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17943,12 +17944,12 @@ func (ec *executionContext) _UnitConfig_snob(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(models.Unit) + res := resTmp.(twmodel.Unit) fc.Result = res return ec.marshalNUnit2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐUnit(ctx, field.Selections, res) } -func (ec *executionContext) _UnitConfig_militia(ctx context.Context, field graphql.CollectedField, obj *models.UnitConfig) (ret graphql.Marshaler) { +func (ec *executionContext) _UnitConfig_militia(ctx context.Context, field graphql.CollectedField, obj *twmodel.UnitConfig) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -17978,12 +17979,12 @@ func (ec *executionContext) _UnitConfig_militia(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(models.Unit) + res := resTmp.(twmodel.Unit) fc.Result = res return ec.marshalNUnit2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐUnit(ctx, field.Selections, res) } -func (ec *executionContext) _Version_code(ctx context.Context, field graphql.CollectedField, obj *models.Version) (ret graphql.Marshaler) { +func (ec *executionContext) _Version_code(ctx context.Context, field graphql.CollectedField, obj *twmodel.Version) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -18013,12 +18014,12 @@ func (ec *executionContext) _Version_code(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(models.VersionCode) + res := resTmp.(twmodel.VersionCode) fc.Result = res return ec.marshalNVersionCode2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersionCode(ctx, field.Selections, res) } -func (ec *executionContext) _Version_name(ctx context.Context, field graphql.CollectedField, obj *models.Version) (ret graphql.Marshaler) { +func (ec *executionContext) _Version_name(ctx context.Context, field graphql.CollectedField, obj *twmodel.Version) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -18053,7 +18054,7 @@ func (ec *executionContext) _Version_name(ctx context.Context, field graphql.Col return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Version_host(ctx context.Context, field graphql.CollectedField, obj *models.Version) (ret graphql.Marshaler) { +func (ec *executionContext) _Version_host(ctx context.Context, field graphql.CollectedField, obj *twmodel.Version) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -18088,7 +18089,7 @@ func (ec *executionContext) _Version_host(ctx context.Context, field graphql.Col return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Version_timezone(ctx context.Context, field graphql.CollectedField, obj *models.Version) (ret graphql.Marshaler) { +func (ec *executionContext) _Version_timezone(ctx context.Context, field graphql.CollectedField, obj *twmodel.Version) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -18150,7 +18151,7 @@ func (ec *executionContext) _VersionList_items(ctx context.Context, field graphq if resTmp == nil { return graphql.Null } - res := resTmp.([]*models.Version) + res := resTmp.([]*twmodel.Version) fc.Result = res return ec.marshalOVersion2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersionᚄ(ctx, field.Selections, res) } @@ -18190,7 +18191,7 @@ func (ec *executionContext) _VersionList_total(ctx context.Context, field graphq return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Village_id(ctx context.Context, field graphql.CollectedField, obj *models.Village) (ret graphql.Marshaler) { +func (ec *executionContext) _Village_id(ctx context.Context, field graphql.CollectedField, obj *twmodel.Village) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -18225,7 +18226,7 @@ func (ec *executionContext) _Village_id(ctx context.Context, field graphql.Colle return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Village_name(ctx context.Context, field graphql.CollectedField, obj *models.Village) (ret graphql.Marshaler) { +func (ec *executionContext) _Village_name(ctx context.Context, field graphql.CollectedField, obj *twmodel.Village) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -18260,7 +18261,7 @@ func (ec *executionContext) _Village_name(ctx context.Context, field graphql.Col return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Village_points(ctx context.Context, field graphql.CollectedField, obj *models.Village) (ret graphql.Marshaler) { +func (ec *executionContext) _Village_points(ctx context.Context, field graphql.CollectedField, obj *twmodel.Village) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -18295,7 +18296,7 @@ func (ec *executionContext) _Village_points(ctx context.Context, field graphql.C return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Village_x(ctx context.Context, field graphql.CollectedField, obj *models.Village) (ret graphql.Marshaler) { +func (ec *executionContext) _Village_x(ctx context.Context, field graphql.CollectedField, obj *twmodel.Village) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -18330,7 +18331,7 @@ func (ec *executionContext) _Village_x(ctx context.Context, field graphql.Collec return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Village_y(ctx context.Context, field graphql.CollectedField, obj *models.Village) (ret graphql.Marshaler) { +func (ec *executionContext) _Village_y(ctx context.Context, field graphql.CollectedField, obj *twmodel.Village) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -18365,7 +18366,7 @@ func (ec *executionContext) _Village_y(ctx context.Context, field graphql.Collec return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Village_bonus(ctx context.Context, field graphql.CollectedField, obj *models.Village) (ret graphql.Marshaler) { +func (ec *executionContext) _Village_bonus(ctx context.Context, field graphql.CollectedField, obj *twmodel.Village) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -18400,7 +18401,7 @@ func (ec *executionContext) _Village_bonus(ctx context.Context, field graphql.Co return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) _Village_player(ctx context.Context, field graphql.CollectedField, obj *models.Village) (ret graphql.Marshaler) { +func (ec *executionContext) _Village_player(ctx context.Context, field graphql.CollectedField, obj *twmodel.Village) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -18427,7 +18428,7 @@ func (ec *executionContext) _Village_player(ctx context.Context, field graphql.C if resTmp == nil { return graphql.Null } - res := resTmp.(*models.Player) + res := resTmp.(*twmodel.Player) fc.Result = res return ec.marshalOPlayer2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayer(ctx, field.Selections, res) } @@ -18459,7 +18460,7 @@ func (ec *executionContext) _VillageList_items(ctx context.Context, field graphq if resTmp == nil { return graphql.Null } - res := resTmp.([]*models.Village) + res := resTmp.([]*twmodel.Village) fc.Result = res return ec.marshalOVillage2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVillageᚄ(ctx, field.Selections, res) } @@ -19586,8 +19587,8 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co // region **************************** input.gotpl ***************************** -func (ec *executionContext) unmarshalInputDailyPlayerStatsFilter(ctx context.Context, obj interface{}) (models.DailyPlayerStatsFilter, error) { - var it models.DailyPlayerStatsFilter +func (ec *executionContext) unmarshalInputDailyPlayerStatsFilter(ctx context.Context, obj interface{}) (twmodel.DailyPlayerStatsFilter, error) { + var it twmodel.DailyPlayerStatsFilter var asMap = obj.(map[string]interface{}) for k, v := range asMap { @@ -19662,8 +19663,8 @@ func (ec *executionContext) unmarshalInputDailyPlayerStatsFilter(ctx context.Con return it, nil } -func (ec *executionContext) unmarshalInputDailyTribeStatsFilter(ctx context.Context, obj interface{}) (models.DailyTribeStatsFilter, error) { - var it models.DailyTribeStatsFilter +func (ec *executionContext) unmarshalInputDailyTribeStatsFilter(ctx context.Context, obj interface{}) (twmodel.DailyTribeStatsFilter, error) { + var it twmodel.DailyTribeStatsFilter var asMap = obj.(map[string]interface{}) for k, v := range asMap { @@ -19738,8 +19739,8 @@ func (ec *executionContext) unmarshalInputDailyTribeStatsFilter(ctx context.Cont return it, nil } -func (ec *executionContext) unmarshalInputEnnoblementFilter(ctx context.Context, obj interface{}) (models.EnnoblementFilter, error) { - var it models.EnnoblementFilter +func (ec *executionContext) unmarshalInputEnnoblementFilter(ctx context.Context, obj interface{}) (twmodel.EnnoblementFilter, error) { + var it twmodel.EnnoblementFilter var asMap = obj.(map[string]interface{}) for k, v := range asMap { @@ -19918,8 +19919,8 @@ func (ec *executionContext) unmarshalInputEnnoblementFilter(ctx context.Context, return it, nil } -func (ec *executionContext) unmarshalInputEnnoblementFilterOr(ctx context.Context, obj interface{}) (models.EnnoblementFilterOr, error) { - var it models.EnnoblementFilterOr +func (ec *executionContext) unmarshalInputEnnoblementFilterOr(ctx context.Context, obj interface{}) (twmodel.EnnoblementFilterOr, error) { + var it twmodel.EnnoblementFilterOr var asMap = obj.(map[string]interface{}) for k, v := range asMap { @@ -19962,8 +19963,8 @@ func (ec *executionContext) unmarshalInputEnnoblementFilterOr(ctx context.Contex return it, nil } -func (ec *executionContext) unmarshalInputPlayerFilter(ctx context.Context, obj interface{}) (models.PlayerFilter, error) { - var it models.PlayerFilter +func (ec *executionContext) unmarshalInputPlayerFilter(ctx context.Context, obj interface{}) (twmodel.PlayerFilter, error) { + var it twmodel.PlayerFilter var asMap = obj.(map[string]interface{}) for k, v := range asMap { @@ -20654,8 +20655,8 @@ func (ec *executionContext) unmarshalInputPlayerFilter(ctx context.Context, obj return it, nil } -func (ec *executionContext) unmarshalInputPlayerHistoryFilter(ctx context.Context, obj interface{}) (models.PlayerHistoryFilter, error) { - var it models.PlayerHistoryFilter +func (ec *executionContext) unmarshalInputPlayerHistoryFilter(ctx context.Context, obj interface{}) (twmodel.PlayerHistoryFilter, error) { + var it twmodel.PlayerHistoryFilter var asMap = obj.(map[string]interface{}) for k, v := range asMap { @@ -20730,8 +20731,8 @@ func (ec *executionContext) unmarshalInputPlayerHistoryFilter(ctx context.Contex return it, nil } -func (ec *executionContext) unmarshalInputServerFilter(ctx context.Context, obj interface{}) (models.ServerFilter, error) { - var it models.ServerFilter +func (ec *executionContext) unmarshalInputServerFilter(ctx context.Context, obj interface{}) (twmodel.ServerFilter, error) { + var it twmodel.ServerFilter var asMap = obj.(map[string]interface{}) for k, v := range asMap { @@ -20806,8 +20807,8 @@ func (ec *executionContext) unmarshalInputServerFilter(ctx context.Context, obj return it, nil } -func (ec *executionContext) unmarshalInputServerStatsFilter(ctx context.Context, obj interface{}) (models.ServerStatsFilter, error) { - var it models.ServerStatsFilter +func (ec *executionContext) unmarshalInputServerStatsFilter(ctx context.Context, obj interface{}) (twmodel.ServerStatsFilter, error) { + var it twmodel.ServerStatsFilter var asMap = obj.(map[string]interface{}) for k, v := range asMap { @@ -20858,8 +20859,8 @@ func (ec *executionContext) unmarshalInputServerStatsFilter(ctx context.Context, return it, nil } -func (ec *executionContext) unmarshalInputTribeChangeFilter(ctx context.Context, obj interface{}) (models.TribeChangeFilter, error) { - var it models.TribeChangeFilter +func (ec *executionContext) unmarshalInputTribeChangeFilter(ctx context.Context, obj interface{}) (twmodel.TribeChangeFilter, error) { + var it twmodel.TribeChangeFilter var asMap = obj.(map[string]interface{}) for k, v := range asMap { @@ -20990,8 +20991,8 @@ func (ec *executionContext) unmarshalInputTribeChangeFilter(ctx context.Context, return it, nil } -func (ec *executionContext) unmarshalInputTribeChangeFilterOr(ctx context.Context, obj interface{}) (models.TribeChangeFilterOr, error) { - var it models.TribeChangeFilterOr +func (ec *executionContext) unmarshalInputTribeChangeFilterOr(ctx context.Context, obj interface{}) (twmodel.TribeChangeFilterOr, error) { + var it twmodel.TribeChangeFilterOr var asMap = obj.(map[string]interface{}) for k, v := range asMap { @@ -21018,8 +21019,8 @@ func (ec *executionContext) unmarshalInputTribeChangeFilterOr(ctx context.Contex return it, nil } -func (ec *executionContext) unmarshalInputTribeFilter(ctx context.Context, obj interface{}) (models.TribeFilter, error) { - var it models.TribeFilter +func (ec *executionContext) unmarshalInputTribeFilter(ctx context.Context, obj interface{}) (twmodel.TribeFilter, error) { + var it twmodel.TribeFilter var asMap = obj.(map[string]interface{}) for k, v := range asMap { @@ -21686,8 +21687,8 @@ func (ec *executionContext) unmarshalInputTribeFilter(ctx context.Context, obj i return it, nil } -func (ec *executionContext) unmarshalInputTribeFilterOr(ctx context.Context, obj interface{}) (models.TribeFilterOr, error) { - var it models.TribeFilterOr +func (ec *executionContext) unmarshalInputTribeFilterOr(ctx context.Context, obj interface{}) (twmodel.TribeFilterOr, error) { + var it twmodel.TribeFilterOr var asMap = obj.(map[string]interface{}) for k, v := range asMap { @@ -21738,8 +21739,8 @@ func (ec *executionContext) unmarshalInputTribeFilterOr(ctx context.Context, obj return it, nil } -func (ec *executionContext) unmarshalInputTribeHistoryFilter(ctx context.Context, obj interface{}) (models.TribeHistoryFilter, error) { - var it models.TribeHistoryFilter +func (ec *executionContext) unmarshalInputTribeHistoryFilter(ctx context.Context, obj interface{}) (twmodel.TribeHistoryFilter, error) { + var it twmodel.TribeHistoryFilter var asMap = obj.(map[string]interface{}) for k, v := range asMap { @@ -21814,8 +21815,8 @@ func (ec *executionContext) unmarshalInputTribeHistoryFilter(ctx context.Context return it, nil } -func (ec *executionContext) unmarshalInputVersionFilter(ctx context.Context, obj interface{}) (models.VersionFilter, error) { - var it models.VersionFilter +func (ec *executionContext) unmarshalInputVersionFilter(ctx context.Context, obj interface{}) (twmodel.VersionFilter, error) { + var it twmodel.VersionFilter var asMap = obj.(map[string]interface{}) for k, v := range asMap { @@ -21874,8 +21875,8 @@ func (ec *executionContext) unmarshalInputVersionFilter(ctx context.Context, obj return it, nil } -func (ec *executionContext) unmarshalInputVillageFilter(ctx context.Context, obj interface{}) (models.VillageFilter, error) { - var it models.VillageFilter +func (ec *executionContext) unmarshalInputVillageFilter(ctx context.Context, obj interface{}) (twmodel.VillageFilter, error) { + var it twmodel.VillageFilter var asMap = obj.(map[string]interface{}) for k, v := range asMap { @@ -22120,7 +22121,7 @@ func (ec *executionContext) unmarshalInputVillageFilter(ctx context.Context, obj var buildingImplementors = []string{"Building"} -func (ec *executionContext) _Building(ctx context.Context, sel ast.SelectionSet, obj *models.Building) graphql.Marshaler { +func (ec *executionContext) _Building(ctx context.Context, sel ast.SelectionSet, obj *twmodel.Building) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, buildingImplementors) out := graphql.NewFieldSet(fields) @@ -22202,7 +22203,7 @@ func (ec *executionContext) _Building(ctx context.Context, sel ast.SelectionSet, var buildingConfigImplementors = []string{"BuildingConfig"} -func (ec *executionContext) _BuildingConfig(ctx context.Context, sel ast.SelectionSet, obj *models.BuildingConfig) graphql.Marshaler { +func (ec *executionContext) _BuildingConfig(ctx context.Context, sel ast.SelectionSet, obj *twmodel.BuildingConfig) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, buildingConfigImplementors) out := graphql.NewFieldSet(fields) @@ -22338,7 +22339,7 @@ func (ec *executionContext) _DailyPlayerStats(ctx context.Context, sel ast.Selec var dailyPlayerStatsRecordImplementors = []string{"DailyPlayerStatsRecord"} -func (ec *executionContext) _DailyPlayerStatsRecord(ctx context.Context, sel ast.SelectionSet, obj *models.DailyPlayerStats) graphql.Marshaler { +func (ec *executionContext) _DailyPlayerStatsRecord(ctx context.Context, sel ast.SelectionSet, obj *twmodel.DailyPlayerStats) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, dailyPlayerStatsRecordImplementors) out := graphql.NewFieldSet(fields) @@ -22460,7 +22461,7 @@ func (ec *executionContext) _DailyTribeStats(ctx context.Context, sel ast.Select var dailyTribeStatsRecordImplementors = []string{"DailyTribeStatsRecord"} -func (ec *executionContext) _DailyTribeStatsRecord(ctx context.Context, sel ast.SelectionSet, obj *models.DailyTribeStats) graphql.Marshaler { +func (ec *executionContext) _DailyTribeStatsRecord(ctx context.Context, sel ast.SelectionSet, obj *twmodel.DailyTribeStats) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, dailyTribeStatsRecordImplementors) out := graphql.NewFieldSet(fields) @@ -22558,7 +22559,7 @@ func (ec *executionContext) _DailyTribeStatsRecord(ctx context.Context, sel ast. var ennoblementImplementors = []string{"Ennoblement"} -func (ec *executionContext) _Ennoblement(ctx context.Context, sel ast.SelectionSet, obj *models.Ennoblement) graphql.Marshaler { +func (ec *executionContext) _Ennoblement(ctx context.Context, sel ast.SelectionSet, obj *twmodel.Ennoblement) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, ennoblementImplementors) out := graphql.NewFieldSet(fields) @@ -22669,7 +22670,7 @@ func (ec *executionContext) _EnnoblementList(ctx context.Context, sel ast.Select var foundPlayerImplementors = []string{"FoundPlayer"} -func (ec *executionContext) _FoundPlayer(ctx context.Context, sel ast.SelectionSet, obj *models.FoundPlayer) graphql.Marshaler { +func (ec *executionContext) _FoundPlayer(ctx context.Context, sel ast.SelectionSet, obj *twmodel.FoundPlayer) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, foundPlayerImplementors) out := graphql.NewFieldSet(fields) @@ -22760,7 +22761,7 @@ func (ec *executionContext) _FoundPlayerList(ctx context.Context, sel ast.Select var foundTribeImplementors = []string{"FoundTribe"} -func (ec *executionContext) _FoundTribe(ctx context.Context, sel ast.SelectionSet, obj *models.FoundTribe) graphql.Marshaler { +func (ec *executionContext) _FoundTribe(ctx context.Context, sel ast.SelectionSet, obj *twmodel.FoundTribe) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, foundTribeImplementors) out := graphql.NewFieldSet(fields) @@ -22846,7 +22847,7 @@ func (ec *executionContext) _FoundTribeList(ctx context.Context, sel ast.Selecti var playerImplementors = []string{"Player"} -func (ec *executionContext) _Player(ctx context.Context, sel ast.SelectionSet, obj *models.Player) graphql.Marshaler { +func (ec *executionContext) _Player(ctx context.Context, sel ast.SelectionSet, obj *twmodel.Player) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, playerImplementors) out := graphql.NewFieldSet(fields) @@ -23053,7 +23054,7 @@ func (ec *executionContext) _PlayerHistory(ctx context.Context, sel ast.Selectio var playerHistoryRecordImplementors = []string{"PlayerHistoryRecord"} -func (ec *executionContext) _PlayerHistoryRecord(ctx context.Context, sel ast.SelectionSet, obj *models.PlayerHistory) graphql.Marshaler { +func (ec *executionContext) _PlayerHistoryRecord(ctx context.Context, sel ast.SelectionSet, obj *twmodel.PlayerHistory) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, playerHistoryRecordImplementors) out := graphql.NewFieldSet(fields) @@ -23186,7 +23187,7 @@ func (ec *executionContext) _PlayerList(ctx context.Context, sel ast.SelectionSe var playerNameChangeImplementors = []string{"PlayerNameChange"} -func (ec *executionContext) _PlayerNameChange(ctx context.Context, sel ast.SelectionSet, obj *models.PlayerNameChange) graphql.Marshaler { +func (ec *executionContext) _PlayerNameChange(ctx context.Context, sel ast.SelectionSet, obj *twmodel.PlayerNameChange) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, playerNameChangeImplementors) out := graphql.NewFieldSet(fields) @@ -23504,7 +23505,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr var serverImplementors = []string{"Server"} -func (ec *executionContext) _Server(ctx context.Context, sel ast.SelectionSet, obj *models.Server) graphql.Marshaler { +func (ec *executionContext) _Server(ctx context.Context, sel ast.SelectionSet, obj *twmodel.Server) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, serverImplementors) out := graphql.NewFieldSet(fields) @@ -23592,7 +23593,7 @@ func (ec *executionContext) _Server(ctx context.Context, sel ast.SelectionSet, o var serverConfigImplementors = []string{"ServerConfig"} -func (ec *executionContext) _ServerConfig(ctx context.Context, sel ast.SelectionSet, obj *models.ServerConfig) graphql.Marshaler { +func (ec *executionContext) _ServerConfig(ctx context.Context, sel ast.SelectionSet, obj *twmodel.ServerConfig) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, serverConfigImplementors) out := graphql.NewFieldSet(fields) @@ -23694,7 +23695,7 @@ func (ec *executionContext) _ServerConfig(ctx context.Context, sel ast.Selection var serverConfigAllyImplementors = []string{"ServerConfigAlly"} -func (ec *executionContext) _ServerConfigAlly(ctx context.Context, sel ast.SelectionSet, obj *models.ServerConfigAlly) graphql.Marshaler { +func (ec *executionContext) _ServerConfigAlly(ctx context.Context, sel ast.SelectionSet, obj *twmodel.ServerConfigAlly) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, serverConfigAllyImplementors) out := graphql.NewFieldSet(fields) @@ -23781,7 +23782,7 @@ func (ec *executionContext) _ServerConfigAlly(ctx context.Context, sel ast.Selec var serverConfigBuildImplementors = []string{"ServerConfigBuild"} -func (ec *executionContext) _ServerConfigBuild(ctx context.Context, sel ast.SelectionSet, obj *models.ServerConfigBuild) graphql.Marshaler { +func (ec *executionContext) _ServerConfigBuild(ctx context.Context, sel ast.SelectionSet, obj *twmodel.ServerConfigBuild) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, serverConfigBuildImplementors) out := graphql.NewFieldSet(fields) @@ -23808,7 +23809,7 @@ func (ec *executionContext) _ServerConfigBuild(ctx context.Context, sel ast.Sele var serverConfigBuildingsImplementors = []string{"ServerConfigBuildings"} -func (ec *executionContext) _ServerConfigBuildings(ctx context.Context, sel ast.SelectionSet, obj *models.ServerConfigBuildings) graphql.Marshaler { +func (ec *executionContext) _ServerConfigBuildings(ctx context.Context, sel ast.SelectionSet, obj *twmodel.ServerConfigBuildings) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, serverConfigBuildingsImplementors) out := graphql.NewFieldSet(fields) @@ -23920,7 +23921,7 @@ func (ec *executionContext) _ServerConfigBuildings(ctx context.Context, sel ast. var serverConfigCommandsImplementors = []string{"ServerConfigCommands"} -func (ec *executionContext) _ServerConfigCommands(ctx context.Context, sel ast.SelectionSet, obj *models.ServerConfigCommands) graphql.Marshaler { +func (ec *executionContext) _ServerConfigCommands(ctx context.Context, sel ast.SelectionSet, obj *twmodel.ServerConfigCommands) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, serverConfigCommandsImplementors) out := graphql.NewFieldSet(fields) @@ -23952,7 +23953,7 @@ func (ec *executionContext) _ServerConfigCommands(ctx context.Context, sel ast.S var serverConfigCoordImplementors = []string{"ServerConfigCoord"} -func (ec *executionContext) _ServerConfigCoord(ctx context.Context, sel ast.SelectionSet, obj *models.ServerConfigCoord) graphql.Marshaler { +func (ec *executionContext) _ServerConfigCoord(ctx context.Context, sel ast.SelectionSet, obj *twmodel.ServerConfigCoord) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, serverConfigCoordImplementors) out := graphql.NewFieldSet(fields) @@ -24024,7 +24025,7 @@ func (ec *executionContext) _ServerConfigCoord(ctx context.Context, sel ast.Sele var serverConfigGameImplementors = []string{"ServerConfigGame"} -func (ec *executionContext) _ServerConfigGame(ctx context.Context, sel ast.SelectionSet, obj *models.ServerConfigGame) graphql.Marshaler { +func (ec *executionContext) _ServerConfigGame(ctx context.Context, sel ast.SelectionSet, obj *twmodel.ServerConfigGame) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, serverConfigGameImplementors) out := graphql.NewFieldSet(fields) @@ -24141,7 +24142,7 @@ func (ec *executionContext) _ServerConfigGame(ctx context.Context, sel ast.Selec var serverConfigMiscImplementors = []string{"ServerConfigMisc"} -func (ec *executionContext) _ServerConfigMisc(ctx context.Context, sel ast.SelectionSet, obj *models.ServerConfigMisc) graphql.Marshaler { +func (ec *executionContext) _ServerConfigMisc(ctx context.Context, sel ast.SelectionSet, obj *twmodel.ServerConfigMisc) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, serverConfigMiscImplementors) out := graphql.NewFieldSet(fields) @@ -24178,7 +24179,7 @@ func (ec *executionContext) _ServerConfigMisc(ctx context.Context, sel ast.Selec var serverConfigNewbieImplementors = []string{"ServerConfigNewbie"} -func (ec *executionContext) _ServerConfigNewbie(ctx context.Context, sel ast.SelectionSet, obj *models.ServerConfigNewbie) graphql.Marshaler { +func (ec *executionContext) _ServerConfigNewbie(ctx context.Context, sel ast.SelectionSet, obj *twmodel.ServerConfigNewbie) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, serverConfigNewbieImplementors) out := graphql.NewFieldSet(fields) @@ -24220,7 +24221,7 @@ func (ec *executionContext) _ServerConfigNewbie(ctx context.Context, sel ast.Sel var serverConfigNightImplementors = []string{"ServerConfigNight"} -func (ec *executionContext) _ServerConfigNight(ctx context.Context, sel ast.SelectionSet, obj *models.ServerConfigNight) graphql.Marshaler { +func (ec *executionContext) _ServerConfigNight(ctx context.Context, sel ast.SelectionSet, obj *twmodel.ServerConfigNight) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, serverConfigNightImplementors) out := graphql.NewFieldSet(fields) @@ -24262,7 +24263,7 @@ func (ec *executionContext) _ServerConfigNight(ctx context.Context, sel ast.Sele var serverConfigSitterImplementors = []string{"ServerConfigSitter"} -func (ec *executionContext) _ServerConfigSitter(ctx context.Context, sel ast.SelectionSet, obj *models.ServerConfigSitter) graphql.Marshaler { +func (ec *executionContext) _ServerConfigSitter(ctx context.Context, sel ast.SelectionSet, obj *twmodel.ServerConfigSitter) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, serverConfigSitterImplementors) out := graphql.NewFieldSet(fields) @@ -24289,7 +24290,7 @@ func (ec *executionContext) _ServerConfigSitter(ctx context.Context, sel ast.Sel var serverConfigSleepImplementors = []string{"ServerConfigSleep"} -func (ec *executionContext) _ServerConfigSleep(ctx context.Context, sel ast.SelectionSet, obj *models.ServerConfigSleep) graphql.Marshaler { +func (ec *executionContext) _ServerConfigSleep(ctx context.Context, sel ast.SelectionSet, obj *twmodel.ServerConfigSleep) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, serverConfigSleepImplementors) out := graphql.NewFieldSet(fields) @@ -24346,7 +24347,7 @@ func (ec *executionContext) _ServerConfigSleep(ctx context.Context, sel ast.Sele var serverConfigSnobImplementors = []string{"ServerConfigSnob"} -func (ec *executionContext) _ServerConfigSnob(ctx context.Context, sel ast.SelectionSet, obj *models.ServerConfigSnob) graphql.Marshaler { +func (ec *executionContext) _ServerConfigSnob(ctx context.Context, sel ast.SelectionSet, obj *twmodel.ServerConfigSnob) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, serverConfigSnobImplementors) out := graphql.NewFieldSet(fields) @@ -24413,7 +24414,7 @@ func (ec *executionContext) _ServerConfigSnob(ctx context.Context, sel ast.Selec var serverConfigWinImplementors = []string{"ServerConfigWin"} -func (ec *executionContext) _ServerConfigWin(ctx context.Context, sel ast.SelectionSet, obj *models.ServerConfigWin) graphql.Marshaler { +func (ec *executionContext) _ServerConfigWin(ctx context.Context, sel ast.SelectionSet, obj *twmodel.ServerConfigWin) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, serverConfigWinImplementors) out := graphql.NewFieldSet(fields) @@ -24498,7 +24499,7 @@ func (ec *executionContext) _ServerStats(ctx context.Context, sel ast.SelectionS var serverStatsRecordImplementors = []string{"ServerStatsRecord"} -func (ec *executionContext) _ServerStatsRecord(ctx context.Context, sel ast.SelectionSet, obj *models.ServerStats) graphql.Marshaler { +func (ec *executionContext) _ServerStatsRecord(ctx context.Context, sel ast.SelectionSet, obj *twmodel.ServerStats) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, serverStatsRecordImplementors) out := graphql.NewFieldSet(fields) @@ -24575,7 +24576,7 @@ func (ec *executionContext) _ServerStatsRecord(ctx context.Context, sel ast.Sele var tribeImplementors = []string{"Tribe"} -func (ec *executionContext) _Tribe(ctx context.Context, sel ast.SelectionSet, obj *models.Tribe) graphql.Marshaler { +func (ec *executionContext) _Tribe(ctx context.Context, sel ast.SelectionSet, obj *twmodel.Tribe) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, tribeImplementors) out := graphql.NewFieldSet(fields) @@ -24714,7 +24715,7 @@ func (ec *executionContext) _Tribe(ctx context.Context, sel ast.SelectionSet, ob var tribeChangeRecordImplementors = []string{"TribeChangeRecord"} -func (ec *executionContext) _TribeChangeRecord(ctx context.Context, sel ast.SelectionSet, obj *models.TribeChange) graphql.Marshaler { +func (ec *executionContext) _TribeChangeRecord(ctx context.Context, sel ast.SelectionSet, obj *twmodel.TribeChange) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, tribeChangeRecordImplementors) out := graphql.NewFieldSet(fields) @@ -24832,7 +24833,7 @@ func (ec *executionContext) _TribeHistory(ctx context.Context, sel ast.Selection var tribeHistoryRecordImplementors = []string{"TribeHistoryRecord"} -func (ec *executionContext) _TribeHistoryRecord(ctx context.Context, sel ast.SelectionSet, obj *models.TribeHistory) graphql.Marshaler { +func (ec *executionContext) _TribeHistoryRecord(ctx context.Context, sel ast.SelectionSet, obj *twmodel.TribeHistory) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, tribeHistoryRecordImplementors) out := graphql.NewFieldSet(fields) @@ -24959,7 +24960,7 @@ func (ec *executionContext) _TribeList(ctx context.Context, sel ast.SelectionSet var unitImplementors = []string{"Unit"} -func (ec *executionContext) _Unit(ctx context.Context, sel ast.SelectionSet, obj *models.Unit) graphql.Marshaler { +func (ec *executionContext) _Unit(ctx context.Context, sel ast.SelectionSet, obj *twmodel.Unit) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, unitImplementors) out := graphql.NewFieldSet(fields) @@ -25021,7 +25022,7 @@ func (ec *executionContext) _Unit(ctx context.Context, sel ast.SelectionSet, obj var unitConfigImplementors = []string{"UnitConfig"} -func (ec *executionContext) _UnitConfig(ctx context.Context, sel ast.SelectionSet, obj *models.UnitConfig) graphql.Marshaler { +func (ec *executionContext) _UnitConfig(ctx context.Context, sel ast.SelectionSet, obj *twmodel.UnitConfig) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, unitConfigImplementors) out := graphql.NewFieldSet(fields) @@ -25108,7 +25109,7 @@ func (ec *executionContext) _UnitConfig(ctx context.Context, sel ast.SelectionSe var versionImplementors = []string{"Version"} -func (ec *executionContext) _Version(ctx context.Context, sel ast.SelectionSet, obj *models.Version) graphql.Marshaler { +func (ec *executionContext) _Version(ctx context.Context, sel ast.SelectionSet, obj *twmodel.Version) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, versionImplementors) out := graphql.NewFieldSet(fields) @@ -25179,7 +25180,7 @@ func (ec *executionContext) _VersionList(ctx context.Context, sel ast.SelectionS var villageImplementors = []string{"Village"} -func (ec *executionContext) _Village(ctx context.Context, sel ast.SelectionSet, obj *models.Village) graphql.Marshaler { +func (ec *executionContext) _Village(ctx context.Context, sel ast.SelectionSet, obj *twmodel.Village) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, villageImplementors) out := graphql.NewFieldSet(fields) @@ -25550,11 +25551,11 @@ func (ec *executionContext) marshalNBoolean2ᚖbool(ctx context.Context, sel ast return res } -func (ec *executionContext) marshalNBuilding2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuilding(ctx context.Context, sel ast.SelectionSet, v models.Building) graphql.Marshaler { +func (ec *executionContext) marshalNBuilding2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuilding(ctx context.Context, sel ast.SelectionSet, v twmodel.Building) graphql.Marshaler { return ec._Building(ctx, sel, &v) } -func (ec *executionContext) marshalNBuildingConfig2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuildingConfig(ctx context.Context, sel ast.SelectionSet, v models.BuildingConfig) graphql.Marshaler { +func (ec *executionContext) marshalNBuildingConfig2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐBuildingConfig(ctx context.Context, sel ast.SelectionSet, v twmodel.BuildingConfig) graphql.Marshaler { return ec._BuildingConfig(ctx, sel, &v) } @@ -25572,7 +25573,7 @@ func (ec *executionContext) marshalNDailyPlayerStats2ᚖgithubᚗcomᚋtribalwar return ec._DailyPlayerStats(ctx, sel, v) } -func (ec *executionContext) marshalNDailyPlayerStatsRecord2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐDailyPlayerStats(ctx context.Context, sel ast.SelectionSet, v *models.DailyPlayerStats) graphql.Marshaler { +func (ec *executionContext) marshalNDailyPlayerStatsRecord2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐDailyPlayerStats(ctx context.Context, sel ast.SelectionSet, v *twmodel.DailyPlayerStats) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -25596,7 +25597,7 @@ func (ec *executionContext) marshalNDailyTribeStats2ᚖgithubᚗcomᚋtribalwars return ec._DailyTribeStats(ctx, sel, v) } -func (ec *executionContext) marshalNDailyTribeStatsRecord2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐDailyTribeStats(ctx context.Context, sel ast.SelectionSet, v *models.DailyTribeStats) graphql.Marshaler { +func (ec *executionContext) marshalNDailyTribeStatsRecord2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐDailyTribeStats(ctx context.Context, sel ast.SelectionSet, v *twmodel.DailyTribeStats) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -25606,7 +25607,7 @@ func (ec *executionContext) marshalNDailyTribeStatsRecord2ᚖgithubᚗcomᚋtrib return ec._DailyTribeStatsRecord(ctx, sel, v) } -func (ec *executionContext) marshalNEnnoblement2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐEnnoblement(ctx context.Context, sel ast.SelectionSet, v *models.Ennoblement) graphql.Marshaler { +func (ec *executionContext) marshalNEnnoblement2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐEnnoblement(ctx context.Context, sel ast.SelectionSet, v *twmodel.Ennoblement) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -25645,7 +25646,7 @@ func (ec *executionContext) marshalNFloat2float64(ctx context.Context, sel ast.S return res } -func (ec *executionContext) marshalNFoundPlayer2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐFoundPlayer(ctx context.Context, sel ast.SelectionSet, v *models.FoundPlayer) graphql.Marshaler { +func (ec *executionContext) marshalNFoundPlayer2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐFoundPlayer(ctx context.Context, sel ast.SelectionSet, v *twmodel.FoundPlayer) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -25669,7 +25670,7 @@ func (ec *executionContext) marshalNFoundPlayerList2ᚖgithubᚗcomᚋtribalwars return ec._FoundPlayerList(ctx, sel, v) } -func (ec *executionContext) marshalNFoundTribe2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐFoundTribe(ctx context.Context, sel ast.SelectionSet, v *models.FoundTribe) graphql.Marshaler { +func (ec *executionContext) marshalNFoundTribe2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐFoundTribe(ctx context.Context, sel ast.SelectionSet, v *twmodel.FoundTribe) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -25708,7 +25709,7 @@ func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.Selecti return res } -func (ec *executionContext) marshalNPlayer2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayer(ctx context.Context, sel ast.SelectionSet, v *models.Player) graphql.Marshaler { +func (ec *executionContext) marshalNPlayer2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayer(ctx context.Context, sel ast.SelectionSet, v *twmodel.Player) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -25732,7 +25733,7 @@ func (ec *executionContext) marshalNPlayerHistory2ᚖgithubᚗcomᚋtribalwarshe return ec._PlayerHistory(ctx, sel, v) } -func (ec *executionContext) marshalNPlayerHistoryRecord2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayerHistory(ctx context.Context, sel ast.SelectionSet, v *models.PlayerHistory) graphql.Marshaler { +func (ec *executionContext) marshalNPlayerHistoryRecord2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayerHistory(ctx context.Context, sel ast.SelectionSet, v *twmodel.PlayerHistory) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -25756,7 +25757,7 @@ func (ec *executionContext) marshalNPlayerList2ᚖgithubᚗcomᚋtribalwarshelp return ec._PlayerList(ctx, sel, v) } -func (ec *executionContext) marshalNPlayerNameChange2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayerNameChangeᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.PlayerNameChange) graphql.Marshaler { +func (ec *executionContext) marshalNPlayerNameChange2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayerNameChangeᚄ(ctx context.Context, sel ast.SelectionSet, v []*twmodel.PlayerNameChange) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -25793,7 +25794,7 @@ func (ec *executionContext) marshalNPlayerNameChange2ᚕᚖgithubᚗcomᚋtribal return ret } -func (ec *executionContext) marshalNPlayerNameChange2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayerNameChange(ctx context.Context, sel ast.SelectionSet, v *models.PlayerNameChange) graphql.Marshaler { +func (ec *executionContext) marshalNPlayerNameChange2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayerNameChange(ctx context.Context, sel ast.SelectionSet, v *twmodel.PlayerNameChange) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -25803,7 +25804,7 @@ func (ec *executionContext) marshalNPlayerNameChange2ᚖgithubᚗcomᚋtribalwar return ec._PlayerNameChange(ctx, sel, v) } -func (ec *executionContext) marshalNServer2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServer(ctx context.Context, sel ast.SelectionSet, v *models.Server) graphql.Marshaler { +func (ec *executionContext) marshalNServer2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServer(ctx context.Context, sel ast.SelectionSet, v *twmodel.Server) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -25813,59 +25814,59 @@ func (ec *executionContext) marshalNServer2ᚖgithubᚗcomᚋtribalwarshelpᚋsh return ec._Server(ctx, sel, v) } -func (ec *executionContext) marshalNServerConfig2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfig(ctx context.Context, sel ast.SelectionSet, v models.ServerConfig) graphql.Marshaler { +func (ec *executionContext) marshalNServerConfig2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfig(ctx context.Context, sel ast.SelectionSet, v twmodel.ServerConfig) graphql.Marshaler { return ec._ServerConfig(ctx, sel, &v) } -func (ec *executionContext) marshalNServerConfigAlly2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigAlly(ctx context.Context, sel ast.SelectionSet, v models.ServerConfigAlly) graphql.Marshaler { +func (ec *executionContext) marshalNServerConfigAlly2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigAlly(ctx context.Context, sel ast.SelectionSet, v twmodel.ServerConfigAlly) graphql.Marshaler { return ec._ServerConfigAlly(ctx, sel, &v) } -func (ec *executionContext) marshalNServerConfigBuild2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigBuild(ctx context.Context, sel ast.SelectionSet, v models.ServerConfigBuild) graphql.Marshaler { +func (ec *executionContext) marshalNServerConfigBuild2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigBuild(ctx context.Context, sel ast.SelectionSet, v twmodel.ServerConfigBuild) graphql.Marshaler { return ec._ServerConfigBuild(ctx, sel, &v) } -func (ec *executionContext) marshalNServerConfigBuildings2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigBuildings(ctx context.Context, sel ast.SelectionSet, v models.ServerConfigBuildings) graphql.Marshaler { +func (ec *executionContext) marshalNServerConfigBuildings2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigBuildings(ctx context.Context, sel ast.SelectionSet, v twmodel.ServerConfigBuildings) graphql.Marshaler { return ec._ServerConfigBuildings(ctx, sel, &v) } -func (ec *executionContext) marshalNServerConfigCommands2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigCommands(ctx context.Context, sel ast.SelectionSet, v models.ServerConfigCommands) graphql.Marshaler { +func (ec *executionContext) marshalNServerConfigCommands2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigCommands(ctx context.Context, sel ast.SelectionSet, v twmodel.ServerConfigCommands) graphql.Marshaler { return ec._ServerConfigCommands(ctx, sel, &v) } -func (ec *executionContext) marshalNServerConfigCoord2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigCoord(ctx context.Context, sel ast.SelectionSet, v models.ServerConfigCoord) graphql.Marshaler { +func (ec *executionContext) marshalNServerConfigCoord2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigCoord(ctx context.Context, sel ast.SelectionSet, v twmodel.ServerConfigCoord) graphql.Marshaler { return ec._ServerConfigCoord(ctx, sel, &v) } -func (ec *executionContext) marshalNServerConfigGame2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigGame(ctx context.Context, sel ast.SelectionSet, v models.ServerConfigGame) graphql.Marshaler { +func (ec *executionContext) marshalNServerConfigGame2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigGame(ctx context.Context, sel ast.SelectionSet, v twmodel.ServerConfigGame) graphql.Marshaler { return ec._ServerConfigGame(ctx, sel, &v) } -func (ec *executionContext) marshalNServerConfigMisc2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigMisc(ctx context.Context, sel ast.SelectionSet, v models.ServerConfigMisc) graphql.Marshaler { +func (ec *executionContext) marshalNServerConfigMisc2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigMisc(ctx context.Context, sel ast.SelectionSet, v twmodel.ServerConfigMisc) graphql.Marshaler { return ec._ServerConfigMisc(ctx, sel, &v) } -func (ec *executionContext) marshalNServerConfigNewbie2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigNewbie(ctx context.Context, sel ast.SelectionSet, v models.ServerConfigNewbie) graphql.Marshaler { +func (ec *executionContext) marshalNServerConfigNewbie2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigNewbie(ctx context.Context, sel ast.SelectionSet, v twmodel.ServerConfigNewbie) graphql.Marshaler { return ec._ServerConfigNewbie(ctx, sel, &v) } -func (ec *executionContext) marshalNServerConfigNight2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigNight(ctx context.Context, sel ast.SelectionSet, v models.ServerConfigNight) graphql.Marshaler { +func (ec *executionContext) marshalNServerConfigNight2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigNight(ctx context.Context, sel ast.SelectionSet, v twmodel.ServerConfigNight) graphql.Marshaler { return ec._ServerConfigNight(ctx, sel, &v) } -func (ec *executionContext) marshalNServerConfigSitter2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigSitter(ctx context.Context, sel ast.SelectionSet, v models.ServerConfigSitter) graphql.Marshaler { +func (ec *executionContext) marshalNServerConfigSitter2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigSitter(ctx context.Context, sel ast.SelectionSet, v twmodel.ServerConfigSitter) graphql.Marshaler { return ec._ServerConfigSitter(ctx, sel, &v) } -func (ec *executionContext) marshalNServerConfigSleep2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigSleep(ctx context.Context, sel ast.SelectionSet, v models.ServerConfigSleep) graphql.Marshaler { +func (ec *executionContext) marshalNServerConfigSleep2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigSleep(ctx context.Context, sel ast.SelectionSet, v twmodel.ServerConfigSleep) graphql.Marshaler { return ec._ServerConfigSleep(ctx, sel, &v) } -func (ec *executionContext) marshalNServerConfigSnob2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigSnob(ctx context.Context, sel ast.SelectionSet, v models.ServerConfigSnob) graphql.Marshaler { +func (ec *executionContext) marshalNServerConfigSnob2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigSnob(ctx context.Context, sel ast.SelectionSet, v twmodel.ServerConfigSnob) graphql.Marshaler { return ec._ServerConfigSnob(ctx, sel, &v) } -func (ec *executionContext) marshalNServerConfigWin2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigWin(ctx context.Context, sel ast.SelectionSet, v models.ServerConfigWin) graphql.Marshaler { +func (ec *executionContext) marshalNServerConfigWin2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerConfigWin(ctx context.Context, sel ast.SelectionSet, v twmodel.ServerConfigWin) graphql.Marshaler { return ec._ServerConfigWin(ctx, sel, &v) } @@ -25897,7 +25898,7 @@ func (ec *executionContext) marshalNServerStats2ᚖgithubᚗcomᚋtribalwarshelp return ec._ServerStats(ctx, sel, v) } -func (ec *executionContext) marshalNServerStatsRecord2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerStats(ctx context.Context, sel ast.SelectionSet, v *models.ServerStats) graphql.Marshaler { +func (ec *executionContext) marshalNServerStatsRecord2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerStats(ctx context.Context, sel ast.SelectionSet, v *twmodel.ServerStats) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -25907,13 +25908,13 @@ func (ec *executionContext) marshalNServerStatsRecord2ᚖgithubᚗcomᚋtribalwa return ec._ServerStatsRecord(ctx, sel, v) } -func (ec *executionContext) unmarshalNServerStatus2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerStatus(ctx context.Context, v interface{}) (models.ServerStatus, error) { - var res models.ServerStatus +func (ec *executionContext) unmarshalNServerStatus2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerStatus(ctx context.Context, v interface{}) (twmodel.ServerStatus, error) { + var res twmodel.ServerStatus err := res.UnmarshalGQL(v) return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNServerStatus2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerStatus(ctx context.Context, sel ast.SelectionSet, v models.ServerStatus) graphql.Marshaler { +func (ec *executionContext) marshalNServerStatus2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerStatus(ctx context.Context, sel ast.SelectionSet, v twmodel.ServerStatus) graphql.Marshaler { return v } @@ -25977,7 +25978,7 @@ func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel as return res } -func (ec *executionContext) marshalNTribe2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribe(ctx context.Context, sel ast.SelectionSet, v *models.Tribe) graphql.Marshaler { +func (ec *executionContext) marshalNTribe2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribe(ctx context.Context, sel ast.SelectionSet, v *twmodel.Tribe) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -25987,7 +25988,7 @@ func (ec *executionContext) marshalNTribe2ᚖgithubᚗcomᚋtribalwarshelpᚋsha return ec._Tribe(ctx, sel, v) } -func (ec *executionContext) marshalNTribeChangeRecord2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeChange(ctx context.Context, sel ast.SelectionSet, v *models.TribeChange) graphql.Marshaler { +func (ec *executionContext) marshalNTribeChangeRecord2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeChange(ctx context.Context, sel ast.SelectionSet, v *twmodel.TribeChange) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -26025,7 +26026,7 @@ func (ec *executionContext) marshalNTribeHistory2ᚖgithubᚗcomᚋtribalwarshel return ec._TribeHistory(ctx, sel, v) } -func (ec *executionContext) marshalNTribeHistoryRecord2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeHistory(ctx context.Context, sel ast.SelectionSet, v *models.TribeHistory) graphql.Marshaler { +func (ec *executionContext) marshalNTribeHistoryRecord2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeHistory(ctx context.Context, sel ast.SelectionSet, v *twmodel.TribeHistory) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -26049,15 +26050,15 @@ func (ec *executionContext) marshalNTribeList2ᚖgithubᚗcomᚋtribalwarshelp return ec._TribeList(ctx, sel, v) } -func (ec *executionContext) marshalNUnit2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐUnit(ctx context.Context, sel ast.SelectionSet, v models.Unit) graphql.Marshaler { +func (ec *executionContext) marshalNUnit2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐUnit(ctx context.Context, sel ast.SelectionSet, v twmodel.Unit) graphql.Marshaler { return ec._Unit(ctx, sel, &v) } -func (ec *executionContext) marshalNUnitConfig2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐUnitConfig(ctx context.Context, sel ast.SelectionSet, v models.UnitConfig) graphql.Marshaler { +func (ec *executionContext) marshalNUnitConfig2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐUnitConfig(ctx context.Context, sel ast.SelectionSet, v twmodel.UnitConfig) graphql.Marshaler { return ec._UnitConfig(ctx, sel, &v) } -func (ec *executionContext) marshalNVersion2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersion(ctx context.Context, sel ast.SelectionSet, v *models.Version) graphql.Marshaler { +func (ec *executionContext) marshalNVersion2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersion(ctx context.Context, sel ast.SelectionSet, v *twmodel.Version) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -26067,13 +26068,13 @@ func (ec *executionContext) marshalNVersion2ᚖgithubᚗcomᚋtribalwarshelpᚋs return ec._Version(ctx, sel, v) } -func (ec *executionContext) unmarshalNVersionCode2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersionCode(ctx context.Context, v interface{}) (models.VersionCode, error) { - var res models.VersionCode +func (ec *executionContext) unmarshalNVersionCode2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersionCode(ctx context.Context, v interface{}) (twmodel.VersionCode, error) { + var res twmodel.VersionCode err := res.UnmarshalGQL(v) return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNVersionCode2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersionCode(ctx context.Context, sel ast.SelectionSet, v models.VersionCode) graphql.Marshaler { +func (ec *executionContext) marshalNVersionCode2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersionCode(ctx context.Context, sel ast.SelectionSet, v twmodel.VersionCode) graphql.Marshaler { return v } @@ -26091,7 +26092,7 @@ func (ec *executionContext) marshalNVersionList2ᚖgithubᚗcomᚋtribalwarshelp return ec._VersionList(ctx, sel, v) } -func (ec *executionContext) marshalNVillage2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVillage(ctx context.Context, sel ast.SelectionSet, v *models.Village) graphql.Marshaler { +func (ec *executionContext) marshalNVillage2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVillage(ctx context.Context, sel ast.SelectionSet, v *twmodel.Village) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -26368,7 +26369,7 @@ func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast return graphql.MarshalBoolean(*v) } -func (ec *executionContext) unmarshalODailyPlayerStatsFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐDailyPlayerStatsFilter(ctx context.Context, v interface{}) (*models.DailyPlayerStatsFilter, error) { +func (ec *executionContext) unmarshalODailyPlayerStatsFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐDailyPlayerStatsFilter(ctx context.Context, v interface{}) (*twmodel.DailyPlayerStatsFilter, error) { if v == nil { return nil, nil } @@ -26376,7 +26377,7 @@ func (ec *executionContext) unmarshalODailyPlayerStatsFilter2ᚖgithubᚗcomᚋt return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalODailyPlayerStatsRecord2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐDailyPlayerStatsᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.DailyPlayerStats) graphql.Marshaler { +func (ec *executionContext) marshalODailyPlayerStatsRecord2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐDailyPlayerStatsᚄ(ctx context.Context, sel ast.SelectionSet, v []*twmodel.DailyPlayerStats) graphql.Marshaler { if v == nil { return graphql.Null } @@ -26416,7 +26417,7 @@ func (ec *executionContext) marshalODailyPlayerStatsRecord2ᚕᚖgithubᚗcomᚋ return ret } -func (ec *executionContext) unmarshalODailyTribeStatsFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐDailyTribeStatsFilter(ctx context.Context, v interface{}) (*models.DailyTribeStatsFilter, error) { +func (ec *executionContext) unmarshalODailyTribeStatsFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐDailyTribeStatsFilter(ctx context.Context, v interface{}) (*twmodel.DailyTribeStatsFilter, error) { if v == nil { return nil, nil } @@ -26424,7 +26425,7 @@ func (ec *executionContext) unmarshalODailyTribeStatsFilter2ᚖgithubᚗcomᚋtr return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalODailyTribeStatsRecord2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐDailyTribeStatsᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.DailyTribeStats) graphql.Marshaler { +func (ec *executionContext) marshalODailyTribeStatsRecord2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐDailyTribeStatsᚄ(ctx context.Context, sel ast.SelectionSet, v []*twmodel.DailyTribeStats) graphql.Marshaler { if v == nil { return graphql.Null } @@ -26464,7 +26465,7 @@ func (ec *executionContext) marshalODailyTribeStatsRecord2ᚕᚖgithubᚗcomᚋt return ret } -func (ec *executionContext) marshalOEnnoblement2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐEnnoblementᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.Ennoblement) graphql.Marshaler { +func (ec *executionContext) marshalOEnnoblement2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐEnnoblementᚄ(ctx context.Context, sel ast.SelectionSet, v []*twmodel.Ennoblement) graphql.Marshaler { if v == nil { return graphql.Null } @@ -26504,7 +26505,7 @@ func (ec *executionContext) marshalOEnnoblement2ᚕᚖgithubᚗcomᚋtribalwarsh return ret } -func (ec *executionContext) unmarshalOEnnoblementFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐEnnoblementFilter(ctx context.Context, v interface{}) (*models.EnnoblementFilter, error) { +func (ec *executionContext) unmarshalOEnnoblementFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐEnnoblementFilter(ctx context.Context, v interface{}) (*twmodel.EnnoblementFilter, error) { if v == nil { return nil, nil } @@ -26512,7 +26513,7 @@ func (ec *executionContext) unmarshalOEnnoblementFilter2ᚖgithubᚗcomᚋtribal return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOEnnoblementFilterOr2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐEnnoblementFilterOr(ctx context.Context, v interface{}) (*models.EnnoblementFilterOr, error) { +func (ec *executionContext) unmarshalOEnnoblementFilterOr2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐEnnoblementFilterOr(ctx context.Context, v interface{}) (*twmodel.EnnoblementFilterOr, error) { if v == nil { return nil, nil } @@ -26520,7 +26521,7 @@ func (ec *executionContext) unmarshalOEnnoblementFilterOr2ᚖgithubᚗcomᚋtrib return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOFoundPlayer2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐFoundPlayerᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.FoundPlayer) graphql.Marshaler { +func (ec *executionContext) marshalOFoundPlayer2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐFoundPlayerᚄ(ctx context.Context, sel ast.SelectionSet, v []*twmodel.FoundPlayer) graphql.Marshaler { if v == nil { return graphql.Null } @@ -26560,7 +26561,7 @@ func (ec *executionContext) marshalOFoundPlayer2ᚕᚖgithubᚗcomᚋtribalwarsh return ret } -func (ec *executionContext) marshalOFoundTribe2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐFoundTribeᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.FoundTribe) graphql.Marshaler { +func (ec *executionContext) marshalOFoundTribe2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐFoundTribeᚄ(ctx context.Context, sel ast.SelectionSet, v []*twmodel.FoundTribe) graphql.Marshaler { if v == nil { return graphql.Null } @@ -26660,7 +26661,7 @@ func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.Sele return graphql.MarshalInt(*v) } -func (ec *executionContext) marshalOPlayer2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayerᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.Player) graphql.Marshaler { +func (ec *executionContext) marshalOPlayer2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayerᚄ(ctx context.Context, sel ast.SelectionSet, v []*twmodel.Player) graphql.Marshaler { if v == nil { return graphql.Null } @@ -26700,14 +26701,14 @@ func (ec *executionContext) marshalOPlayer2ᚕᚖgithubᚗcomᚋtribalwarshelp return ret } -func (ec *executionContext) marshalOPlayer2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayer(ctx context.Context, sel ast.SelectionSet, v *models.Player) graphql.Marshaler { +func (ec *executionContext) marshalOPlayer2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayer(ctx context.Context, sel ast.SelectionSet, v *twmodel.Player) graphql.Marshaler { if v == nil { return graphql.Null } return ec._Player(ctx, sel, v) } -func (ec *executionContext) unmarshalOPlayerFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayerFilter(ctx context.Context, v interface{}) (*models.PlayerFilter, error) { +func (ec *executionContext) unmarshalOPlayerFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayerFilter(ctx context.Context, v interface{}) (*twmodel.PlayerFilter, error) { if v == nil { return nil, nil } @@ -26715,7 +26716,7 @@ func (ec *executionContext) unmarshalOPlayerFilter2ᚖgithubᚗcomᚋtribalwarsh return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOPlayerHistoryFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayerHistoryFilter(ctx context.Context, v interface{}) (*models.PlayerHistoryFilter, error) { +func (ec *executionContext) unmarshalOPlayerHistoryFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayerHistoryFilter(ctx context.Context, v interface{}) (*twmodel.PlayerHistoryFilter, error) { if v == nil { return nil, nil } @@ -26723,7 +26724,7 @@ func (ec *executionContext) unmarshalOPlayerHistoryFilter2ᚖgithubᚗcomᚋtrib return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOPlayerHistoryRecord2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayerHistoryᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.PlayerHistory) graphql.Marshaler { +func (ec *executionContext) marshalOPlayerHistoryRecord2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐPlayerHistoryᚄ(ctx context.Context, sel ast.SelectionSet, v []*twmodel.PlayerHistory) graphql.Marshaler { if v == nil { return graphql.Null } @@ -26763,7 +26764,7 @@ func (ec *executionContext) marshalOPlayerHistoryRecord2ᚕᚖgithubᚗcomᚋtri return ret } -func (ec *executionContext) marshalOServer2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.Server) graphql.Marshaler { +func (ec *executionContext) marshalOServer2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerᚄ(ctx context.Context, sel ast.SelectionSet, v []*twmodel.Server) graphql.Marshaler { if v == nil { return graphql.Null } @@ -26803,14 +26804,14 @@ func (ec *executionContext) marshalOServer2ᚕᚖgithubᚗcomᚋtribalwarshelp return ret } -func (ec *executionContext) marshalOServer2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServer(ctx context.Context, sel ast.SelectionSet, v *models.Server) graphql.Marshaler { +func (ec *executionContext) marshalOServer2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServer(ctx context.Context, sel ast.SelectionSet, v *twmodel.Server) graphql.Marshaler { if v == nil { return graphql.Null } return ec._Server(ctx, sel, v) } -func (ec *executionContext) unmarshalOServerFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerFilter(ctx context.Context, v interface{}) (*models.ServerFilter, error) { +func (ec *executionContext) unmarshalOServerFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerFilter(ctx context.Context, v interface{}) (*twmodel.ServerFilter, error) { if v == nil { return nil, nil } @@ -26818,7 +26819,7 @@ func (ec *executionContext) unmarshalOServerFilter2ᚖgithubᚗcomᚋtribalwarsh return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOServerStatsFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerStatsFilter(ctx context.Context, v interface{}) (*models.ServerStatsFilter, error) { +func (ec *executionContext) unmarshalOServerStatsFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerStatsFilter(ctx context.Context, v interface{}) (*twmodel.ServerStatsFilter, error) { if v == nil { return nil, nil } @@ -26826,7 +26827,7 @@ func (ec *executionContext) unmarshalOServerStatsFilter2ᚖgithubᚗcomᚋtribal return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOServerStatsRecord2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerStatsᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.ServerStats) graphql.Marshaler { +func (ec *executionContext) marshalOServerStatsRecord2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerStatsᚄ(ctx context.Context, sel ast.SelectionSet, v []*twmodel.ServerStats) graphql.Marshaler { if v == nil { return graphql.Null } @@ -26866,7 +26867,7 @@ func (ec *executionContext) marshalOServerStatsRecord2ᚕᚖgithubᚗcomᚋtriba return ret } -func (ec *executionContext) unmarshalOServerStatus2ᚕgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerStatusᚄ(ctx context.Context, v interface{}) ([]models.ServerStatus, error) { +func (ec *executionContext) unmarshalOServerStatus2ᚕgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerStatusᚄ(ctx context.Context, v interface{}) ([]twmodel.ServerStatus, error) { if v == nil { return nil, nil } @@ -26879,7 +26880,7 @@ func (ec *executionContext) unmarshalOServerStatus2ᚕgithubᚗcomᚋtribalwarsh } } var err error - res := make([]models.ServerStatus, len(vSlice)) + res := make([]twmodel.ServerStatus, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalNServerStatus2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerStatus(ctx, vSlice[i]) @@ -26890,7 +26891,7 @@ func (ec *executionContext) unmarshalOServerStatus2ᚕgithubᚗcomᚋtribalwarsh return res, nil } -func (ec *executionContext) marshalOServerStatus2ᚕgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerStatusᚄ(ctx context.Context, sel ast.SelectionSet, v []models.ServerStatus) graphql.Marshaler { +func (ec *executionContext) marshalOServerStatus2ᚕgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐServerStatusᚄ(ctx context.Context, sel ast.SelectionSet, v []twmodel.ServerStatus) graphql.Marshaler { if v == nil { return graphql.Null } @@ -26999,7 +27000,7 @@ func (ec *executionContext) marshalOTime2timeᚐTime(ctx context.Context, sel as return graphql.MarshalTime(v) } -func (ec *executionContext) marshalOTribe2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.Tribe) graphql.Marshaler { +func (ec *executionContext) marshalOTribe2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeᚄ(ctx context.Context, sel ast.SelectionSet, v []*twmodel.Tribe) graphql.Marshaler { if v == nil { return graphql.Null } @@ -27039,14 +27040,14 @@ func (ec *executionContext) marshalOTribe2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋ return ret } -func (ec *executionContext) marshalOTribe2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribe(ctx context.Context, sel ast.SelectionSet, v *models.Tribe) graphql.Marshaler { +func (ec *executionContext) marshalOTribe2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribe(ctx context.Context, sel ast.SelectionSet, v *twmodel.Tribe) graphql.Marshaler { if v == nil { return graphql.Null } return ec._Tribe(ctx, sel, v) } -func (ec *executionContext) unmarshalOTribeChangeFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeChangeFilter(ctx context.Context, v interface{}) (*models.TribeChangeFilter, error) { +func (ec *executionContext) unmarshalOTribeChangeFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeChangeFilter(ctx context.Context, v interface{}) (*twmodel.TribeChangeFilter, error) { if v == nil { return nil, nil } @@ -27054,7 +27055,7 @@ func (ec *executionContext) unmarshalOTribeChangeFilter2ᚖgithubᚗcomᚋtribal return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOTribeChangeFilterOr2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeChangeFilterOr(ctx context.Context, v interface{}) (*models.TribeChangeFilterOr, error) { +func (ec *executionContext) unmarshalOTribeChangeFilterOr2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeChangeFilterOr(ctx context.Context, v interface{}) (*twmodel.TribeChangeFilterOr, error) { if v == nil { return nil, nil } @@ -27062,7 +27063,7 @@ func (ec *executionContext) unmarshalOTribeChangeFilterOr2ᚖgithubᚗcomᚋtrib return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOTribeChangeRecord2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeChangeᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.TribeChange) graphql.Marshaler { +func (ec *executionContext) marshalOTribeChangeRecord2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeChangeᚄ(ctx context.Context, sel ast.SelectionSet, v []*twmodel.TribeChange) graphql.Marshaler { if v == nil { return graphql.Null } @@ -27102,7 +27103,7 @@ func (ec *executionContext) marshalOTribeChangeRecord2ᚕᚖgithubᚗcomᚋtriba return ret } -func (ec *executionContext) unmarshalOTribeFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeFilter(ctx context.Context, v interface{}) (*models.TribeFilter, error) { +func (ec *executionContext) unmarshalOTribeFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeFilter(ctx context.Context, v interface{}) (*twmodel.TribeFilter, error) { if v == nil { return nil, nil } @@ -27110,7 +27111,7 @@ func (ec *executionContext) unmarshalOTribeFilter2ᚖgithubᚗcomᚋtribalwarshe return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOTribeFilterOr2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeFilterOr(ctx context.Context, v interface{}) (*models.TribeFilterOr, error) { +func (ec *executionContext) unmarshalOTribeFilterOr2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeFilterOr(ctx context.Context, v interface{}) (*twmodel.TribeFilterOr, error) { if v == nil { return nil, nil } @@ -27118,7 +27119,7 @@ func (ec *executionContext) unmarshalOTribeFilterOr2ᚖgithubᚗcomᚋtribalwars return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOTribeHistoryFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeHistoryFilter(ctx context.Context, v interface{}) (*models.TribeHistoryFilter, error) { +func (ec *executionContext) unmarshalOTribeHistoryFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeHistoryFilter(ctx context.Context, v interface{}) (*twmodel.TribeHistoryFilter, error) { if v == nil { return nil, nil } @@ -27126,7 +27127,7 @@ func (ec *executionContext) unmarshalOTribeHistoryFilter2ᚖgithubᚗcomᚋtriba return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOTribeHistoryRecord2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeHistoryᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.TribeHistory) graphql.Marshaler { +func (ec *executionContext) marshalOTribeHistoryRecord2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐTribeHistoryᚄ(ctx context.Context, sel ast.SelectionSet, v []*twmodel.TribeHistory) graphql.Marshaler { if v == nil { return graphql.Null } @@ -27166,7 +27167,7 @@ func (ec *executionContext) marshalOTribeHistoryRecord2ᚕᚖgithubᚗcomᚋtrib return ret } -func (ec *executionContext) marshalOVersion2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersionᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.Version) graphql.Marshaler { +func (ec *executionContext) marshalOVersion2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersionᚄ(ctx context.Context, sel ast.SelectionSet, v []*twmodel.Version) graphql.Marshaler { if v == nil { return graphql.Null } @@ -27206,14 +27207,14 @@ func (ec *executionContext) marshalOVersion2ᚕᚖgithubᚗcomᚋtribalwarshelp return ret } -func (ec *executionContext) marshalOVersion2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersion(ctx context.Context, sel ast.SelectionSet, v *models.Version) graphql.Marshaler { +func (ec *executionContext) marshalOVersion2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersion(ctx context.Context, sel ast.SelectionSet, v *twmodel.Version) graphql.Marshaler { if v == nil { return graphql.Null } return ec._Version(ctx, sel, v) } -func (ec *executionContext) unmarshalOVersionCode2ᚕgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersionCodeᚄ(ctx context.Context, v interface{}) ([]models.VersionCode, error) { +func (ec *executionContext) unmarshalOVersionCode2ᚕgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersionCodeᚄ(ctx context.Context, v interface{}) ([]twmodel.VersionCode, error) { if v == nil { return nil, nil } @@ -27226,7 +27227,7 @@ func (ec *executionContext) unmarshalOVersionCode2ᚕgithubᚗcomᚋtribalwarshe } } var err error - res := make([]models.VersionCode, len(vSlice)) + res := make([]twmodel.VersionCode, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalNVersionCode2githubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersionCode(ctx, vSlice[i]) @@ -27237,7 +27238,7 @@ func (ec *executionContext) unmarshalOVersionCode2ᚕgithubᚗcomᚋtribalwarshe return res, nil } -func (ec *executionContext) marshalOVersionCode2ᚕgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersionCodeᚄ(ctx context.Context, sel ast.SelectionSet, v []models.VersionCode) graphql.Marshaler { +func (ec *executionContext) marshalOVersionCode2ᚕgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersionCodeᚄ(ctx context.Context, sel ast.SelectionSet, v []twmodel.VersionCode) graphql.Marshaler { if v == nil { return graphql.Null } @@ -27277,7 +27278,7 @@ func (ec *executionContext) marshalOVersionCode2ᚕgithubᚗcomᚋtribalwarshelp return ret } -func (ec *executionContext) unmarshalOVersionFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersionFilter(ctx context.Context, v interface{}) (*models.VersionFilter, error) { +func (ec *executionContext) unmarshalOVersionFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVersionFilter(ctx context.Context, v interface{}) (*twmodel.VersionFilter, error) { if v == nil { return nil, nil } @@ -27285,7 +27286,7 @@ func (ec *executionContext) unmarshalOVersionFilter2ᚖgithubᚗcomᚋtribalwars return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOVillage2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVillageᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.Village) graphql.Marshaler { +func (ec *executionContext) marshalOVillage2ᚕᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVillageᚄ(ctx context.Context, sel ast.SelectionSet, v []*twmodel.Village) graphql.Marshaler { if v == nil { return graphql.Null } @@ -27325,14 +27326,14 @@ func (ec *executionContext) marshalOVillage2ᚕᚖgithubᚗcomᚋtribalwarshelp return ret } -func (ec *executionContext) marshalOVillage2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVillage(ctx context.Context, sel ast.SelectionSet, v *models.Village) graphql.Marshaler { +func (ec *executionContext) marshalOVillage2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVillage(ctx context.Context, sel ast.SelectionSet, v *twmodel.Village) graphql.Marshaler { if v == nil { return graphql.Null } return ec._Village(ctx, sel, v) } -func (ec *executionContext) unmarshalOVillageFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVillageFilter(ctx context.Context, v interface{}) (*models.VillageFilter, error) { +func (ec *executionContext) unmarshalOVillageFilter2ᚖgithubᚗcomᚋtribalwarshelpᚋsharedᚋmodelsᚐVillageFilter(ctx context.Context, v interface{}) (*twmodel.VillageFilter, error) { if v == nil { return nil, nil } diff --git a/graphql/generated/models.go b/graphql/generated/models.go index 1143278..a9c85fa 100644 --- a/graphql/generated/models.go +++ b/graphql/generated/models.go @@ -3,75 +3,75 @@ package generated import ( - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type DailyPlayerStats struct { - Total int `json:"total"` - Items []*models.DailyPlayerStats `json:"items"` + Total int `json:"total"` + Items []*twmodel.DailyPlayerStats `json:"items"` } type DailyTribeStats struct { - Total int `json:"total"` - Items []*models.DailyTribeStats `json:"items"` + Total int `json:"total"` + Items []*twmodel.DailyTribeStats `json:"items"` } type EnnoblementList struct { - Items []*models.Ennoblement `json:"items"` - Total int `json:"total"` + Items []*twmodel.Ennoblement `json:"items"` + Total int `json:"total"` } type FoundPlayerList struct { - Items []*models.FoundPlayer `json:"items"` - Total int `json:"total"` + Items []*twmodel.FoundPlayer `json:"items"` + Total int `json:"total"` } type FoundTribeList struct { - Items []*models.FoundTribe `json:"items"` - Total int `json:"total"` + Items []*twmodel.FoundTribe `json:"items"` + Total int `json:"total"` } type PlayerHistory struct { - Total int `json:"total"` - Items []*models.PlayerHistory `json:"items"` + Total int `json:"total"` + Items []*twmodel.PlayerHistory `json:"items"` } type PlayerList struct { - Items []*models.Player `json:"items"` - Total int `json:"total"` + Items []*twmodel.Player `json:"items"` + Total int `json:"total"` } type ServerList struct { - Items []*models.Server `json:"items"` - Total int `json:"total"` + Items []*twmodel.Server `json:"items"` + Total int `json:"total"` } type ServerStats struct { - Items []*models.ServerStats `json:"items"` - Total int `json:"total"` + Items []*twmodel.ServerStats `json:"items"` + Total int `json:"total"` } type TribeChanges struct { - Total int `json:"total"` - Items []*models.TribeChange `json:"items"` + Total int `json:"total"` + Items []*twmodel.TribeChange `json:"items"` } type TribeHistory struct { - Total int `json:"total"` - Items []*models.TribeHistory `json:"items"` + Total int `json:"total"` + Items []*twmodel.TribeHistory `json:"items"` } type TribeList struct { - Items []*models.Tribe `json:"items"` - Total int `json:"total"` + Items []*twmodel.Tribe `json:"items"` + Total int `json:"total"` } type VersionList struct { - Items []*models.Version `json:"items"` - Total int `json:"total"` + Items []*twmodel.Version `json:"items"` + Total int `json:"total"` } type VillageList struct { - Items []*models.Village `json:"items"` - Total int `json:"total"` + Items []*twmodel.Village `json:"items"` + Total int `json:"total"` } diff --git a/graphql/gqlgen.yml b/graphql/gqlgen.yml index 47d6b98..838b8bd 100644 --- a/graphql/gqlgen.yml +++ b/graphql/gqlgen.yml @@ -4,7 +4,7 @@ exec: filename: generated/generated.go package: generated model: - filename: generated/models.go + filename: generated/twmodel.go package: generated resolver: filename: resolvers/resolver.go @@ -16,104 +16,104 @@ directives: skip_runtime: true models: VersionCode: - model: github.com/tribalwarshelp/shared/models.VersionCode + model: github.com/tribalwarshelp/shared/twmodel.VersionCode ServerStatus: - model: github.com/tribalwarshelp/shared/models.ServerStatus + model: github.com/tribalwarshelp/shared/twmodel.ServerStatus Version: - model: github.com/tribalwarshelp/shared/models.Version + model: github.com/tribalwarshelp/shared/twmodel.Version VersionFilter: - model: github.com/tribalwarshelp/shared/models.VersionFilter + model: github.com/tribalwarshelp/shared/twmodel.VersionFilter Server: - model: github.com/tribalwarshelp/shared/models.Server + model: github.com/tribalwarshelp/shared/twmodel.Server ServerConfig: - model: github.com/tribalwarshelp/shared/models.ServerConfig + model: github.com/tribalwarshelp/shared/twmodel.ServerConfig ServerConfigBuild: - model: github.com/tribalwarshelp/shared/models.ServerConfigBuild + model: github.com/tribalwarshelp/shared/twmodel.ServerConfigBuild ServerConfigMisc: - model: github.com/tribalwarshelp/shared/models.ServerConfigMisc + model: github.com/tribalwarshelp/shared/twmodel.ServerConfigMisc ServerConfigCommands: - model: github.com/tribalwarshelp/shared/models.ServerConfigCommands + model: github.com/tribalwarshelp/shared/twmodel.ServerConfigCommands ServerConfigNewbie: - model: github.com/tribalwarshelp/shared/models.ServerConfigNewbie + model: github.com/tribalwarshelp/shared/twmodel.ServerConfigNewbie ServerConfigGame: - model: github.com/tribalwarshelp/shared/models.ServerConfigGame + model: github.com/tribalwarshelp/shared/twmodel.ServerConfigGame ServerConfigBuildings: - model: github.com/tribalwarshelp/shared/models.ServerConfigBuildings + model: github.com/tribalwarshelp/shared/twmodel.ServerConfigBuildings ServerConfigSnob: - model: github.com/tribalwarshelp/shared/models.ServerConfigSnob + model: github.com/tribalwarshelp/shared/twmodel.ServerConfigSnob ServerConfigAlly: - model: github.com/tribalwarshelp/shared/models.ServerConfigAlly + model: github.com/tribalwarshelp/shared/twmodel.ServerConfigAlly ServerConfigCoord: - model: github.com/tribalwarshelp/shared/models.ServerConfigCoord + model: github.com/tribalwarshelp/shared/twmodel.ServerConfigCoord ServerConfigSitter: - model: github.com/tribalwarshelp/shared/models.ServerConfigSitter + model: github.com/tribalwarshelp/shared/twmodel.ServerConfigSitter ServerConfigSleep: - model: github.com/tribalwarshelp/shared/models.ServerConfigSleep + model: github.com/tribalwarshelp/shared/twmodel.ServerConfigSleep ServerConfigNight: - model: github.com/tribalwarshelp/shared/models.ServerConfigNight + model: github.com/tribalwarshelp/shared/twmodel.ServerConfigNight ServerConfigWin: - model: github.com/tribalwarshelp/shared/models.ServerConfigWin + model: github.com/tribalwarshelp/shared/twmodel.ServerConfigWin Unit: - model: github.com/tribalwarshelp/shared/models.Unit + model: github.com/tribalwarshelp/shared/twmodel.Unit UnitConfig: - model: github.com/tribalwarshelp/shared/models.UnitConfig + model: github.com/tribalwarshelp/shared/twmodel.UnitConfig Building: - model: github.com/tribalwarshelp/shared/models.Building + model: github.com/tribalwarshelp/shared/twmodel.Building BuildingConfig: - model: github.com/tribalwarshelp/shared/models.BuildingConfig + model: github.com/tribalwarshelp/shared/twmodel.BuildingConfig ServerFilter: - model: github.com/tribalwarshelp/shared/models.ServerFilter + model: github.com/tribalwarshelp/shared/twmodel.ServerFilter Player: - model: github.com/tribalwarshelp/shared/models.Player + model: github.com/tribalwarshelp/shared/twmodel.Player PlayerFilter: - model: github.com/tribalwarshelp/shared/models.PlayerFilter + model: github.com/tribalwarshelp/shared/twmodel.PlayerFilter FoundPlayer: - model: github.com/tribalwarshelp/shared/models.FoundPlayer + model: github.com/tribalwarshelp/shared/twmodel.FoundPlayer Tribe: - model: github.com/tribalwarshelp/shared/models.Tribe + model: github.com/tribalwarshelp/shared/twmodel.Tribe TribeFilter: - model: github.com/tribalwarshelp/shared/models.TribeFilter + model: github.com/tribalwarshelp/shared/twmodel.TribeFilter TribeFilterOr: - model: github.com/tribalwarshelp/shared/models.TribeFilterOr + model: github.com/tribalwarshelp/shared/twmodel.TribeFilterOr FoundTribe: - model: github.com/tribalwarshelp/shared/models.FoundTribe + model: github.com/tribalwarshelp/shared/twmodel.FoundTribe Village: - model: github.com/tribalwarshelp/shared/models.Village + model: github.com/tribalwarshelp/shared/twmodel.Village VillageFilter: - model: github.com/tribalwarshelp/shared/models.VillageFilter + model: github.com/tribalwarshelp/shared/twmodel.VillageFilter LiveEnnoblement: - model: github.com/tribalwarshelp/shared/models.LiveEnnoblement + model: github.com/tribalwarshelp/shared/twmodel.LiveEnnoblement Ennoblement: - model: github.com/tribalwarshelp/shared/models.Ennoblement + model: github.com/tribalwarshelp/shared/twmodel.Ennoblement EnnoblementFilter: - model: github.com/tribalwarshelp/shared/models.EnnoblementFilter + model: github.com/tribalwarshelp/shared/twmodel.EnnoblementFilter EnnoblementFilterOr: - model: github.com/tribalwarshelp/shared/models.EnnoblementFilterOr + model: github.com/tribalwarshelp/shared/twmodel.EnnoblementFilterOr PlayerHistoryRecord: - model: github.com/tribalwarshelp/shared/models.PlayerHistory + model: github.com/tribalwarshelp/shared/twmodel.PlayerHistory PlayerHistoryFilter: - model: github.com/tribalwarshelp/shared/models.PlayerHistoryFilter + model: github.com/tribalwarshelp/shared/twmodel.PlayerHistoryFilter TribeHistoryRecord: - model: github.com/tribalwarshelp/shared/models.TribeHistory + model: github.com/tribalwarshelp/shared/twmodel.TribeHistory TribeHistoryFilter: - model: github.com/tribalwarshelp/shared/models.TribeHistoryFilter + model: github.com/tribalwarshelp/shared/twmodel.TribeHistoryFilter ServerStatsRecord: - model: github.com/tribalwarshelp/shared/models.ServerStats + model: github.com/tribalwarshelp/shared/twmodel.ServerStats ServerStatsFilter: - model: github.com/tribalwarshelp/shared/models.ServerStatsFilter + model: github.com/tribalwarshelp/shared/twmodel.ServerStatsFilter TribeChangeRecord: - model: github.com/tribalwarshelp/shared/models.TribeChange + model: github.com/tribalwarshelp/shared/twmodel.TribeChange TribeChangeFilter: - model: github.com/tribalwarshelp/shared/models.TribeChangeFilter + model: github.com/tribalwarshelp/shared/twmodel.TribeChangeFilter TribeChangeFilterOr: - model: github.com/tribalwarshelp/shared/models.TribeChangeFilterOr + model: github.com/tribalwarshelp/shared/twmodel.TribeChangeFilterOr DailyPlayerStatsRecord: - model: github.com/tribalwarshelp/shared/models.DailyPlayerStats + model: github.com/tribalwarshelp/shared/twmodel.DailyPlayerStats DailyPlayerStatsFilter: - model: github.com/tribalwarshelp/shared/models.DailyPlayerStatsFilter + model: github.com/tribalwarshelp/shared/twmodel.DailyPlayerStatsFilter DailyTribeStatsRecord: - model: github.com/tribalwarshelp/shared/models.DailyTribeStats + model: github.com/tribalwarshelp/shared/twmodel.DailyTribeStats DailyTribeStatsFilter: - model: github.com/tribalwarshelp/shared/models.DailyTribeStatsFilter + model: github.com/tribalwarshelp/shared/twmodel.DailyTribeStatsFilter PlayerNameChange: - model: github.com/tribalwarshelp/shared/models.PlayerNameChange + model: github.com/tribalwarshelp/shared/twmodel.PlayerNameChange diff --git a/graphql/querycomplexity/query_complexity.go b/graphql/querycomplexity/query_complexity.go index 72778be..4bceb3c 100644 --- a/graphql/querycomplexity/query_complexity.go +++ b/graphql/querycomplexity/query_complexity.go @@ -1,6 +1,9 @@ package querycomplexity import ( + "github.com/Kichiyaki/goutil/safeptr" + "github.com/tribalwarshelp/shared/tw/twmodel" + "github.com/tribalwarshelp/api/dailyplayerstats" "github.com/tribalwarshelp/api/dailytribestats" "github.com/tribalwarshelp/api/ennoblement" @@ -12,10 +15,8 @@ import ( "github.com/tribalwarshelp/api/tribe" "github.com/tribalwarshelp/api/tribechange" "github.com/tribalwarshelp/api/tribehistory" - "github.com/tribalwarshelp/api/utils" "github.com/tribalwarshelp/api/version" "github.com/tribalwarshelp/api/village" - "github.com/tribalwarshelp/shared/models" ) const ( @@ -43,14 +44,14 @@ func GetComplexityRoot() generated.ComplexityRoot { complexityRoot.Query.DailyPlayerStats = func( childComplexity int, server string, - filter *models.DailyPlayerStatsFilter, + filter *twmodel.DailyPlayerStatsFilter, limit *int, offset *int, sort []string, ) int { return computeComplexity( childComplexity, - utils.SafeIntPointer(limit, dailyplayerstats.FetchLimit), + safeptr.SafeIntPointer(limit, dailyplayerstats.FetchLimit), dailyPlayerStatsTotalFieldComplexity, 1, ) @@ -60,14 +61,14 @@ func GetComplexityRoot() generated.ComplexityRoot { complexityRoot.Query.DailyTribeStats = func( childComplexity int, server string, - filter *models.DailyTribeStatsFilter, + filter *twmodel.DailyTribeStatsFilter, limit *int, offset *int, sort []string, ) int { return computeComplexity( childComplexity, - utils.SafeIntPointer(limit, dailytribestats.FetchLimit), + safeptr.SafeIntPointer(limit, dailytribestats.FetchLimit), dailyTribeStatsTotalFieldComplexity, 1, ) @@ -77,14 +78,14 @@ func GetComplexityRoot() generated.ComplexityRoot { complexityRoot.Query.Ennoblements = func( childComplexity int, server string, - filter *models.EnnoblementFilter, + filter *twmodel.EnnoblementFilter, limit *int, offset *int, sort []string, ) int { return computeComplexity( childComplexity, - utils.SafeIntPointer(limit, ennoblement.FetchLimit), + safeptr.SafeIntPointer(limit, ennoblement.FetchLimit), ennoblementsTotalFieldComplexity, 1, ) @@ -94,14 +95,14 @@ func GetComplexityRoot() generated.ComplexityRoot { complexityRoot.Query.PlayerHistory = func( childComplexity int, server string, - filter *models.PlayerHistoryFilter, + filter *twmodel.PlayerHistoryFilter, limit *int, offset *int, sort []string, ) int { return computeComplexity( childComplexity, - utils.SafeIntPointer(limit, playerhistory.FetchLimit), + safeptr.SafeIntPointer(limit, playerhistory.FetchLimit), playerHistoryTotalFieldComplexity, 1, ) @@ -111,14 +112,14 @@ func GetComplexityRoot() generated.ComplexityRoot { complexityRoot.Query.TribeHistory = func( childComplexity int, server string, - filter *models.TribeHistoryFilter, + filter *twmodel.TribeHistoryFilter, limit *int, offset *int, sort []string, ) int { return computeComplexity( childComplexity, - utils.SafeIntPointer(limit, tribehistory.FetchLimit), + safeptr.SafeIntPointer(limit, tribehistory.FetchLimit), tribeHistoryTotalFieldComplexity, 1, ) @@ -128,14 +129,14 @@ func GetComplexityRoot() generated.ComplexityRoot { complexityRoot.Query.TribeChanges = func( childComplexity int, server string, - filter *models.TribeChangeFilter, + filter *twmodel.TribeChangeFilter, limit *int, offset *int, sort []string, ) int { return computeComplexity( childComplexity, - utils.SafeIntPointer(limit, tribechange.FetchLimit), + safeptr.SafeIntPointer(limit, tribechange.FetchLimit), tribeChangesTotalFieldComplexity, 1, ) @@ -153,7 +154,7 @@ func GetComplexityRoot() generated.ComplexityRoot { ) int { return computeComplexity( childComplexity, - utils.SafeIntPointer(limit, player.FetchLimit), + safeptr.SafeIntPointer(limit, player.FetchLimit), searchPlayerTotalFieldComplexity, 3, ) @@ -170,7 +171,7 @@ func GetComplexityRoot() generated.ComplexityRoot { ) int { return computeComplexity( childComplexity, - utils.SafeIntPointer(limit, tribe.FetchLimit), + safeptr.SafeIntPointer(limit, tribe.FetchLimit), searchTribeTotalFieldComplexity, 3, ) @@ -186,14 +187,14 @@ func GetComplexityRoot() generated.ComplexityRoot { complexityRoot.Query.Players = func( childComplexity int, server string, - filter *models.PlayerFilter, + filter *twmodel.PlayerFilter, limit *int, offset *int, sort []string, ) int { return computeComplexity( childComplexity, - utils.SafeIntPointer(limit, player.FetchLimit), + safeptr.SafeIntPointer(limit, player.FetchLimit), playersTotalFieldComplexity, 1, ) @@ -203,14 +204,14 @@ func GetComplexityRoot() generated.ComplexityRoot { complexityRoot.Query.Tribes = func( childComplexity int, server string, - filter *models.TribeFilter, + filter *twmodel.TribeFilter, limit *int, offset *int, sort []string, ) int { return computeComplexity( childComplexity, - utils.SafeIntPointer(limit, tribe.FetchLimit), + safeptr.SafeIntPointer(limit, tribe.FetchLimit), tribesTotalFieldComplexity, 1, ) @@ -220,14 +221,14 @@ func GetComplexityRoot() generated.ComplexityRoot { complexityRoot.Query.Villages = func( childComplexity int, server string, - filter *models.VillageFilter, + filter *twmodel.VillageFilter, limit *int, offset *int, sort []string, ) int { return computeComplexity( childComplexity, - utils.SafeIntPointer(limit, village.FetchLimit), + safeptr.SafeIntPointer(limit, village.FetchLimit), villagesTotalFieldComplexity, 1, ) @@ -237,14 +238,14 @@ func GetComplexityRoot() generated.ComplexityRoot { complexityRoot.Query.ServerStats = func( childComplexity int, server string, - filter *models.ServerStatsFilter, + filter *twmodel.ServerStatsFilter, limit *int, offset *int, sort []string, ) int { return computeComplexity( childComplexity, - utils.SafeIntPointer(limit, serverstats.FetchLimit), + safeptr.SafeIntPointer(limit, serverstats.FetchLimit), serverStatsTotalFieldComplexity, 1, ) @@ -253,14 +254,14 @@ func GetComplexityRoot() generated.ComplexityRoot { complexityRoot.ServerList.Total = getCountComplexity complexityRoot.Query.Servers = func( childComplexity int, - filter *models.ServerFilter, + filter *twmodel.ServerFilter, limit *int, offset *int, sort []string, ) int { return computeComplexity( childComplexity, - utils.SafeIntPointer(limit, server.FetchLimit), + safeptr.SafeIntPointer(limit, server.FetchLimit), serversTotalFieldComplexity, 1, ) @@ -269,14 +270,14 @@ func GetComplexityRoot() generated.ComplexityRoot { complexityRoot.VersionList.Total = getCountComplexity complexityRoot.Query.Versions = func( childComplexity int, - filter *models.VersionFilter, + filter *twmodel.VersionFilter, limit *int, offset *int, sort []string, ) int { return computeComplexity( childComplexity, - utils.SafeIntPointer(limit, version.FetchLimit), + safeptr.SafeIntPointer(limit, version.FetchLimit), versionsTotalFieldComplexity, 1, ) diff --git a/graphql/resolvers/daily_player_stats.go b/graphql/resolvers/daily_player_stats.go index ecc9939..1656bbd 100644 --- a/graphql/resolvers/daily_player_stats.go +++ b/graphql/resolvers/daily_player_stats.go @@ -2,14 +2,14 @@ package resolvers import ( "context" - "github.com/tribalwarshelp/api/utils" + "github.com/Kichiyaki/goutil/safeptr" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/dailyplayerstats" "github.com/tribalwarshelp/api/graphql/generated" - "github.com/tribalwarshelp/shared/models" ) -func (r *dailyPlayerStatsRecordResolver) Player(ctx context.Context, obj *models.DailyPlayerStats) (*models.Player, error) { +func (r *dailyPlayerStatsRecordResolver) Player(ctx context.Context, obj *twmodel.DailyPlayerStats) (*twmodel.Player, error) { if obj.Player != nil { return obj.Player, nil } @@ -19,7 +19,7 @@ func (r *dailyPlayerStatsRecordResolver) Player(ctx context.Context, obj *models func (r *queryResolver) DailyPlayerStats(ctx context.Context, server string, - filter *models.DailyPlayerStatsFilter, + filter *twmodel.DailyPlayerStatsFilter, limit *int, offset *int, sort []string) (*generated.DailyPlayerStats, error) { @@ -29,8 +29,8 @@ func (r *queryResolver) DailyPlayerStats(ctx context.Context, Server: server, Filter: filter, Sort: sort, - Limit: utils.SafeIntPointer(limit, 0), - Offset: utils.SafeIntPointer(offset, 0), + Limit: safeptr.SafeIntPointer(limit, 0), + Offset: safeptr.SafeIntPointer(offset, 0), Select: shouldSelectItems(ctx), Count: shouldCount(ctx), }) diff --git a/graphql/resolvers/daily_tribe_stats.go b/graphql/resolvers/daily_tribe_stats.go index d7f61fa..33a37ec 100644 --- a/graphql/resolvers/daily_tribe_stats.go +++ b/graphql/resolvers/daily_tribe_stats.go @@ -2,14 +2,14 @@ package resolvers import ( "context" - "github.com/tribalwarshelp/api/utils" + "github.com/Kichiyaki/goutil/safeptr" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/dailytribestats" "github.com/tribalwarshelp/api/graphql/generated" - "github.com/tribalwarshelp/shared/models" ) -func (r *dailyTribeStatsRecordResolver) Tribe(ctx context.Context, obj *models.DailyTribeStats) (*models.Tribe, error) { +func (r *dailyTribeStatsRecordResolver) Tribe(ctx context.Context, obj *twmodel.DailyTribeStats) (*twmodel.Tribe, error) { if obj.Tribe != nil { return obj.Tribe, nil } @@ -19,7 +19,7 @@ func (r *dailyTribeStatsRecordResolver) Tribe(ctx context.Context, obj *models.D func (r *queryResolver) DailyTribeStats(ctx context.Context, server string, - filter *models.DailyTribeStatsFilter, + filter *twmodel.DailyTribeStatsFilter, limit *int, offset *int, sort []string) (*generated.DailyTribeStats, error) { @@ -29,8 +29,8 @@ func (r *queryResolver) DailyTribeStats(ctx context.Context, Server: server, Filter: filter, Sort: sort, - Limit: utils.SafeIntPointer(limit, 0), - Offset: utils.SafeIntPointer(offset, 0), + Limit: safeptr.SafeIntPointer(limit, 0), + Offset: safeptr.SafeIntPointer(offset, 0), Select: shouldSelectItems(ctx), Count: shouldCount(ctx), }) diff --git a/graphql/resolvers/ennoblement.go b/graphql/resolvers/ennoblement.go index 0ee62a6..2c60a5e 100644 --- a/graphql/resolvers/ennoblement.go +++ b/graphql/resolvers/ennoblement.go @@ -2,14 +2,14 @@ package resolvers import ( "context" - "github.com/tribalwarshelp/api/utils" + "github.com/Kichiyaki/goutil/safeptr" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/ennoblement" "github.com/tribalwarshelp/api/graphql/generated" - "github.com/tribalwarshelp/shared/models" ) -func (r *ennoblementResolver) NewOwner(ctx context.Context, obj *models.Ennoblement) (*models.Player, error) { +func (r *ennoblementResolver) NewOwner(ctx context.Context, obj *twmodel.Ennoblement) (*twmodel.Player, error) { if obj.NewOwner != nil { return obj.NewOwner, nil } @@ -17,7 +17,7 @@ func (r *ennoblementResolver) NewOwner(ctx context.Context, obj *models.Ennoblem return getPlayer(ctx, obj.NewOwnerID), nil } -func (r *ennoblementResolver) NewOwnerTribe(ctx context.Context, obj *models.Ennoblement) (*models.Tribe, error) { +func (r *ennoblementResolver) NewOwnerTribe(ctx context.Context, obj *twmodel.Ennoblement) (*twmodel.Tribe, error) { if obj.NewOwnerTribe != nil { return obj.NewOwnerTribe, nil } @@ -25,7 +25,7 @@ func (r *ennoblementResolver) NewOwnerTribe(ctx context.Context, obj *models.Enn return getTribe(ctx, obj.NewOwnerTribeID), nil } -func (r *ennoblementResolver) OldOwner(ctx context.Context, obj *models.Ennoblement) (*models.Player, error) { +func (r *ennoblementResolver) OldOwner(ctx context.Context, obj *twmodel.Ennoblement) (*twmodel.Player, error) { if obj.OldOwner != nil { return obj.OldOwner, nil } @@ -33,7 +33,7 @@ func (r *ennoblementResolver) OldOwner(ctx context.Context, obj *models.Ennoblem return getPlayer(ctx, obj.OldOwnerID), nil } -func (r *ennoblementResolver) OldOwnerTribe(ctx context.Context, obj *models.Ennoblement) (*models.Tribe, error) { +func (r *ennoblementResolver) OldOwnerTribe(ctx context.Context, obj *twmodel.Ennoblement) (*twmodel.Tribe, error) { if obj.OldOwnerTribe != nil { return obj.OldOwnerTribe, nil } @@ -41,7 +41,7 @@ func (r *ennoblementResolver) OldOwnerTribe(ctx context.Context, obj *models.Enn return getTribe(ctx, obj.OldOwnerTribeID), nil } -func (r *ennoblementResolver) Village(ctx context.Context, obj *models.Ennoblement) (*models.Village, error) { +func (r *ennoblementResolver) Village(ctx context.Context, obj *twmodel.Ennoblement) (*twmodel.Village, error) { if obj.Village != nil { return obj.Village, nil } @@ -50,7 +50,7 @@ func (r *ennoblementResolver) Village(ctx context.Context, obj *models.Ennobleme } func (r *queryResolver) Ennoblements(ctx context.Context, server string, - f *models.EnnoblementFilter, + f *twmodel.EnnoblementFilter, limit *int, offset *int, sort []string) (*generated.EnnoblementList, error) { @@ -60,8 +60,8 @@ func (r *queryResolver) Ennoblements(ctx context.Context, server string, Server: server, Filter: f, Sort: sort, - Limit: utils.SafeIntPointer(limit, 0), - Offset: utils.SafeIntPointer(offset, 0), + Limit: safeptr.SafeIntPointer(limit, 0), + Offset: safeptr.SafeIntPointer(offset, 0), Count: shouldCount(ctx), Select: shouldSelectItems(ctx), }) diff --git a/graphql/resolvers/helpers.go b/graphql/resolvers/helpers.go index a3653dd..ca76a8b 100644 --- a/graphql/resolvers/helpers.go +++ b/graphql/resolvers/helpers.go @@ -2,10 +2,11 @@ package resolvers import ( "context" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/99designs/gqlgen/graphql" + "github.com/tribalwarshelp/api/middleware" - "github.com/tribalwarshelp/shared/models" ) func getServer(ctx context.Context) (string, bool) { @@ -22,7 +23,7 @@ func getServer(ctx context.Context) (string, bool) { return server, ok } -func getPlayer(ctx context.Context, id int) *models.Player { +func getPlayer(ctx context.Context, id int) *twmodel.Player { if server, ok := getServer(ctx); ok { dataloaders := middleware.ServerDataLoadersFromContext(ctx) if dataloaders != nil { @@ -37,7 +38,7 @@ func getPlayer(ctx context.Context, id int) *models.Player { return nil } -func getVillage(ctx context.Context, id int) *models.Village { +func getVillage(ctx context.Context, id int) *twmodel.Village { if server, ok := getServer(ctx); ok { dataloaders := middleware.ServerDataLoadersFromContext(ctx) if dataloaders != nil { @@ -52,7 +53,7 @@ func getVillage(ctx context.Context, id int) *models.Village { return nil } -func getTribe(ctx context.Context, id int) *models.Tribe { +func getTribe(ctx context.Context, id int) *twmodel.Tribe { if server, ok := getServer(ctx); ok { dataloaders := middleware.ServerDataLoadersFromContext(ctx) if dataloaders != nil { diff --git a/graphql/resolvers/player.go b/graphql/resolvers/player.go index d3c8e60..0ff01c5 100644 --- a/graphql/resolvers/player.go +++ b/graphql/resolvers/player.go @@ -2,16 +2,15 @@ package resolvers import ( "context" - "github.com/tribalwarshelp/api/utils" + "github.com/Kichiyaki/goutil/safeptr" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/graphql/generated" "github.com/tribalwarshelp/api/middleware" "github.com/tribalwarshelp/api/player" - "github.com/tribalwarshelp/shared/models" - "github.com/tribalwarshelp/shared/tw" ) -func (r *playerResolver) Tribe(ctx context.Context, obj *models.Player) (*models.Tribe, error) { +func (r *playerResolver) Tribe(ctx context.Context, obj *twmodel.Player) (*twmodel.Tribe, error) { if obj.Tribe != nil { return obj.Tribe, nil } @@ -19,11 +18,11 @@ func (r *playerResolver) Tribe(ctx context.Context, obj *models.Player) (*models return getTribe(ctx, obj.TribeID), nil } -func (r *playerResolver) Servers(ctx context.Context, obj *models.Player) ([]string, error) { +func (r *playerResolver) Servers(ctx context.Context, obj *twmodel.Player) ([]string, error) { versionDataLoaders := middleware.VersionDataLoadersFromContext(ctx) if versionDataLoaders != nil { serverKey, _ := getServer(ctx) - if loaders, ok := versionDataLoaders[tw.VersionCodeFromServerKey(serverKey)]; ok { + if loaders, ok := versionDataLoaders[twmodel.VersionCodeFromServerKey(serverKey)]; ok { servers, err := loaders.PlayerServersByID.Load(obj.ID) if err == nil { return servers, nil @@ -33,23 +32,23 @@ func (r *playerResolver) Servers(ctx context.Context, obj *models.Player) ([]str return []string{}, nil } -func (r *playerResolver) NameChanges(ctx context.Context, obj *models.Player) ([]*models.PlayerNameChange, error) { +func (r *playerResolver) NameChanges(ctx context.Context, obj *twmodel.Player) ([]*twmodel.PlayerNameChange, error) { versionDataLoaders := middleware.VersionDataLoadersFromContext(ctx) if versionDataLoaders != nil { serverKey, _ := getServer(ctx) - if loaders, ok := versionDataLoaders[tw.VersionCodeFromServerKey(serverKey)]; ok { + if loaders, ok := versionDataLoaders[twmodel.VersionCodeFromServerKey(serverKey)]; ok { servers, err := loaders.PlayerNameChangesByID.Load(obj.ID) if err == nil { return servers, nil } } } - return []*models.PlayerNameChange{}, nil + return []*twmodel.PlayerNameChange{}, nil } func (r *queryResolver) Players(ctx context.Context, server string, - f *models.PlayerFilter, + f *twmodel.PlayerFilter, limit *int, offset *int, sort []string) (*generated.PlayerList, error) { @@ -59,15 +58,15 @@ func (r *queryResolver) Players(ctx context.Context, Server: server, Filter: f, Sort: sort, - Limit: utils.SafeIntPointer(limit, 0), - Offset: utils.SafeIntPointer(offset, 0), + Limit: safeptr.SafeIntPointer(limit, 0), + Offset: safeptr.SafeIntPointer(offset, 0), Count: shouldCount(ctx), Select: shouldSelectItems(ctx), }) return list, err } -func (r *queryResolver) Player(ctx context.Context, server string, id int) (*models.Player, error) { +func (r *queryResolver) Player(ctx context.Context, server string, id int) (*twmodel.Player, error) { return r.PlayerUcase.GetByID(ctx, server, id) } @@ -82,11 +81,11 @@ func (r *queryResolver) SearchPlayer(ctx context.Context, list := &generated.FoundPlayerList{} list.Items, list.Total, err = r.PlayerUcase.SearchPlayer(ctx, player.SearchPlayerConfig{ Sort: sort, - Limit: utils.SafeIntPointer(limit, 0), - Offset: utils.SafeIntPointer(offset, 0), + Limit: safeptr.SafeIntPointer(limit, 0), + Offset: safeptr.SafeIntPointer(offset, 0), Version: version, - Name: utils.SafeStrPointer(name, ""), - ID: utils.SafeIntPointer(id, 0), + Name: safeptr.SafeStringPointer(name, ""), + ID: safeptr.SafeIntPointer(id, 0), Count: shouldCount(ctx), }) return list, err diff --git a/graphql/resolvers/player_history.go b/graphql/resolvers/player_history.go index 6035261..a1826e6 100644 --- a/graphql/resolvers/player_history.go +++ b/graphql/resolvers/player_history.go @@ -2,14 +2,14 @@ package resolvers import ( "context" - "github.com/tribalwarshelp/api/utils" + "github.com/Kichiyaki/goutil/safeptr" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/graphql/generated" "github.com/tribalwarshelp/api/playerhistory" - "github.com/tribalwarshelp/shared/models" ) -func (r *playerHistoryRecordResolver) Player(ctx context.Context, obj *models.PlayerHistory) (*models.Player, error) { +func (r *playerHistoryRecordResolver) Player(ctx context.Context, obj *twmodel.PlayerHistory) (*twmodel.Player, error) { if obj.Player != nil { return obj.Player, nil } @@ -17,7 +17,7 @@ func (r *playerHistoryRecordResolver) Player(ctx context.Context, obj *models.Pl return getPlayer(ctx, obj.PlayerID), nil } -func (r *playerHistoryRecordResolver) Tribe(ctx context.Context, obj *models.PlayerHistory) (*models.Tribe, error) { +func (r *playerHistoryRecordResolver) Tribe(ctx context.Context, obj *twmodel.PlayerHistory) (*twmodel.Tribe, error) { if obj.Tribe != nil { return obj.Tribe, nil } @@ -27,7 +27,7 @@ func (r *playerHistoryRecordResolver) Tribe(ctx context.Context, obj *models.Pla func (r *Resolver) PlayerHistory(ctx context.Context, server string, - f *models.PlayerHistoryFilter, + f *twmodel.PlayerHistoryFilter, limit *int, offset *int, sort []string) (*generated.PlayerHistory, error) { @@ -37,8 +37,8 @@ func (r *Resolver) PlayerHistory(ctx context.Context, Server: server, Filter: f, Sort: sort, - Limit: utils.SafeIntPointer(limit, 0), - Offset: utils.SafeIntPointer(offset, 0), + Limit: safeptr.SafeIntPointer(limit, 0), + Offset: safeptr.SafeIntPointer(offset, 0), Count: shouldCount(ctx), Select: shouldSelectItems(ctx), }) diff --git a/graphql/resolvers/server.go b/graphql/resolvers/server.go index 87ecc40..05e2bc2 100644 --- a/graphql/resolvers/server.go +++ b/graphql/resolvers/server.go @@ -2,16 +2,16 @@ package resolvers import ( "context" - "github.com/tribalwarshelp/api/utils" + "github.com/Kichiyaki/goutil/safeptr" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/middleware" "github.com/tribalwarshelp/api/server" "github.com/tribalwarshelp/api/graphql/generated" - "github.com/tribalwarshelp/shared/models" ) -func (r *serverResolver) Version(ctx context.Context, obj *models.Server) (*models.Version, error) { +func (r *serverResolver) Version(ctx context.Context, obj *twmodel.Server) (*twmodel.Version, error) { loaders := middleware.DataLoadersFromContext(ctx) if loaders != nil { lv, _ := loaders.VersionByCode.Load(obj.VersionCode.String()) @@ -21,7 +21,7 @@ func (r *serverResolver) Version(ctx context.Context, obj *models.Server) (*mode } func (r *queryResolver) Servers(ctx context.Context, - f *models.ServerFilter, + f *twmodel.ServerFilter, limit *int, offset *int, sort []string) (*generated.ServerList, error) { @@ -30,14 +30,14 @@ func (r *queryResolver) Servers(ctx context.Context, list.Items, list.Total, err = r.ServerUcase.Fetch(ctx, server.FetchConfig{ Filter: f, Sort: sort, - Limit: utils.SafeIntPointer(limit, 0), - Offset: utils.SafeIntPointer(offset, 0), + Limit: safeptr.SafeIntPointer(limit, 0), + Offset: safeptr.SafeIntPointer(offset, 0), Count: shouldCount(ctx), Select: shouldSelectItems(ctx), }) return list, err } -func (r *queryResolver) Server(ctx context.Context, key string) (*models.Server, error) { +func (r *queryResolver) Server(ctx context.Context, key string) (*twmodel.Server, error) { return r.ServerUcase.GetByKey(ctx, key) } diff --git a/graphql/resolvers/server_stats.go b/graphql/resolvers/server_stats.go index fde66de..4e0e85d 100644 --- a/graphql/resolvers/server_stats.go +++ b/graphql/resolvers/server_stats.go @@ -2,16 +2,16 @@ package resolvers import ( "context" - "github.com/tribalwarshelp/api/utils" + "github.com/Kichiyaki/goutil/safeptr" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/graphql/generated" "github.com/tribalwarshelp/api/serverstats" - "github.com/tribalwarshelp/shared/models" ) func (r *Resolver) ServerStats(ctx context.Context, server string, - f *models.ServerStatsFilter, + f *twmodel.ServerStatsFilter, limit *int, offset *int, sort []string) (*generated.ServerStats, error) { @@ -21,8 +21,8 @@ func (r *Resolver) ServerStats(ctx context.Context, Server: server, Filter: f, Sort: sort, - Limit: utils.SafeIntPointer(limit, 0), - Offset: utils.SafeIntPointer(offset, 0), + Limit: safeptr.SafeIntPointer(limit, 0), + Offset: safeptr.SafeIntPointer(offset, 0), Count: shouldCount(ctx), Select: shouldSelectItems(ctx), }) diff --git a/graphql/resolvers/tribe.go b/graphql/resolvers/tribe.go index 79bee9e..d4aff5b 100644 --- a/graphql/resolvers/tribe.go +++ b/graphql/resolvers/tribe.go @@ -2,16 +2,16 @@ package resolvers import ( "context" - "github.com/tribalwarshelp/api/utils" + "github.com/Kichiyaki/goutil/safeptr" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/graphql/generated" "github.com/tribalwarshelp/api/tribe" - "github.com/tribalwarshelp/shared/models" ) func (r *queryResolver) Tribes(ctx context.Context, server string, - f *models.TribeFilter, + f *twmodel.TribeFilter, limit *int, offset *int, sort []string) (*generated.TribeList, error) { @@ -21,15 +21,15 @@ func (r *queryResolver) Tribes(ctx context.Context, Server: server, Filter: f, Sort: sort, - Limit: utils.SafeIntPointer(limit, 0), - Offset: utils.SafeIntPointer(offset, 0), + Limit: safeptr.SafeIntPointer(limit, 0), + Offset: safeptr.SafeIntPointer(offset, 0), Count: shouldCount(ctx), Select: shouldSelectItems(ctx), }) return list, err } -func (r *queryResolver) Tribe(ctx context.Context, server string, id int) (*models.Tribe, error) { +func (r *queryResolver) Tribe(ctx context.Context, server string, id int) (*twmodel.Tribe, error) { return r.TribeUcase.GetByID(ctx, server, id) } @@ -43,8 +43,8 @@ func (r *queryResolver) SearchTribe(ctx context.Context, list := &generated.FoundTribeList{} list.Items, list.Total, err = r.TribeUcase.SearchTribe(ctx, tribe.SearchTribeConfig{ Sort: sort, - Limit: utils.SafeIntPointer(limit, 0), - Offset: utils.SafeIntPointer(offset, 0), + Limit: safeptr.SafeIntPointer(limit, 0), + Offset: safeptr.SafeIntPointer(offset, 0), Version: version, Query: query, Count: shouldCount(ctx), diff --git a/graphql/resolvers/tribe_change.go b/graphql/resolvers/tribe_change.go index 5afde8a..ba3b19a 100644 --- a/graphql/resolvers/tribe_change.go +++ b/graphql/resolvers/tribe_change.go @@ -2,14 +2,14 @@ package resolvers import ( "context" - "github.com/tribalwarshelp/api/utils" + "github.com/Kichiyaki/goutil/safeptr" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/graphql/generated" "github.com/tribalwarshelp/api/tribechange" - "github.com/tribalwarshelp/shared/models" ) -func (r *tribeChangeRecordResolver) Player(ctx context.Context, obj *models.TribeChange) (*models.Player, error) { +func (r *tribeChangeRecordResolver) Player(ctx context.Context, obj *twmodel.TribeChange) (*twmodel.Player, error) { if obj.Player != nil { return obj.Player, nil } @@ -17,7 +17,7 @@ func (r *tribeChangeRecordResolver) Player(ctx context.Context, obj *models.Trib return getPlayer(ctx, obj.PlayerID), nil } -func (r *tribeChangeRecordResolver) NewTribe(ctx context.Context, obj *models.TribeChange) (*models.Tribe, error) { +func (r *tribeChangeRecordResolver) NewTribe(ctx context.Context, obj *twmodel.TribeChange) (*twmodel.Tribe, error) { if obj.NewTribe != nil { return obj.NewTribe, nil } @@ -25,7 +25,7 @@ func (r *tribeChangeRecordResolver) NewTribe(ctx context.Context, obj *models.Tr return getTribe(ctx, obj.NewTribeID), nil } -func (r *tribeChangeRecordResolver) OldTribe(ctx context.Context, obj *models.TribeChange) (*models.Tribe, error) { +func (r *tribeChangeRecordResolver) OldTribe(ctx context.Context, obj *twmodel.TribeChange) (*twmodel.Tribe, error) { if obj.OldTribe != nil { return obj.OldTribe, nil } @@ -35,7 +35,7 @@ func (r *tribeChangeRecordResolver) OldTribe(ctx context.Context, obj *models.Tr func (r *Resolver) TribeChanges(ctx context.Context, server string, - f *models.TribeChangeFilter, + f *twmodel.TribeChangeFilter, limit *int, offset *int, sort []string) (*generated.TribeChanges, error) { @@ -44,8 +44,8 @@ func (r *Resolver) TribeChanges(ctx context.Context, list.Items, list.Total, err = r.TribeChangeUcase.Fetch(ctx, tribechange.FetchConfig{ Filter: f, Sort: sort, - Limit: utils.SafeIntPointer(limit, 0), - Offset: utils.SafeIntPointer(offset, 0), + Limit: safeptr.SafeIntPointer(limit, 0), + Offset: safeptr.SafeIntPointer(offset, 0), Count: shouldCount(ctx), Select: shouldSelectItems(ctx), Server: server, diff --git a/graphql/resolvers/tribe_history.go b/graphql/resolvers/tribe_history.go index a89d381..d850717 100644 --- a/graphql/resolvers/tribe_history.go +++ b/graphql/resolvers/tribe_history.go @@ -2,14 +2,14 @@ package resolvers import ( "context" - "github.com/tribalwarshelp/api/utils" + "github.com/Kichiyaki/goutil/safeptr" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/graphql/generated" "github.com/tribalwarshelp/api/tribehistory" - "github.com/tribalwarshelp/shared/models" ) -func (r *tribeHistoryRecordResolver) Tribe(ctx context.Context, obj *models.TribeHistory) (*models.Tribe, error) { +func (r *tribeHistoryRecordResolver) Tribe(ctx context.Context, obj *twmodel.TribeHistory) (*twmodel.Tribe, error) { if obj.Tribe != nil { return obj.Tribe, nil } @@ -19,7 +19,7 @@ func (r *tribeHistoryRecordResolver) Tribe(ctx context.Context, obj *models.Trib func (r *Resolver) TribeHistory(ctx context.Context, server string, - f *models.TribeHistoryFilter, + f *twmodel.TribeHistoryFilter, limit *int, offset *int, sort []string) (*generated.TribeHistory, error) { @@ -28,8 +28,8 @@ func (r *Resolver) TribeHistory(ctx context.Context, list.Items, list.Total, err = r.TribeHistoryUcase.Fetch(ctx, tribehistory.FetchConfig{ Filter: f, Sort: sort, - Limit: utils.SafeIntPointer(limit, 0), - Offset: utils.SafeIntPointer(offset, 0), + Limit: safeptr.SafeIntPointer(limit, 0), + Offset: safeptr.SafeIntPointer(offset, 0), Count: shouldCount(ctx), Select: shouldSelectItems(ctx), Server: server, diff --git a/graphql/resolvers/version.go b/graphql/resolvers/version.go index 11fc905..daadefc 100644 --- a/graphql/resolvers/version.go +++ b/graphql/resolvers/version.go @@ -2,15 +2,15 @@ package resolvers import ( "context" - "github.com/tribalwarshelp/api/utils" + "github.com/Kichiyaki/goutil/safeptr" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/graphql/generated" "github.com/tribalwarshelp/api/version" - "github.com/tribalwarshelp/shared/models" ) func (r *queryResolver) Versions(ctx context.Context, - f *models.VersionFilter, + f *twmodel.VersionFilter, limit *int, offset *int, sort []string) (*generated.VersionList, error) { @@ -19,14 +19,14 @@ func (r *queryResolver) Versions(ctx context.Context, list.Items, list.Total, err = r.VersionUcase.Fetch(ctx, version.FetchConfig{ Filter: f, Sort: sort, - Limit: utils.SafeIntPointer(limit, 0), - Offset: utils.SafeIntPointer(offset, 0), + Limit: safeptr.SafeIntPointer(limit, 0), + Offset: safeptr.SafeIntPointer(offset, 0), Select: shouldSelectItems(ctx), Count: shouldCount(ctx), }) return list, err } -func (r *queryResolver) Version(ctx context.Context, code models.VersionCode) (*models.Version, error) { +func (r *queryResolver) Version(ctx context.Context, code twmodel.VersionCode) (*twmodel.Version, error) { return r.VersionUcase.GetByCode(ctx, code) } diff --git a/graphql/resolvers/village.go b/graphql/resolvers/village.go index 02c9fbe..0c1cc18 100644 --- a/graphql/resolvers/village.go +++ b/graphql/resolvers/village.go @@ -2,14 +2,14 @@ package resolvers import ( "context" - "github.com/tribalwarshelp/api/utils" + "github.com/Kichiyaki/goutil/safeptr" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/graphql/generated" "github.com/tribalwarshelp/api/village" - "github.com/tribalwarshelp/shared/models" ) -func (r *villageResolver) Player(ctx context.Context, obj *models.Village) (*models.Player, error) { +func (r *villageResolver) Player(ctx context.Context, obj *twmodel.Village) (*twmodel.Player, error) { if obj.Player != nil { return obj.Player, nil } @@ -19,7 +19,7 @@ func (r *villageResolver) Player(ctx context.Context, obj *models.Village) (*mod func (r *queryResolver) Villages(ctx context.Context, server string, - f *models.VillageFilter, + f *twmodel.VillageFilter, limit *int, offset *int, sort []string) (*generated.VillageList, error) { @@ -28,8 +28,8 @@ func (r *queryResolver) Villages(ctx context.Context, list.Items, list.Total, err = r.VillageUcase.Fetch(ctx, village.FetchConfig{ Filter: f, Sort: sort, - Limit: utils.SafeIntPointer(limit, 0), - Offset: utils.SafeIntPointer(offset, 0), + Limit: safeptr.SafeIntPointer(limit, 0), + Offset: safeptr.SafeIntPointer(offset, 0), Select: shouldSelectItems(ctx), Count: shouldCount(ctx), Server: server, @@ -37,6 +37,6 @@ func (r *queryResolver) Villages(ctx context.Context, return list, err } -func (r *queryResolver) Village(ctx context.Context, server string, id int) (*models.Village, error) { +func (r *queryResolver) Village(ctx context.Context, server string, id int) (*twmodel.Village, error) { return r.VillageUcase.GetByID(ctx, server, id) } diff --git a/main.go b/main.go index e627ae0..18c4fbf 100644 --- a/main.go +++ b/main.go @@ -2,11 +2,12 @@ package main import ( "context" + "github.com/Kichiyaki/appmode" + "github.com/Kichiyaki/goutil/envutil" "github.com/sirupsen/logrus" "net/http" "os" "os/signal" - "strconv" "strings" "time" @@ -14,8 +15,6 @@ import ( servermaphttpdelivery "github.com/tribalwarshelp/api/servermap/delivery/http" - "github.com/tribalwarshelp/shared/mode" - httpdelivery "github.com/tribalwarshelp/api/graphql/delivery/http" "github.com/tribalwarshelp/api/graphql/resolvers" @@ -59,7 +58,7 @@ import ( func init() { os.Setenv("TZ", "UTC") - if mode.Get() == mode.DevelopmentMode { + if appmode.Equals(appmode.DevelopmentMode) { godotenv.Load(".env.local") } @@ -72,7 +71,7 @@ func main() { Password: os.Getenv("DB_PASSWORD"), Database: os.Getenv("DB_NAME"), Addr: os.Getenv("DB_HOST") + ":" + os.Getenv("DB_PORT"), - PoolSize: mustParseEnvToInt("DB_POOL_SIZE"), + PoolSize: envutil.GetenvInt("DB_POOL_SIZE"), }) defer func() { if err := db.Close(); err != nil { @@ -109,7 +108,7 @@ func main() { router := gin.New() router.Use(ginlogrus.Logger(logrus.WithField("hostname", "api")), gin.Recovery()) - if mode.Get() == mode.DevelopmentMode { + if appmode.Equals(appmode.DevelopmentMode) { router.Use(cors.New(cors.Config{ AllowOriginFunc: func(string) bool { return true @@ -187,25 +186,13 @@ func main() { logrus.Println("Server exiting") } -func mustParseEnvToInt(key string) int { - str := os.Getenv(key) - if str == "" { - return 0 - } - i, err := strconv.Atoi(str) - if err != nil { - return 0 - } - return i -} - func setupLogger() { - if mode.Get() == mode.DevelopmentMode { + if appmode.Equals(appmode.DevelopmentMode) { logrus.SetLevel(logrus.DebugLevel) } timestampFormat := "2006-01-02 15:04:05" - if mode.Get() == mode.ProductionMode { + if appmode.Equals(appmode.ProductionMode) { customFormatter := new(logrus.JSONFormatter) customFormatter.TimestampFormat = timestampFormat logrus.SetFormatter(customFormatter) diff --git a/middleware/dataloaders_to_context.go b/middleware/dataloaders_to_context.go index c977040..df3b109 100644 --- a/middleware/dataloaders_to_context.go +++ b/middleware/dataloaders_to_context.go @@ -2,16 +2,16 @@ package middleware import ( "context" + "github.com/Kichiyaki/goutil/strutil" + "github.com/tribalwarshelp/shared/tw/twmodel" "net/http" "github.com/vektah/gqlparser/v2/gqlerror" + "github.com/gin-gonic/gin" + "github.com/tribalwarshelp/api/graphql/dataloaders" "github.com/tribalwarshelp/api/server" - "github.com/tribalwarshelp/api/utils" - "github.com/tribalwarshelp/shared/models" - - "github.com/gin-gonic/gin" ) var serverDataLoadersContextKey ContextKey = "serverDataLoaders" @@ -26,9 +26,9 @@ func DataLoadersToContext(dltcc DataLoadersToContextConfig, cfg dataloaders.Conf return func(c *gin.Context) { ctx := c.Request.Context() serverDataLoaders := make(map[string]*dataloaders.ServerDataLoaders) - versionDataLoaders := make(map[models.VersionCode]*dataloaders.VersionDataLoaders) + versionDataLoaders := make(map[twmodel.VersionCode]*dataloaders.VersionDataLoaders) servers, _, err := dltcc.ServerRepo.Fetch(c.Request.Context(), server.FetchConfig{ - Columns: []string{utils.Underscore("versionCode"), "key"}, + Columns: []string{strutil.Underscore("versionCode"), "key"}, Select: true, }) if err != nil { @@ -65,17 +65,17 @@ func ServerDataLoadersFromContext(ctx context.Context) map[string]*dataloaders.S return dl.(map[string]*dataloaders.ServerDataLoaders) } -func StoreVersionDataLoadersInContext(ctx context.Context, loaders map[models.VersionCode]*dataloaders.VersionDataLoaders) context.Context { +func StoreVersionDataLoadersInContext(ctx context.Context, loaders map[twmodel.VersionCode]*dataloaders.VersionDataLoaders) context.Context { return context.WithValue(ctx, versionLoadersContextKey, loaders) } -func VersionDataLoadersFromContext(ctx context.Context) map[models.VersionCode]*dataloaders.VersionDataLoaders { +func VersionDataLoadersFromContext(ctx context.Context) map[twmodel.VersionCode]*dataloaders.VersionDataLoaders { dl := ctx.Value(versionLoadersContextKey) if dl == nil { return nil } - return dl.(map[models.VersionCode]*dataloaders.VersionDataLoaders) + return dl.(map[twmodel.VersionCode]*dataloaders.VersionDataLoaders) } func StoreDataLoadersInContext(ctx context.Context, loaders *dataloaders.DataLoaders) context.Context { diff --git a/middleware/limit_whitelist.go b/middleware/limit_whitelist.go index b3c6d29..2d71027 100644 --- a/middleware/limit_whitelist.go +++ b/middleware/limit_whitelist.go @@ -2,10 +2,10 @@ package middleware import ( "context" + "github.com/Kichiyaki/appmode" "net" "github.com/gin-gonic/gin" - "github.com/tribalwarshelp/shared/mode" ) var limitWhitelistContextKey ContextKey = "limitWhitelist" @@ -59,7 +59,7 @@ func LimitWhitelist(cfg LimitWhitelistConfig) gin.HandlerFunc { return func(c *gin.Context) { ctx := c.Request.Context() clientIP := net.ParseIP(c.ClientIP()) - canExceedLimit := networksAndIps.Contains(clientIP) || mode.Get() == mode.DevelopmentMode + canExceedLimit := networksAndIps.Contains(clientIP) || appmode.Equals(appmode.DevelopmentMode) ctx = StoreLimitWhitelistDataInContext(ctx, canExceedLimit) c.Request = c.Request.WithContext(ctx) c.Next() diff --git a/player/repository.go b/player/repository.go index 6a844d4..cc4d888 100644 --- a/player/repository.go +++ b/player/repository.go @@ -2,13 +2,12 @@ package player import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type FetchConfig struct { Server string - Filter *models.PlayerFilter + Filter *twmodel.PlayerFilter Select bool Count bool Sort []string @@ -27,8 +26,8 @@ type SearchPlayerConfig struct { } type Repository interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.Player, int, error) - FetchNameChanges(ctx context.Context, code models.VersionCode, playerID ...int) (map[int][]*models.PlayerNameChange, error) - FetchPlayerServers(ctx context.Context, code models.VersionCode, playerID ...int) (map[int][]string, error) - SearchPlayer(ctx context.Context, cfg SearchPlayerConfig) ([]*models.FoundPlayer, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.Player, int, error) + FetchNameChanges(ctx context.Context, code twmodel.VersionCode, playerID ...int) (map[int][]*twmodel.PlayerNameChange, error) + FetchPlayerServers(ctx context.Context, code twmodel.VersionCode, playerID ...int) (map[int][]string, error) + SearchPlayer(ctx context.Context, cfg SearchPlayerConfig) ([]*twmodel.FoundPlayer, int, error) } diff --git a/player/repository/pg_repository.go b/player/repository/pg_repository.go index 96531cf..247bd44 100644 --- a/player/repository/pg_repository.go +++ b/player/repository/pg_repository.go @@ -2,13 +2,15 @@ package repository import ( "context" - "fmt" + "github.com/Kichiyaki/gopgutil/v10" + "github.com/pkg/errors" + "github.com/tribalwarshelp/shared/tw/twmodel" "strings" "github.com/go-pg/pg/v10" "github.com/go-pg/pg/v10/orm" + "github.com/tribalwarshelp/api/player" - "github.com/tribalwarshelp/shared/models" ) type pgRepository struct { @@ -19,25 +21,21 @@ func NewPGRepository(db *pg.DB) player.Repository { return &pgRepository{db} } -func (repo *pgRepository) Fetch(ctx context.Context, cfg player.FetchConfig) ([]*models.Player, int, error) { +func (repo *pgRepository) Fetch(ctx context.Context, cfg player.FetchConfig) ([]*twmodel.Player, int, error) { var err error - data := []*models.Player{} + data := []*twmodel.Player{} total := 0 query := repo. WithParam("SERVER", pg.Safe(cfg.Server)). Model(&data). Context(ctx). Limit(cfg.Limit). - Offset(cfg.Offset) - relationshipAndSortAppender := &models.PlayerRelationshipAndSortAppender{ - Filter: &models.PlayerFilter{}, - Sort: cfg.Sort, - } - if cfg.Filter != nil { - query = query.Apply(cfg.Filter.Where) - relationshipAndSortAppender.Filter = cfg.Filter - } - query = query.Apply(relationshipAndSortAppender.Append) + Offset(cfg.Offset). + Apply(cfg.Filter.WhereWithRelations). + Apply(gopgutil.OrderAppender{ + Orders: cfg.Sort, + MaxDepth: 4, + }.Apply) if cfg.Count && cfg.Select { total, err = query.SelectAndCount() @@ -48,9 +46,9 @@ func (repo *pgRepository) Fetch(ctx context.Context, cfg player.FetchConfig) ([] } if err != nil && err != pg.ErrNoRows { if strings.Contains(err.Error(), `relation "`+cfg.Server) { - return nil, 0, fmt.Errorf("Server not found") + return nil, 0, errors.New("Server not found") } - return nil, 0, fmt.Errorf("Internal server error") + return nil, 0, errors.New("Internal server error") } return data, total, nil @@ -61,27 +59,27 @@ type fetchPlayerServersQueryResult struct { Servers []string `pg:",array"` } -func (repo *pgRepository) FetchNameChanges(ctx context.Context, code models.VersionCode, playerID ...int) (map[int][]*models.PlayerNameChange, error) { - data := []*models.PlayerNameChange{} +func (repo *pgRepository) FetchNameChanges(ctx context.Context, code twmodel.VersionCode, playerID ...int) (map[int][]*twmodel.PlayerNameChange, error) { + data := []*twmodel.PlayerNameChange{} if err := repo.Model(&data). Context(ctx). Where("version_code = ?", code). Where("player_id IN (?)", pg.In(playerID)). Order("change_date ASC"). Select(); err != nil && err != pg.ErrNoRows { - return nil, fmt.Errorf("Internal server error") + return nil, errors.New("Internal server error") } - m := make(map[int][]*models.PlayerNameChange) + m := make(map[int][]*twmodel.PlayerNameChange) for _, res := range data { m[res.PlayerID] = append(m[res.PlayerID], res) } return m, nil } -func (repo *pgRepository) FetchPlayerServers(ctx context.Context, code models.VersionCode, playerID ...int) (map[int][]string, error) { +func (repo *pgRepository) FetchPlayerServers(ctx context.Context, code twmodel.VersionCode, playerID ...int) (map[int][]string, error) { data := []*fetchPlayerServersQueryResult{} - if err := repo.Model(&models.PlayerToServer{}). + if err := repo.Model(&twmodel.PlayerToServer{}). Context(ctx). Column("player_id"). ColumnExpr("array_agg(server_key) as servers"). @@ -90,7 +88,7 @@ func (repo *pgRepository) FetchPlayerServers(ctx context.Context, code models.Ve Where("player_id IN (?)", pg.In(playerID)). Group("player_id"). Select(&data); err != nil && err != pg.ErrNoRows { - return nil, fmt.Errorf("Internal server error") + return nil, errors.New("Internal server error") } m := make(map[int][]string) @@ -100,19 +98,19 @@ func (repo *pgRepository) FetchPlayerServers(ctx context.Context, code models.Ve return m, nil } -func (repo *pgRepository) SearchPlayer(ctx context.Context, cfg player.SearchPlayerConfig) ([]*models.FoundPlayer, int, error) { - servers := []*models.Server{} +func (repo *pgRepository) SearchPlayer(ctx context.Context, cfg player.SearchPlayerConfig) ([]*twmodel.FoundPlayer, int, error) { + servers := []*twmodel.Server{} if err := repo. Model(&servers). Context(ctx). Column("key"). Where("version_code = ?", cfg.Version). Select(); err != nil { - return nil, 0, fmt.Errorf("Internal server error") + return nil, 0, errors.New("Internal server error") } var query *orm.Query - res := []*models.FoundPlayer{} + res := []*twmodel.FoundPlayer{} whereClause := "player.id = ?1 OR player.name ILIKE ?0" if cfg.ID <= 0 { whereClause = "player.name ILIKE ?0" @@ -147,14 +145,17 @@ func (repo *pgRepository) SearchPlayer(ctx context.Context, cfg player.SearchPla Table("union_q"). Limit(cfg.Limit). Offset(cfg.Offset). - Order(cfg.Sort...) + Apply(gopgutil.OrderAppender{ + Orders: cfg.Sort, + MaxDepth: 4, + }.Apply) if cfg.Count { count, err = base.SelectAndCount(&res) } else { err = base.Select(&res) } if err != nil && err != pg.ErrNoRows { - return nil, 0, fmt.Errorf("Internal server error") + return nil, 0, errors.New("Internal server error") } } diff --git a/player/usecase.go b/player/usecase.go index 20e9a1c..1a1bf11 100644 --- a/player/usecase.go +++ b/player/usecase.go @@ -2,12 +2,11 @@ package player import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type Usecase interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.Player, int, error) - GetByID(ctx context.Context, server string, id int) (*models.Player, error) - SearchPlayer(ctx context.Context, cfg SearchPlayerConfig) ([]*models.FoundPlayer, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.Player, int, error) + GetByID(ctx context.Context, server string, id int) (*twmodel.Player, error) + SearchPlayer(ctx context.Context, cfg SearchPlayerConfig) ([]*twmodel.FoundPlayer, int, error) } diff --git a/player/usecase/player_usecase.go b/player/usecase/player_usecase.go index 1886a5f..daf5fd7 100644 --- a/player/usecase/player_usecase.go +++ b/player/usecase/player_usecase.go @@ -3,12 +3,12 @@ package usecase import ( "context" "fmt" + "github.com/pkg/errors" + "github.com/tribalwarshelp/shared/tw/twmodel" "strings" "github.com/tribalwarshelp/api/middleware" "github.com/tribalwarshelp/api/player" - "github.com/tribalwarshelp/api/utils" - "github.com/tribalwarshelp/shared/models" ) type usecase struct { @@ -19,22 +19,20 @@ func New(repo player.Repository) player.Usecase { return &usecase{repo} } -func (ucase *usecase) Fetch(ctx context.Context, cfg player.FetchConfig) ([]*models.Player, int, error) { +func (ucase *usecase) Fetch(ctx context.Context, cfg player.FetchConfig) ([]*twmodel.Player, int, error) { if cfg.Filter == nil { - cfg.Filter = &models.PlayerFilter{} + cfg.Filter = &twmodel.PlayerFilter{} } - if !middleware.CanExceedLimit(ctx) && (cfg.Limit > player.FetchLimit || cfg.Limit <= 0) { cfg.Limit = player.FetchLimit } - cfg.Sort = utils.SanitizeSorts(cfg.Sort) return ucase.repo.Fetch(ctx, cfg) } -func (ucase *usecase) GetByID(ctx context.Context, server string, id int) (*models.Player, error) { +func (ucase *usecase) GetByID(ctx context.Context, server string, id int) (*twmodel.Player, error) { players, _, err := ucase.repo.Fetch(ctx, player.FetchConfig{ Server: server, - Filter: &models.PlayerFilter{ + Filter: &twmodel.PlayerFilter{ ID: []int{id}, }, Limit: 1, @@ -50,16 +48,15 @@ func (ucase *usecase) GetByID(ctx context.Context, server string, id int) (*mode return players[0], nil } -func (ucase *usecase) SearchPlayer(ctx context.Context, cfg player.SearchPlayerConfig) ([]*models.FoundPlayer, int, error) { +func (ucase *usecase) SearchPlayer(ctx context.Context, cfg player.SearchPlayerConfig) ([]*twmodel.FoundPlayer, int, error) { if "" == strings.TrimSpace(cfg.Version) { - return nil, 0, fmt.Errorf("Version is required.") + return nil, 0, errors.New("Version is required.") } if "" == strings.TrimSpace(cfg.Name) && cfg.ID <= 0 { - return nil, 0, fmt.Errorf("Your search is ambiguous. You must specify the variable 'name' or 'id'.") + return nil, 0, errors.New("Your search is ambiguous. You must specify the variable 'name' or 'id'.") } if !middleware.CanExceedLimit(ctx) && (cfg.Limit > player.FetchLimit || cfg.Limit <= 0) { cfg.Limit = player.FetchLimit } - cfg.Sort = utils.SanitizeSorts(cfg.Sort) return ucase.repo.SearchPlayer(ctx, cfg) } diff --git a/playerhistory/repository.go b/playerhistory/repository.go index a65cd53..85beb97 100644 --- a/playerhistory/repository.go +++ b/playerhistory/repository.go @@ -2,13 +2,12 @@ package playerhistory import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type FetchConfig struct { Server string - Filter *models.PlayerHistoryFilter + Filter *twmodel.PlayerHistoryFilter Count bool Select bool Sort []string @@ -17,5 +16,5 @@ type FetchConfig struct { } type Repository interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.PlayerHistory, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.PlayerHistory, int, error) } diff --git a/playerhistory/repository/pg_repository.go b/playerhistory/repository/pg_repository.go index 53f6d99..ec6cfd5 100644 --- a/playerhistory/repository/pg_repository.go +++ b/playerhistory/repository/pg_repository.go @@ -2,12 +2,14 @@ package repository import ( "context" - "fmt" + "github.com/Kichiyaki/gopgutil/v10" + "github.com/pkg/errors" + "github.com/tribalwarshelp/shared/tw/twmodel" "strings" "github.com/go-pg/pg/v10" + "github.com/tribalwarshelp/api/playerhistory" - "github.com/tribalwarshelp/shared/models" ) type pgRepository struct { @@ -18,25 +20,21 @@ func NewPGRepository(db *pg.DB) playerhistory.Repository { return &pgRepository{db} } -func (repo *pgRepository) Fetch(ctx context.Context, cfg playerhistory.FetchConfig) ([]*models.PlayerHistory, int, error) { +func (repo *pgRepository) Fetch(ctx context.Context, cfg playerhistory.FetchConfig) ([]*twmodel.PlayerHistory, int, error) { var err error total := 0 - data := []*models.PlayerHistory{} + data := []*twmodel.PlayerHistory{} query := repo. WithParam("SERVER", pg.Safe(cfg.Server)). Model(&data). Context(ctx). Limit(cfg.Limit). - Offset(cfg.Offset) - relationshipAndSortAppender := &models.PlayerHistoryRelationshipAndSortAppender{ - Filter: &models.PlayerHistoryFilter{}, - Sort: cfg.Sort, - } - if cfg.Filter != nil { - query = query.Apply(cfg.Filter.Where) - relationshipAndSortAppender.Filter = cfg.Filter - } - query = query.Apply(relationshipAndSortAppender.Append) + Offset(cfg.Offset). + Apply(cfg.Filter.WhereWithRelations). + Apply(gopgutil.OrderAppender{ + Orders: cfg.Sort, + MaxDepth: 4, + }.Apply) if cfg.Count && cfg.Select { total, err = query.SelectAndCount() @@ -47,9 +45,9 @@ func (repo *pgRepository) Fetch(ctx context.Context, cfg playerhistory.FetchConf } if err != nil && err != pg.ErrNoRows { if strings.Contains(err.Error(), `relation "`+cfg.Server) { - return nil, 0, fmt.Errorf("Server not found") + return nil, 0, errors.New("Server not found") } - return nil, 0, fmt.Errorf("Internal server error") + return nil, 0, errors.New("Internal server error") } return data, total, nil diff --git a/playerhistory/usecase.go b/playerhistory/usecase.go index 8a2dfcf..66e4e49 100644 --- a/playerhistory/usecase.go +++ b/playerhistory/usecase.go @@ -2,10 +2,9 @@ package playerhistory import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type Usecase interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.PlayerHistory, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.PlayerHistory, int, error) } diff --git a/playerhistory/usecase/playerhistory_usecase.go b/playerhistory/usecase/playerhistory_usecase.go index 2f57ce0..4a60ff9 100644 --- a/playerhistory/usecase/playerhistory_usecase.go +++ b/playerhistory/usecase/playerhistory_usecase.go @@ -2,11 +2,10 @@ package usecase import ( "context" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/middleware" "github.com/tribalwarshelp/api/playerhistory" - "github.com/tribalwarshelp/api/utils" - "github.com/tribalwarshelp/shared/models" ) type usecase struct { @@ -17,14 +16,12 @@ func New(repo playerhistory.Repository) playerhistory.Usecase { return &usecase{repo} } -func (ucase *usecase) Fetch(ctx context.Context, cfg playerhistory.FetchConfig) ([]*models.PlayerHistory, int, error) { +func (ucase *usecase) Fetch(ctx context.Context, cfg playerhistory.FetchConfig) ([]*twmodel.PlayerHistory, int, error) { if cfg.Filter == nil { - cfg.Filter = &models.PlayerHistoryFilter{} + cfg.Filter = &twmodel.PlayerHistoryFilter{} } - if !middleware.CanExceedLimit(ctx) && (cfg.Limit > playerhistory.FetchLimit || cfg.Limit <= 0) { cfg.Limit = playerhistory.FetchLimit } - cfg.Sort = utils.SanitizeSorts(cfg.Sort) return ucase.repo.Fetch(ctx, cfg) } diff --git a/scripts/dev.sh b/scripts/dev.sh deleted file mode 100755 index a13e0f8..0000000 --- a/scripts/dev.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -export MODE=development -export GIN_MODE=debug -go run -race main.go \ No newline at end of file diff --git a/server/repository.go b/server/repository.go index 9949607..6853530 100644 --- a/server/repository.go +++ b/server/repository.go @@ -2,12 +2,11 @@ package server import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type FetchConfig struct { - Filter *models.ServerFilter + Filter *twmodel.ServerFilter Columns []string Select bool Count bool @@ -17,5 +16,5 @@ type FetchConfig struct { } type Repository interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.Server, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.Server, int, error) } diff --git a/server/repository/pg_repository.go b/server/repository/pg_repository.go index ac7f03e..6a9c5e0 100644 --- a/server/repository/pg_repository.go +++ b/server/repository/pg_repository.go @@ -3,12 +3,14 @@ package repository import ( "context" "fmt" + "github.com/Kichiyaki/gopgutil/v10" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/go-pg/pg/v10" "github.com/go-pg/pg/v10/orm" "github.com/pkg/errors" + "github.com/tribalwarshelp/api/server" - "github.com/tribalwarshelp/shared/models" ) type pgRepository struct { @@ -16,7 +18,7 @@ type pgRepository struct { } func NewPGRepository(db *pg.DB) (server.Repository, error) { - if err := db.Model(&models.Server{}).CreateTable(&orm.CreateTableOptions{ + if err := db.Model(&twmodel.Server{}).CreateTable(&orm.CreateTableOptions{ IfNotExists: true, }); err != nil { return nil, errors.Wrap(err, "cannot create 'servers' table") @@ -24,19 +26,20 @@ func NewPGRepository(db *pg.DB) (server.Repository, error) { return &pgRepository{db}, nil } -func (repo *pgRepository) Fetch(ctx context.Context, cfg server.FetchConfig) ([]*models.Server, int, error) { +func (repo *pgRepository) Fetch(ctx context.Context, cfg server.FetchConfig) ([]*twmodel.Server, int, error) { var err error total := 0 - data := []*models.Server{} + data := []*twmodel.Server{} query := repo. Model(&data). Context(ctx). - Order(cfg.Sort...). Limit(cfg.Limit). - Offset(cfg.Offset) - if cfg.Filter != nil { - query = query.Apply(cfg.Filter.Where) - } + Apply(cfg.Filter.Where). + Apply(gopgutil.OrderAppender{ + Orders: cfg.Sort, + MaxDepth: 4, + }.Apply) + if len(cfg.Columns) > 0 { query = query.Column(cfg.Columns...) } diff --git a/server/usecase.go b/server/usecase.go index 5394cdf..b380c08 100644 --- a/server/usecase.go +++ b/server/usecase.go @@ -2,11 +2,10 @@ package server import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type Usecase interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.Server, int, error) - GetByKey(ctx context.Context, key string) (*models.Server, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.Server, int, error) + GetByKey(ctx context.Context, key string) (*twmodel.Server, error) } diff --git a/server/usecase/server_usecase.go b/server/usecase/server_usecase.go index fdcfb13..4432c55 100644 --- a/server/usecase/server_usecase.go +++ b/server/usecase/server_usecase.go @@ -3,11 +3,10 @@ package usecase import ( "context" "fmt" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/middleware" "github.com/tribalwarshelp/api/server" - "github.com/tribalwarshelp/api/utils" - "github.com/tribalwarshelp/shared/models" ) type usecase struct { @@ -18,20 +17,19 @@ func New(repo server.Repository) server.Usecase { return &usecase{repo} } -func (ucase *usecase) Fetch(ctx context.Context, cfg server.FetchConfig) ([]*models.Server, int, error) { +func (ucase *usecase) Fetch(ctx context.Context, cfg server.FetchConfig) ([]*twmodel.Server, int, error) { if cfg.Filter == nil { - cfg.Filter = &models.ServerFilter{} + cfg.Filter = &twmodel.ServerFilter{} } if !middleware.CanExceedLimit(ctx) && (cfg.Limit > server.FetchLimit || cfg.Limit <= 0) { cfg.Limit = server.FetchLimit } - cfg.Sort = utils.SanitizeSorts(cfg.Sort) return ucase.repo.Fetch(ctx, cfg) } -func (ucase *usecase) GetByKey(ctx context.Context, key string) (*models.Server, error) { +func (ucase *usecase) GetByKey(ctx context.Context, key string) (*twmodel.Server, error) { servers, _, err := ucase.repo.Fetch(ctx, server.FetchConfig{ - Filter: &models.ServerFilter{ + Filter: &twmodel.ServerFilter{ Key: []string{key}, }, Limit: 1, diff --git a/servermap/delivery/http/http_delivery.go b/servermap/delivery/http/http_delivery.go index 3f833fc..20b297e 100644 --- a/servermap/delivery/http/http_delivery.go +++ b/servermap/delivery/http/http_delivery.go @@ -2,17 +2,18 @@ package httpdelivery import ( "fmt" + "github.com/Kichiyaki/appmode" "net/http" "strconv" "time" "github.com/tribalwarshelp/map-generator/generator" - "github.com/tribalwarshelp/shared/mode" "github.com/gin-gonic/gin" + "github.com/vektah/gqlparser/v2/gqlerror" + "github.com/tribalwarshelp/api/server" "github.com/tribalwarshelp/api/servermap" - "github.com/vektah/gqlparser/v2/gqlerror" ) const ( @@ -43,7 +44,7 @@ func Attach(cfg Config) error { func (h *handler) mapHandler(c *gin.Context) { c.Header("Cache-Control", fmt.Sprintf(`public, max-age=%d`, imageTTL)) - server, err := h.serverUsecase.GetByKey(c.Request.Context(), c.Param("server")) + srv, err := h.serverUsecase.GetByKey(c.Request.Context(), c.Param("server")) if err != nil { c.JSON(http.StatusNotFound, &gqlerror.Error{ Message: err.Error(), @@ -55,7 +56,7 @@ func (h *handler) mapHandler(c *gin.Context) { largerMarkers := c.Query("largerMarkers") markersOnly := c.Query("markersOnly") markers, err := h.mapUsecase.GetMarkers(c.Request.Context(), servermap.GetMarkersConfig{ - Server: server.Key, + Server: srv.Key, Tribes: c.Request.URL.Query()["tribe"], Players: c.Request.URL.Query()["player"], ShowBarbarianVillages: showBarbarian == "true" || showBarbarian == "1", @@ -87,12 +88,12 @@ func (h *handler) mapHandler(c *gin.Context) { BackgroundColor: c.Query("backgroundColor"), GridLineColor: c.Query("gridLineColor"), ContinentNumberColor: c.Query("continentNumberColor"), - MapSize: server.Config.Coord.MapSize, + MapSize: srv.Config.Coord.MapSize, CenterX: centerX, CenterY: centerY, Scale: float32(scale), Quality: 90, - PNG: mode.Get() == mode.ProductionMode, + PNG: appmode.Equals(appmode.ProductionMode), }); err != nil { c.JSON(http.StatusBadRequest, &gqlerror.Error{ Message: err.Error(), diff --git a/servermap/usecase/map_usecase.go b/servermap/usecase/map_usecase.go index d63ccc2..915b3df 100644 --- a/servermap/usecase/map_usecase.go +++ b/servermap/usecase/map_usecase.go @@ -3,16 +3,18 @@ package usecase import ( "context" "fmt" + "github.com/tribalwarshelp/shared/tw/twmodel" "sort" "strconv" "strings" "sync" "github.com/pkg/errors" + "github.com/tribalwarshelp/map-generator/generator" + "github.com/tribalwarshelp/api/servermap" "github.com/tribalwarshelp/api/village" - "github.com/tribalwarshelp/map-generator/generator" - "github.com/tribalwarshelp/shared/models" + "golang.org/x/sync/errgroup" ) @@ -52,8 +54,8 @@ func (ucase *usecase) GetMarkers(ctx context.Context, cfg servermap.GetMarkersCo g.Go(func() error { villages, _, err := ucase.villageRepo.Fetch(ctx, village.FetchConfig{ Server: cfg.Server, - Filter: &models.VillageFilter{ - PlayerFilter: &models.PlayerFilter{ + Filter: &twmodel.VillageFilter{ + PlayerFilter: &twmodel.PlayerFilter{ IDNEQ: append(playerIDs, 0), TribeIDNEQ: tribeIDs, }, @@ -82,7 +84,7 @@ func (ucase *usecase) GetMarkers(ctx context.Context, cfg servermap.GetMarkersCo g.Go(func() error { villages, _, err := ucase.villageRepo.Fetch(ctx, village.FetchConfig{ Server: cfg.Server, - Filter: &models.VillageFilter{ + Filter: &twmodel.VillageFilter{ PlayerID: []int{0}, }, Select: true, @@ -110,8 +112,8 @@ func (ucase *usecase) GetMarkers(ctx context.Context, cfg servermap.GetMarkersCo g.Go(func() error { villages, _, err := ucase.villageRepo.Fetch(ctx, village.FetchConfig{ Server: cfg.Server, - Filter: &models.VillageFilter{ - PlayerFilter: &models.PlayerFilter{ + Filter: &twmodel.VillageFilter{ + PlayerFilter: &twmodel.PlayerFilter{ IDNEQ: playerIDs, TribeID: ids, }, @@ -142,7 +144,7 @@ func (ucase *usecase) GetMarkers(ctx context.Context, cfg servermap.GetMarkersCo g.Go(func() error { villages, _, err := ucase.villageRepo.Fetch(ctx, village.FetchConfig{ Server: cfg.Server, - Filter: &models.VillageFilter{ + Filter: &twmodel.VillageFilter{ PlayerID: ids, }, Select: true, diff --git a/serverstats/repository.go b/serverstats/repository.go index 3fbd7e7..f7ca3ae 100644 --- a/serverstats/repository.go +++ b/serverstats/repository.go @@ -2,13 +2,12 @@ package serverstats import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type FetchConfig struct { Server string - Filter *models.ServerStatsFilter + Filter *twmodel.ServerStatsFilter Select bool Count bool Sort []string @@ -17,5 +16,5 @@ type FetchConfig struct { } type Repository interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.ServerStats, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.ServerStats, int, error) } diff --git a/serverstats/repository/pg_repository.go b/serverstats/repository/pg_repository.go index 41306b9..59a17f3 100644 --- a/serverstats/repository/pg_repository.go +++ b/serverstats/repository/pg_repository.go @@ -3,11 +3,13 @@ package repository import ( "context" "fmt" + "github.com/Kichiyaki/gopgutil/v10" + "github.com/tribalwarshelp/shared/tw/twmodel" "strings" "github.com/go-pg/pg/v10" + "github.com/tribalwarshelp/api/serverstats" - "github.com/tribalwarshelp/shared/models" ) type pgRepository struct { @@ -18,20 +20,21 @@ func NewPGRepository(db *pg.DB) serverstats.Repository { return &pgRepository{db} } -func (repo *pgRepository) Fetch(ctx context.Context, cfg serverstats.FetchConfig) ([]*models.ServerStats, int, error) { +func (repo *pgRepository) Fetch(ctx context.Context, cfg serverstats.FetchConfig) ([]*twmodel.ServerStats, int, error) { var err error - data := []*models.ServerStats{} + data := []*twmodel.ServerStats{} total := 0 query := repo. WithParam("SERVER", pg.Safe(cfg.Server)). Model(&data). Context(ctx). - Order(cfg.Sort...). Limit(cfg.Limit). - Offset(cfg.Offset) - if cfg.Filter != nil { - query = query.Apply(cfg.Filter.Where) - } + Offset(cfg.Offset). + Apply(cfg.Filter.Where). + Apply(gopgutil.OrderAppender{ + Orders: cfg.Sort, + MaxDepth: 4, + }.Apply) if cfg.Count && cfg.Select { total, err = query.SelectAndCount() diff --git a/serverstats/usecase.go b/serverstats/usecase.go index b4eb245..76c351c 100644 --- a/serverstats/usecase.go +++ b/serverstats/usecase.go @@ -2,10 +2,9 @@ package serverstats import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type Usecase interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.ServerStats, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.ServerStats, int, error) } diff --git a/serverstats/usecase/serverstats_usecase.go b/serverstats/usecase/serverstats_usecase.go index 9a8b79d..1c3d7e2 100644 --- a/serverstats/usecase/serverstats_usecase.go +++ b/serverstats/usecase/serverstats_usecase.go @@ -2,11 +2,10 @@ package usecase import ( "context" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/middleware" "github.com/tribalwarshelp/api/serverstats" - "github.com/tribalwarshelp/api/utils" - "github.com/tribalwarshelp/shared/models" ) type usecase struct { @@ -17,14 +16,14 @@ func New(repo serverstats.Repository) serverstats.Usecase { return &usecase{repo} } -func (ucase *usecase) Fetch(ctx context.Context, cfg serverstats.FetchConfig) ([]*models.ServerStats, int, error) { +func (ucase *usecase) Fetch(ctx context.Context, cfg serverstats.FetchConfig) ([]*twmodel.ServerStats, int, error) { if cfg.Filter == nil { - cfg.Filter = &models.ServerStatsFilter{} + cfg.Filter = &twmodel.ServerStatsFilter{} } if !middleware.CanExceedLimit(ctx) && (cfg.Limit > serverstats.FetchLimit || cfg.Limit <= 0) { cfg.Limit = serverstats.FetchLimit } - cfg.Sort = utils.SanitizeSorts(cfg.Sort) + return ucase.repo.Fetch(ctx, cfg) } diff --git a/tribe/repository.go b/tribe/repository.go index 0a8e067..e70496e 100644 --- a/tribe/repository.go +++ b/tribe/repository.go @@ -2,13 +2,12 @@ package tribe import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type FetchConfig struct { Server string - Filter *models.TribeFilter + Filter *twmodel.TribeFilter Count bool Select bool Sort []string @@ -26,6 +25,6 @@ type SearchTribeConfig struct { } type Repository interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.Tribe, int, error) - SearchTribe(ctx context.Context, cfg SearchTribeConfig) ([]*models.FoundTribe, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.Tribe, int, error) + SearchTribe(ctx context.Context, cfg SearchTribeConfig) ([]*twmodel.FoundTribe, int, error) } diff --git a/tribe/repository/pg_repository.go b/tribe/repository/pg_repository.go index da33f9e..da18260 100644 --- a/tribe/repository/pg_repository.go +++ b/tribe/repository/pg_repository.go @@ -3,12 +3,14 @@ package repository import ( "context" "fmt" + "github.com/Kichiyaki/gopgutil/v10" + "github.com/tribalwarshelp/shared/tw/twmodel" "strings" "github.com/go-pg/pg/v10" "github.com/go-pg/pg/v10/orm" + "github.com/tribalwarshelp/api/tribe" - "github.com/tribalwarshelp/shared/models" ) type pgRepository struct { @@ -19,20 +21,21 @@ func NewPGRepository(db *pg.DB) tribe.Repository { return &pgRepository{db} } -func (repo *pgRepository) Fetch(ctx context.Context, cfg tribe.FetchConfig) ([]*models.Tribe, int, error) { +func (repo *pgRepository) Fetch(ctx context.Context, cfg tribe.FetchConfig) ([]*twmodel.Tribe, int, error) { var err error - data := []*models.Tribe{} + data := []*twmodel.Tribe{} total := 0 query := repo. WithParam("SERVER", pg.Safe(cfg.Server)). Model(&data). Context(ctx). - Order(cfg.Sort...). Limit(cfg.Limit). - Offset(cfg.Offset) - if cfg.Filter != nil { - query = query.Apply(cfg.Filter.Where) - } + Offset(cfg.Offset). + Apply(cfg.Filter.Where). + Apply(gopgutil.OrderAppender{ + Orders: cfg.Sort, + MaxDepth: 4, + }.Apply) if cfg.Count && cfg.Select { total, err = query.SelectAndCount() @@ -51,8 +54,8 @@ func (repo *pgRepository) Fetch(ctx context.Context, cfg tribe.FetchConfig) ([]* return data, total, nil } -func (repo *pgRepository) SearchTribe(ctx context.Context, cfg tribe.SearchTribeConfig) ([]*models.FoundTribe, int, error) { - servers := []*models.Server{} +func (repo *pgRepository) SearchTribe(ctx context.Context, cfg tribe.SearchTribeConfig) ([]*twmodel.FoundTribe, int, error) { + servers := []*twmodel.Server{} if err := repo. Model(&servers). Context(ctx). @@ -63,7 +66,7 @@ func (repo *pgRepository) SearchTribe(ctx context.Context, cfg tribe.SearchTribe } var query *orm.Query - res := []*models.FoundTribe{} + res := []*twmodel.FoundTribe{} for _, server := range servers { safeKey := pg.Safe(server.Key) otherQuery := repo. @@ -89,7 +92,10 @@ func (repo *pgRepository) SearchTribe(ctx context.Context, cfg tribe.SearchTribe Table("union_q"). Limit(cfg.Limit). Offset(cfg.Offset). - Order(cfg.Sort...) + Apply(gopgutil.OrderAppender{ + Orders: cfg.Sort, + MaxDepth: 4, + }.Apply) if cfg.Count { count, err = base.SelectAndCount(&res) } else { diff --git a/tribe/usecase.go b/tribe/usecase.go index 3e89bcc..8d15333 100644 --- a/tribe/usecase.go +++ b/tribe/usecase.go @@ -2,12 +2,11 @@ package tribe import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type Usecase interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.Tribe, int, error) - GetByID(ctx context.Context, server string, id int) (*models.Tribe, error) - SearchTribe(ctx context.Context, cfg SearchTribeConfig) ([]*models.FoundTribe, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.Tribe, int, error) + GetByID(ctx context.Context, server string, id int) (*twmodel.Tribe, error) + SearchTribe(ctx context.Context, cfg SearchTribeConfig) ([]*twmodel.FoundTribe, int, error) } diff --git a/tribe/usecase/tribe_usecase.go b/tribe/usecase/tribe_usecase.go index 9334348..c3534e5 100644 --- a/tribe/usecase/tribe_usecase.go +++ b/tribe/usecase/tribe_usecase.go @@ -3,12 +3,11 @@ package usecase import ( "context" "fmt" + "github.com/tribalwarshelp/shared/tw/twmodel" "strings" "github.com/tribalwarshelp/api/middleware" "github.com/tribalwarshelp/api/tribe" - "github.com/tribalwarshelp/api/utils" - "github.com/tribalwarshelp/shared/models" ) type usecase struct { @@ -19,21 +18,19 @@ func New(repo tribe.Repository) tribe.Usecase { return &usecase{repo} } -func (ucase *usecase) Fetch(ctx context.Context, cfg tribe.FetchConfig) ([]*models.Tribe, int, error) { +func (ucase *usecase) Fetch(ctx context.Context, cfg tribe.FetchConfig) ([]*twmodel.Tribe, int, error) { if cfg.Filter == nil { - cfg.Filter = &models.TribeFilter{} + cfg.Filter = &twmodel.TribeFilter{} } - if !middleware.CanExceedLimit(ctx) && (cfg.Limit > tribe.FetchLimit || cfg.Limit <= 0) { cfg.Limit = tribe.FetchLimit } - cfg.Sort = utils.SanitizeSorts(cfg.Sort) return ucase.repo.Fetch(ctx, cfg) } -func (ucase *usecase) GetByID(ctx context.Context, server string, id int) (*models.Tribe, error) { +func (ucase *usecase) GetByID(ctx context.Context, server string, id int) (*twmodel.Tribe, error) { tribes, _, err := ucase.repo.Fetch(ctx, tribe.FetchConfig{ - Filter: &models.TribeFilter{ + Filter: &twmodel.TribeFilter{ ID: []int{id}, }, Limit: 1, @@ -50,7 +47,7 @@ func (ucase *usecase) GetByID(ctx context.Context, server string, id int) (*mode return tribes[0], nil } -func (ucase *usecase) SearchTribe(ctx context.Context, cfg tribe.SearchTribeConfig) ([]*models.FoundTribe, int, error) { +func (ucase *usecase) SearchTribe(ctx context.Context, cfg tribe.SearchTribeConfig) ([]*twmodel.FoundTribe, int, error) { if "" == strings.TrimSpace(cfg.Version) { return nil, 0, fmt.Errorf("Version is required.") } @@ -60,6 +57,5 @@ func (ucase *usecase) SearchTribe(ctx context.Context, cfg tribe.SearchTribeConf if !middleware.CanExceedLimit(ctx) && (cfg.Limit > tribe.FetchLimit || cfg.Limit <= 0) { cfg.Limit = tribe.FetchLimit } - cfg.Sort = utils.SanitizeSorts(cfg.Sort) return ucase.repo.SearchTribe(ctx, cfg) } diff --git a/tribechange/repository.go b/tribechange/repository.go index 20d22d2..7a1e551 100644 --- a/tribechange/repository.go +++ b/tribechange/repository.go @@ -2,13 +2,12 @@ package tribechange import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type FetchConfig struct { Server string - Filter *models.TribeChangeFilter + Filter *twmodel.TribeChangeFilter Count bool Select bool Sort []string @@ -17,5 +16,5 @@ type FetchConfig struct { } type Repository interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.TribeChange, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.TribeChange, int, error) } diff --git a/tribechange/repository/helpers.go b/tribechange/repository/helpers.go deleted file mode 100644 index ae3caa1..0000000 --- a/tribechange/repository/helpers.go +++ /dev/null @@ -1,22 +0,0 @@ -package repository - -import ( - "github.com/go-pg/pg/v10" - "github.com/go-pg/pg/v10/orm" - - "github.com/tribalwarshelp/shared/models" -) - -func appendTribeChangeFilterOr(or *models.TribeChangeFilterOr) func(*orm.Query) (*orm.Query, error) { - return func(q *orm.Query) (*orm.Query, error) { - if or != nil { - if len(or.NewTribeID) > 0 { - q = q.WhereOr("new_tribe_id IN (?)", pg.In(or.NewTribeID)) - } - if len(or.OldTribeID) > 0 { - q = q.WhereOr("old_tribe_id IN (?)", pg.In(or.OldTribeID)) - } - } - return q, nil - } -} diff --git a/tribechange/repository/pg_repository.go b/tribechange/repository/pg_repository.go index 9989520..907a5a9 100644 --- a/tribechange/repository/pg_repository.go +++ b/tribechange/repository/pg_repository.go @@ -3,11 +3,13 @@ package repository import ( "context" "fmt" + "github.com/Kichiyaki/gopgutil/v10" + "github.com/tribalwarshelp/shared/tw/twmodel" "strings" "github.com/go-pg/pg/v10" + "github.com/tribalwarshelp/api/tribechange" - "github.com/tribalwarshelp/shared/models" ) type pgRepository struct { @@ -18,25 +20,21 @@ func NewPGRepository(db *pg.DB) tribechange.Repository { return &pgRepository{db} } -func (repo *pgRepository) Fetch(ctx context.Context, cfg tribechange.FetchConfig) ([]*models.TribeChange, int, error) { +func (repo *pgRepository) Fetch(ctx context.Context, cfg tribechange.FetchConfig) ([]*twmodel.TribeChange, int, error) { var err error total := 0 - data := []*models.TribeChange{} + data := []*twmodel.TribeChange{} query := repo. WithParam("SERVER", pg.Safe(cfg.Server)). Model(&data). Context(ctx). Limit(cfg.Limit). - Offset(cfg.Offset) - relationshipAndSortAppender := &models.TribeChangeRelationshipAndSortAppender{ - Filter: &models.TribeChangeFilter{}, - Sort: cfg.Sort, - } - if cfg.Filter != nil { - query = query.Apply(cfg.Filter.Where) - relationshipAndSortAppender.Filter = cfg.Filter - } - query = query.Apply(relationshipAndSortAppender.Append) + Offset(cfg.Offset). + Apply(cfg.Filter.WhereWithRelations). + Apply(gopgutil.OrderAppender{ + Orders: cfg.Sort, + MaxDepth: 4, + }.Apply) if cfg.Count && cfg.Select { total, err = query.SelectAndCount() diff --git a/tribechange/usecase.go b/tribechange/usecase.go index 83fa05f..99a7079 100644 --- a/tribechange/usecase.go +++ b/tribechange/usecase.go @@ -2,10 +2,9 @@ package tribechange import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type Usecase interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.TribeChange, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.TribeChange, int, error) } diff --git a/tribechange/usecase/tribechange_usecase.go b/tribechange/usecase/tribe_change_usecase.go similarity index 70% rename from tribechange/usecase/tribechange_usecase.go rename to tribechange/usecase/tribe_change_usecase.go index d0572c5..30ad55f 100644 --- a/tribechange/usecase/tribechange_usecase.go +++ b/tribechange/usecase/tribe_change_usecase.go @@ -2,11 +2,10 @@ package usecase import ( "context" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/middleware" "github.com/tribalwarshelp/api/tribechange" - "github.com/tribalwarshelp/api/utils" - "github.com/tribalwarshelp/shared/models" ) type usecase struct { @@ -17,14 +16,12 @@ func New(repo tribechange.Repository) tribechange.Usecase { return &usecase{repo} } -func (ucase *usecase) Fetch(ctx context.Context, cfg tribechange.FetchConfig) ([]*models.TribeChange, int, error) { +func (ucase *usecase) Fetch(ctx context.Context, cfg tribechange.FetchConfig) ([]*twmodel.TribeChange, int, error) { if cfg.Filter == nil { - cfg.Filter = &models.TribeChangeFilter{} + cfg.Filter = &twmodel.TribeChangeFilter{} } - if !middleware.CanExceedLimit(ctx) && (cfg.Limit > tribechange.FetchLimit || cfg.Limit <= 0) { cfg.Limit = tribechange.FetchLimit } - cfg.Sort = utils.SanitizeSorts(cfg.Sort) return ucase.repo.Fetch(ctx, cfg) } diff --git a/tribehistory/repository.go b/tribehistory/repository.go index 4c10b98..0a29d6e 100644 --- a/tribehistory/repository.go +++ b/tribehistory/repository.go @@ -2,13 +2,12 @@ package tribehistory import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type FetchConfig struct { Server string - Filter *models.TribeHistoryFilter + Filter *twmodel.TribeHistoryFilter Select bool Count bool Sort []string @@ -17,5 +16,5 @@ type FetchConfig struct { } type Repository interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.TribeHistory, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.TribeHistory, int, error) } diff --git a/tribehistory/repository/pg_repository.go b/tribehistory/repository/pg_repository.go index 1a24f96..2ff3f54 100644 --- a/tribehistory/repository/pg_repository.go +++ b/tribehistory/repository/pg_repository.go @@ -3,11 +3,13 @@ package repository import ( "context" "fmt" + "github.com/Kichiyaki/gopgutil/v10" + "github.com/tribalwarshelp/shared/tw/twmodel" "strings" "github.com/go-pg/pg/v10" + "github.com/tribalwarshelp/api/tribehistory" - "github.com/tribalwarshelp/shared/models" ) type pgRepository struct { @@ -18,25 +20,21 @@ func NewPGRepository(db *pg.DB) tribehistory.Repository { return &pgRepository{db} } -func (repo *pgRepository) Fetch(ctx context.Context, cfg tribehistory.FetchConfig) ([]*models.TribeHistory, int, error) { +func (repo *pgRepository) Fetch(ctx context.Context, cfg tribehistory.FetchConfig) ([]*twmodel.TribeHistory, int, error) { var err error total := 0 - data := []*models.TribeHistory{} + data := []*twmodel.TribeHistory{} query := repo. WithParam("SERVER", pg.Safe(cfg.Server)). Model(&data). Context(ctx). Limit(cfg.Limit). - Offset(cfg.Offset) - relationshipAndSortAppender := &models.TribeHistoryRelationshipAndSortAppender{ - Filter: &models.TribeHistoryFilter{}, - Sort: cfg.Sort, - } - if cfg.Filter != nil { - query = query.Apply(cfg.Filter.Where) - relationshipAndSortAppender.Filter = cfg.Filter - } - query = query.Apply(relationshipAndSortAppender.Append) + Offset(cfg.Offset). + Apply(cfg.Filter.WhereWithRelations). + Apply(gopgutil.OrderAppender{ + Orders: cfg.Sort, + MaxDepth: 4, + }.Apply) if cfg.Count && cfg.Select { total, err = query.SelectAndCount() diff --git a/tribehistory/usecase.go b/tribehistory/usecase.go index 9c86113..2482583 100644 --- a/tribehistory/usecase.go +++ b/tribehistory/usecase.go @@ -2,10 +2,9 @@ package tribehistory import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type Usecase interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.TribeHistory, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.TribeHistory, int, error) } diff --git a/tribehistory/usecase/tribehistory_usecase.go b/tribehistory/usecase/tribehistory_usecase.go index 4c3237b..b23a2aa 100644 --- a/tribehistory/usecase/tribehistory_usecase.go +++ b/tribehistory/usecase/tribehistory_usecase.go @@ -2,11 +2,10 @@ package usecase import ( "context" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/middleware" "github.com/tribalwarshelp/api/tribehistory" - "github.com/tribalwarshelp/api/utils" - "github.com/tribalwarshelp/shared/models" ) type usecase struct { @@ -17,14 +16,12 @@ func New(repo tribehistory.Repository) tribehistory.Usecase { return &usecase{repo} } -func (ucase *usecase) Fetch(ctx context.Context, cfg tribehistory.FetchConfig) ([]*models.TribeHistory, int, error) { +func (ucase *usecase) Fetch(ctx context.Context, cfg tribehistory.FetchConfig) ([]*twmodel.TribeHistory, int, error) { if cfg.Filter == nil { - cfg.Filter = &models.TribeHistoryFilter{} + cfg.Filter = &twmodel.TribeHistoryFilter{} } - if !middleware.CanExceedLimit(ctx) && (cfg.Limit > tribehistory.FetchLimit || cfg.Limit <= 0) { cfg.Limit = tribehistory.FetchLimit } - cfg.Sort = utils.SanitizeSorts(cfg.Sort) return ucase.repo.Fetch(ctx, cfg) } diff --git a/utils/find_string_with_prefix.go b/utils/find_string_with_prefix.go deleted file mode 100644 index 4a4bd45..0000000 --- a/utils/find_string_with_prefix.go +++ /dev/null @@ -1,12 +0,0 @@ -package utils - -import "strings" - -func FindStringWithPrefix(sl []string, prefix string) string { - for _, s := range sl { - if strings.HasPrefix(s, prefix) { - return s - } - } - return "" -} diff --git a/utils/safe_pointer.go b/utils/safe_pointer.go deleted file mode 100644 index 3b9a464..0000000 --- a/utils/safe_pointer.go +++ /dev/null @@ -1,22 +0,0 @@ -package utils - -func SafeBoolPointer(value *bool, defaultValue bool) bool { - if value == nil { - return defaultValue - } - return *value -} - -func SafeIntPointer(value *int, defaultValue int) int { - if value == nil { - return defaultValue - } - return *value -} - -func SafeStrPointer(value *string, defaultValue string) string { - if value == nil { - return defaultValue - } - return *value -} diff --git a/utils/sanitize_sort.go b/utils/sanitize_sort.go deleted file mode 100644 index 208f8ba..0000000 --- a/utils/sanitize_sort.go +++ /dev/null @@ -1,41 +0,0 @@ -package utils - -import ( - "regexp" - "strings" -) - -var ( - sortexprRegex = regexp.MustCompile(`^[\p{L}\_\.]+$`) -) - -func SanitizeSort(expr string) string { - splitted := strings.Split(strings.TrimSpace(expr), " ") - length := len(splitted) - if length != 2 || !sortexprRegex.Match([]byte(splitted[0])) { - return "" - } - table := "" - column := splitted[0] - if strings.Contains(splitted[0], ".") { - columnAndTable := strings.Split(splitted[0], ".") - table = Underscore(columnAndTable[0]) + "." - column = columnAndTable[1] - } - keyword := "ASC" - if strings.ToUpper(splitted[1]) == "DESC" { - keyword = "DESC" - } - return strings.ToLower(table+Underscore(column)) + " " + keyword -} - -func SanitizeSorts(sorts []string) []string { - sanitized := []string{} - for _, sort := range sorts { - sanitizedSort := SanitizeSort(sort) - if sanitizedSort != "" { - sanitized = append(sanitized, sanitizedSort) - } - } - return sanitized -} diff --git a/utils/underscore.go b/utils/underscore.go deleted file mode 100644 index ee0b574..0000000 --- a/utils/underscore.go +++ /dev/null @@ -1,61 +0,0 @@ -package utils - -import ( - "unicode" - "unicode/utf8" -) - -type buffer struct { - r []byte - runeBytes [utf8.UTFMax]byte -} - -func (b *buffer) write(r rune) { - if r < utf8.RuneSelf { - b.r = append(b.r, byte(r)) - return - } - n := utf8.EncodeRune(b.runeBytes[0:], r) - b.r = append(b.r, b.runeBytes[0:n]...) -} - -func (b *buffer) indent() { - if len(b.r) > 0 { - b.r = append(b.r, '_') - } -} - -func Underscore(s string) string { - b := buffer{ - r: make([]byte, 0, len(s)), - } - var m rune - var w bool - for _, ch := range s { - if unicode.IsUpper(ch) { - if m != 0 { - if !w { - b.indent() - w = true - } - b.write(m) - } - m = unicode.ToLower(ch) - } else { - if m != 0 { - b.indent() - b.write(m) - m = 0 - w = false - } - b.write(ch) - } - } - if m != 0 { - if !w { - b.indent() - } - b.write(m) - } - return string(b.r) -} diff --git a/version/repository.go b/version/repository.go index ee47866..15c8917 100644 --- a/version/repository.go +++ b/version/repository.go @@ -2,12 +2,11 @@ package version import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type FetchConfig struct { - Filter *models.VersionFilter + Filter *twmodel.VersionFilter Select bool Count bool Sort []string @@ -16,5 +15,5 @@ type FetchConfig struct { } type Repository interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.Version, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.Version, int, error) } diff --git a/version/repository/pg_repository.go b/version/repository/pg_repository.go index fee8740..f7bc830 100644 --- a/version/repository/pg_repository.go +++ b/version/repository/pg_repository.go @@ -3,12 +3,14 @@ package repository import ( "context" "fmt" + "github.com/Kichiyaki/gopgutil/v10" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/go-pg/pg/v10" "github.com/go-pg/pg/v10/orm" "github.com/pkg/errors" + "github.com/tribalwarshelp/api/version" - "github.com/tribalwarshelp/shared/models" ) type pgRepository struct { @@ -16,7 +18,7 @@ type pgRepository struct { } func NewPGRepository(db *pg.DB) (version.Repository, error) { - if err := db.Model(&models.Version{}).CreateTable(&orm.CreateTableOptions{ + if err := db.Model(&twmodel.Version{}).CreateTable(&orm.CreateTableOptions{ IfNotExists: true, }); err != nil { return nil, errors.Wrap(err, "cannot create 'versions' table") @@ -24,19 +26,20 @@ func NewPGRepository(db *pg.DB) (version.Repository, error) { return &pgRepository{db}, nil } -func (repo *pgRepository) Fetch(ctx context.Context, cfg version.FetchConfig) ([]*models.Version, int, error) { +func (repo *pgRepository) Fetch(ctx context.Context, cfg version.FetchConfig) ([]*twmodel.Version, int, error) { var err error - data := []*models.Version{} + data := []*twmodel.Version{} total := 0 query := repo. Model(&data). Context(ctx). - Order(cfg.Sort...). Limit(cfg.Limit). - Offset(cfg.Offset) - if cfg.Filter != nil { - query = query.Apply(cfg.Filter.Where) - } + Offset(cfg.Offset). + Apply(cfg.Filter.Where). + Apply(gopgutil.OrderAppender{ + Orders: cfg.Sort, + MaxDepth: 4, + }.Apply) if cfg.Count && cfg.Select { total, err = query.SelectAndCount() diff --git a/version/usecase.go b/version/usecase.go index 00b81fd..0563226 100644 --- a/version/usecase.go +++ b/version/usecase.go @@ -2,11 +2,10 @@ package version import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type Usecase interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.Version, int, error) - GetByCode(ctx context.Context, code models.VersionCode) (*models.Version, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.Version, int, error) + GetByCode(ctx context.Context, code twmodel.VersionCode) (*twmodel.Version, error) } diff --git a/version/usecase/version_usecase.go b/version/usecase/version_usecase.go index b3ea5b3..5f68ce1 100644 --- a/version/usecase/version_usecase.go +++ b/version/usecase/version_usecase.go @@ -3,12 +3,10 @@ package usecase import ( "context" "fmt" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/middleware" - "github.com/tribalwarshelp/api/utils" - "github.com/tribalwarshelp/api/version" - "github.com/tribalwarshelp/shared/models" ) type usecase struct { @@ -21,22 +19,20 @@ func New(repo version.Repository) version.Usecase { } } -func (ucase *usecase) Fetch(ctx context.Context, cfg version.FetchConfig) ([]*models.Version, int, error) { +func (ucase *usecase) Fetch(ctx context.Context, cfg version.FetchConfig) ([]*twmodel.Version, int, error) { if cfg.Filter == nil { - cfg.Filter = &models.VersionFilter{} + cfg.Filter = &twmodel.VersionFilter{} } - if !middleware.CanExceedLimit(ctx) && (cfg.Limit > version.FetchLimit || cfg.Limit <= 0) { cfg.Limit = version.FetchLimit } - cfg.Sort = utils.SanitizeSorts(cfg.Sort) return ucase.repo.Fetch(ctx, cfg) } -func (ucase *usecase) GetByCode(ctx context.Context, code models.VersionCode) (*models.Version, error) { +func (ucase *usecase) GetByCode(ctx context.Context, code twmodel.VersionCode) (*twmodel.Version, error) { versions, _, err := ucase.repo.Fetch(ctx, version.FetchConfig{ - Filter: &models.VersionFilter{ - Code: []models.VersionCode{code}, + Filter: &twmodel.VersionFilter{ + Code: []twmodel.VersionCode{code}, }, Limit: 1, Select: true, diff --git a/village/repository.go b/village/repository.go index d3c993f..06ff34e 100644 --- a/village/repository.go +++ b/village/repository.go @@ -2,13 +2,12 @@ package village import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type FetchConfig struct { Server string - Filter *models.VillageFilter + Filter *twmodel.VillageFilter Columns []string Select bool Count bool @@ -18,5 +17,5 @@ type FetchConfig struct { } type Repository interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.Village, int, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.Village, int, error) } diff --git a/village/repository/pg_repository.go b/village/repository/pg_repository.go index 38c930e..823dea0 100644 --- a/village/repository/pg_repository.go +++ b/village/repository/pg_repository.go @@ -3,11 +3,13 @@ package repository import ( "context" "fmt" + "github.com/Kichiyaki/gopgutil/v10" + "github.com/tribalwarshelp/shared/tw/twmodel" "strings" "github.com/go-pg/pg/v10" + "github.com/tribalwarshelp/api/village" - "github.com/tribalwarshelp/shared/models" ) type pgRepository struct { @@ -18,27 +20,23 @@ func NewPGRepository(db *pg.DB) village.Repository { return &pgRepository{db} } -func (repo *pgRepository) Fetch(ctx context.Context, cfg village.FetchConfig) ([]*models.Village, int, error) { +func (repo *pgRepository) Fetch(ctx context.Context, cfg village.FetchConfig) ([]*twmodel.Village, int, error) { var err error - data := []*models.Village{} + data := []*twmodel.Village{} query := repo. WithParam("SERVER", pg.Safe(cfg.Server)). Model(&data). Context(ctx). Limit(cfg.Limit). - Offset(cfg.Offset) + Offset(cfg.Offset). + Apply(cfg.Filter.WhereWithRelations). + Apply(gopgutil.OrderAppender{ + Orders: cfg.Sort, + MaxDepth: 4, + }.Apply) if len(cfg.Columns) > 0 { query = query.Column(cfg.Columns...) } - relationshipAndSortAppender := &models.VillageRelationshipAndSortAppender{ - Filter: &models.VillageFilter{}, - Sort: cfg.Sort, - } - if cfg.Filter != nil { - query = query.Apply(cfg.Filter.Where) - relationshipAndSortAppender.Filter = cfg.Filter - } - query = query.Apply(relationshipAndSortAppender.Append) total := 0 if cfg.Count && cfg.Select { diff --git a/village/usecase.go b/village/usecase.go index 2379db9..f164c38 100644 --- a/village/usecase.go +++ b/village/usecase.go @@ -2,11 +2,10 @@ package village import ( "context" - - "github.com/tribalwarshelp/shared/models" + "github.com/tribalwarshelp/shared/tw/twmodel" ) type Usecase interface { - Fetch(ctx context.Context, cfg FetchConfig) ([]*models.Village, int, error) - GetByID(ctx context.Context, server string, id int) (*models.Village, error) + Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.Village, int, error) + GetByID(ctx context.Context, server string, id int) (*twmodel.Village, error) } diff --git a/village/usecase/village_usecase.go b/village/usecase/village_usecase.go index da62e1b..eb4b535 100644 --- a/village/usecase/village_usecase.go +++ b/village/usecase/village_usecase.go @@ -3,11 +3,10 @@ package usecase import ( "context" "fmt" + "github.com/tribalwarshelp/shared/tw/twmodel" "github.com/tribalwarshelp/api/middleware" - "github.com/tribalwarshelp/api/utils" "github.com/tribalwarshelp/api/village" - "github.com/tribalwarshelp/shared/models" ) type usecase struct { @@ -18,21 +17,19 @@ func New(repo village.Repository) village.Usecase { return &usecase{repo} } -func (ucase *usecase) Fetch(ctx context.Context, cfg village.FetchConfig) ([]*models.Village, int, error) { +func (ucase *usecase) Fetch(ctx context.Context, cfg village.FetchConfig) ([]*twmodel.Village, int, error) { if cfg.Filter == nil { - cfg.Filter = &models.VillageFilter{} + cfg.Filter = &twmodel.VillageFilter{} } - if !middleware.CanExceedLimit(ctx) && (cfg.Limit > village.FetchLimit || cfg.Limit <= 0) { cfg.Limit = village.FetchLimit } - cfg.Sort = utils.SanitizeSorts(cfg.Sort) return ucase.repo.Fetch(ctx, cfg) } -func (ucase *usecase) GetByID(ctx context.Context, server string, id int) (*models.Village, error) { +func (ucase *usecase) GetByID(ctx context.Context, server string, id int) (*twmodel.Village, error) { villages, _, err := ucase.repo.Fetch(ctx, village.FetchConfig{ - Filter: &models.VillageFilter{ + Filter: &twmodel.VillageFilter{ ID: []int{id}, }, Limit: 1,