[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

@@ -224,6 +224,26 @@ func (pu *PlayerUpdate) ClearAuthCode() *PlayerUpdate {
return pu
}
// SetProfileCreated sets the "profile_created" field.
func (pu *PlayerUpdate) SetProfileCreated(t time.Time) *PlayerUpdate {
pu.mutation.SetProfileCreated(t)
return pu
}
// SetNillableProfileCreated sets the "profile_created" field if the given value is not nil.
func (pu *PlayerUpdate) SetNillableProfileCreated(t *time.Time) *PlayerUpdate {
if t != nil {
pu.SetProfileCreated(*t)
}
return pu
}
// ClearProfileCreated clears the value of the "profile_created" field.
func (pu *PlayerUpdate) ClearProfileCreated() *PlayerUpdate {
pu.mutation.ClearProfileCreated()
return pu
}
// AddStatIDs adds the "stats" edge to the Stats entity by IDs.
func (pu *PlayerUpdate) AddStatIDs(ids ...int) *PlayerUpdate {
pu.mutation.AddStatIDs(ids...)
@@ -498,6 +518,19 @@ func (pu *PlayerUpdate) sqlSave(ctx context.Context) (n int, err error) {
Column: player.FieldAuthCode,
})
}
if value, ok := pu.mutation.ProfileCreated(); ok {
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
Type: field.TypeTime,
Value: value,
Column: player.FieldProfileCreated,
})
}
if pu.mutation.ProfileCreatedCleared() {
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
Type: field.TypeTime,
Column: player.FieldProfileCreated,
})
}
if pu.mutation.StatsCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
@@ -820,6 +853,26 @@ func (puo *PlayerUpdateOne) ClearAuthCode() *PlayerUpdateOne {
return puo
}
// SetProfileCreated sets the "profile_created" field.
func (puo *PlayerUpdateOne) SetProfileCreated(t time.Time) *PlayerUpdateOne {
puo.mutation.SetProfileCreated(t)
return puo
}
// SetNillableProfileCreated sets the "profile_created" field if the given value is not nil.
func (puo *PlayerUpdateOne) SetNillableProfileCreated(t *time.Time) *PlayerUpdateOne {
if t != nil {
puo.SetProfileCreated(*t)
}
return puo
}
// ClearProfileCreated clears the value of the "profile_created" field.
func (puo *PlayerUpdateOne) ClearProfileCreated() *PlayerUpdateOne {
puo.mutation.ClearProfileCreated()
return puo
}
// AddStatIDs adds the "stats" edge to the Stats entity by IDs.
func (puo *PlayerUpdateOne) AddStatIDs(ids ...int) *PlayerUpdateOne {
puo.mutation.AddStatIDs(ids...)
@@ -1118,6 +1171,19 @@ func (puo *PlayerUpdateOne) sqlSave(ctx context.Context) (_node *Player, err err
Column: player.FieldAuthCode,
})
}
if value, ok := puo.mutation.ProfileCreated(); ok {
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
Type: field.TypeTime,
Value: value,
Column: player.FieldProfileCreated,
})
}
if puo.mutation.ProfileCreatedCleared() {
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
Type: field.TypeTime,
Column: player.FieldProfileCreated,
})
}
if puo.mutation.StatsCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,