[FEATURE] Detailed stats about player weapon usage and hitgroups (#1)

Reviewed-on: https://git.harting.dev/CSGOWTF/csgowtfd/pulls/1
Co-authored-by: Giovanni Harting <539@idlegandalf.com>
Co-committed-by: Giovanni Harting <539@idlegandalf.com>
This commit is contained in:
2021-10-16 01:49:52 +02:00
parent 3ff65bc5d7
commit 99ec0ad1bc
37 changed files with 15185 additions and 1080 deletions

View File

@@ -31,6 +31,8 @@ const (
FieldSharecodeUpdated = "sharecode_updated"
// FieldAuthCode holds the string denoting the auth_code field in the database.
FieldAuthCode = "auth_code"
// FieldProfileCreated holds the string denoting the profile_created field in the database.
FieldProfileCreated = "profile_created"
// EdgeStats holds the string denoting the stats edge name in mutations.
EdgeStats = "stats"
// EdgeMatches holds the string denoting the matches edge name in mutations.
@@ -64,6 +66,7 @@ var Columns = []string{
FieldSteamUpdated,
FieldSharecodeUpdated,
FieldAuthCode,
FieldProfileCreated,
}
var (

View File

@@ -163,6 +163,13 @@ func AuthCode(v string) predicate.Player {
})
}
// ProfileCreated applies equality check predicate on the "profile_created" field. It's identical to ProfileCreatedEQ.
func ProfileCreated(v time.Time) predicate.Player {
return predicate.Player(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldProfileCreated), v))
})
}
// NameEQ applies the EQ predicate on the "name" field.
func NameEQ(v string) predicate.Player {
return predicate.Player(func(s *sql.Selector) {
@@ -1148,6 +1155,96 @@ func AuthCodeContainsFold(v string) predicate.Player {
})
}
// ProfileCreatedEQ applies the EQ predicate on the "profile_created" field.
func ProfileCreatedEQ(v time.Time) predicate.Player {
return predicate.Player(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldProfileCreated), v))
})
}
// ProfileCreatedNEQ applies the NEQ predicate on the "profile_created" field.
func ProfileCreatedNEQ(v time.Time) predicate.Player {
return predicate.Player(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldProfileCreated), v))
})
}
// ProfileCreatedIn applies the In predicate on the "profile_created" field.
func ProfileCreatedIn(vs ...time.Time) predicate.Player {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.Player(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldProfileCreated), v...))
})
}
// ProfileCreatedNotIn applies the NotIn predicate on the "profile_created" field.
func ProfileCreatedNotIn(vs ...time.Time) predicate.Player {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.Player(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldProfileCreated), v...))
})
}
// ProfileCreatedGT applies the GT predicate on the "profile_created" field.
func ProfileCreatedGT(v time.Time) predicate.Player {
return predicate.Player(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldProfileCreated), v))
})
}
// ProfileCreatedGTE applies the GTE predicate on the "profile_created" field.
func ProfileCreatedGTE(v time.Time) predicate.Player {
return predicate.Player(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldProfileCreated), v))
})
}
// ProfileCreatedLT applies the LT predicate on the "profile_created" field.
func ProfileCreatedLT(v time.Time) predicate.Player {
return predicate.Player(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldProfileCreated), v))
})
}
// ProfileCreatedLTE applies the LTE predicate on the "profile_created" field.
func ProfileCreatedLTE(v time.Time) predicate.Player {
return predicate.Player(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldProfileCreated), v))
})
}
// ProfileCreatedIsNil applies the IsNil predicate on the "profile_created" field.
func ProfileCreatedIsNil() predicate.Player {
return predicate.Player(func(s *sql.Selector) {
s.Where(sql.IsNull(s.C(FieldProfileCreated)))
})
}
// ProfileCreatedNotNil applies the NotNil predicate on the "profile_created" field.
func ProfileCreatedNotNil() predicate.Player {
return predicate.Player(func(s *sql.Selector) {
s.Where(sql.NotNull(s.C(FieldProfileCreated)))
})
}
// HasStats applies the HasEdge predicate on the "stats" edge.
func HasStats() predicate.Player {
return predicate.Player(func(s *sql.Selector) {