1
0

fix ue game lv

This commit is contained in:
2024-06-01 23:35:34 +09:00
parent 2b479451c1
commit e508a50025
21 changed files with 2170 additions and 79 deletions

View File

@@ -1017,6 +1017,33 @@ func (uu *UserUpdate) ClearGameLv() *UserUpdate {
return uu
}
// SetGameExp sets the "game_exp" field.
func (uu *UserUpdate) SetGameExp(i int) *UserUpdate {
uu.mutation.ResetGameExp()
uu.mutation.SetGameExp(i)
return uu
}
// SetNillableGameExp sets the "game_exp" field if the given value is not nil.
func (uu *UserUpdate) SetNillableGameExp(i *int) *UserUpdate {
if i != nil {
uu.SetGameExp(*i)
}
return uu
}
// AddGameExp adds i to the "game_exp" field.
func (uu *UserUpdate) AddGameExp(i int) *UserUpdate {
uu.mutation.AddGameExp(i)
return uu
}
// ClearGameExp clears the value of the "game_exp" field.
func (uu *UserUpdate) ClearGameExp() *UserUpdate {
uu.mutation.ClearGameExp()
return uu
}
// SetCoin sets the "coin" field.
func (uu *UserUpdate) SetCoin(i int) *UserUpdate {
uu.mutation.ResetCoin()
@@ -1581,6 +1608,15 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) {
if uu.mutation.GameLvCleared() {
_spec.ClearField(user.FieldGameLv, field.TypeInt)
}
if value, ok := uu.mutation.GameExp(); ok {
_spec.SetField(user.FieldGameExp, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedGameExp(); ok {
_spec.AddField(user.FieldGameExp, field.TypeInt, value)
}
if uu.mutation.GameExpCleared() {
_spec.ClearField(user.FieldGameExp, field.TypeInt)
}
if value, ok := uu.mutation.Coin(); ok {
_spec.SetField(user.FieldCoin, field.TypeInt, value)
}
@@ -2787,6 +2823,33 @@ func (uuo *UserUpdateOne) ClearGameLv() *UserUpdateOne {
return uuo
}
// SetGameExp sets the "game_exp" field.
func (uuo *UserUpdateOne) SetGameExp(i int) *UserUpdateOne {
uuo.mutation.ResetGameExp()
uuo.mutation.SetGameExp(i)
return uuo
}
// SetNillableGameExp sets the "game_exp" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableGameExp(i *int) *UserUpdateOne {
if i != nil {
uuo.SetGameExp(*i)
}
return uuo
}
// AddGameExp adds i to the "game_exp" field.
func (uuo *UserUpdateOne) AddGameExp(i int) *UserUpdateOne {
uuo.mutation.AddGameExp(i)
return uuo
}
// ClearGameExp clears the value of the "game_exp" field.
func (uuo *UserUpdateOne) ClearGameExp() *UserUpdateOne {
uuo.mutation.ClearGameExp()
return uuo
}
// SetCoin sets the "coin" field.
func (uuo *UserUpdateOne) SetCoin(i int) *UserUpdateOne {
uuo.mutation.ResetCoin()
@@ -3381,6 +3444,15 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error)
if uuo.mutation.GameLvCleared() {
_spec.ClearField(user.FieldGameLv, field.TypeInt)
}
if value, ok := uuo.mutation.GameExp(); ok {
_spec.SetField(user.FieldGameExp, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedGameExp(); ok {
_spec.AddField(user.FieldGameExp, field.TypeInt, value)
}
if uuo.mutation.GameExpCleared() {
_spec.ClearField(user.FieldGameExp, field.TypeInt)
}
if value, ok := uuo.mutation.Coin(); ok {
_spec.SetField(user.FieldCoin, field.TypeInt, value)
}