added chat messages

This commit is contained in:
2022-01-29 19:32:13 +01:00
parent 2e6c94de81
commit b036275665
48 changed files with 4167 additions and 353 deletions

View File

@@ -8,6 +8,7 @@ import (
"csgowtfd/ent/matchplayer"
"csgowtfd/ent/player"
"csgowtfd/ent/predicate"
"errors"
"fmt"
"time"
@@ -188,6 +189,18 @@ func (mu *MatchUpdate) SetNillableGamebanPresent(b *bool) *MatchUpdate {
return mu
}
// SetDecryptionKey sets the "decryption_key" field.
func (mu *MatchUpdate) SetDecryptionKey(b []byte) *MatchUpdate {
mu.mutation.SetDecryptionKey(b)
return mu
}
// ClearDecryptionKey clears the value of the "decryption_key" field.
func (mu *MatchUpdate) ClearDecryptionKey() *MatchUpdate {
mu.mutation.ClearDecryptionKey()
return mu
}
// AddStatIDs adds the "stats" edge to the MatchPlayer entity by IDs.
func (mu *MatchUpdate) AddStatIDs(ids ...int) *MatchUpdate {
mu.mutation.AddStatIDs(ids...)
@@ -468,6 +481,19 @@ func (mu *MatchUpdate) sqlSave(ctx context.Context) (n int, err error) {
Column: match.FieldGamebanPresent,
})
}
if value, ok := mu.mutation.DecryptionKey(); ok {
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
Type: field.TypeBytes,
Value: value,
Column: match.FieldDecryptionKey,
})
}
if mu.mutation.DecryptionKeyCleared() {
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
Type: field.TypeBytes,
Column: match.FieldDecryptionKey,
})
}
if mu.mutation.StatsCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
@@ -754,6 +780,18 @@ func (muo *MatchUpdateOne) SetNillableGamebanPresent(b *bool) *MatchUpdateOne {
return muo
}
// SetDecryptionKey sets the "decryption_key" field.
func (muo *MatchUpdateOne) SetDecryptionKey(b []byte) *MatchUpdateOne {
muo.mutation.SetDecryptionKey(b)
return muo
}
// ClearDecryptionKey clears the value of the "decryption_key" field.
func (muo *MatchUpdateOne) ClearDecryptionKey() *MatchUpdateOne {
muo.mutation.ClearDecryptionKey()
return muo
}
// AddStatIDs adds the "stats" edge to the MatchPlayer entity by IDs.
func (muo *MatchUpdateOne) AddStatIDs(ids ...int) *MatchUpdateOne {
muo.mutation.AddStatIDs(ids...)
@@ -905,7 +943,7 @@ func (muo *MatchUpdateOne) sqlSave(ctx context.Context) (_node *Match, err error
}
id, ok := muo.mutation.ID()
if !ok {
return nil, &ValidationError{Name: "ID", err: fmt.Errorf("missing Match.ID for update")}
return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "Match.id" for update`)}
}
_spec.Node.ID.Value = id
if fields := muo.fields; len(fields) > 0 {
@@ -1058,6 +1096,19 @@ func (muo *MatchUpdateOne) sqlSave(ctx context.Context) (_node *Match, err error
Column: match.FieldGamebanPresent,
})
}
if value, ok := muo.mutation.DecryptionKey(); ok {
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
Type: field.TypeBytes,
Value: value,
Column: match.FieldDecryptionKey,
})
}
if muo.mutation.DecryptionKeyCleared() {
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
Type: field.TypeBytes,
Column: match.FieldDecryptionKey,
})
}
if muo.mutation.StatsCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,