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

@@ -134,6 +134,12 @@ func (mc *MatchCreate) SetNillableGamebanPresent(b *bool) *MatchCreate {
return mc
}
// SetDecryptionKey sets the "decryption_key" field.
func (mc *MatchCreate) SetDecryptionKey(b []byte) *MatchCreate {
mc.mutation.SetDecryptionKey(b)
return mc
}
// SetID sets the "id" field.
func (mc *MatchCreate) SetID(u uint64) *MatchCreate {
mc.mutation.SetID(u)
@@ -258,34 +264,34 @@ func (mc *MatchCreate) defaults() {
// check runs all checks and user-defined validators on the builder.
func (mc *MatchCreate) check() error {
if _, ok := mc.mutation.ShareCode(); !ok {
return &ValidationError{Name: "share_code", err: errors.New(`ent: missing required field "share_code"`)}
return &ValidationError{Name: "share_code", err: errors.New(`ent: missing required field "Match.share_code"`)}
}
if _, ok := mc.mutation.Date(); !ok {
return &ValidationError{Name: "date", err: errors.New(`ent: missing required field "date"`)}
return &ValidationError{Name: "date", err: errors.New(`ent: missing required field "Match.date"`)}
}
if _, ok := mc.mutation.ScoreTeamA(); !ok {
return &ValidationError{Name: "score_team_a", err: errors.New(`ent: missing required field "score_team_a"`)}
return &ValidationError{Name: "score_team_a", err: errors.New(`ent: missing required field "Match.score_team_a"`)}
}
if _, ok := mc.mutation.ScoreTeamB(); !ok {
return &ValidationError{Name: "score_team_b", err: errors.New(`ent: missing required field "score_team_b"`)}
return &ValidationError{Name: "score_team_b", err: errors.New(`ent: missing required field "Match.score_team_b"`)}
}
if _, ok := mc.mutation.Duration(); !ok {
return &ValidationError{Name: "duration", err: errors.New(`ent: missing required field "duration"`)}
return &ValidationError{Name: "duration", err: errors.New(`ent: missing required field "Match.duration"`)}
}
if _, ok := mc.mutation.MatchResult(); !ok {
return &ValidationError{Name: "match_result", err: errors.New(`ent: missing required field "match_result"`)}
return &ValidationError{Name: "match_result", err: errors.New(`ent: missing required field "Match.match_result"`)}
}
if _, ok := mc.mutation.MaxRounds(); !ok {
return &ValidationError{Name: "max_rounds", err: errors.New(`ent: missing required field "max_rounds"`)}
return &ValidationError{Name: "max_rounds", err: errors.New(`ent: missing required field "Match.max_rounds"`)}
}
if _, ok := mc.mutation.DemoParsed(); !ok {
return &ValidationError{Name: "demo_parsed", err: errors.New(`ent: missing required field "demo_parsed"`)}
return &ValidationError{Name: "demo_parsed", err: errors.New(`ent: missing required field "Match.demo_parsed"`)}
}
if _, ok := mc.mutation.VacPresent(); !ok {
return &ValidationError{Name: "vac_present", err: errors.New(`ent: missing required field "vac_present"`)}
return &ValidationError{Name: "vac_present", err: errors.New(`ent: missing required field "Match.vac_present"`)}
}
if _, ok := mc.mutation.GamebanPresent(); !ok {
return &ValidationError{Name: "gameban_present", err: errors.New(`ent: missing required field "gameban_present"`)}
return &ValidationError{Name: "gameban_present", err: errors.New(`ent: missing required field "Match.gameban_present"`)}
}
return nil
}
@@ -416,6 +422,14 @@ func (mc *MatchCreate) createSpec() (*Match, *sqlgraph.CreateSpec) {
})
_node.GamebanPresent = value
}
if value, ok := mc.mutation.DecryptionKey(); ok {
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
Type: field.TypeBytes,
Value: value,
Column: match.FieldDecryptionKey,
})
_node.DecryptionKey = value
}
if nodes := mc.mutation.StatsIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,