1
0

fix game story

This commit is contained in:
syui 2024-06-08 01:02:15 +09:00
parent e508a50025
commit e707b1802e
Signed by: syui
GPG Key ID: 5417CFEBAD92DF56
21 changed files with 1804 additions and 82 deletions

View File

@ -153,6 +153,7 @@ var (
{Name: "game_lv", Type: field.TypeString, Nullable: true},
{Name: "game_exp", Type: field.TypeString, Nullable: true},
{Name: "game_id", Type: field.TypeString, Nullable: true},
{Name: "game_story", Type: field.TypeInt, Nullable: true},
{Name: "created_at", Type: field.TypeTime, Nullable: true},
{Name: "user_ue", Type: field.TypeInt},
}
@ -164,7 +165,7 @@ var (
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "ues_users_ue",
Columns: []*schema.Column{UesColumns[23]},
Columns: []*schema.Column{UesColumns[24]},
RefColumns: []*schema.Column{UsersColumns[0]},
OnDelete: schema.NoAction,
},
@ -205,7 +206,7 @@ var (
{Name: "ten_post", Type: field.TypeString, Nullable: true},
{Name: "ten_get", Type: field.TypeString, Nullable: true},
{Name: "ten_at", Type: field.TypeTime, Nullable: true},
{Name: "next", Type: field.TypeString, Nullable: true, Default: "20240601"},
{Name: "next", Type: field.TypeString, Nullable: true, Default: "20240607"},
{Name: "room", Type: field.TypeInt, Nullable: true},
{Name: "model", Type: field.TypeBool, Nullable: true},
{Name: "model_at", Type: field.TypeTime, Nullable: true},
@ -221,6 +222,8 @@ var (
{Name: "game_account", Type: field.TypeBool, Nullable: true, Default: false},
{Name: "game_lv", Type: field.TypeInt, Nullable: true},
{Name: "game_exp", Type: field.TypeInt, Nullable: true},
{Name: "game_story", Type: field.TypeInt, Nullable: true},
{Name: "game_limit", Type: field.TypeBool, Nullable: true, Default: false},
{Name: "coin", Type: field.TypeInt, Nullable: true},
{Name: "coin_open", Type: field.TypeBool, Nullable: true, Default: false},
{Name: "coin_at", Type: field.TypeTime, Nullable: true},
@ -234,7 +237,7 @@ var (
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "users_groups_users",
Columns: []*schema.Column{UsersColumns[52]},
Columns: []*schema.Column{UsersColumns[54]},
RefColumns: []*schema.Column{GroupsColumns[0]},
OnDelete: schema.SetNull,
},

View File

@ -5117,6 +5117,8 @@ type UeMutation struct {
game_lv *string
game_exp *string
game_id *string
game_story *int
addgame_story *int
created_at *time.Time
clearedFields map[string]struct{}
owner *int
@ -6471,6 +6473,76 @@ func (m *UeMutation) ResetGameID() {
delete(m.clearedFields, ue.FieldGameID)
}
// SetGameStory sets the "game_story" field.
func (m *UeMutation) SetGameStory(i int) {
m.game_story = &i
m.addgame_story = nil
}
// GameStory returns the value of the "game_story" field in the mutation.
func (m *UeMutation) GameStory() (r int, exists bool) {
v := m.game_story
if v == nil {
return
}
return *v, true
}
// OldGameStory returns the old "game_story" field's value of the Ue entity.
// If the Ue object wasn't provided to the builder, the object is fetched from the database.
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (m *UeMutation) OldGameStory(ctx context.Context) (v int, err error) {
if !m.op.Is(OpUpdateOne) {
return v, errors.New("OldGameStory is only allowed on UpdateOne operations")
}
if m.id == nil || m.oldValue == nil {
return v, errors.New("OldGameStory requires an ID field in the mutation")
}
oldValue, err := m.oldValue(ctx)
if err != nil {
return v, fmt.Errorf("querying old value for OldGameStory: %w", err)
}
return oldValue.GameStory, nil
}
// AddGameStory adds i to the "game_story" field.
func (m *UeMutation) AddGameStory(i int) {
if m.addgame_story != nil {
*m.addgame_story += i
} else {
m.addgame_story = &i
}
}
// AddedGameStory returns the value that was added to the "game_story" field in this mutation.
func (m *UeMutation) AddedGameStory() (r int, exists bool) {
v := m.addgame_story
if v == nil {
return
}
return *v, true
}
// ClearGameStory clears the value of the "game_story" field.
func (m *UeMutation) ClearGameStory() {
m.game_story = nil
m.addgame_story = nil
m.clearedFields[ue.FieldGameStory] = struct{}{}
}
// GameStoryCleared returns if the "game_story" field was cleared in this mutation.
func (m *UeMutation) GameStoryCleared() bool {
_, ok := m.clearedFields[ue.FieldGameStory]
return ok
}
// ResetGameStory resets all changes to the "game_story" field.
func (m *UeMutation) ResetGameStory() {
m.game_story = nil
m.addgame_story = nil
delete(m.clearedFields, ue.FieldGameStory)
}
// SetCreatedAt sets the "created_at" field.
func (m *UeMutation) SetCreatedAt(t time.Time) {
m.created_at = &t
@ -6593,7 +6665,7 @@ func (m *UeMutation) Type() string {
// order to get all numeric fields that were incremented/decremented, call
// AddedFields().
func (m *UeMutation) Fields() []string {
fields := make([]string, 0, 22)
fields := make([]string, 0, 23)
if m._limit != nil {
fields = append(fields, ue.FieldLimit)
}
@ -6657,6 +6729,9 @@ func (m *UeMutation) Fields() []string {
if m.game_id != nil {
fields = append(fields, ue.FieldGameID)
}
if m.game_story != nil {
fields = append(fields, ue.FieldGameStory)
}
if m.created_at != nil {
fields = append(fields, ue.FieldCreatedAt)
}
@ -6710,6 +6785,8 @@ func (m *UeMutation) Field(name string) (ent.Value, bool) {
return m.GameExp()
case ue.FieldGameID:
return m.GameID()
case ue.FieldGameStory:
return m.GameStory()
case ue.FieldCreatedAt:
return m.CreatedAt()
}
@ -6763,6 +6840,8 @@ func (m *UeMutation) OldField(ctx context.Context, name string) (ent.Value, erro
return m.OldGameExp(ctx)
case ue.FieldGameID:
return m.OldGameID(ctx)
case ue.FieldGameStory:
return m.OldGameStory(ctx)
case ue.FieldCreatedAt:
return m.OldCreatedAt(ctx)
}
@ -6921,6 +7000,13 @@ func (m *UeMutation) SetField(name string, value ent.Value) error {
}
m.SetGameID(v)
return nil
case ue.FieldGameStory:
v, ok := value.(int)
if !ok {
return fmt.Errorf("unexpected type %T for field %s", value, name)
}
m.SetGameStory(v)
return nil
case ue.FieldCreatedAt:
v, ok := value.(time.Time)
if !ok {
@ -6969,6 +7055,9 @@ func (m *UeMutation) AddedFields() []string {
if m.addlocation_n != nil {
fields = append(fields, ue.FieldLocationN)
}
if m.addgame_story != nil {
fields = append(fields, ue.FieldGameStory)
}
return fields
}
@ -6999,6 +7088,8 @@ func (m *UeMutation) AddedField(name string) (ent.Value, bool) {
return m.AddedLocationZ()
case ue.FieldLocationN:
return m.AddedLocationN()
case ue.FieldGameStory:
return m.AddedGameStory()
}
return nil, false
}
@ -7085,6 +7176,13 @@ func (m *UeMutation) AddField(name string, value ent.Value) error {
}
m.AddLocationN(v)
return nil
case ue.FieldGameStory:
v, ok := value.(int)
if !ok {
return fmt.Errorf("unexpected type %T for field %s", value, name)
}
m.AddGameStory(v)
return nil
}
return fmt.Errorf("unknown Ue numeric field %s", name)
}
@ -7153,6 +7251,9 @@ func (m *UeMutation) ClearedFields() []string {
if m.FieldCleared(ue.FieldGameID) {
fields = append(fields, ue.FieldGameID)
}
if m.FieldCleared(ue.FieldGameStory) {
fields = append(fields, ue.FieldGameStory)
}
if m.FieldCleared(ue.FieldCreatedAt) {
fields = append(fields, ue.FieldCreatedAt)
}
@ -7230,6 +7331,9 @@ func (m *UeMutation) ClearField(name string) error {
case ue.FieldGameID:
m.ClearGameID()
return nil
case ue.FieldGameStory:
m.ClearGameStory()
return nil
case ue.FieldCreatedAt:
m.ClearCreatedAt()
return nil
@ -7304,6 +7408,9 @@ func (m *UeMutation) ResetField(name string) error {
case ue.FieldGameID:
m.ResetGameID()
return nil
case ue.FieldGameStory:
m.ResetGameStory()
return nil
case ue.FieldCreatedAt:
m.ResetCreatedAt()
return nil
@ -7455,6 +7562,9 @@ type UserMutation struct {
addgame_lv *int
game_exp *int
addgame_exp *int
game_story *int
addgame_story *int
game_limit *bool
coin *int
addcoin *int
coin_open *bool
@ -10237,6 +10347,125 @@ func (m *UserMutation) ResetGameExp() {
delete(m.clearedFields, user.FieldGameExp)
}
// SetGameStory sets the "game_story" field.
func (m *UserMutation) SetGameStory(i int) {
m.game_story = &i
m.addgame_story = nil
}
// GameStory returns the value of the "game_story" field in the mutation.
func (m *UserMutation) GameStory() (r int, exists bool) {
v := m.game_story
if v == nil {
return
}
return *v, true
}
// OldGameStory returns the old "game_story" field's value of the User entity.
// If the User object wasn't provided to the builder, the object is fetched from the database.
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (m *UserMutation) OldGameStory(ctx context.Context) (v int, err error) {
if !m.op.Is(OpUpdateOne) {
return v, errors.New("OldGameStory is only allowed on UpdateOne operations")
}
if m.id == nil || m.oldValue == nil {
return v, errors.New("OldGameStory requires an ID field in the mutation")
}
oldValue, err := m.oldValue(ctx)
if err != nil {
return v, fmt.Errorf("querying old value for OldGameStory: %w", err)
}
return oldValue.GameStory, nil
}
// AddGameStory adds i to the "game_story" field.
func (m *UserMutation) AddGameStory(i int) {
if m.addgame_story != nil {
*m.addgame_story += i
} else {
m.addgame_story = &i
}
}
// AddedGameStory returns the value that was added to the "game_story" field in this mutation.
func (m *UserMutation) AddedGameStory() (r int, exists bool) {
v := m.addgame_story
if v == nil {
return
}
return *v, true
}
// ClearGameStory clears the value of the "game_story" field.
func (m *UserMutation) ClearGameStory() {
m.game_story = nil
m.addgame_story = nil
m.clearedFields[user.FieldGameStory] = struct{}{}
}
// GameStoryCleared returns if the "game_story" field was cleared in this mutation.
func (m *UserMutation) GameStoryCleared() bool {
_, ok := m.clearedFields[user.FieldGameStory]
return ok
}
// ResetGameStory resets all changes to the "game_story" field.
func (m *UserMutation) ResetGameStory() {
m.game_story = nil
m.addgame_story = nil
delete(m.clearedFields, user.FieldGameStory)
}
// SetGameLimit sets the "game_limit" field.
func (m *UserMutation) SetGameLimit(b bool) {
m.game_limit = &b
}
// GameLimit returns the value of the "game_limit" field in the mutation.
func (m *UserMutation) GameLimit() (r bool, exists bool) {
v := m.game_limit
if v == nil {
return
}
return *v, true
}
// OldGameLimit returns the old "game_limit" field's value of the User entity.
// If the User object wasn't provided to the builder, the object is fetched from the database.
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (m *UserMutation) OldGameLimit(ctx context.Context) (v bool, err error) {
if !m.op.Is(OpUpdateOne) {
return v, errors.New("OldGameLimit is only allowed on UpdateOne operations")
}
if m.id == nil || m.oldValue == nil {
return v, errors.New("OldGameLimit requires an ID field in the mutation")
}
oldValue, err := m.oldValue(ctx)
if err != nil {
return v, fmt.Errorf("querying old value for OldGameLimit: %w", err)
}
return oldValue.GameLimit, nil
}
// ClearGameLimit clears the value of the "game_limit" field.
func (m *UserMutation) ClearGameLimit() {
m.game_limit = nil
m.clearedFields[user.FieldGameLimit] = struct{}{}
}
// GameLimitCleared returns if the "game_limit" field was cleared in this mutation.
func (m *UserMutation) GameLimitCleared() bool {
_, ok := m.clearedFields[user.FieldGameLimit]
return ok
}
// ResetGameLimit resets all changes to the "game_limit" field.
func (m *UserMutation) ResetGameLimit() {
m.game_limit = nil
delete(m.clearedFields, user.FieldGameLimit)
}
// SetCoin sets the "coin" field.
func (m *UserMutation) SetCoin(i int) {
m.coin = &i
@ -10655,7 +10884,7 @@ func (m *UserMutation) Type() string {
// order to get all numeric fields that were incremented/decremented, call
// AddedFields().
func (m *UserMutation) Fields() []string {
fields := make([]string, 0, 51)
fields := make([]string, 0, 53)
if m.username != nil {
fields = append(fields, user.FieldUsername)
}
@ -10800,6 +11029,12 @@ func (m *UserMutation) Fields() []string {
if m.game_exp != nil {
fields = append(fields, user.FieldGameExp)
}
if m.game_story != nil {
fields = append(fields, user.FieldGameStory)
}
if m.game_limit != nil {
fields = append(fields, user.FieldGameLimit)
}
if m.coin != nil {
fields = append(fields, user.FieldCoin)
}
@ -10913,6 +11148,10 @@ func (m *UserMutation) Field(name string) (ent.Value, bool) {
return m.GameLv()
case user.FieldGameExp:
return m.GameExp()
case user.FieldGameStory:
return m.GameStory()
case user.FieldGameLimit:
return m.GameLimit()
case user.FieldCoin:
return m.Coin()
case user.FieldCoinOpen:
@ -11024,6 +11263,10 @@ func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, er
return m.OldGameLv(ctx)
case user.FieldGameExp:
return m.OldGameExp(ctx)
case user.FieldGameStory:
return m.OldGameStory(ctx)
case user.FieldGameLimit:
return m.OldGameLimit(ctx)
case user.FieldCoin:
return m.OldCoin(ctx)
case user.FieldCoinOpen:
@ -11375,6 +11618,20 @@ func (m *UserMutation) SetField(name string, value ent.Value) error {
}
m.SetGameExp(v)
return nil
case user.FieldGameStory:
v, ok := value.(int)
if !ok {
return fmt.Errorf("unexpected type %T for field %s", value, name)
}
m.SetGameStory(v)
return nil
case user.FieldGameLimit:
v, ok := value.(bool)
if !ok {
return fmt.Errorf("unexpected type %T for field %s", value, name)
}
m.SetGameLimit(v)
return nil
case user.FieldCoin:
v, ok := value.(int)
if !ok {
@ -11452,6 +11709,9 @@ func (m *UserMutation) AddedFields() []string {
if m.addgame_exp != nil {
fields = append(fields, user.FieldGameExp)
}
if m.addgame_story != nil {
fields = append(fields, user.FieldGameStory)
}
if m.addcoin != nil {
fields = append(fields, user.FieldCoin)
}
@ -11495,6 +11755,8 @@ func (m *UserMutation) AddedField(name string) (ent.Value, bool) {
return m.AddedGameLv()
case user.FieldGameExp:
return m.AddedGameExp()
case user.FieldGameStory:
return m.AddedGameStory()
case user.FieldCoin:
return m.AddedCoin()
}
@ -11618,6 +11880,13 @@ func (m *UserMutation) AddField(name string, value ent.Value) error {
}
m.AddGameExp(v)
return nil
case user.FieldGameStory:
v, ok := value.(int)
if !ok {
return fmt.Errorf("unexpected type %T for field %s", value, name)
}
m.AddGameStory(v)
return nil
case user.FieldCoin:
v, ok := value.(int)
if !ok {
@ -11771,6 +12040,12 @@ func (m *UserMutation) ClearedFields() []string {
if m.FieldCleared(user.FieldGameExp) {
fields = append(fields, user.FieldGameExp)
}
if m.FieldCleared(user.FieldGameStory) {
fields = append(fields, user.FieldGameStory)
}
if m.FieldCleared(user.FieldGameLimit) {
fields = append(fields, user.FieldGameLimit)
}
if m.FieldCleared(user.FieldCoin) {
fields = append(fields, user.FieldCoin)
}
@ -11932,6 +12207,12 @@ func (m *UserMutation) ClearField(name string) error {
case user.FieldGameExp:
m.ClearGameExp()
return nil
case user.FieldGameStory:
m.ClearGameStory()
return nil
case user.FieldGameLimit:
m.ClearGameLimit()
return nil
case user.FieldCoin:
m.ClearCoin()
return nil
@ -12093,6 +12374,12 @@ func (m *UserMutation) ResetField(name string) error {
case user.FieldGameExp:
m.ResetGameExp()
return nil
case user.FieldGameStory:
m.ResetGameStory()
return nil
case user.FieldGameLimit:
m.ResetGameLimit()
return nil
case user.FieldCoin:
m.ResetCoin()
return nil

File diff suppressed because it is too large Load Diff

View File

@ -265,6 +265,8 @@ type CardOwnerRead struct {
GameAccount OptBool `json:"game_account"`
GameLv OptInt `json:"game_lv"`
GameExp OptInt `json:"game_exp"`
GameStory OptInt `json:"game_story"`
GameLimit OptBool `json:"game_limit"`
Coin OptInt `json:"coin"`
CoinOpen OptBool `json:"coin_open"`
CoinAt OptDateTime `json:"coin_at"`
@ -505,6 +507,16 @@ func (s *CardOwnerRead) GetGameExp() OptInt {
return s.GameExp
}
// GetGameStory returns the value of GameStory.
func (s *CardOwnerRead) GetGameStory() OptInt {
return s.GameStory
}
// GetGameLimit returns the value of GameLimit.
func (s *CardOwnerRead) GetGameLimit() OptBool {
return s.GameLimit
}
// GetCoin returns the value of Coin.
func (s *CardOwnerRead) GetCoin() OptInt {
return s.Coin
@ -755,6 +767,16 @@ func (s *CardOwnerRead) SetGameExp(val OptInt) {
s.GameExp = val
}
// SetGameStory sets the value of GameStory.
func (s *CardOwnerRead) SetGameStory(val OptInt) {
s.GameStory = val
}
// SetGameLimit sets the value of GameLimit.
func (s *CardOwnerRead) SetGameLimit(val OptBool) {
s.GameLimit = val
}
// SetCoin sets the value of Coin.
func (s *CardOwnerRead) SetCoin(val OptInt) {
s.Coin = val
@ -1577,6 +1599,7 @@ type CreateUeReq struct {
GameLv OptString `json:"game_lv"`
GameExp OptString `json:"game_exp"`
GameID OptString `json:"game_id"`
GameStory OptInt `json:"game_story"`
CreatedAt OptDateTime `json:"created_at"`
Owner int `json:"owner"`
}
@ -1686,6 +1709,11 @@ func (s *CreateUeReq) GetGameID() OptString {
return s.GameID
}
// GetGameStory returns the value of GameStory.
func (s *CreateUeReq) GetGameStory() OptInt {
return s.GameStory
}
// GetCreatedAt returns the value of CreatedAt.
func (s *CreateUeReq) GetCreatedAt() OptDateTime {
return s.CreatedAt
@ -1801,6 +1829,11 @@ func (s *CreateUeReq) SetGameID(val OptString) {
s.GameID = val
}
// SetGameStory sets the value of GameStory.
func (s *CreateUeReq) SetGameStory(val OptInt) {
s.GameStory = val
}
// SetCreatedAt sets the value of CreatedAt.
func (s *CreateUeReq) SetCreatedAt(val OptDateTime) {
s.CreatedAt = val
@ -1860,6 +1893,8 @@ type CreateUserReq struct {
GameAccount OptBool `json:"game_account"`
GameLv OptInt `json:"game_lv"`
GameExp OptInt `json:"game_exp"`
GameStory OptInt `json:"game_story"`
GameLimit OptBool `json:"game_limit"`
Coin OptInt `json:"coin"`
CoinOpen OptBool `json:"coin_open"`
CoinAt OptDateTime `json:"coin_at"`
@ -2109,6 +2144,16 @@ func (s *CreateUserReq) GetGameExp() OptInt {
return s.GameExp
}
// GetGameStory returns the value of GameStory.
func (s *CreateUserReq) GetGameStory() OptInt {
return s.GameStory
}
// GetGameLimit returns the value of GameLimit.
func (s *CreateUserReq) GetGameLimit() OptBool {
return s.GameLimit
}
// GetCoin returns the value of Coin.
func (s *CreateUserReq) GetCoin() OptInt {
return s.Coin
@ -2384,6 +2429,16 @@ func (s *CreateUserReq) SetGameExp(val OptInt) {
s.GameExp = val
}
// SetGameStory sets the value of GameStory.
func (s *CreateUserReq) SetGameStory(val OptInt) {
s.GameStory = val
}
// SetGameLimit sets the value of GameLimit.
func (s *CreateUserReq) SetGameLimit(val OptBool) {
s.GameLimit = val
}
// SetCoin sets the value of Coin.
func (s *CreateUserReq) SetCoin(val OptInt) {
s.Coin = val
@ -2614,6 +2669,8 @@ type GroupUsersList struct {
GameAccount OptBool `json:"game_account"`
GameLv OptInt `json:"game_lv"`
GameExp OptInt `json:"game_exp"`
GameStory OptInt `json:"game_story"`
GameLimit OptBool `json:"game_limit"`
Coin OptInt `json:"coin"`
CoinOpen OptBool `json:"coin_open"`
CoinAt OptDateTime `json:"coin_at"`
@ -2854,6 +2911,16 @@ func (s *GroupUsersList) GetGameExp() OptInt {
return s.GameExp
}
// GetGameStory returns the value of GameStory.
func (s *GroupUsersList) GetGameStory() OptInt {
return s.GameStory
}
// GetGameLimit returns the value of GameLimit.
func (s *GroupUsersList) GetGameLimit() OptBool {
return s.GameLimit
}
// GetCoin returns the value of Coin.
func (s *GroupUsersList) GetCoin() OptInt {
return s.Coin
@ -3104,6 +3171,16 @@ func (s *GroupUsersList) SetGameExp(val OptInt) {
s.GameExp = val
}
// SetGameStory sets the value of GameStory.
func (s *GroupUsersList) SetGameStory(val OptInt) {
s.GameStory = val
}
// SetGameLimit sets the value of GameLimit.
func (s *GroupUsersList) SetGameLimit(val OptBool) {
s.GameLimit = val
}
// SetCoin sets the value of Coin.
func (s *GroupUsersList) SetCoin(val OptInt) {
s.Coin = val
@ -3706,6 +3783,8 @@ type MaOwnerRead struct {
GameAccount OptBool `json:"game_account"`
GameLv OptInt `json:"game_lv"`
GameExp OptInt `json:"game_exp"`
GameStory OptInt `json:"game_story"`
GameLimit OptBool `json:"game_limit"`
Coin OptInt `json:"coin"`
CoinOpen OptBool `json:"coin_open"`
CoinAt OptDateTime `json:"coin_at"`
@ -3946,6 +4025,16 @@ func (s *MaOwnerRead) GetGameExp() OptInt {
return s.GameExp
}
// GetGameStory returns the value of GameStory.
func (s *MaOwnerRead) GetGameStory() OptInt {
return s.GameStory
}
// GetGameLimit returns the value of GameLimit.
func (s *MaOwnerRead) GetGameLimit() OptBool {
return s.GameLimit
}
// GetCoin returns the value of Coin.
func (s *MaOwnerRead) GetCoin() OptInt {
return s.Coin
@ -4196,6 +4285,16 @@ func (s *MaOwnerRead) SetGameExp(val OptInt) {
s.GameExp = val
}
// SetGameStory sets the value of GameStory.
func (s *MaOwnerRead) SetGameStory(val OptInt) {
s.GameStory = val
}
// SetGameLimit sets the value of GameLimit.
func (s *MaOwnerRead) SetGameLimit(val OptBool) {
s.GameLimit = val
}
// SetCoin sets the value of Coin.
func (s *MaOwnerRead) SetCoin(val OptInt) {
s.Coin = val
@ -5492,6 +5591,8 @@ type SevOwnerRead struct {
GameAccount OptBool `json:"game_account"`
GameLv OptInt `json:"game_lv"`
GameExp OptInt `json:"game_exp"`
GameStory OptInt `json:"game_story"`
GameLimit OptBool `json:"game_limit"`
Coin OptInt `json:"coin"`
CoinOpen OptBool `json:"coin_open"`
CoinAt OptDateTime `json:"coin_at"`
@ -5732,6 +5833,16 @@ func (s *SevOwnerRead) GetGameExp() OptInt {
return s.GameExp
}
// GetGameStory returns the value of GameStory.
func (s *SevOwnerRead) GetGameStory() OptInt {
return s.GameStory
}
// GetGameLimit returns the value of GameLimit.
func (s *SevOwnerRead) GetGameLimit() OptBool {
return s.GameLimit
}
// GetCoin returns the value of Coin.
func (s *SevOwnerRead) GetCoin() OptInt {
return s.Coin
@ -5982,6 +6093,16 @@ func (s *SevOwnerRead) SetGameExp(val OptInt) {
s.GameExp = val
}
// SetGameStory sets the value of GameStory.
func (s *SevOwnerRead) SetGameStory(val OptInt) {
s.GameStory = val
}
// SetGameLimit sets the value of GameLimit.
func (s *SevOwnerRead) SetGameLimit(val OptBool) {
s.GameLimit = val
}
// SetCoin sets the value of Coin.
func (s *SevOwnerRead) SetCoin(val OptInt) {
s.Coin = val
@ -6275,6 +6396,7 @@ type UeCreate struct {
GameLv OptString `json:"game_lv"`
GameExp OptString `json:"game_exp"`
GameID OptString `json:"game_id"`
GameStory OptInt `json:"game_story"`
CreatedAt OptDateTime `json:"created_at"`
}
@ -6378,6 +6500,11 @@ func (s *UeCreate) GetGameID() OptString {
return s.GameID
}
// GetGameStory returns the value of GameStory.
func (s *UeCreate) GetGameStory() OptInt {
return s.GameStory
}
// GetCreatedAt returns the value of CreatedAt.
func (s *UeCreate) GetCreatedAt() OptDateTime {
return s.CreatedAt
@ -6483,6 +6610,11 @@ func (s *UeCreate) SetGameID(val OptString) {
s.GameID = val
}
// SetGameStory sets the value of GameStory.
func (s *UeCreate) SetGameStory(val OptInt) {
s.GameStory = val
}
// SetCreatedAt sets the value of CreatedAt.
func (s *UeCreate) SetCreatedAt(val OptDateTime) {
s.CreatedAt = val
@ -6512,6 +6644,7 @@ type UeList struct {
GameLv OptString `json:"game_lv"`
GameExp OptString `json:"game_exp"`
GameID OptString `json:"game_id"`
GameStory OptInt `json:"game_story"`
CreatedAt OptDateTime `json:"created_at"`
}
@ -6615,6 +6748,11 @@ func (s *UeList) GetGameID() OptString {
return s.GameID
}
// GetGameStory returns the value of GameStory.
func (s *UeList) GetGameStory() OptInt {
return s.GameStory
}
// GetCreatedAt returns the value of CreatedAt.
func (s *UeList) GetCreatedAt() OptDateTime {
return s.CreatedAt
@ -6720,6 +6858,11 @@ func (s *UeList) SetGameID(val OptString) {
s.GameID = val
}
// SetGameStory sets the value of GameStory.
func (s *UeList) SetGameStory(val OptInt) {
s.GameStory = val
}
// SetCreatedAt sets the value of CreatedAt.
func (s *UeList) SetCreatedAt(val OptDateTime) {
s.CreatedAt = val
@ -6774,6 +6917,8 @@ type UeOwnerRead struct {
GameAccount OptBool `json:"game_account"`
GameLv OptInt `json:"game_lv"`
GameExp OptInt `json:"game_exp"`
GameStory OptInt `json:"game_story"`
GameLimit OptBool `json:"game_limit"`
Coin OptInt `json:"coin"`
CoinOpen OptBool `json:"coin_open"`
CoinAt OptDateTime `json:"coin_at"`
@ -7014,6 +7159,16 @@ func (s *UeOwnerRead) GetGameExp() OptInt {
return s.GameExp
}
// GetGameStory returns the value of GameStory.
func (s *UeOwnerRead) GetGameStory() OptInt {
return s.GameStory
}
// GetGameLimit returns the value of GameLimit.
func (s *UeOwnerRead) GetGameLimit() OptBool {
return s.GameLimit
}
// GetCoin returns the value of Coin.
func (s *UeOwnerRead) GetCoin() OptInt {
return s.Coin
@ -7264,6 +7419,16 @@ func (s *UeOwnerRead) SetGameExp(val OptInt) {
s.GameExp = val
}
// SetGameStory sets the value of GameStory.
func (s *UeOwnerRead) SetGameStory(val OptInt) {
s.GameStory = val
}
// SetGameLimit sets the value of GameLimit.
func (s *UeOwnerRead) SetGameLimit(val OptBool) {
s.GameLimit = val
}
// SetCoin sets the value of Coin.
func (s *UeOwnerRead) SetCoin(val OptInt) {
s.Coin = val
@ -7303,6 +7468,7 @@ type UeRead struct {
GameLv OptString `json:"game_lv"`
GameExp OptString `json:"game_exp"`
GameID OptString `json:"game_id"`
GameStory OptInt `json:"game_story"`
CreatedAt OptDateTime `json:"created_at"`
}
@ -7406,6 +7572,11 @@ func (s *UeRead) GetGameID() OptString {
return s.GameID
}
// GetGameStory returns the value of GameStory.
func (s *UeRead) GetGameStory() OptInt {
return s.GameStory
}
// GetCreatedAt returns the value of CreatedAt.
func (s *UeRead) GetCreatedAt() OptDateTime {
return s.CreatedAt
@ -7511,6 +7682,11 @@ func (s *UeRead) SetGameID(val OptString) {
s.GameID = val
}
// SetGameStory sets the value of GameStory.
func (s *UeRead) SetGameStory(val OptInt) {
s.GameStory = val
}
// SetCreatedAt sets the value of CreatedAt.
func (s *UeRead) SetCreatedAt(val OptDateTime) {
s.CreatedAt = val
@ -7540,6 +7716,7 @@ type UeUpdate struct {
GameLv OptString `json:"game_lv"`
GameExp OptString `json:"game_exp"`
GameID OptString `json:"game_id"`
GameStory OptInt `json:"game_story"`
CreatedAt OptDateTime `json:"created_at"`
}
@ -7643,6 +7820,11 @@ func (s *UeUpdate) GetGameID() OptString {
return s.GameID
}
// GetGameStory returns the value of GameStory.
func (s *UeUpdate) GetGameStory() OptInt {
return s.GameStory
}
// GetCreatedAt returns the value of CreatedAt.
func (s *UeUpdate) GetCreatedAt() OptDateTime {
return s.CreatedAt
@ -7748,6 +7930,11 @@ func (s *UeUpdate) SetGameID(val OptString) {
s.GameID = val
}
// SetGameStory sets the value of GameStory.
func (s *UeUpdate) SetGameStory(val OptInt) {
s.GameStory = val
}
// SetCreatedAt sets the value of CreatedAt.
func (s *UeUpdate) SetCreatedAt(val OptDateTime) {
s.CreatedAt = val
@ -8272,6 +8459,7 @@ type UpdateUeReq struct {
GameLv OptString `json:"game_lv"`
GameExp OptString `json:"game_exp"`
GameID OptString `json:"game_id"`
GameStory OptInt `json:"game_story"`
Owner OptInt `json:"owner"`
}
@ -8375,6 +8563,11 @@ func (s *UpdateUeReq) GetGameID() OptString {
return s.GameID
}
// GetGameStory returns the value of GameStory.
func (s *UpdateUeReq) GetGameStory() OptInt {
return s.GameStory
}
// GetOwner returns the value of Owner.
func (s *UpdateUeReq) GetOwner() OptInt {
return s.Owner
@ -8480,6 +8673,11 @@ func (s *UpdateUeReq) SetGameID(val OptString) {
s.GameID = val
}
// SetGameStory sets the value of GameStory.
func (s *UpdateUeReq) SetGameStory(val OptInt) {
s.GameStory = val
}
// SetOwner sets the value of Owner.
func (s *UpdateUeReq) SetOwner(val OptInt) {
s.Owner = val
@ -8531,6 +8729,8 @@ type UpdateUserReq struct {
GameAccount OptBool `json:"game_account"`
GameLv OptInt `json:"game_lv"`
GameExp OptInt `json:"game_exp"`
GameStory OptInt `json:"game_story"`
GameLimit OptBool `json:"game_limit"`
Coin OptInt `json:"coin"`
CoinOpen OptBool `json:"coin_open"`
CoinAt OptDateTime `json:"coin_at"`
@ -8765,6 +8965,16 @@ func (s *UpdateUserReq) GetGameExp() OptInt {
return s.GameExp
}
// GetGameStory returns the value of GameStory.
func (s *UpdateUserReq) GetGameStory() OptInt {
return s.GameStory
}
// GetGameLimit returns the value of GameLimit.
func (s *UpdateUserReq) GetGameLimit() OptBool {
return s.GameLimit
}
// GetCoin returns the value of Coin.
func (s *UpdateUserReq) GetCoin() OptInt {
return s.Coin
@ -9025,6 +9235,16 @@ func (s *UpdateUserReq) SetGameExp(val OptInt) {
s.GameExp = val
}
// SetGameStory sets the value of GameStory.
func (s *UpdateUserReq) SetGameStory(val OptInt) {
s.GameStory = val
}
// SetGameLimit sets the value of GameLimit.
func (s *UpdateUserReq) SetGameLimit(val OptBool) {
s.GameLimit = val
}
// SetCoin sets the value of Coin.
func (s *UpdateUserReq) SetCoin(val OptInt) {
s.Coin = val
@ -9212,6 +9432,8 @@ type UserCreate struct {
GameAccount OptBool `json:"game_account"`
GameLv OptInt `json:"game_lv"`
GameExp OptInt `json:"game_exp"`
GameStory OptInt `json:"game_story"`
GameLimit OptBool `json:"game_limit"`
Coin OptInt `json:"coin"`
CoinOpen OptBool `json:"coin_open"`
CoinAt OptDateTime `json:"coin_at"`
@ -9452,6 +9674,16 @@ func (s *UserCreate) GetGameExp() OptInt {
return s.GameExp
}
// GetGameStory returns the value of GameStory.
func (s *UserCreate) GetGameStory() OptInt {
return s.GameStory
}
// GetGameLimit returns the value of GameLimit.
func (s *UserCreate) GetGameLimit() OptBool {
return s.GameLimit
}
// GetCoin returns the value of Coin.
func (s *UserCreate) GetCoin() OptInt {
return s.Coin
@ -9702,6 +9934,16 @@ func (s *UserCreate) SetGameExp(val OptInt) {
s.GameExp = val
}
// SetGameStory sets the value of GameStory.
func (s *UserCreate) SetGameStory(val OptInt) {
s.GameStory = val
}
// SetGameLimit sets the value of GameLimit.
func (s *UserCreate) SetGameLimit(val OptBool) {
s.GameLimit = val
}
// SetCoin sets the value of Coin.
func (s *UserCreate) SetCoin(val OptInt) {
s.Coin = val
@ -9768,6 +10010,8 @@ type UserList struct {
GameAccount OptBool `json:"game_account"`
GameLv OptInt `json:"game_lv"`
GameExp OptInt `json:"game_exp"`
GameStory OptInt `json:"game_story"`
GameLimit OptBool `json:"game_limit"`
Coin OptInt `json:"coin"`
CoinOpen OptBool `json:"coin_open"`
CoinAt OptDateTime `json:"coin_at"`
@ -10008,6 +10252,16 @@ func (s *UserList) GetGameExp() OptInt {
return s.GameExp
}
// GetGameStory returns the value of GameStory.
func (s *UserList) GetGameStory() OptInt {
return s.GameStory
}
// GetGameLimit returns the value of GameLimit.
func (s *UserList) GetGameLimit() OptBool {
return s.GameLimit
}
// GetCoin returns the value of Coin.
func (s *UserList) GetCoin() OptInt {
return s.Coin
@ -10258,6 +10512,16 @@ func (s *UserList) SetGameExp(val OptInt) {
s.GameExp = val
}
// SetGameStory sets the value of GameStory.
func (s *UserList) SetGameStory(val OptInt) {
s.GameStory = val
}
// SetGameLimit sets the value of GameLimit.
func (s *UserList) SetGameLimit(val OptBool) {
s.GameLimit = val
}
// SetCoin sets the value of Coin.
func (s *UserList) SetCoin(val OptInt) {
s.Coin = val
@ -10568,6 +10832,8 @@ type UserRead struct {
GameAccount OptBool `json:"game_account"`
GameLv OptInt `json:"game_lv"`
GameExp OptInt `json:"game_exp"`
GameStory OptInt `json:"game_story"`
GameLimit OptBool `json:"game_limit"`
Coin OptInt `json:"coin"`
CoinOpen OptBool `json:"coin_open"`
CoinAt OptDateTime `json:"coin_at"`
@ -10808,6 +11074,16 @@ func (s *UserRead) GetGameExp() OptInt {
return s.GameExp
}
// GetGameStory returns the value of GameStory.
func (s *UserRead) GetGameStory() OptInt {
return s.GameStory
}
// GetGameLimit returns the value of GameLimit.
func (s *UserRead) GetGameLimit() OptBool {
return s.GameLimit
}
// GetCoin returns the value of Coin.
func (s *UserRead) GetCoin() OptInt {
return s.Coin
@ -11058,6 +11334,16 @@ func (s *UserRead) SetGameExp(val OptInt) {
s.GameExp = val
}
// SetGameStory sets the value of GameStory.
func (s *UserRead) SetGameStory(val OptInt) {
s.GameStory = val
}
// SetGameLimit sets the value of GameLimit.
func (s *UserRead) SetGameLimit(val OptBool) {
s.GameLimit = val
}
// SetCoin sets the value of Coin.
func (s *UserRead) SetCoin(val OptInt) {
s.Coin = val
@ -11222,6 +11508,7 @@ type UserUeList struct {
GameLv OptString `json:"game_lv"`
GameExp OptString `json:"game_exp"`
GameID OptString `json:"game_id"`
GameStory OptInt `json:"game_story"`
CreatedAt OptDateTime `json:"created_at"`
}
@ -11325,6 +11612,11 @@ func (s *UserUeList) GetGameID() OptString {
return s.GameID
}
// GetGameStory returns the value of GameStory.
func (s *UserUeList) GetGameStory() OptInt {
return s.GameStory
}
// GetCreatedAt returns the value of CreatedAt.
func (s *UserUeList) GetCreatedAt() OptDateTime {
return s.CreatedAt
@ -11430,6 +11722,11 @@ func (s *UserUeList) SetGameID(val OptString) {
s.GameID = val
}
// SetGameStory sets the value of GameStory.
func (s *UserUeList) SetGameStory(val OptInt) {
s.GameStory = val
}
// SetCreatedAt sets the value of CreatedAt.
func (s *UserUeList) SetCreatedAt(val OptDateTime) {
s.CreatedAt = val
@ -11484,6 +11781,8 @@ type UserUpdate struct {
GameAccount OptBool `json:"game_account"`
GameLv OptInt `json:"game_lv"`
GameExp OptInt `json:"game_exp"`
GameStory OptInt `json:"game_story"`
GameLimit OptBool `json:"game_limit"`
Coin OptInt `json:"coin"`
CoinOpen OptBool `json:"coin_open"`
CoinAt OptDateTime `json:"coin_at"`
@ -11724,6 +12023,16 @@ func (s *UserUpdate) GetGameExp() OptInt {
return s.GameExp
}
// GetGameStory returns the value of GameStory.
func (s *UserUpdate) GetGameStory() OptInt {
return s.GameStory
}
// GetGameLimit returns the value of GameLimit.
func (s *UserUpdate) GetGameLimit() OptBool {
return s.GameLimit
}
// GetCoin returns the value of Coin.
func (s *UserUpdate) GetCoin() OptInt {
return s.Coin
@ -11974,6 +12283,16 @@ func (s *UserUpdate) SetGameExp(val OptInt) {
s.GameExp = val
}
// SetGameStory sets the value of GameStory.
func (s *UserUpdate) SetGameStory(val OptInt) {
s.GameStory = val
}
// SetGameLimit sets the value of GameLimit.
func (s *UserUpdate) SetGameLimit(val OptBool) {
s.GameLimit = val
}
// SetCoin sets the value of Coin.
func (s *UserUpdate) SetCoin(val OptInt) {
s.Coin = val

View File

@ -1174,6 +1174,9 @@ func (h *OgentHandler) CreateUe(ctx context.Context, req *CreateUeReq) (CreateUe
if v, ok := req.GameID.Get(); ok {
b.SetGameID(v)
}
if v, ok := req.GameStory.Get(); ok {
b.SetGameStory(v)
}
// Add all edges.
//b.SetOwnerID(req.Owner)
@ -1303,6 +1306,10 @@ func (h *OgentHandler) UpdateUe(ctx context.Context, req *UpdateUeReq, params Up
if v, ok := req.GameID.Get(); ok {
b.SetGameID(v)
}
if v, ok := req.GameStory.Get(); ok {
b.SetGameStory(v)
}
// Add all edges.
//if v, ok := req.Owner.Get(); ok {
// b.SetOwnerID(v)
@ -1585,6 +1592,12 @@ func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (Crea
if v, ok := req.GameExp.Get(); ok {
b.SetGameExp(v)
}
if v, ok := req.GameStory.Get(); ok {
b.SetGameStory(v)
}
if v, ok := req.GameLimit.Get(); ok {
b.SetGameLimit(v)
}
if v, ok := req.Coin.Get(); ok {
b.SetCoin(v)
}
@ -1797,6 +1810,12 @@ func (h *OgentHandler) UpdateUser(ctx context.Context, req *UpdateUserReq, param
if v, ok := req.GameExp.Get(); ok {
b.SetGameExp(v)
}
if v, ok := req.GameStory.Get(); ok {
b.SetGameStory(v)
}
if v, ok := req.GameLimit.Get(); ok {
b.SetGameLimit(v)
}
if v, ok := req.Coin.Get(); ok {
b.SetCoin(v)
}

View File

@ -196,6 +196,8 @@ func NewCardOwnerRead(e *ent.User) *CardOwnerRead {
ret.GameAccount = NewOptBool(e.GameAccount)
ret.GameLv = NewOptInt(e.GameLv)
ret.GameExp = NewOptInt(e.GameExp)
ret.GameStory = NewOptInt(e.GameStory)
ret.GameLimit = NewOptBool(e.GameLimit)
ret.Coin = NewOptInt(e.Coin)
ret.CoinOpen = NewOptBool(e.CoinOpen)
ret.CoinAt = NewOptDateTime(e.CoinAt)
@ -384,6 +386,8 @@ func NewGroupUsersList(e *ent.User) *GroupUsersList {
ret.GameAccount = NewOptBool(e.GameAccount)
ret.GameLv = NewOptInt(e.GameLv)
ret.GameExp = NewOptInt(e.GameExp)
ret.GameStory = NewOptInt(e.GameStory)
ret.GameLimit = NewOptBool(e.GameLimit)
ret.Coin = NewOptInt(e.Coin)
ret.CoinOpen = NewOptBool(e.CoinOpen)
ret.CoinAt = NewOptDateTime(e.CoinAt)
@ -652,6 +656,8 @@ func NewMaOwnerRead(e *ent.User) *MaOwnerRead {
ret.GameAccount = NewOptBool(e.GameAccount)
ret.GameLv = NewOptInt(e.GameLv)
ret.GameExp = NewOptInt(e.GameExp)
ret.GameStory = NewOptInt(e.GameStory)
ret.GameLimit = NewOptBool(e.GameLimit)
ret.Coin = NewOptInt(e.Coin)
ret.CoinOpen = NewOptBool(e.CoinOpen)
ret.CoinAt = NewOptDateTime(e.CoinAt)
@ -876,6 +882,8 @@ func NewSevOwnerRead(e *ent.User) *SevOwnerRead {
ret.GameAccount = NewOptBool(e.GameAccount)
ret.GameLv = NewOptInt(e.GameLv)
ret.GameExp = NewOptInt(e.GameExp)
ret.GameStory = NewOptInt(e.GameStory)
ret.GameLimit = NewOptBool(e.GameLimit)
ret.Coin = NewOptInt(e.Coin)
ret.CoinOpen = NewOptBool(e.CoinOpen)
ret.CoinAt = NewOptDateTime(e.CoinAt)
@ -925,6 +933,7 @@ func NewUeCreate(e *ent.Ue) *UeCreate {
ret.GameLv = NewOptString(e.GameLv)
ret.GameExp = NewOptString(e.GameExp)
ret.GameID = NewOptString(e.GameID)
ret.GameStory = NewOptInt(e.GameStory)
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
return &ret
}
@ -972,6 +981,7 @@ func NewUeList(e *ent.Ue) *UeList {
ret.GameLv = NewOptString(e.GameLv)
ret.GameExp = NewOptString(e.GameExp)
ret.GameID = NewOptString(e.GameID)
ret.GameStory = NewOptInt(e.GameStory)
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
return &ret
}
@ -1019,6 +1029,7 @@ func NewUeRead(e *ent.Ue) *UeRead {
ret.GameLv = NewOptString(e.GameLv)
ret.GameExp = NewOptString(e.GameExp)
ret.GameID = NewOptString(e.GameID)
ret.GameStory = NewOptInt(e.GameStory)
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
return &ret
}
@ -1066,6 +1077,7 @@ func NewUeUpdate(e *ent.Ue) *UeUpdate {
ret.GameLv = NewOptString(e.GameLv)
ret.GameExp = NewOptString(e.GameExp)
ret.GameID = NewOptString(e.GameID)
ret.GameStory = NewOptInt(e.GameStory)
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
return &ret
}
@ -1140,6 +1152,8 @@ func NewUeOwnerRead(e *ent.User) *UeOwnerRead {
ret.GameAccount = NewOptBool(e.GameAccount)
ret.GameLv = NewOptInt(e.GameLv)
ret.GameExp = NewOptInt(e.GameExp)
ret.GameStory = NewOptInt(e.GameStory)
ret.GameLimit = NewOptBool(e.GameLimit)
ret.Coin = NewOptInt(e.Coin)
ret.CoinOpen = NewOptBool(e.CoinOpen)
ret.CoinAt = NewOptDateTime(e.CoinAt)
@ -1216,6 +1230,8 @@ func NewUserCreate(e *ent.User) *UserCreate {
ret.GameAccount = NewOptBool(e.GameAccount)
ret.GameLv = NewOptInt(e.GameLv)
ret.GameExp = NewOptInt(e.GameExp)
ret.GameStory = NewOptInt(e.GameStory)
ret.GameLimit = NewOptBool(e.GameLimit)
ret.Coin = NewOptInt(e.Coin)
ret.CoinOpen = NewOptBool(e.CoinOpen)
ret.CoinAt = NewOptDateTime(e.CoinAt)
@ -1292,6 +1308,8 @@ func NewUserList(e *ent.User) *UserList {
ret.GameAccount = NewOptBool(e.GameAccount)
ret.GameLv = NewOptInt(e.GameLv)
ret.GameExp = NewOptInt(e.GameExp)
ret.GameStory = NewOptInt(e.GameStory)
ret.GameLimit = NewOptBool(e.GameLimit)
ret.Coin = NewOptInt(e.Coin)
ret.CoinOpen = NewOptBool(e.CoinOpen)
ret.CoinAt = NewOptDateTime(e.CoinAt)
@ -1368,6 +1386,8 @@ func NewUserRead(e *ent.User) *UserRead {
ret.GameAccount = NewOptBool(e.GameAccount)
ret.GameLv = NewOptInt(e.GameLv)
ret.GameExp = NewOptInt(e.GameExp)
ret.GameStory = NewOptInt(e.GameStory)
ret.GameLimit = NewOptBool(e.GameLimit)
ret.Coin = NewOptInt(e.Coin)
ret.CoinOpen = NewOptBool(e.CoinOpen)
ret.CoinAt = NewOptDateTime(e.CoinAt)
@ -1444,6 +1464,8 @@ func NewUserUpdate(e *ent.User) *UserUpdate {
ret.GameAccount = NewOptBool(e.GameAccount)
ret.GameLv = NewOptInt(e.GameLv)
ret.GameExp = NewOptInt(e.GameExp)
ret.GameStory = NewOptInt(e.GameStory)
ret.GameLimit = NewOptBool(e.GameLimit)
ret.Coin = NewOptInt(e.Coin)
ret.CoinOpen = NewOptBool(e.CoinOpen)
ret.CoinAt = NewOptDateTime(e.CoinAt)
@ -1613,6 +1635,7 @@ func NewUserUeList(e *ent.Ue) *UserUeList {
ret.GameLv = NewOptString(e.GameLv)
ret.GameExp = NewOptString(e.GameExp)
ret.GameID = NewOptString(e.GameID)
ret.GameStory = NewOptInt(e.GameStory)
ret.CreatedAt = NewOptDateTime(e.CreatedAt)
return &ret
}

View File

@ -1626,6 +1626,9 @@
"game_id": {
"type": "string"
},
"game_story": {
"type": "integer"
},
"created_at": {
"type": "string",
"format": "date-time"
@ -1831,6 +1834,9 @@
"game_id": {
"type": "string"
},
"game_story": {
"type": "integer"
},
"owner": {
"type": "integer"
}
@ -2135,6 +2141,12 @@
"game_exp": {
"type": "integer"
},
"game_story": {
"type": "integer"
},
"game_limit": {
"type": "boolean"
},
"coin": {
"type": "integer"
},
@ -2450,6 +2462,12 @@
"game_exp": {
"type": "integer"
},
"game_story": {
"type": "integer"
},
"game_limit": {
"type": "boolean"
},
"coin": {
"type": "integer"
},
@ -3144,6 +3162,12 @@
"game_exp": {
"type": "integer"
},
"game_story": {
"type": "integer"
},
"game_limit": {
"type": "boolean"
},
"coin": {
"type": "integer"
},
@ -3398,6 +3422,12 @@
"game_exp": {
"type": "integer"
},
"game_story": {
"type": "integer"
},
"game_limit": {
"type": "boolean"
},
"coin": {
"type": "integer"
},
@ -3958,6 +3988,12 @@
"game_exp": {
"type": "integer"
},
"game_story": {
"type": "integer"
},
"game_limit": {
"type": "boolean"
},
"coin": {
"type": "integer"
},
@ -4353,6 +4389,12 @@
"game_exp": {
"type": "integer"
},
"game_story": {
"type": "integer"
},
"game_limit": {
"type": "boolean"
},
"coin": {
"type": "integer"
},
@ -4438,6 +4480,9 @@
"game_id": {
"type": "string"
},
"game_story": {
"type": "integer"
},
"created_at": {
"type": "string",
"format": "date-time"
@ -4515,6 +4560,9 @@
"game_id": {
"type": "string"
},
"game_story": {
"type": "integer"
},
"created_at": {
"type": "string",
"format": "date-time"
@ -4587,6 +4635,9 @@
"game_id": {
"type": "string"
},
"game_story": {
"type": "integer"
},
"created_at": {
"type": "string",
"format": "date-time"
@ -4659,6 +4710,9 @@
"game_id": {
"type": "string"
},
"game_story": {
"type": "integer"
},
"created_at": {
"type": "string",
"format": "date-time"
@ -4731,6 +4785,9 @@
"game_id": {
"type": "string"
},
"game_story": {
"type": "integer"
},
"created_at": {
"type": "string",
"format": "date-time"
@ -4893,6 +4950,12 @@
"game_exp": {
"type": "integer"
},
"game_story": {
"type": "integer"
},
"game_limit": {
"type": "boolean"
},
"coin": {
"type": "integer"
},
@ -5068,6 +5131,12 @@
"game_exp": {
"type": "integer"
},
"game_story": {
"type": "integer"
},
"game_limit": {
"type": "boolean"
},
"coin": {
"type": "integer"
},
@ -5262,6 +5331,12 @@
"game_exp": {
"type": "integer"
},
"game_story": {
"type": "integer"
},
"game_limit": {
"type": "boolean"
},
"coin": {
"type": "integer"
},
@ -5431,6 +5506,12 @@
"game_exp": {
"type": "integer"
},
"game_story": {
"type": "integer"
},
"game_limit": {
"type": "boolean"
},
"coin": {
"type": "integer"
},
@ -5600,6 +5681,12 @@
"game_exp": {
"type": "integer"
},
"game_story": {
"type": "integer"
},
"game_limit": {
"type": "boolean"
},
"coin": {
"type": "integer"
},
@ -5769,6 +5856,12 @@
"game_exp": {
"type": "integer"
},
"game_story": {
"type": "integer"
},
"game_limit": {
"type": "boolean"
},
"coin": {
"type": "integer"
},
@ -6003,6 +6096,9 @@
"game_id": {
"type": "string"
},
"game_story": {
"type": "integer"
},
"created_at": {
"type": "string",
"format": "date-time"

View File

@ -100,7 +100,7 @@ func init() {
// ue.PasswordValidator is a validator for the "password" field. It is called by the builders before save.
ue.PasswordValidator = ueDescPassword.Validators[0].(func(string) error)
// ueDescCreatedAt is the schema descriptor for created_at field.
ueDescCreatedAt := ueFields[21].Descriptor()
ueDescCreatedAt := ueFields[22].Descriptor()
// ue.DefaultCreatedAt holds the default value on creation for the created_at field.
ue.DefaultCreatedAt = ueDescCreatedAt.Default.(func() time.Time)
userFields := schema.User{}.Fields()
@ -215,12 +215,16 @@ func init() {
userDescGameAccount := userFields[45].Descriptor()
// user.DefaultGameAccount holds the default value on creation for the game_account field.
user.DefaultGameAccount = userDescGameAccount.Default.(bool)
// userDescGameLimit is the schema descriptor for game_limit field.
userDescGameLimit := userFields[49].Descriptor()
// user.DefaultGameLimit holds the default value on creation for the game_limit field.
user.DefaultGameLimit = userDescGameLimit.Default.(bool)
// userDescCoinOpen is the schema descriptor for coin_open field.
userDescCoinOpen := userFields[49].Descriptor()
userDescCoinOpen := userFields[51].Descriptor()
// user.DefaultCoinOpen holds the default value on creation for the coin_open field.
user.DefaultCoinOpen = userDescCoinOpen.Default.(bool)
// userDescCoinAt is the schema descriptor for coin_at field.
userDescCoinAt := userFields[50].Descriptor()
userDescCoinAt := userFields[52].Descriptor()
// user.DefaultCoinAt holds the default value on creation for the coin_at field.
user.DefaultCoinAt = userDescCoinAt.Default.(func() time.Time)
}

View File

@ -84,6 +84,9 @@ func (Ue) Fields() []ent.Field {
field.String("game_id").
Optional(),
field.Int("game_story").
Optional(),
field.Time("created_at").
Immutable().
Optional().

View File

@ -221,6 +221,13 @@ func (User) Fields() []ent.Field {
field.Int("game_exp").
Optional(),
field.Int("game_story").
Optional(),
field.Bool("game_limit").
Default(false).
Optional(),
field.Int("coin").
Optional(),

View File

@ -60,6 +60,8 @@ type Ue struct {
GameExp string `json:"game_exp,omitempty"`
// GameID holds the value of the "game_id" field.
GameID string `json:"game_id,omitempty"`
// GameStory holds the value of the "game_story" field.
GameStory int `json:"game_story,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
@ -98,7 +100,7 @@ func (*Ue) scanValues(columns []string) ([]any, error) {
switch columns[i] {
case ue.FieldLimit, ue.FieldLimitBoss, ue.FieldLimitItem:
values[i] = new(sql.NullBool)
case ue.FieldID, ue.FieldLv, ue.FieldLvPoint, ue.FieldModel, ue.FieldSword, ue.FieldCard, ue.FieldCp, ue.FieldCount, ue.FieldLocationX, ue.FieldLocationY, ue.FieldLocationZ, ue.FieldLocationN:
case ue.FieldID, ue.FieldLv, ue.FieldLvPoint, ue.FieldModel, ue.FieldSword, ue.FieldCard, ue.FieldCp, ue.FieldCount, ue.FieldLocationX, ue.FieldLocationY, ue.FieldLocationZ, ue.FieldLocationN, ue.FieldGameStory:
values[i] = new(sql.NullInt64)
case ue.FieldPassword, ue.FieldMode, ue.FieldToken, ue.FieldAuthor, ue.FieldGameLv, ue.FieldGameExp, ue.FieldGameID:
values[i] = new(sql.NullString)
@ -253,6 +255,12 @@ func (u *Ue) assignValues(columns []string, values []any) error {
} else if value.Valid {
u.GameID = value.String
}
case ue.FieldGameStory:
if value, ok := values[i].(*sql.NullInt64); !ok {
return fmt.Errorf("unexpected type %T for field game_story", values[i])
} else if value.Valid {
u.GameStory = int(value.Int64)
}
case ue.FieldCreatedAt:
if value, ok := values[i].(*sql.NullTime); !ok {
return fmt.Errorf("unexpected type %T for field created_at", values[i])
@ -368,6 +376,9 @@ func (u *Ue) String() string {
builder.WriteString("game_id=")
builder.WriteString(u.GameID)
builder.WriteString(", ")
builder.WriteString("game_story=")
builder.WriteString(fmt.Sprintf("%v", u.GameStory))
builder.WriteString(", ")
builder.WriteString("created_at=")
builder.WriteString(u.CreatedAt.Format(time.ANSIC))
builder.WriteByte(')')

View File

@ -56,6 +56,8 @@ const (
FieldGameExp = "game_exp"
// FieldGameID holds the string denoting the game_id field in the database.
FieldGameID = "game_id"
// FieldGameStory holds the string denoting the game_story field in the database.
FieldGameStory = "game_story"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// EdgeOwner holds the string denoting the owner edge name in mutations.
@ -95,6 +97,7 @@ var Columns = []string{
FieldGameLv,
FieldGameExp,
FieldGameID,
FieldGameStory,
FieldCreatedAt,
}
@ -245,6 +248,11 @@ func ByGameID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldGameID, opts...).ToFunc()
}
// ByGameStory orders the results by the game_story field.
func ByGameStory(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldGameStory, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()

View File

@ -160,6 +160,11 @@ func GameID(v string) predicate.Ue {
return predicate.Ue(sql.FieldEQ(FieldGameID, v))
}
// GameStory applies equality check predicate on the "game_story" field. It's identical to GameStoryEQ.
func GameStory(v int) predicate.Ue {
return predicate.Ue(sql.FieldEQ(FieldGameStory, v))
}
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
func CreatedAt(v time.Time) predicate.Ue {
return predicate.Ue(sql.FieldEQ(FieldCreatedAt, v))
@ -1290,6 +1295,56 @@ func GameIDContainsFold(v string) predicate.Ue {
return predicate.Ue(sql.FieldContainsFold(FieldGameID, v))
}
// GameStoryEQ applies the EQ predicate on the "game_story" field.
func GameStoryEQ(v int) predicate.Ue {
return predicate.Ue(sql.FieldEQ(FieldGameStory, v))
}
// GameStoryNEQ applies the NEQ predicate on the "game_story" field.
func GameStoryNEQ(v int) predicate.Ue {
return predicate.Ue(sql.FieldNEQ(FieldGameStory, v))
}
// GameStoryIn applies the In predicate on the "game_story" field.
func GameStoryIn(vs ...int) predicate.Ue {
return predicate.Ue(sql.FieldIn(FieldGameStory, vs...))
}
// GameStoryNotIn applies the NotIn predicate on the "game_story" field.
func GameStoryNotIn(vs ...int) predicate.Ue {
return predicate.Ue(sql.FieldNotIn(FieldGameStory, vs...))
}
// GameStoryGT applies the GT predicate on the "game_story" field.
func GameStoryGT(v int) predicate.Ue {
return predicate.Ue(sql.FieldGT(FieldGameStory, v))
}
// GameStoryGTE applies the GTE predicate on the "game_story" field.
func GameStoryGTE(v int) predicate.Ue {
return predicate.Ue(sql.FieldGTE(FieldGameStory, v))
}
// GameStoryLT applies the LT predicate on the "game_story" field.
func GameStoryLT(v int) predicate.Ue {
return predicate.Ue(sql.FieldLT(FieldGameStory, v))
}
// GameStoryLTE applies the LTE predicate on the "game_story" field.
func GameStoryLTE(v int) predicate.Ue {
return predicate.Ue(sql.FieldLTE(FieldGameStory, v))
}
// GameStoryIsNil applies the IsNil predicate on the "game_story" field.
func GameStoryIsNil() predicate.Ue {
return predicate.Ue(sql.FieldIsNull(FieldGameStory))
}
// GameStoryNotNil applies the NotNil predicate on the "game_story" field.
func GameStoryNotNil() predicate.Ue {
return predicate.Ue(sql.FieldNotNull(FieldGameStory))
}
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
func CreatedAtEQ(v time.Time) predicate.Ue {
return predicate.Ue(sql.FieldEQ(FieldCreatedAt, v))

View File

@ -307,6 +307,20 @@ func (uc *UeCreate) SetNillableGameID(s *string) *UeCreate {
return uc
}
// SetGameStory sets the "game_story" field.
func (uc *UeCreate) SetGameStory(i int) *UeCreate {
uc.mutation.SetGameStory(i)
return uc
}
// SetNillableGameStory sets the "game_story" field if the given value is not nil.
func (uc *UeCreate) SetNillableGameStory(i *int) *UeCreate {
if i != nil {
uc.SetGameStory(*i)
}
return uc
}
// SetCreatedAt sets the "created_at" field.
func (uc *UeCreate) SetCreatedAt(t time.Time) *UeCreate {
uc.mutation.SetCreatedAt(t)
@ -508,6 +522,10 @@ func (uc *UeCreate) createSpec() (*Ue, *sqlgraph.CreateSpec) {
_spec.SetField(ue.FieldGameID, field.TypeString, value)
_node.GameID = value
}
if value, ok := uc.mutation.GameStory(); ok {
_spec.SetField(ue.FieldGameStory, field.TypeInt, value)
_node.GameStory = value
}
if value, ok := uc.mutation.CreatedAt(); ok {
_spec.SetField(ue.FieldCreatedAt, field.TypeTime, value)
_node.CreatedAt = value

View File

@ -505,6 +505,33 @@ func (uu *UeUpdate) ClearGameID() *UeUpdate {
return uu
}
// SetGameStory sets the "game_story" field.
func (uu *UeUpdate) SetGameStory(i int) *UeUpdate {
uu.mutation.ResetGameStory()
uu.mutation.SetGameStory(i)
return uu
}
// SetNillableGameStory sets the "game_story" field if the given value is not nil.
func (uu *UeUpdate) SetNillableGameStory(i *int) *UeUpdate {
if i != nil {
uu.SetGameStory(*i)
}
return uu
}
// AddGameStory adds i to the "game_story" field.
func (uu *UeUpdate) AddGameStory(i int) *UeUpdate {
uu.mutation.AddGameStory(i)
return uu
}
// ClearGameStory clears the value of the "game_story" field.
func (uu *UeUpdate) ClearGameStory() *UeUpdate {
uu.mutation.ClearGameStory()
return uu
}
// SetOwnerID sets the "owner" edge to the User entity by ID.
func (uu *UeUpdate) SetOwnerID(id int) *UeUpdate {
uu.mutation.SetOwnerID(id)
@ -727,6 +754,15 @@ func (uu *UeUpdate) sqlSave(ctx context.Context) (n int, err error) {
if uu.mutation.GameIDCleared() {
_spec.ClearField(ue.FieldGameID, field.TypeString)
}
if value, ok := uu.mutation.GameStory(); ok {
_spec.SetField(ue.FieldGameStory, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedGameStory(); ok {
_spec.AddField(ue.FieldGameStory, field.TypeInt, value)
}
if uu.mutation.GameStoryCleared() {
_spec.ClearField(ue.FieldGameStory, field.TypeInt)
}
if uu.mutation.CreatedAtCleared() {
_spec.ClearField(ue.FieldCreatedAt, field.TypeTime)
}
@ -1256,6 +1292,33 @@ func (uuo *UeUpdateOne) ClearGameID() *UeUpdateOne {
return uuo
}
// SetGameStory sets the "game_story" field.
func (uuo *UeUpdateOne) SetGameStory(i int) *UeUpdateOne {
uuo.mutation.ResetGameStory()
uuo.mutation.SetGameStory(i)
return uuo
}
// SetNillableGameStory sets the "game_story" field if the given value is not nil.
func (uuo *UeUpdateOne) SetNillableGameStory(i *int) *UeUpdateOne {
if i != nil {
uuo.SetGameStory(*i)
}
return uuo
}
// AddGameStory adds i to the "game_story" field.
func (uuo *UeUpdateOne) AddGameStory(i int) *UeUpdateOne {
uuo.mutation.AddGameStory(i)
return uuo
}
// ClearGameStory clears the value of the "game_story" field.
func (uuo *UeUpdateOne) ClearGameStory() *UeUpdateOne {
uuo.mutation.ClearGameStory()
return uuo
}
// SetOwnerID sets the "owner" edge to the User entity by ID.
func (uuo *UeUpdateOne) SetOwnerID(id int) *UeUpdateOne {
uuo.mutation.SetOwnerID(id)
@ -1508,6 +1571,15 @@ func (uuo *UeUpdateOne) sqlSave(ctx context.Context) (_node *Ue, err error) {
if uuo.mutation.GameIDCleared() {
_spec.ClearField(ue.FieldGameID, field.TypeString)
}
if value, ok := uuo.mutation.GameStory(); ok {
_spec.SetField(ue.FieldGameStory, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedGameStory(); ok {
_spec.AddField(ue.FieldGameStory, field.TypeInt, value)
}
if uuo.mutation.GameStoryCleared() {
_spec.ClearField(ue.FieldGameStory, field.TypeInt)
}
if uuo.mutation.CreatedAtCleared() {
_spec.ClearField(ue.FieldCreatedAt, field.TypeTime)
}

View File

@ -113,6 +113,10 @@ type User struct {
GameLv int `json:"game_lv,omitempty"`
// GameExp holds the value of the "game_exp" field.
GameExp int `json:"game_exp,omitempty"`
// GameStory holds the value of the "game_story" field.
GameStory int `json:"game_story,omitempty"`
// GameLimit holds the value of the "game_limit" field.
GameLimit bool `json:"game_limit,omitempty"`
// Coin holds the value of the "coin" field.
Coin int `json:"coin,omitempty"`
// CoinOpen holds the value of the "coin_open" field.
@ -182,9 +186,9 @@ func (*User) scanValues(columns []string) ([]any, error) {
values := make([]any, len(columns))
for i := range columns {
switch columns[i] {
case user.FieldMember, user.FieldBook, user.FieldManga, user.FieldBadge, user.FieldBsky, user.FieldMastodon, user.FieldDelete, user.FieldHandle, user.FieldTen, user.FieldModel, user.FieldGame, user.FieldGameTest, user.FieldGameEnd, user.FieldGameAccount, user.FieldCoinOpen:
case user.FieldMember, user.FieldBook, user.FieldManga, user.FieldBadge, user.FieldBsky, user.FieldMastodon, user.FieldDelete, user.FieldHandle, user.FieldTen, user.FieldModel, user.FieldGame, user.FieldGameTest, user.FieldGameEnd, user.FieldGameAccount, user.FieldGameLimit, user.FieldCoinOpen:
values[i] = new(sql.NullBool)
case user.FieldID, user.FieldLuck, user.FieldLike, user.FieldLikeRank, user.FieldFav, user.FieldTenSu, user.FieldTenKai, user.FieldAiten, user.FieldRoom, user.FieldModelAttack, user.FieldModelLimit, user.FieldModelSkill, user.FieldModelMode, user.FieldModelCritical, user.FieldModelCriticalD, user.FieldGameLv, user.FieldGameExp, user.FieldCoin:
case user.FieldID, user.FieldLuck, user.FieldLike, user.FieldLikeRank, user.FieldFav, user.FieldTenSu, user.FieldTenKai, user.FieldAiten, user.FieldRoom, user.FieldModelAttack, user.FieldModelLimit, user.FieldModelSkill, user.FieldModelMode, user.FieldModelCritical, user.FieldModelCriticalD, user.FieldGameLv, user.FieldGameExp, user.FieldGameStory, user.FieldCoin:
values[i] = new(sql.NullInt64)
case user.FieldUsername, user.FieldDid, user.FieldToken, user.FieldPassword, user.FieldTenCard, user.FieldTenDelete, user.FieldTenPost, user.FieldTenGet, user.FieldNext:
values[i] = new(sql.NullString)
@ -501,6 +505,18 @@ func (u *User) assignValues(columns []string, values []any) error {
} else if value.Valid {
u.GameExp = int(value.Int64)
}
case user.FieldGameStory:
if value, ok := values[i].(*sql.NullInt64); !ok {
return fmt.Errorf("unexpected type %T for field game_story", values[i])
} else if value.Valid {
u.GameStory = int(value.Int64)
}
case user.FieldGameLimit:
if value, ok := values[i].(*sql.NullBool); !ok {
return fmt.Errorf("unexpected type %T for field game_limit", values[i])
} else if value.Valid {
u.GameLimit = value.Bool
}
case user.FieldCoin:
if value, ok := values[i].(*sql.NullInt64); !ok {
return fmt.Errorf("unexpected type %T for field coin", values[i])
@ -724,6 +740,12 @@ func (u *User) String() string {
builder.WriteString("game_exp=")
builder.WriteString(fmt.Sprintf("%v", u.GameExp))
builder.WriteString(", ")
builder.WriteString("game_story=")
builder.WriteString(fmt.Sprintf("%v", u.GameStory))
builder.WriteString(", ")
builder.WriteString("game_limit=")
builder.WriteString(fmt.Sprintf("%v", u.GameLimit))
builder.WriteString(", ")
builder.WriteString("coin=")
builder.WriteString(fmt.Sprintf("%v", u.Coin))
builder.WriteString(", ")

View File

@ -110,6 +110,10 @@ const (
FieldGameLv = "game_lv"
// FieldGameExp holds the string denoting the game_exp field in the database.
FieldGameExp = "game_exp"
// FieldGameStory holds the string denoting the game_story field in the database.
FieldGameStory = "game_story"
// FieldGameLimit holds the string denoting the game_limit field in the database.
FieldGameLimit = "game_limit"
// FieldCoin holds the string denoting the coin field in the database.
FieldCoin = "coin"
// FieldCoinOpen holds the string denoting the coin_open field in the database.
@ -207,6 +211,8 @@ var Columns = []string{
FieldGameAccount,
FieldGameLv,
FieldGameExp,
FieldGameStory,
FieldGameLimit,
FieldCoin,
FieldCoinOpen,
FieldCoinAt,
@ -282,6 +288,8 @@ var (
DefaultGameEnd bool
// DefaultGameAccount holds the default value on creation for the "game_account" field.
DefaultGameAccount bool
// DefaultGameLimit holds the default value on creation for the "game_limit" field.
DefaultGameLimit bool
// DefaultCoinOpen holds the default value on creation for the "coin_open" field.
DefaultCoinOpen bool
// DefaultCoinAt holds the default value on creation for the "coin_at" field.
@ -536,6 +544,16 @@ func ByGameExp(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldGameExp, opts...).ToFunc()
}
// ByGameStory orders the results by the game_story field.
func ByGameStory(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldGameStory, opts...).ToFunc()
}
// ByGameLimit orders the results by the game_limit field.
func ByGameLimit(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldGameLimit, opts...).ToFunc()
}
// ByCoin orders the results by the coin field.
func ByCoin(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCoin, opts...).ToFunc()

View File

@ -295,6 +295,16 @@ func GameExp(v int) predicate.User {
return predicate.User(sql.FieldEQ(FieldGameExp, v))
}
// GameStory applies equality check predicate on the "game_story" field. It's identical to GameStoryEQ.
func GameStory(v int) predicate.User {
return predicate.User(sql.FieldEQ(FieldGameStory, v))
}
// GameLimit applies equality check predicate on the "game_limit" field. It's identical to GameLimitEQ.
func GameLimit(v bool) predicate.User {
return predicate.User(sql.FieldEQ(FieldGameLimit, v))
}
// Coin applies equality check predicate on the "coin" field. It's identical to CoinEQ.
func Coin(v int) predicate.User {
return predicate.User(sql.FieldEQ(FieldCoin, v))
@ -2495,6 +2505,76 @@ func GameExpNotNil() predicate.User {
return predicate.User(sql.FieldNotNull(FieldGameExp))
}
// GameStoryEQ applies the EQ predicate on the "game_story" field.
func GameStoryEQ(v int) predicate.User {
return predicate.User(sql.FieldEQ(FieldGameStory, v))
}
// GameStoryNEQ applies the NEQ predicate on the "game_story" field.
func GameStoryNEQ(v int) predicate.User {
return predicate.User(sql.FieldNEQ(FieldGameStory, v))
}
// GameStoryIn applies the In predicate on the "game_story" field.
func GameStoryIn(vs ...int) predicate.User {
return predicate.User(sql.FieldIn(FieldGameStory, vs...))
}
// GameStoryNotIn applies the NotIn predicate on the "game_story" field.
func GameStoryNotIn(vs ...int) predicate.User {
return predicate.User(sql.FieldNotIn(FieldGameStory, vs...))
}
// GameStoryGT applies the GT predicate on the "game_story" field.
func GameStoryGT(v int) predicate.User {
return predicate.User(sql.FieldGT(FieldGameStory, v))
}
// GameStoryGTE applies the GTE predicate on the "game_story" field.
func GameStoryGTE(v int) predicate.User {
return predicate.User(sql.FieldGTE(FieldGameStory, v))
}
// GameStoryLT applies the LT predicate on the "game_story" field.
func GameStoryLT(v int) predicate.User {
return predicate.User(sql.FieldLT(FieldGameStory, v))
}
// GameStoryLTE applies the LTE predicate on the "game_story" field.
func GameStoryLTE(v int) predicate.User {
return predicate.User(sql.FieldLTE(FieldGameStory, v))
}
// GameStoryIsNil applies the IsNil predicate on the "game_story" field.
func GameStoryIsNil() predicate.User {
return predicate.User(sql.FieldIsNull(FieldGameStory))
}
// GameStoryNotNil applies the NotNil predicate on the "game_story" field.
func GameStoryNotNil() predicate.User {
return predicate.User(sql.FieldNotNull(FieldGameStory))
}
// GameLimitEQ applies the EQ predicate on the "game_limit" field.
func GameLimitEQ(v bool) predicate.User {
return predicate.User(sql.FieldEQ(FieldGameLimit, v))
}
// GameLimitNEQ applies the NEQ predicate on the "game_limit" field.
func GameLimitNEQ(v bool) predicate.User {
return predicate.User(sql.FieldNEQ(FieldGameLimit, v))
}
// GameLimitIsNil applies the IsNil predicate on the "game_limit" field.
func GameLimitIsNil() predicate.User {
return predicate.User(sql.FieldIsNull(FieldGameLimit))
}
// GameLimitNotNil applies the NotNil predicate on the "game_limit" field.
func GameLimitNotNil() predicate.User {
return predicate.User(sql.FieldNotNull(FieldGameLimit))
}
// CoinEQ applies the EQ predicate on the "coin" field.
func CoinEQ(v int) predicate.User {
return predicate.User(sql.FieldEQ(FieldCoin, v))

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

View File

@ -1044,6 +1044,53 @@ func (uu *UserUpdate) ClearGameExp() *UserUpdate {
return uu
}
// SetGameStory sets the "game_story" field.
func (uu *UserUpdate) SetGameStory(i int) *UserUpdate {
uu.mutation.ResetGameStory()
uu.mutation.SetGameStory(i)
return uu
}
// SetNillableGameStory sets the "game_story" field if the given value is not nil.
func (uu *UserUpdate) SetNillableGameStory(i *int) *UserUpdate {
if i != nil {
uu.SetGameStory(*i)
}
return uu
}
// AddGameStory adds i to the "game_story" field.
func (uu *UserUpdate) AddGameStory(i int) *UserUpdate {
uu.mutation.AddGameStory(i)
return uu
}
// ClearGameStory clears the value of the "game_story" field.
func (uu *UserUpdate) ClearGameStory() *UserUpdate {
uu.mutation.ClearGameStory()
return uu
}
// SetGameLimit sets the "game_limit" field.
func (uu *UserUpdate) SetGameLimit(b bool) *UserUpdate {
uu.mutation.SetGameLimit(b)
return uu
}
// SetNillableGameLimit sets the "game_limit" field if the given value is not nil.
func (uu *UserUpdate) SetNillableGameLimit(b *bool) *UserUpdate {
if b != nil {
uu.SetGameLimit(*b)
}
return uu
}
// ClearGameLimit clears the value of the "game_limit" field.
func (uu *UserUpdate) ClearGameLimit() *UserUpdate {
uu.mutation.ClearGameLimit()
return uu
}
// SetCoin sets the "coin" field.
func (uu *UserUpdate) SetCoin(i int) *UserUpdate {
uu.mutation.ResetCoin()
@ -1617,6 +1664,21 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) {
if uu.mutation.GameExpCleared() {
_spec.ClearField(user.FieldGameExp, field.TypeInt)
}
if value, ok := uu.mutation.GameStory(); ok {
_spec.SetField(user.FieldGameStory, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedGameStory(); ok {
_spec.AddField(user.FieldGameStory, field.TypeInt, value)
}
if uu.mutation.GameStoryCleared() {
_spec.ClearField(user.FieldGameStory, field.TypeInt)
}
if value, ok := uu.mutation.GameLimit(); ok {
_spec.SetField(user.FieldGameLimit, field.TypeBool, value)
}
if uu.mutation.GameLimitCleared() {
_spec.ClearField(user.FieldGameLimit, field.TypeBool)
}
if value, ok := uu.mutation.Coin(); ok {
_spec.SetField(user.FieldCoin, field.TypeInt, value)
}
@ -2850,6 +2912,53 @@ func (uuo *UserUpdateOne) ClearGameExp() *UserUpdateOne {
return uuo
}
// SetGameStory sets the "game_story" field.
func (uuo *UserUpdateOne) SetGameStory(i int) *UserUpdateOne {
uuo.mutation.ResetGameStory()
uuo.mutation.SetGameStory(i)
return uuo
}
// SetNillableGameStory sets the "game_story" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableGameStory(i *int) *UserUpdateOne {
if i != nil {
uuo.SetGameStory(*i)
}
return uuo
}
// AddGameStory adds i to the "game_story" field.
func (uuo *UserUpdateOne) AddGameStory(i int) *UserUpdateOne {
uuo.mutation.AddGameStory(i)
return uuo
}
// ClearGameStory clears the value of the "game_story" field.
func (uuo *UserUpdateOne) ClearGameStory() *UserUpdateOne {
uuo.mutation.ClearGameStory()
return uuo
}
// SetGameLimit sets the "game_limit" field.
func (uuo *UserUpdateOne) SetGameLimit(b bool) *UserUpdateOne {
uuo.mutation.SetGameLimit(b)
return uuo
}
// SetNillableGameLimit sets the "game_limit" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableGameLimit(b *bool) *UserUpdateOne {
if b != nil {
uuo.SetGameLimit(*b)
}
return uuo
}
// ClearGameLimit clears the value of the "game_limit" field.
func (uuo *UserUpdateOne) ClearGameLimit() *UserUpdateOne {
uuo.mutation.ClearGameLimit()
return uuo
}
// SetCoin sets the "coin" field.
func (uuo *UserUpdateOne) SetCoin(i int) *UserUpdateOne {
uuo.mutation.ResetCoin()
@ -3453,6 +3562,21 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error)
if uuo.mutation.GameExpCleared() {
_spec.ClearField(user.FieldGameExp, field.TypeInt)
}
if value, ok := uuo.mutation.GameStory(); ok {
_spec.SetField(user.FieldGameStory, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedGameStory(); ok {
_spec.AddField(user.FieldGameStory, field.TypeInt, value)
}
if uuo.mutation.GameStoryCleared() {
_spec.ClearField(user.FieldGameStory, field.TypeInt)
}
if value, ok := uuo.mutation.GameLimit(); ok {
_spec.SetField(user.FieldGameLimit, field.TypeBool, value)
}
if uuo.mutation.GameLimitCleared() {
_spec.ClearField(user.FieldGameLimit, field.TypeBool)
}
if value, ok := uuo.mutation.Coin(); ok {
_spec.SetField(user.FieldCoin, field.TypeInt, value)
}

View File

@ -1174,6 +1174,9 @@ func (h *OgentHandler) CreateUe(ctx context.Context, req *CreateUeReq) (CreateUe
if v, ok := req.GameID.Get(); ok {
b.SetGameID(v)
}
if v, ok := req.GameStory.Get(); ok {
b.SetGameStory(v)
}
// Add all edges.
//b.SetOwnerID(req.Owner)
@ -1303,6 +1306,10 @@ func (h *OgentHandler) UpdateUe(ctx context.Context, req *UpdateUeReq, params Up
if v, ok := req.GameID.Get(); ok {
b.SetGameID(v)
}
if v, ok := req.GameStory.Get(); ok {
b.SetGameStory(v)
}
// Add all edges.
//if v, ok := req.Owner.Get(); ok {
// b.SetOwnerID(v)
@ -1585,6 +1592,12 @@ func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (Crea
if v, ok := req.GameExp.Get(); ok {
b.SetGameExp(v)
}
if v, ok := req.GameStory.Get(); ok {
b.SetGameStory(v)
}
if v, ok := req.GameLimit.Get(); ok {
b.SetGameLimit(v)
}
if v, ok := req.Coin.Get(); ok {
b.SetCoin(v)
}
@ -1797,6 +1810,12 @@ func (h *OgentHandler) UpdateUser(ctx context.Context, req *UpdateUserReq, param
if v, ok := req.GameExp.Get(); ok {
b.SetGameExp(v)
}
if v, ok := req.GameStory.Get(); ok {
b.SetGameStory(v)
}
if v, ok := req.GameLimit.Get(); ok {
b.SetGameLimit(v)
}
if v, ok := req.Coin.Get(); ok {
b.SetCoin(v)
}