add ServerStatsFilter model

This commit is contained in:
Dawid Wysokiński 2020-06-21 13:31:35 +02:00
parent e0fdaa9bdf
commit f37b4069ea
2 changed files with 15 additions and 1 deletions

View File

@ -28,3 +28,17 @@ func (s *ServerStats) BeforeInsert(ctx context.Context) (context.Context, error)
return ctx, nil
}
type ServerStatsFilter struct {
tableName struct{} `urlstruct:"stats"`
CreatedAt time.Time `json:"createdAt" gqlgen:"createdAt" xml:"createdAt"`
CreatedAtGT time.Time `json:"createdAtGT" gqlgen:"createdAtGT" xml:"createdAtGT"`
CreatedAtGTE time.Time `json:"createdAtGTE" gqlgen:"createdAtGTE" xml:"createdAtGTE"`
CreatedAtLT time.Time `json:"createdAtLT" gqlgen:"createdAtLT" xml:"createdAtLT"`
CreatedAtLTE time.Time `json:"createdAtLTE" gqlgen:"createdAtLTE" xml:"createdAtLTE"`
Offset int `urlstruct:",nowhere" json:"offset" gqlgen:"offset"`
Limit int `urlstruct:",nowhere" json:"limit" gqlgen:"limit"`
Sort string `urlstruct:",nowhere" json:"sort" gqlgen:"sort"`
}

View File

@ -27,7 +27,7 @@ func (v *Village) Continent() string {
}
type VillageFilter struct {
tableName struct{} `urlstruct:"village" json:"tableName" gqlgen:"tableName"`
tableName struct{} `urlstruct:"village"`
ID []int `json:"id" gqlgen:"id"`
IdNEQ []int `json:"idNEQ" gqlgen:"idNEQ"`