added avg ping recording
This commit is contained in:
@@ -772,6 +772,33 @@ func (mpu *MatchPlayerUpdate) ClearFlashAssists() *MatchPlayerUpdate {
|
||||
return mpu
|
||||
}
|
||||
|
||||
// SetAvgPing sets the "avg_ping" field.
|
||||
func (mpu *MatchPlayerUpdate) SetAvgPing(f float64) *MatchPlayerUpdate {
|
||||
mpu.mutation.ResetAvgPing()
|
||||
mpu.mutation.SetAvgPing(f)
|
||||
return mpu
|
||||
}
|
||||
|
||||
// SetNillableAvgPing sets the "avg_ping" field if the given value is not nil.
|
||||
func (mpu *MatchPlayerUpdate) SetNillableAvgPing(f *float64) *MatchPlayerUpdate {
|
||||
if f != nil {
|
||||
mpu.SetAvgPing(*f)
|
||||
}
|
||||
return mpu
|
||||
}
|
||||
|
||||
// AddAvgPing adds f to the "avg_ping" field.
|
||||
func (mpu *MatchPlayerUpdate) AddAvgPing(f float64) *MatchPlayerUpdate {
|
||||
mpu.mutation.AddAvgPing(f)
|
||||
return mpu
|
||||
}
|
||||
|
||||
// ClearAvgPing clears the value of the "avg_ping" field.
|
||||
func (mpu *MatchPlayerUpdate) ClearAvgPing() *MatchPlayerUpdate {
|
||||
mpu.mutation.ClearAvgPing()
|
||||
return mpu
|
||||
}
|
||||
|
||||
// SetMatchesID sets the "matches" edge to the Match entity by ID.
|
||||
func (mpu *MatchPlayerUpdate) SetMatchesID(id uint64) *MatchPlayerUpdate {
|
||||
mpu.mutation.SetMatchesID(id)
|
||||
@@ -1308,6 +1335,15 @@ func (mpu *MatchPlayerUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
if mpu.mutation.FlashAssistsCleared() {
|
||||
_spec.ClearField(matchplayer.FieldFlashAssists, field.TypeInt)
|
||||
}
|
||||
if value, ok := mpu.mutation.AvgPing(); ok {
|
||||
_spec.SetField(matchplayer.FieldAvgPing, field.TypeFloat64, value)
|
||||
}
|
||||
if value, ok := mpu.mutation.AddedAvgPing(); ok {
|
||||
_spec.AddField(matchplayer.FieldAvgPing, field.TypeFloat64, value)
|
||||
}
|
||||
if mpu.mutation.AvgPingCleared() {
|
||||
_spec.ClearField(matchplayer.FieldAvgPing, field.TypeFloat64)
|
||||
}
|
||||
if mpu.mutation.MatchesCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
Rel: sqlgraph.M2O,
|
||||
@@ -2353,6 +2389,33 @@ func (mpuo *MatchPlayerUpdateOne) ClearFlashAssists() *MatchPlayerUpdateOne {
|
||||
return mpuo
|
||||
}
|
||||
|
||||
// SetAvgPing sets the "avg_ping" field.
|
||||
func (mpuo *MatchPlayerUpdateOne) SetAvgPing(f float64) *MatchPlayerUpdateOne {
|
||||
mpuo.mutation.ResetAvgPing()
|
||||
mpuo.mutation.SetAvgPing(f)
|
||||
return mpuo
|
||||
}
|
||||
|
||||
// SetNillableAvgPing sets the "avg_ping" field if the given value is not nil.
|
||||
func (mpuo *MatchPlayerUpdateOne) SetNillableAvgPing(f *float64) *MatchPlayerUpdateOne {
|
||||
if f != nil {
|
||||
mpuo.SetAvgPing(*f)
|
||||
}
|
||||
return mpuo
|
||||
}
|
||||
|
||||
// AddAvgPing adds f to the "avg_ping" field.
|
||||
func (mpuo *MatchPlayerUpdateOne) AddAvgPing(f float64) *MatchPlayerUpdateOne {
|
||||
mpuo.mutation.AddAvgPing(f)
|
||||
return mpuo
|
||||
}
|
||||
|
||||
// ClearAvgPing clears the value of the "avg_ping" field.
|
||||
func (mpuo *MatchPlayerUpdateOne) ClearAvgPing() *MatchPlayerUpdateOne {
|
||||
mpuo.mutation.ClearAvgPing()
|
||||
return mpuo
|
||||
}
|
||||
|
||||
// SetMatchesID sets the "matches" edge to the Match entity by ID.
|
||||
func (mpuo *MatchPlayerUpdateOne) SetMatchesID(id uint64) *MatchPlayerUpdateOne {
|
||||
mpuo.mutation.SetMatchesID(id)
|
||||
@@ -2919,6 +2982,15 @@ func (mpuo *MatchPlayerUpdateOne) sqlSave(ctx context.Context) (_node *MatchPlay
|
||||
if mpuo.mutation.FlashAssistsCleared() {
|
||||
_spec.ClearField(matchplayer.FieldFlashAssists, field.TypeInt)
|
||||
}
|
||||
if value, ok := mpuo.mutation.AvgPing(); ok {
|
||||
_spec.SetField(matchplayer.FieldAvgPing, field.TypeFloat64, value)
|
||||
}
|
||||
if value, ok := mpuo.mutation.AddedAvgPing(); ok {
|
||||
_spec.AddField(matchplayer.FieldAvgPing, field.TypeFloat64, value)
|
||||
}
|
||||
if mpuo.mutation.AvgPingCleared() {
|
||||
_spec.ClearField(matchplayer.FieldAvgPing, field.TypeFloat64)
|
||||
}
|
||||
if mpuo.mutation.MatchesCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
Rel: sqlgraph.M2O,
|
||||
|
Reference in New Issue
Block a user