1
0

fix game story

This commit is contained in:
2024-06-08 01:02:15 +09:00
parent e508a50025
commit a01e86d8b3
21 changed files with 2291 additions and 85 deletions

View File

@@ -680,6 +680,34 @@ func (uc *UserCreate) SetNillableGameExp(i *int) *UserCreate {
return uc
}
// SetGameStory sets the "game_story" field.
func (uc *UserCreate) SetGameStory(i int) *UserCreate {
uc.mutation.SetGameStory(i)
return uc
}
// SetNillableGameStory sets the "game_story" field if the given value is not nil.
func (uc *UserCreate) SetNillableGameStory(i *int) *UserCreate {
if i != nil {
uc.SetGameStory(*i)
}
return uc
}
// SetGameLimit sets the "game_limit" field.
func (uc *UserCreate) SetGameLimit(b bool) *UserCreate {
uc.mutation.SetGameLimit(b)
return uc
}
// SetNillableGameLimit sets the "game_limit" field if the given value is not nil.
func (uc *UserCreate) SetNillableGameLimit(b *bool) *UserCreate {
if b != nil {
uc.SetGameLimit(*b)
}
return uc
}
// SetCoin sets the "coin" field.
func (uc *UserCreate) SetCoin(i int) *UserCreate {
uc.mutation.SetCoin(i)
@@ -905,6 +933,10 @@ func (uc *UserCreate) defaults() {
v := user.DefaultGameAccount
uc.mutation.SetGameAccount(v)
}
if _, ok := uc.mutation.GameLimit(); !ok {
v := user.DefaultGameLimit
uc.mutation.SetGameLimit(v)
}
if _, ok := uc.mutation.CoinOpen(); !ok {
v := user.DefaultCoinOpen
uc.mutation.SetCoinOpen(v)
@@ -1151,6 +1183,14 @@ func (uc *UserCreate) createSpec() (*User, *sqlgraph.CreateSpec) {
_spec.SetField(user.FieldGameExp, field.TypeInt, value)
_node.GameExp = value
}
if value, ok := uc.mutation.GameStory(); ok {
_spec.SetField(user.FieldGameStory, field.TypeInt, value)
_node.GameStory = value
}
if value, ok := uc.mutation.GameLimit(); ok {
_spec.SetField(user.FieldGameLimit, field.TypeBool, value)
_node.GameLimit = value
}
if value, ok := uc.mutation.Coin(); ok {
_spec.SetField(user.FieldCoin, field.TypeInt, value)
_node.Coin = value