From e707b1802e3fa3fd6cba356c9264b1d562657e1d Mon Sep 17 00:00:00 2001 From: syui Date: Sat, 8 Jun 2024 01:02:15 +0900 Subject: [PATCH] fix game story --- ent/migrate/schema.go | 9 +- ent/mutation.go | 291 +++++++++++++++- ent/ogent/oas_json_gen.go | 636 +++++++++++++++++++++++++++++++---- ent/ogent/oas_schemas_gen.go | 319 ++++++++++++++++++ ent/ogent/ogent.go | 19 ++ ent/ogent/responses.go | 23 ++ ent/openapi.json | 96 ++++++ ent/runtime.go | 10 +- ent/schema/ue.go | 3 + ent/schema/user.go | 7 + ent/ue.go | 13 +- ent/ue/ue.go | 8 + ent/ue/where.go | 55 +++ ent/ue_create.go | 18 + ent/ue_update.go | 72 ++++ ent/user.go | 26 +- ent/user/user.go | 18 + ent/user/where.go | 80 +++++ ent/user_create.go | 40 +++ ent/user_update.go | 124 +++++++ tmp/ogent/ogent.go | 19 ++ 21 files changed, 1804 insertions(+), 82 deletions(-) diff --git a/ent/migrate/schema.go b/ent/migrate/schema.go index e987719..5e67d99 100644 --- a/ent/migrate/schema.go +++ b/ent/migrate/schema.go @@ -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, }, diff --git a/ent/mutation.go b/ent/mutation.go index fca598d..1f7bb2b 100644 --- a/ent/mutation.go +++ b/ent/mutation.go @@ -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 diff --git a/ent/ogent/oas_json_gen.go b/ent/ogent/oas_json_gen.go index cbbd4d3..176ffd7 100644 --- a/ent/ogent/oas_json_gen.go +++ b/ent/ogent/oas_json_gen.go @@ -771,6 +771,18 @@ func (s *CardOwnerRead) encodeFields(e *jx.Encoder) { s.GameExp.Encode(e) } } + { + if s.GameStory.Set { + e.FieldStart("game_story") + s.GameStory.Encode(e) + } + } + { + if s.GameLimit.Set { + e.FieldStart("game_limit") + s.GameLimit.Encode(e) + } + } { if s.Coin.Set { e.FieldStart("coin") @@ -791,7 +803,7 @@ func (s *CardOwnerRead) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCardOwnerRead = [50]string{ +var jsonFieldsNameOfCardOwnerRead = [52]string{ 0: "id", 1: "username", 2: "did", @@ -839,9 +851,11 @@ var jsonFieldsNameOfCardOwnerRead = [50]string{ 44: "game_account", 45: "game_lv", 46: "game_exp", - 47: "coin", - 48: "coin_open", - 49: "coin_at", + 47: "game_story", + 48: "game_limit", + 49: "coin", + 50: "coin_open", + 51: "coin_at", } // Decode decodes CardOwnerRead from json. @@ -1327,6 +1341,26 @@ func (s *CardOwnerRead) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"game_exp\"") } + case "game_story": + if err := func() error { + s.GameStory.Reset() + if err := s.GameStory.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_story\"") + } + case "game_limit": + if err := func() error { + s.GameLimit.Reset() + if err := s.GameLimit.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_limit\"") + } case "coin": if err := func() error { s.Coin.Reset() @@ -3229,6 +3263,12 @@ func (s *CreateUeReq) encodeFields(e *jx.Encoder) { s.GameID.Encode(e) } } + { + if s.GameStory.Set { + e.FieldStart("game_story") + s.GameStory.Encode(e) + } + } { if s.CreatedAt.Set { e.FieldStart("created_at") @@ -3242,7 +3282,7 @@ func (s *CreateUeReq) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCreateUeReq = [23]string{ +var jsonFieldsNameOfCreateUeReq = [24]string{ 0: "limit", 1: "limit_boss", 2: "limit_item", @@ -3264,8 +3304,9 @@ var jsonFieldsNameOfCreateUeReq = [23]string{ 18: "game_lv", 19: "game_exp", 20: "game_id", - 21: "created_at", - 22: "owner", + 21: "game_story", + 22: "created_at", + 23: "owner", } // Decode decodes CreateUeReq from json. @@ -3489,6 +3530,16 @@ func (s *CreateUeReq) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"game_id\"") } + case "game_story": + if err := func() error { + s.GameStory.Reset() + if err := s.GameStory.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_story\"") + } case "created_at": if err := func() error { s.CreatedAt.Reset() @@ -3500,7 +3551,7 @@ func (s *CreateUeReq) Decode(d *jx.Decoder) error { return errors.Wrap(err, "decode field \"created_at\"") } case "owner": - requiredBitSet[2] |= 1 << 6 + requiredBitSet[2] |= 1 << 7 if err := func() error { v, err := d.Int() s.Owner = int(v) @@ -3523,7 +3574,7 @@ func (s *CreateUeReq) Decode(d *jx.Decoder) error { for i, mask := range [3]uint8{ 0b00001000, 0b00000000, - 0b01000000, + 0b10000000, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -3864,6 +3915,18 @@ func (s *CreateUserReq) encodeFields(e *jx.Encoder) { s.GameExp.Encode(e) } } + { + if s.GameStory.Set { + e.FieldStart("game_story") + s.GameStory.Encode(e) + } + } + { + if s.GameLimit.Set { + e.FieldStart("game_limit") + s.GameLimit.Encode(e) + } + } { if s.Coin.Set { e.FieldStart("coin") @@ -3924,7 +3987,7 @@ func (s *CreateUserReq) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCreateUserReq = [55]string{ +var jsonFieldsNameOfCreateUserReq = [57]string{ 0: "username", 1: "did", 2: "member", @@ -3973,13 +4036,15 @@ var jsonFieldsNameOfCreateUserReq = [55]string{ 45: "game_account", 46: "game_lv", 47: "game_exp", - 48: "coin", - 49: "coin_open", - 50: "coin_at", - 51: "card", - 52: "ue", - 53: "ma", - 54: "sev", + 48: "game_story", + 49: "game_limit", + 50: "coin", + 51: "coin_open", + 52: "coin_at", + 53: "card", + 54: "ue", + 55: "ma", + 56: "sev", } // Decode decodes CreateUserReq from json. @@ -3987,7 +4052,7 @@ func (s *CreateUserReq) Decode(d *jx.Decoder) error { if s == nil { return errors.New("invalid: unable to decode CreateUserReq to nil") } - var requiredBitSet [7]uint8 + var requiredBitSet [8]uint8 if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { @@ -4475,6 +4540,26 @@ func (s *CreateUserReq) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"game_exp\"") } + case "game_story": + if err := func() error { + s.GameStory.Reset() + if err := s.GameStory.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_story\"") + } + case "game_limit": + if err := func() error { + s.GameLimit.Reset() + if err := s.GameLimit.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_limit\"") + } case "coin": if err := func() error { s.Coin.Reset() @@ -4590,7 +4675,7 @@ func (s *CreateUserReq) Decode(d *jx.Decoder) error { } // Validate required fields. var failures []validate.FieldError - for i, mask := range [7]uint8{ + for i, mask := range [8]uint8{ 0b00000001, 0b00001000, 0b00000000, @@ -4598,6 +4683,7 @@ func (s *CreateUserReq) Decode(d *jx.Decoder) error { 0b00000000, 0b00000000, 0b00000000, + 0b00000000, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -5392,6 +5478,18 @@ func (s *GroupUsersList) encodeFields(e *jx.Encoder) { s.GameExp.Encode(e) } } + { + if s.GameStory.Set { + e.FieldStart("game_story") + s.GameStory.Encode(e) + } + } + { + if s.GameLimit.Set { + e.FieldStart("game_limit") + s.GameLimit.Encode(e) + } + } { if s.Coin.Set { e.FieldStart("coin") @@ -5412,7 +5510,7 @@ func (s *GroupUsersList) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfGroupUsersList = [50]string{ +var jsonFieldsNameOfGroupUsersList = [52]string{ 0: "id", 1: "username", 2: "did", @@ -5460,9 +5558,11 @@ var jsonFieldsNameOfGroupUsersList = [50]string{ 44: "game_account", 45: "game_lv", 46: "game_exp", - 47: "coin", - 48: "coin_open", - 49: "coin_at", + 47: "game_story", + 48: "game_limit", + 49: "coin", + 50: "coin_open", + 51: "coin_at", } // Decode decodes GroupUsersList from json. @@ -5948,6 +6048,26 @@ func (s *GroupUsersList) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"game_exp\"") } + case "game_story": + if err := func() error { + s.GameStory.Reset() + if err := s.GameStory.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_story\"") + } + case "game_limit": + if err := func() error { + s.GameLimit.Reset() + if err := s.GameLimit.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_limit\"") + } case "coin": if err := func() error { s.Coin.Reset() @@ -7791,6 +7911,18 @@ func (s *MaOwnerRead) encodeFields(e *jx.Encoder) { s.GameExp.Encode(e) } } + { + if s.GameStory.Set { + e.FieldStart("game_story") + s.GameStory.Encode(e) + } + } + { + if s.GameLimit.Set { + e.FieldStart("game_limit") + s.GameLimit.Encode(e) + } + } { if s.Coin.Set { e.FieldStart("coin") @@ -7811,7 +7943,7 @@ func (s *MaOwnerRead) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfMaOwnerRead = [50]string{ +var jsonFieldsNameOfMaOwnerRead = [52]string{ 0: "id", 1: "username", 2: "did", @@ -7859,9 +7991,11 @@ var jsonFieldsNameOfMaOwnerRead = [50]string{ 44: "game_account", 45: "game_lv", 46: "game_exp", - 47: "coin", - 48: "coin_open", - 49: "coin_at", + 47: "game_story", + 48: "game_limit", + 49: "coin", + 50: "coin_open", + 51: "coin_at", } // Decode decodes MaOwnerRead from json. @@ -8347,6 +8481,26 @@ func (s *MaOwnerRead) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"game_exp\"") } + case "game_story": + if err := func() error { + s.GameStory.Reset() + if err := s.GameStory.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_story\"") + } + case "game_limit": + if err := func() error { + s.GameLimit.Reset() + if err := s.GameLimit.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_limit\"") + } case "coin": if err := func() error { s.Coin.Reset() @@ -10852,6 +11006,18 @@ func (s *SevOwnerRead) encodeFields(e *jx.Encoder) { s.GameExp.Encode(e) } } + { + if s.GameStory.Set { + e.FieldStart("game_story") + s.GameStory.Encode(e) + } + } + { + if s.GameLimit.Set { + e.FieldStart("game_limit") + s.GameLimit.Encode(e) + } + } { if s.Coin.Set { e.FieldStart("coin") @@ -10872,7 +11038,7 @@ func (s *SevOwnerRead) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfSevOwnerRead = [50]string{ +var jsonFieldsNameOfSevOwnerRead = [52]string{ 0: "id", 1: "username", 2: "did", @@ -10920,9 +11086,11 @@ var jsonFieldsNameOfSevOwnerRead = [50]string{ 44: "game_account", 45: "game_lv", 46: "game_exp", - 47: "coin", - 48: "coin_open", - 49: "coin_at", + 47: "game_story", + 48: "game_limit", + 49: "coin", + 50: "coin_open", + 51: "coin_at", } // Decode decodes SevOwnerRead from json. @@ -11408,6 +11576,26 @@ func (s *SevOwnerRead) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"game_exp\"") } + case "game_story": + if err := func() error { + s.GameStory.Reset() + if err := s.GameStory.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_story\"") + } + case "game_limit": + if err := func() error { + s.GameLimit.Reset() + if err := s.GameLimit.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_limit\"") + } case "coin": if err := func() error { s.Coin.Reset() @@ -12164,6 +12352,12 @@ func (s *UeCreate) encodeFields(e *jx.Encoder) { s.GameID.Encode(e) } } + { + if s.GameStory.Set { + e.FieldStart("game_story") + s.GameStory.Encode(e) + } + } { if s.CreatedAt.Set { e.FieldStart("created_at") @@ -12172,7 +12366,7 @@ func (s *UeCreate) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfUeCreate = [21]string{ +var jsonFieldsNameOfUeCreate = [22]string{ 0: "id", 1: "limit", 2: "limit_boss", @@ -12193,7 +12387,8 @@ var jsonFieldsNameOfUeCreate = [21]string{ 17: "game_lv", 18: "game_exp", 19: "game_id", - 20: "created_at", + 20: "game_story", + 21: "created_at", } // Decode decodes UeCreate from json. @@ -12407,6 +12602,16 @@ func (s *UeCreate) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"game_id\"") } + case "game_story": + if err := func() error { + s.GameStory.Reset() + if err := s.GameStory.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_story\"") + } case "created_at": if err := func() error { s.CreatedAt.Reset() @@ -12603,6 +12808,12 @@ func (s *UeList) encodeFields(e *jx.Encoder) { s.GameID.Encode(e) } } + { + if s.GameStory.Set { + e.FieldStart("game_story") + s.GameStory.Encode(e) + } + } { if s.CreatedAt.Set { e.FieldStart("created_at") @@ -12611,7 +12822,7 @@ func (s *UeList) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfUeList = [21]string{ +var jsonFieldsNameOfUeList = [22]string{ 0: "id", 1: "limit", 2: "limit_boss", @@ -12632,7 +12843,8 @@ var jsonFieldsNameOfUeList = [21]string{ 17: "game_lv", 18: "game_exp", 19: "game_id", - 20: "created_at", + 20: "game_story", + 21: "created_at", } // Decode decodes UeList from json. @@ -12846,6 +13058,16 @@ func (s *UeList) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"game_id\"") } + case "game_story": + if err := func() error { + s.GameStory.Reset() + if err := s.GameStory.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_story\"") + } case "created_at": if err := func() error { s.CreatedAt.Reset() @@ -13203,6 +13425,18 @@ func (s *UeOwnerRead) encodeFields(e *jx.Encoder) { s.GameExp.Encode(e) } } + { + if s.GameStory.Set { + e.FieldStart("game_story") + s.GameStory.Encode(e) + } + } + { + if s.GameLimit.Set { + e.FieldStart("game_limit") + s.GameLimit.Encode(e) + } + } { if s.Coin.Set { e.FieldStart("coin") @@ -13223,7 +13457,7 @@ func (s *UeOwnerRead) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfUeOwnerRead = [50]string{ +var jsonFieldsNameOfUeOwnerRead = [52]string{ 0: "id", 1: "username", 2: "did", @@ -13271,9 +13505,11 @@ var jsonFieldsNameOfUeOwnerRead = [50]string{ 44: "game_account", 45: "game_lv", 46: "game_exp", - 47: "coin", - 48: "coin_open", - 49: "coin_at", + 47: "game_story", + 48: "game_limit", + 49: "coin", + 50: "coin_open", + 51: "coin_at", } // Decode decodes UeOwnerRead from json. @@ -13759,6 +13995,26 @@ func (s *UeOwnerRead) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"game_exp\"") } + case "game_story": + if err := func() error { + s.GameStory.Reset() + if err := s.GameStory.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_story\"") + } + case "game_limit": + if err := func() error { + s.GameLimit.Reset() + if err := s.GameLimit.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_limit\"") + } case "coin": if err := func() error { s.Coin.Reset() @@ -13979,6 +14235,12 @@ func (s *UeRead) encodeFields(e *jx.Encoder) { s.GameID.Encode(e) } } + { + if s.GameStory.Set { + e.FieldStart("game_story") + s.GameStory.Encode(e) + } + } { if s.CreatedAt.Set { e.FieldStart("created_at") @@ -13987,7 +14249,7 @@ func (s *UeRead) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfUeRead = [21]string{ +var jsonFieldsNameOfUeRead = [22]string{ 0: "id", 1: "limit", 2: "limit_boss", @@ -14008,7 +14270,8 @@ var jsonFieldsNameOfUeRead = [21]string{ 17: "game_lv", 18: "game_exp", 19: "game_id", - 20: "created_at", + 20: "game_story", + 21: "created_at", } // Decode decodes UeRead from json. @@ -14222,6 +14485,16 @@ func (s *UeRead) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"game_id\"") } + case "game_story": + if err := func() error { + s.GameStory.Reset() + if err := s.GameStory.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_story\"") + } case "created_at": if err := func() error { s.CreatedAt.Reset() @@ -14418,6 +14691,12 @@ func (s *UeUpdate) encodeFields(e *jx.Encoder) { s.GameID.Encode(e) } } + { + if s.GameStory.Set { + e.FieldStart("game_story") + s.GameStory.Encode(e) + } + } { if s.CreatedAt.Set { e.FieldStart("created_at") @@ -14426,7 +14705,7 @@ func (s *UeUpdate) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfUeUpdate = [21]string{ +var jsonFieldsNameOfUeUpdate = [22]string{ 0: "id", 1: "limit", 2: "limit_boss", @@ -14447,7 +14726,8 @@ var jsonFieldsNameOfUeUpdate = [21]string{ 17: "game_lv", 18: "game_exp", 19: "game_id", - 20: "created_at", + 20: "game_story", + 21: "created_at", } // Decode decodes UeUpdate from json. @@ -14661,6 +14941,16 @@ func (s *UeUpdate) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"game_id\"") } + case "game_story": + if err := func() error { + s.GameStory.Reset() + if err := s.GameStory.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_story\"") + } case "created_at": if err := func() error { s.CreatedAt.Reset() @@ -15803,6 +16093,12 @@ func (s *UpdateUeReq) encodeFields(e *jx.Encoder) { s.GameID.Encode(e) } } + { + if s.GameStory.Set { + e.FieldStart("game_story") + s.GameStory.Encode(e) + } + } { if s.Owner.Set { e.FieldStart("owner") @@ -15811,7 +16107,7 @@ func (s *UpdateUeReq) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfUpdateUeReq = [21]string{ +var jsonFieldsNameOfUpdateUeReq = [22]string{ 0: "limit", 1: "limit_boss", 2: "limit_item", @@ -15832,7 +16128,8 @@ var jsonFieldsNameOfUpdateUeReq = [21]string{ 17: "game_lv", 18: "game_exp", 19: "game_id", - 20: "owner", + 20: "game_story", + 21: "owner", } // Decode decodes UpdateUeReq from json. @@ -16043,6 +16340,16 @@ func (s *UpdateUeReq) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"game_id\"") } + case "game_story": + if err := func() error { + s.GameStory.Reset() + if err := s.GameStory.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_story\"") + } case "owner": if err := func() error { s.Owner.Reset() @@ -16356,6 +16663,18 @@ func (s *UpdateUserReq) encodeFields(e *jx.Encoder) { s.GameExp.Encode(e) } } + { + if s.GameStory.Set { + e.FieldStart("game_story") + s.GameStory.Encode(e) + } + } + { + if s.GameLimit.Set { + e.FieldStart("game_limit") + s.GameLimit.Encode(e) + } + } { if s.Coin.Set { e.FieldStart("coin") @@ -16416,7 +16735,7 @@ func (s *UpdateUserReq) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfUpdateUserReq = [52]string{ +var jsonFieldsNameOfUpdateUserReq = [54]string{ 0: "did", 1: "member", 2: "book", @@ -16462,13 +16781,15 @@ var jsonFieldsNameOfUpdateUserReq = [52]string{ 42: "game_account", 43: "game_lv", 44: "game_exp", - 45: "coin", - 46: "coin_open", - 47: "coin_at", - 48: "card", - 49: "ue", - 50: "ma", - 51: "sev", + 45: "game_story", + 46: "game_limit", + 47: "coin", + 48: "coin_open", + 49: "coin_at", + 50: "card", + 51: "ue", + 52: "ma", + 53: "sev", } // Decode decodes UpdateUserReq from json. @@ -16929,6 +17250,26 @@ func (s *UpdateUserReq) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"game_exp\"") } + case "game_story": + if err := func() error { + s.GameStory.Reset() + if err := s.GameStory.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_story\"") + } + case "game_limit": + if err := func() error { + s.GameLimit.Reset() + if err := s.GameLimit.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_limit\"") + } case "coin": if err := func() error { s.Coin.Reset() @@ -17582,6 +17923,18 @@ func (s *UserCreate) encodeFields(e *jx.Encoder) { s.GameExp.Encode(e) } } + { + if s.GameStory.Set { + e.FieldStart("game_story") + s.GameStory.Encode(e) + } + } + { + if s.GameLimit.Set { + e.FieldStart("game_limit") + s.GameLimit.Encode(e) + } + } { if s.Coin.Set { e.FieldStart("coin") @@ -17602,7 +17955,7 @@ func (s *UserCreate) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfUserCreate = [50]string{ +var jsonFieldsNameOfUserCreate = [52]string{ 0: "id", 1: "username", 2: "did", @@ -17650,9 +18003,11 @@ var jsonFieldsNameOfUserCreate = [50]string{ 44: "game_account", 45: "game_lv", 46: "game_exp", - 47: "coin", - 48: "coin_open", - 49: "coin_at", + 47: "game_story", + 48: "game_limit", + 49: "coin", + 50: "coin_open", + 51: "coin_at", } // Decode decodes UserCreate from json. @@ -18138,6 +18493,26 @@ func (s *UserCreate) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"game_exp\"") } + case "game_story": + if err := func() error { + s.GameStory.Reset() + if err := s.GameStory.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_story\"") + } + case "game_limit": + if err := func() error { + s.GameLimit.Reset() + if err := s.GameLimit.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_limit\"") + } case "coin": if err := func() error { s.Coin.Reset() @@ -18519,6 +18894,18 @@ func (s *UserList) encodeFields(e *jx.Encoder) { s.GameExp.Encode(e) } } + { + if s.GameStory.Set { + e.FieldStart("game_story") + s.GameStory.Encode(e) + } + } + { + if s.GameLimit.Set { + e.FieldStart("game_limit") + s.GameLimit.Encode(e) + } + } { if s.Coin.Set { e.FieldStart("coin") @@ -18539,7 +18926,7 @@ func (s *UserList) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfUserList = [50]string{ +var jsonFieldsNameOfUserList = [52]string{ 0: "id", 1: "username", 2: "did", @@ -18587,9 +18974,11 @@ var jsonFieldsNameOfUserList = [50]string{ 44: "game_account", 45: "game_lv", 46: "game_exp", - 47: "coin", - 48: "coin_open", - 49: "coin_at", + 47: "game_story", + 48: "game_limit", + 49: "coin", + 50: "coin_open", + 51: "coin_at", } // Decode decodes UserList from json. @@ -19075,6 +19464,26 @@ func (s *UserList) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"game_exp\"") } + case "game_story": + if err := func() error { + s.GameStory.Reset() + if err := s.GameStory.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_story\"") + } + case "game_limit": + if err := func() error { + s.GameLimit.Reset() + if err := s.GameLimit.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_limit\"") + } case "coin": if err := func() error { s.Coin.Reset() @@ -19912,6 +20321,18 @@ func (s *UserRead) encodeFields(e *jx.Encoder) { s.GameExp.Encode(e) } } + { + if s.GameStory.Set { + e.FieldStart("game_story") + s.GameStory.Encode(e) + } + } + { + if s.GameLimit.Set { + e.FieldStart("game_limit") + s.GameLimit.Encode(e) + } + } { if s.Coin.Set { e.FieldStart("coin") @@ -19932,7 +20353,7 @@ func (s *UserRead) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfUserRead = [50]string{ +var jsonFieldsNameOfUserRead = [52]string{ 0: "id", 1: "username", 2: "did", @@ -19980,9 +20401,11 @@ var jsonFieldsNameOfUserRead = [50]string{ 44: "game_account", 45: "game_lv", 46: "game_exp", - 47: "coin", - 48: "coin_open", - 49: "coin_at", + 47: "game_story", + 48: "game_limit", + 49: "coin", + 50: "coin_open", + 51: "coin_at", } // Decode decodes UserRead from json. @@ -20468,6 +20891,26 @@ func (s *UserRead) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"game_exp\"") } + case "game_story": + if err := func() error { + s.GameStory.Reset() + if err := s.GameStory.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_story\"") + } + case "game_limit": + if err := func() error { + s.GameLimit.Reset() + if err := s.GameLimit.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_limit\"") + } case "coin": if err := func() error { s.Coin.Reset() @@ -20956,6 +21399,12 @@ func (s *UserUeList) encodeFields(e *jx.Encoder) { s.GameID.Encode(e) } } + { + if s.GameStory.Set { + e.FieldStart("game_story") + s.GameStory.Encode(e) + } + } { if s.CreatedAt.Set { e.FieldStart("created_at") @@ -20964,7 +21413,7 @@ func (s *UserUeList) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfUserUeList = [21]string{ +var jsonFieldsNameOfUserUeList = [22]string{ 0: "id", 1: "limit", 2: "limit_boss", @@ -20985,7 +21434,8 @@ var jsonFieldsNameOfUserUeList = [21]string{ 17: "game_lv", 18: "game_exp", 19: "game_id", - 20: "created_at", + 20: "game_story", + 21: "created_at", } // Decode decodes UserUeList from json. @@ -21199,6 +21649,16 @@ func (s *UserUeList) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"game_id\"") } + case "game_story": + if err := func() error { + s.GameStory.Reset() + if err := s.GameStory.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_story\"") + } case "created_at": if err := func() error { s.CreatedAt.Reset() @@ -21556,6 +22016,18 @@ func (s *UserUpdate) encodeFields(e *jx.Encoder) { s.GameExp.Encode(e) } } + { + if s.GameStory.Set { + e.FieldStart("game_story") + s.GameStory.Encode(e) + } + } + { + if s.GameLimit.Set { + e.FieldStart("game_limit") + s.GameLimit.Encode(e) + } + } { if s.Coin.Set { e.FieldStart("coin") @@ -21576,7 +22048,7 @@ func (s *UserUpdate) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfUserUpdate = [50]string{ +var jsonFieldsNameOfUserUpdate = [52]string{ 0: "id", 1: "username", 2: "did", @@ -21624,9 +22096,11 @@ var jsonFieldsNameOfUserUpdate = [50]string{ 44: "game_account", 45: "game_lv", 46: "game_exp", - 47: "coin", - 48: "coin_open", - 49: "coin_at", + 47: "game_story", + 48: "game_limit", + 49: "coin", + 50: "coin_open", + 51: "coin_at", } // Decode decodes UserUpdate from json. @@ -22112,6 +22586,26 @@ func (s *UserUpdate) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"game_exp\"") } + case "game_story": + if err := func() error { + s.GameStory.Reset() + if err := s.GameStory.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_story\"") + } + case "game_limit": + if err := func() error { + s.GameLimit.Reset() + if err := s.GameLimit.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"game_limit\"") + } case "coin": if err := func() error { s.Coin.Reset() diff --git a/ent/ogent/oas_schemas_gen.go b/ent/ogent/oas_schemas_gen.go index a1ef6c2..b2c6549 100644 --- a/ent/ogent/oas_schemas_gen.go +++ b/ent/ogent/oas_schemas_gen.go @@ -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 diff --git a/ent/ogent/ogent.go b/ent/ogent/ogent.go index 786227c..af33c9b 100644 --- a/ent/ogent/ogent.go +++ b/ent/ogent/ogent.go @@ -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) } diff --git a/ent/ogent/responses.go b/ent/ogent/responses.go index 144bd46..2e4765d 100644 --- a/ent/ogent/responses.go +++ b/ent/ogent/responses.go @@ -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 } diff --git a/ent/openapi.json b/ent/openapi.json index 5d57a16..ae89b2f 100644 --- a/ent/openapi.json +++ b/ent/openapi.json @@ -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" diff --git a/ent/runtime.go b/ent/runtime.go index 4f31ad1..4785e5b 100644 --- a/ent/runtime.go +++ b/ent/runtime.go @@ -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) } diff --git a/ent/schema/ue.go b/ent/schema/ue.go index eab1919..aee3386 100644 --- a/ent/schema/ue.go +++ b/ent/schema/ue.go @@ -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(). diff --git a/ent/schema/user.go b/ent/schema/user.go index 17295d4..29a4cbb 100644 --- a/ent/schema/user.go +++ b/ent/schema/user.go @@ -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(), diff --git a/ent/ue.go b/ent/ue.go index 14fea0b..ab5c8c9 100644 --- a/ent/ue.go +++ b/ent/ue.go @@ -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(')') diff --git a/ent/ue/ue.go b/ent/ue/ue.go index a4f89fe..a3e3dae 100644 --- a/ent/ue/ue.go +++ b/ent/ue/ue.go @@ -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() diff --git a/ent/ue/where.go b/ent/ue/where.go index cdc4744..1448238 100644 --- a/ent/ue/where.go +++ b/ent/ue/where.go @@ -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)) diff --git a/ent/ue_create.go b/ent/ue_create.go index b078595..6c4c549 100644 --- a/ent/ue_create.go +++ b/ent/ue_create.go @@ -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 diff --git a/ent/ue_update.go b/ent/ue_update.go index ac57265..74651e1 100644 --- a/ent/ue_update.go +++ b/ent/ue_update.go @@ -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) } diff --git a/ent/user.go b/ent/user.go index 25ddea4..52e5492 100644 --- a/ent/user.go +++ b/ent/user.go @@ -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(", ") diff --git a/ent/user/user.go b/ent/user/user.go index 8027365..df915c7 100644 --- a/ent/user/user.go +++ b/ent/user/user.go @@ -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() diff --git a/ent/user/where.go b/ent/user/where.go index fd8141f..15a52e7 100644 --- a/ent/user/where.go +++ b/ent/user/where.go @@ -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)) diff --git a/ent/user_create.go b/ent/user_create.go index 27608a3..e914763 100644 --- a/ent/user_create.go +++ b/ent/user_create.go @@ -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 diff --git a/ent/user_update.go b/ent/user_update.go index dc8d4bb..f4d4237 100644 --- a/ent/user_update.go +++ b/ent/user_update.go @@ -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) } diff --git a/tmp/ogent/ogent.go b/tmp/ogent/ogent.go index 786227c..af33c9b 100644 --- a/tmp/ogent/ogent.go +++ b/tmp/ogent/ogent.go @@ -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) }