add new fields to Player/Tribe models

This commit is contained in:
Dawid Wysokiński 2020-06-25 13:36:40 +02:00
parent 9768e416ae
commit 16e0e71c77
2 changed files with 35 additions and 23 deletions

View File

@ -14,6 +14,12 @@ type Player struct {
TribeID int `json:"-" pg:",use_zero" gqlgen:"tribeID"`
Tribe *Tribe `json:"tribe,omitempty" gqlgen:"-"`
DailyGrowth int `json:"dailyGrowth" pg:",use_zero" gqlgen:"dailyGrowth"`
BestRank int `json:"bestRank" pg:",use_zero" gqlgen:"bestRank"`
BestRankAt time.Time `json:"bestRankAt" pg:"default:now(),use_zero" gqlgen:"bestRankAt"`
MostPoints int `json:"mostPoints" pg:",use_zero" gqlgen:"mostPoints"`
MostPointsAt time.Time `json:"mostPointsAt" pg:"default:now(),use_zero" gqlgen:"mostPointsAt"`
MostVillages int `json:"mostVillages" pg:",use_zero" gqlgen:"mostVillages"`
MostVillagesAt time.Time `json:"mostVillagesAt" pg:"default:now(),use_zero" gqlgen:"mostVillagesAt"`
JoinedAt time.Time `json:"joinedAt" pg:"default:now(),use_zero" gqlgen:"joinedAt"`
DeletedAt time.Time `json:"deletedAt" pg:",use_zero" gqlgen:"deletedAt"`

View File

@ -8,13 +8,19 @@ type Tribe struct {
ID int `json:"id" gqlgen:"id"`
Name string `json:"name" gqlgen:"name"`
Tag string `json:"tag" gqlgen:"tag"`
Exist *bool `json:"exist" gqlgen:"exist" pg:",use_zero"`
TotalMembers int `json:"totalMembers" gqlgen:"totalMembers" pg:",use_zero"`
TotalVillages int `json:"totalVillages" gqlgen:"totalVillages" pg:",use_zero"`
Points int `json:"points" gqlgen:"points" pg:",use_zero"`
AllPoints int `json:"allPoints" gqlgen:"allPoints" pg:",use_zero"`
Rank int `json:"rank" gqlgen:"rank" pg:",use_zero"`
Dominance float64 `json:"dominance" gqlgen:"dominance" pg:",use_zero"`
Exist *bool `json:"exist" gqlgen:"exist" pg:",use_zero"`
BestRank int `json:"bestRank" pg:",use_zero" gqlgen:"bestRank"`
BestRankAt time.Time `json:"bestRankAt" pg:"default:now(),use_zero" gqlgen:"bestRankAt"`
MostPoints int `json:"mostPoints" pg:",use_zero" gqlgen:"mostPoints"`
MostPointsAt time.Time `json:"mostPointsAt" pg:"default:now(),use_zero" gqlgen:"mostPointsAt"`
MostVillages int `json:"mostVillages" pg:",use_zero" gqlgen:"mostVillages"`
MostVillagesAt time.Time `json:"mostVillagesAt" pg:"default:now(),use_zero" gqlgen:"mostVillagesAt"`
CreatedAt time.Time `json:"createdAt" pg:"default:now(),use_zero" gqlgen:"createdAt"`
DeletedAt time.Time `json:"deletedAt" pg:",use_zero" gqlgen:"deletedAt"`