diff --git a/build.zsh b/build.zsh index 064ca12..e9007d0 100755 --- a/build.zsh +++ b/build.zsh @@ -2,7 +2,7 @@ d=${0:a:h} cd $d -su=5000 +su=10000 go1.21.8 generate ./... #go generate ./... @@ -20,6 +20,6 @@ case $OSTYPE in esac cp -rf $d/tmp/ogent ent/ -f=~/.config/ai/api_card.json +#f=~/.config/ai/api_card.json #PASS=`cat $f|jq -r .password` TOKEN=`cat $f|jq -r .token` go build #PASS=`cat $f|jq -r .password` TOKEN=`cat $f|jq -r .token` go run -mod=mod main.go diff --git a/ent/migrate/schema.go b/ent/migrate/schema.go index 10bad20..ed4caea 100644 --- a/ent/migrate/schema.go +++ b/ent/migrate/schema.go @@ -207,7 +207,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: "20240607"}, + {Name: "next", Type: field.TypeString, Nullable: true, Default: "20240731"}, {Name: "room", Type: field.TypeInt, Nullable: true}, {Name: "model", Type: field.TypeBool, Nullable: true}, {Name: "model_at", Type: field.TypeTime, Nullable: true}, @@ -228,6 +228,14 @@ var ( {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}, + {Name: "planet", Type: field.TypeInt, Nullable: true}, + {Name: "planet_at", Type: field.TypeTime, Nullable: true}, + {Name: "login", Type: field.TypeBool, Nullable: true, Default: false}, + {Name: "login_at", Type: field.TypeTime, Nullable: true}, + {Name: "location_x", Type: field.TypeInt, Nullable: true}, + {Name: "location_y", Type: field.TypeInt, Nullable: true}, + {Name: "location_z", Type: field.TypeInt, Nullable: true}, + {Name: "location_n", Type: field.TypeInt, Nullable: true}, {Name: "group_users", Type: field.TypeInt, Nullable: true}, } // UsersTable holds the schema information for the "users" table. @@ -238,7 +246,7 @@ var ( ForeignKeys: []*schema.ForeignKey{ { Symbol: "users_groups_users", - Columns: []*schema.Column{UsersColumns[54]}, + Columns: []*schema.Column{UsersColumns[62]}, RefColumns: []*schema.Column{GroupsColumns[0]}, OnDelete: schema.SetNull, }, diff --git a/ent/mutation.go b/ent/mutation.go index 73097e6..1f6ee03 100644 --- a/ent/mutation.go +++ b/ent/mutation.go @@ -7642,6 +7642,19 @@ type UserMutation struct { addcoin *int coin_open *bool coin_at *time.Time + planet *int + addplanet *int + planet_at *time.Time + login *bool + login_at *time.Time + location_x *int + addlocation_x *int + location_y *int + addlocation_y *int + location_z *int + addlocation_z *int + location_n *int + addlocation_n *int clearedFields map[string]struct{} card map[int]struct{} removedcard map[int]struct{} @@ -10707,6 +10720,503 @@ func (m *UserMutation) ResetCoinAt() { delete(m.clearedFields, user.FieldCoinAt) } +// SetPlanet sets the "planet" field. +func (m *UserMutation) SetPlanet(i int) { + m.planet = &i + m.addplanet = nil +} + +// Planet returns the value of the "planet" field in the mutation. +func (m *UserMutation) Planet() (r int, exists bool) { + v := m.planet + if v == nil { + return + } + return *v, true +} + +// OldPlanet returns the old "planet" 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) OldPlanet(ctx context.Context) (v int, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPlanet is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPlanet requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPlanet: %w", err) + } + return oldValue.Planet, nil +} + +// AddPlanet adds i to the "planet" field. +func (m *UserMutation) AddPlanet(i int) { + if m.addplanet != nil { + *m.addplanet += i + } else { + m.addplanet = &i + } +} + +// AddedPlanet returns the value that was added to the "planet" field in this mutation. +func (m *UserMutation) AddedPlanet() (r int, exists bool) { + v := m.addplanet + if v == nil { + return + } + return *v, true +} + +// ClearPlanet clears the value of the "planet" field. +func (m *UserMutation) ClearPlanet() { + m.planet = nil + m.addplanet = nil + m.clearedFields[user.FieldPlanet] = struct{}{} +} + +// PlanetCleared returns if the "planet" field was cleared in this mutation. +func (m *UserMutation) PlanetCleared() bool { + _, ok := m.clearedFields[user.FieldPlanet] + return ok +} + +// ResetPlanet resets all changes to the "planet" field. +func (m *UserMutation) ResetPlanet() { + m.planet = nil + m.addplanet = nil + delete(m.clearedFields, user.FieldPlanet) +} + +// SetPlanetAt sets the "planet_at" field. +func (m *UserMutation) SetPlanetAt(t time.Time) { + m.planet_at = &t +} + +// PlanetAt returns the value of the "planet_at" field in the mutation. +func (m *UserMutation) PlanetAt() (r time.Time, exists bool) { + v := m.planet_at + if v == nil { + return + } + return *v, true +} + +// OldPlanetAt returns the old "planet_at" 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) OldPlanetAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPlanetAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPlanetAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPlanetAt: %w", err) + } + return oldValue.PlanetAt, nil +} + +// ClearPlanetAt clears the value of the "planet_at" field. +func (m *UserMutation) ClearPlanetAt() { + m.planet_at = nil + m.clearedFields[user.FieldPlanetAt] = struct{}{} +} + +// PlanetAtCleared returns if the "planet_at" field was cleared in this mutation. +func (m *UserMutation) PlanetAtCleared() bool { + _, ok := m.clearedFields[user.FieldPlanetAt] + return ok +} + +// ResetPlanetAt resets all changes to the "planet_at" field. +func (m *UserMutation) ResetPlanetAt() { + m.planet_at = nil + delete(m.clearedFields, user.FieldPlanetAt) +} + +// SetLogin sets the "login" field. +func (m *UserMutation) SetLogin(b bool) { + m.login = &b +} + +// Login returns the value of the "login" field in the mutation. +func (m *UserMutation) Login() (r bool, exists bool) { + v := m.login + if v == nil { + return + } + return *v, true +} + +// OldLogin returns the old "login" 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) OldLogin(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLogin is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLogin requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLogin: %w", err) + } + return oldValue.Login, nil +} + +// ClearLogin clears the value of the "login" field. +func (m *UserMutation) ClearLogin() { + m.login = nil + m.clearedFields[user.FieldLogin] = struct{}{} +} + +// LoginCleared returns if the "login" field was cleared in this mutation. +func (m *UserMutation) LoginCleared() bool { + _, ok := m.clearedFields[user.FieldLogin] + return ok +} + +// ResetLogin resets all changes to the "login" field. +func (m *UserMutation) ResetLogin() { + m.login = nil + delete(m.clearedFields, user.FieldLogin) +} + +// SetLoginAt sets the "login_at" field. +func (m *UserMutation) SetLoginAt(t time.Time) { + m.login_at = &t +} + +// LoginAt returns the value of the "login_at" field in the mutation. +func (m *UserMutation) LoginAt() (r time.Time, exists bool) { + v := m.login_at + if v == nil { + return + } + return *v, true +} + +// OldLoginAt returns the old "login_at" 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) OldLoginAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLoginAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLoginAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLoginAt: %w", err) + } + return oldValue.LoginAt, nil +} + +// ClearLoginAt clears the value of the "login_at" field. +func (m *UserMutation) ClearLoginAt() { + m.login_at = nil + m.clearedFields[user.FieldLoginAt] = struct{}{} +} + +// LoginAtCleared returns if the "login_at" field was cleared in this mutation. +func (m *UserMutation) LoginAtCleared() bool { + _, ok := m.clearedFields[user.FieldLoginAt] + return ok +} + +// ResetLoginAt resets all changes to the "login_at" field. +func (m *UserMutation) ResetLoginAt() { + m.login_at = nil + delete(m.clearedFields, user.FieldLoginAt) +} + +// SetLocationX sets the "location_x" field. +func (m *UserMutation) SetLocationX(i int) { + m.location_x = &i + m.addlocation_x = nil +} + +// LocationX returns the value of the "location_x" field in the mutation. +func (m *UserMutation) LocationX() (r int, exists bool) { + v := m.location_x + if v == nil { + return + } + return *v, true +} + +// OldLocationX returns the old "location_x" 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) OldLocationX(ctx context.Context) (v int, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLocationX is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLocationX requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLocationX: %w", err) + } + return oldValue.LocationX, nil +} + +// AddLocationX adds i to the "location_x" field. +func (m *UserMutation) AddLocationX(i int) { + if m.addlocation_x != nil { + *m.addlocation_x += i + } else { + m.addlocation_x = &i + } +} + +// AddedLocationX returns the value that was added to the "location_x" field in this mutation. +func (m *UserMutation) AddedLocationX() (r int, exists bool) { + v := m.addlocation_x + if v == nil { + return + } + return *v, true +} + +// ClearLocationX clears the value of the "location_x" field. +func (m *UserMutation) ClearLocationX() { + m.location_x = nil + m.addlocation_x = nil + m.clearedFields[user.FieldLocationX] = struct{}{} +} + +// LocationXCleared returns if the "location_x" field was cleared in this mutation. +func (m *UserMutation) LocationXCleared() bool { + _, ok := m.clearedFields[user.FieldLocationX] + return ok +} + +// ResetLocationX resets all changes to the "location_x" field. +func (m *UserMutation) ResetLocationX() { + m.location_x = nil + m.addlocation_x = nil + delete(m.clearedFields, user.FieldLocationX) +} + +// SetLocationY sets the "location_y" field. +func (m *UserMutation) SetLocationY(i int) { + m.location_y = &i + m.addlocation_y = nil +} + +// LocationY returns the value of the "location_y" field in the mutation. +func (m *UserMutation) LocationY() (r int, exists bool) { + v := m.location_y + if v == nil { + return + } + return *v, true +} + +// OldLocationY returns the old "location_y" 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) OldLocationY(ctx context.Context) (v int, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLocationY is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLocationY requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLocationY: %w", err) + } + return oldValue.LocationY, nil +} + +// AddLocationY adds i to the "location_y" field. +func (m *UserMutation) AddLocationY(i int) { + if m.addlocation_y != nil { + *m.addlocation_y += i + } else { + m.addlocation_y = &i + } +} + +// AddedLocationY returns the value that was added to the "location_y" field in this mutation. +func (m *UserMutation) AddedLocationY() (r int, exists bool) { + v := m.addlocation_y + if v == nil { + return + } + return *v, true +} + +// ClearLocationY clears the value of the "location_y" field. +func (m *UserMutation) ClearLocationY() { + m.location_y = nil + m.addlocation_y = nil + m.clearedFields[user.FieldLocationY] = struct{}{} +} + +// LocationYCleared returns if the "location_y" field was cleared in this mutation. +func (m *UserMutation) LocationYCleared() bool { + _, ok := m.clearedFields[user.FieldLocationY] + return ok +} + +// ResetLocationY resets all changes to the "location_y" field. +func (m *UserMutation) ResetLocationY() { + m.location_y = nil + m.addlocation_y = nil + delete(m.clearedFields, user.FieldLocationY) +} + +// SetLocationZ sets the "location_z" field. +func (m *UserMutation) SetLocationZ(i int) { + m.location_z = &i + m.addlocation_z = nil +} + +// LocationZ returns the value of the "location_z" field in the mutation. +func (m *UserMutation) LocationZ() (r int, exists bool) { + v := m.location_z + if v == nil { + return + } + return *v, true +} + +// OldLocationZ returns the old "location_z" 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) OldLocationZ(ctx context.Context) (v int, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLocationZ is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLocationZ requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLocationZ: %w", err) + } + return oldValue.LocationZ, nil +} + +// AddLocationZ adds i to the "location_z" field. +func (m *UserMutation) AddLocationZ(i int) { + if m.addlocation_z != nil { + *m.addlocation_z += i + } else { + m.addlocation_z = &i + } +} + +// AddedLocationZ returns the value that was added to the "location_z" field in this mutation. +func (m *UserMutation) AddedLocationZ() (r int, exists bool) { + v := m.addlocation_z + if v == nil { + return + } + return *v, true +} + +// ClearLocationZ clears the value of the "location_z" field. +func (m *UserMutation) ClearLocationZ() { + m.location_z = nil + m.addlocation_z = nil + m.clearedFields[user.FieldLocationZ] = struct{}{} +} + +// LocationZCleared returns if the "location_z" field was cleared in this mutation. +func (m *UserMutation) LocationZCleared() bool { + _, ok := m.clearedFields[user.FieldLocationZ] + return ok +} + +// ResetLocationZ resets all changes to the "location_z" field. +func (m *UserMutation) ResetLocationZ() { + m.location_z = nil + m.addlocation_z = nil + delete(m.clearedFields, user.FieldLocationZ) +} + +// SetLocationN sets the "location_n" field. +func (m *UserMutation) SetLocationN(i int) { + m.location_n = &i + m.addlocation_n = nil +} + +// LocationN returns the value of the "location_n" field in the mutation. +func (m *UserMutation) LocationN() (r int, exists bool) { + v := m.location_n + if v == nil { + return + } + return *v, true +} + +// OldLocationN returns the old "location_n" 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) OldLocationN(ctx context.Context) (v int, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLocationN is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLocationN requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLocationN: %w", err) + } + return oldValue.LocationN, nil +} + +// AddLocationN adds i to the "location_n" field. +func (m *UserMutation) AddLocationN(i int) { + if m.addlocation_n != nil { + *m.addlocation_n += i + } else { + m.addlocation_n = &i + } +} + +// AddedLocationN returns the value that was added to the "location_n" field in this mutation. +func (m *UserMutation) AddedLocationN() (r int, exists bool) { + v := m.addlocation_n + if v == nil { + return + } + return *v, true +} + +// ClearLocationN clears the value of the "location_n" field. +func (m *UserMutation) ClearLocationN() { + m.location_n = nil + m.addlocation_n = nil + m.clearedFields[user.FieldLocationN] = struct{}{} +} + +// LocationNCleared returns if the "location_n" field was cleared in this mutation. +func (m *UserMutation) LocationNCleared() bool { + _, ok := m.clearedFields[user.FieldLocationN] + return ok +} + +// ResetLocationN resets all changes to the "location_n" field. +func (m *UserMutation) ResetLocationN() { + m.location_n = nil + m.addlocation_n = nil + delete(m.clearedFields, user.FieldLocationN) +} + // AddCardIDs adds the "card" edge to the Card entity by ids. func (m *UserMutation) AddCardIDs(ids ...int) { if m.card == nil { @@ -10957,7 +11467,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, 53) + fields := make([]string, 0, 61) if m.username != nil { fields = append(fields, user.FieldUsername) } @@ -11117,6 +11627,30 @@ func (m *UserMutation) Fields() []string { if m.coin_at != nil { fields = append(fields, user.FieldCoinAt) } + if m.planet != nil { + fields = append(fields, user.FieldPlanet) + } + if m.planet_at != nil { + fields = append(fields, user.FieldPlanetAt) + } + if m.login != nil { + fields = append(fields, user.FieldLogin) + } + if m.login_at != nil { + fields = append(fields, user.FieldLoginAt) + } + if m.location_x != nil { + fields = append(fields, user.FieldLocationX) + } + if m.location_y != nil { + fields = append(fields, user.FieldLocationY) + } + if m.location_z != nil { + fields = append(fields, user.FieldLocationZ) + } + if m.location_n != nil { + fields = append(fields, user.FieldLocationN) + } return fields } @@ -11231,6 +11765,22 @@ func (m *UserMutation) Field(name string) (ent.Value, bool) { return m.CoinOpen() case user.FieldCoinAt: return m.CoinAt() + case user.FieldPlanet: + return m.Planet() + case user.FieldPlanetAt: + return m.PlanetAt() + case user.FieldLogin: + return m.Login() + case user.FieldLoginAt: + return m.LoginAt() + case user.FieldLocationX: + return m.LocationX() + case user.FieldLocationY: + return m.LocationY() + case user.FieldLocationZ: + return m.LocationZ() + case user.FieldLocationN: + return m.LocationN() } return nil, false } @@ -11346,6 +11896,22 @@ func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, er return m.OldCoinOpen(ctx) case user.FieldCoinAt: return m.OldCoinAt(ctx) + case user.FieldPlanet: + return m.OldPlanet(ctx) + case user.FieldPlanetAt: + return m.OldPlanetAt(ctx) + case user.FieldLogin: + return m.OldLogin(ctx) + case user.FieldLoginAt: + return m.OldLoginAt(ctx) + case user.FieldLocationX: + return m.OldLocationX(ctx) + case user.FieldLocationY: + return m.OldLocationY(ctx) + case user.FieldLocationZ: + return m.OldLocationZ(ctx) + case user.FieldLocationN: + return m.OldLocationN(ctx) } return nil, fmt.Errorf("unknown User field %s", name) } @@ -11726,6 +12292,62 @@ func (m *UserMutation) SetField(name string, value ent.Value) error { } m.SetCoinAt(v) return nil + case user.FieldPlanet: + v, ok := value.(int) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPlanet(v) + return nil + case user.FieldPlanetAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPlanetAt(v) + return nil + case user.FieldLogin: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLogin(v) + return nil + case user.FieldLoginAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLoginAt(v) + return nil + case user.FieldLocationX: + v, ok := value.(int) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLocationX(v) + return nil + case user.FieldLocationY: + v, ok := value.(int) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLocationY(v) + return nil + case user.FieldLocationZ: + v, ok := value.(int) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLocationZ(v) + return nil + case user.FieldLocationN: + v, ok := value.(int) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLocationN(v) + return nil } return fmt.Errorf("unknown User field %s", name) } @@ -11788,6 +12410,21 @@ func (m *UserMutation) AddedFields() []string { if m.addcoin != nil { fields = append(fields, user.FieldCoin) } + if m.addplanet != nil { + fields = append(fields, user.FieldPlanet) + } + if m.addlocation_x != nil { + fields = append(fields, user.FieldLocationX) + } + if m.addlocation_y != nil { + fields = append(fields, user.FieldLocationY) + } + if m.addlocation_z != nil { + fields = append(fields, user.FieldLocationZ) + } + if m.addlocation_n != nil { + fields = append(fields, user.FieldLocationN) + } return fields } @@ -11832,6 +12469,16 @@ func (m *UserMutation) AddedField(name string) (ent.Value, bool) { return m.AddedGameStory() case user.FieldCoin: return m.AddedCoin() + case user.FieldPlanet: + return m.AddedPlanet() + case user.FieldLocationX: + return m.AddedLocationX() + case user.FieldLocationY: + return m.AddedLocationY() + case user.FieldLocationZ: + return m.AddedLocationZ() + case user.FieldLocationN: + return m.AddedLocationN() } return nil, false } @@ -11967,6 +12614,41 @@ func (m *UserMutation) AddField(name string, value ent.Value) error { } m.AddCoin(v) return nil + case user.FieldPlanet: + v, ok := value.(int) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddPlanet(v) + return nil + case user.FieldLocationX: + v, ok := value.(int) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddLocationX(v) + return nil + case user.FieldLocationY: + v, ok := value.(int) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddLocationY(v) + return nil + case user.FieldLocationZ: + v, ok := value.(int) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddLocationZ(v) + return nil + case user.FieldLocationN: + v, ok := value.(int) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddLocationN(v) + return nil } return fmt.Errorf("unknown User numeric field %s", name) } @@ -12128,6 +12810,30 @@ func (m *UserMutation) ClearedFields() []string { if m.FieldCleared(user.FieldCoinAt) { fields = append(fields, user.FieldCoinAt) } + if m.FieldCleared(user.FieldPlanet) { + fields = append(fields, user.FieldPlanet) + } + if m.FieldCleared(user.FieldPlanetAt) { + fields = append(fields, user.FieldPlanetAt) + } + if m.FieldCleared(user.FieldLogin) { + fields = append(fields, user.FieldLogin) + } + if m.FieldCleared(user.FieldLoginAt) { + fields = append(fields, user.FieldLoginAt) + } + if m.FieldCleared(user.FieldLocationX) { + fields = append(fields, user.FieldLocationX) + } + if m.FieldCleared(user.FieldLocationY) { + fields = append(fields, user.FieldLocationY) + } + if m.FieldCleared(user.FieldLocationZ) { + fields = append(fields, user.FieldLocationZ) + } + if m.FieldCleared(user.FieldLocationN) { + fields = append(fields, user.FieldLocationN) + } return fields } @@ -12295,6 +13001,30 @@ func (m *UserMutation) ClearField(name string) error { case user.FieldCoinAt: m.ClearCoinAt() return nil + case user.FieldPlanet: + m.ClearPlanet() + return nil + case user.FieldPlanetAt: + m.ClearPlanetAt() + return nil + case user.FieldLogin: + m.ClearLogin() + return nil + case user.FieldLoginAt: + m.ClearLoginAt() + return nil + case user.FieldLocationX: + m.ClearLocationX() + return nil + case user.FieldLocationY: + m.ClearLocationY() + return nil + case user.FieldLocationZ: + m.ClearLocationZ() + return nil + case user.FieldLocationN: + m.ClearLocationN() + return nil } return fmt.Errorf("unknown User nullable field %s", name) } @@ -12462,6 +13192,30 @@ func (m *UserMutation) ResetField(name string) error { case user.FieldCoinAt: m.ResetCoinAt() return nil + case user.FieldPlanet: + m.ResetPlanet() + return nil + case user.FieldPlanetAt: + m.ResetPlanetAt() + return nil + case user.FieldLogin: + m.ResetLogin() + return nil + case user.FieldLoginAt: + m.ResetLoginAt() + return nil + case user.FieldLocationX: + m.ResetLocationX() + return nil + case user.FieldLocationY: + m.ResetLocationY() + return nil + case user.FieldLocationZ: + m.ResetLocationZ() + return nil + case user.FieldLocationN: + m.ResetLocationN() + return nil } return fmt.Errorf("unknown User field %s", name) } diff --git a/ent/ogent/oas_json_gen.go b/ent/ogent/oas_json_gen.go index 5e3ed10..a3c7508 100644 --- a/ent/ogent/oas_json_gen.go +++ b/ent/ogent/oas_json_gen.go @@ -801,9 +801,57 @@ func (s *CardOwnerRead) encodeFields(e *jx.Encoder) { s.CoinAt.Encode(e, json.EncodeDateTime) } } + { + if s.Planet.Set { + e.FieldStart("planet") + s.Planet.Encode(e) + } + } + { + if s.PlanetAt.Set { + e.FieldStart("planet_at") + s.PlanetAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.Login.Set { + e.FieldStart("login") + s.Login.Encode(e) + } + } + { + if s.LoginAt.Set { + e.FieldStart("login_at") + s.LoginAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.LocationX.Set { + e.FieldStart("location_x") + s.LocationX.Encode(e) + } + } + { + if s.LocationY.Set { + e.FieldStart("location_y") + s.LocationY.Encode(e) + } + } + { + if s.LocationZ.Set { + e.FieldStart("location_z") + s.LocationZ.Encode(e) + } + } + { + if s.LocationN.Set { + e.FieldStart("location_n") + s.LocationN.Encode(e) + } + } } -var jsonFieldsNameOfCardOwnerRead = [52]string{ +var jsonFieldsNameOfCardOwnerRead = [60]string{ 0: "id", 1: "username", 2: "did", @@ -856,6 +904,14 @@ var jsonFieldsNameOfCardOwnerRead = [52]string{ 49: "coin", 50: "coin_open", 51: "coin_at", + 52: "planet", + 53: "planet_at", + 54: "login", + 55: "login_at", + 56: "location_x", + 57: "location_y", + 58: "location_z", + 59: "location_n", } // Decode decodes CardOwnerRead from json. @@ -863,7 +919,7 @@ func (s *CardOwnerRead) Decode(d *jx.Decoder) error { if s == nil { return errors.New("invalid: unable to decode CardOwnerRead to nil") } - var requiredBitSet [7]uint8 + var requiredBitSet [8]uint8 if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { @@ -1391,6 +1447,86 @@ func (s *CardOwnerRead) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"coin_at\"") } + case "planet": + if err := func() error { + s.Planet.Reset() + if err := s.Planet.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet\"") + } + case "planet_at": + if err := func() error { + s.PlanetAt.Reset() + if err := s.PlanetAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet_at\"") + } + case "login": + if err := func() error { + s.Login.Reset() + if err := s.Login.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login\"") + } + case "login_at": + if err := func() error { + s.LoginAt.Reset() + if err := s.LoginAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login_at\"") + } + case "location_x": + if err := func() error { + s.LocationX.Reset() + if err := s.LocationX.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_x\"") + } + case "location_y": + if err := func() error { + s.LocationY.Reset() + if err := s.LocationY.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_y\"") + } + case "location_z": + if err := func() error { + s.LocationZ.Reset() + if err := s.LocationZ.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_z\"") + } + case "location_n": + if err := func() error { + s.LocationN.Reset() + if err := s.LocationN.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_n\"") + } default: return d.Skip() } @@ -1400,7 +1536,7 @@ func (s *CardOwnerRead) Decode(d *jx.Decoder) error { } // Validate required fields. var failures []validate.FieldError - for i, mask := range [7]uint8{ + for i, mask := range [8]uint8{ 0b00000011, 0b00000000, 0b00000000, @@ -1408,6 +1544,7 @@ func (s *CardOwnerRead) 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. @@ -3963,6 +4100,54 @@ func (s *CreateUserReq) encodeFields(e *jx.Encoder) { s.CoinAt.Encode(e, json.EncodeDateTime) } } + { + if s.Planet.Set { + e.FieldStart("planet") + s.Planet.Encode(e) + } + } + { + if s.PlanetAt.Set { + e.FieldStart("planet_at") + s.PlanetAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.Login.Set { + e.FieldStart("login") + s.Login.Encode(e) + } + } + { + if s.LoginAt.Set { + e.FieldStart("login_at") + s.LoginAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.LocationX.Set { + e.FieldStart("location_x") + s.LocationX.Encode(e) + } + } + { + if s.LocationY.Set { + e.FieldStart("location_y") + s.LocationY.Encode(e) + } + } + { + if s.LocationZ.Set { + e.FieldStart("location_z") + s.LocationZ.Encode(e) + } + } + { + if s.LocationN.Set { + e.FieldStart("location_n") + s.LocationN.Encode(e) + } + } { if s.Card != nil { e.FieldStart("card") @@ -4005,7 +4190,7 @@ func (s *CreateUserReq) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfCreateUserReq = [57]string{ +var jsonFieldsNameOfCreateUserReq = [65]string{ 0: "username", 1: "did", 2: "member", @@ -4059,10 +4244,18 @@ var jsonFieldsNameOfCreateUserReq = [57]string{ 50: "coin", 51: "coin_open", 52: "coin_at", - 53: "card", - 54: "ue", - 55: "ma", - 56: "sev", + 53: "planet", + 54: "planet_at", + 55: "login", + 56: "login_at", + 57: "location_x", + 58: "location_y", + 59: "location_z", + 60: "location_n", + 61: "card", + 62: "ue", + 63: "ma", + 64: "sev", } // Decode decodes CreateUserReq from json. @@ -4070,7 +4263,7 @@ func (s *CreateUserReq) Decode(d *jx.Decoder) error { if s == nil { return errors.New("invalid: unable to decode CreateUserReq to nil") } - var requiredBitSet [8]uint8 + var requiredBitSet [9]uint8 if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { @@ -4608,6 +4801,86 @@ func (s *CreateUserReq) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"coin_at\"") } + case "planet": + if err := func() error { + s.Planet.Reset() + if err := s.Planet.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet\"") + } + case "planet_at": + if err := func() error { + s.PlanetAt.Reset() + if err := s.PlanetAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet_at\"") + } + case "login": + if err := func() error { + s.Login.Reset() + if err := s.Login.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login\"") + } + case "login_at": + if err := func() error { + s.LoginAt.Reset() + if err := s.LoginAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login_at\"") + } + case "location_x": + if err := func() error { + s.LocationX.Reset() + if err := s.LocationX.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_x\"") + } + case "location_y": + if err := func() error { + s.LocationY.Reset() + if err := s.LocationY.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_y\"") + } + case "location_z": + if err := func() error { + s.LocationZ.Reset() + if err := s.LocationZ.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_z\"") + } + case "location_n": + if err := func() error { + s.LocationN.Reset() + if err := s.LocationN.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_n\"") + } case "card": if err := func() error { s.Card = make([]int, 0) @@ -4693,7 +4966,7 @@ func (s *CreateUserReq) Decode(d *jx.Decoder) error { } // Validate required fields. var failures []validate.FieldError - for i, mask := range [8]uint8{ + for i, mask := range [9]uint8{ 0b00000001, 0b00001000, 0b00000000, @@ -4702,6 +4975,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. @@ -5526,9 +5800,57 @@ func (s *GroupUsersList) encodeFields(e *jx.Encoder) { s.CoinAt.Encode(e, json.EncodeDateTime) } } + { + if s.Planet.Set { + e.FieldStart("planet") + s.Planet.Encode(e) + } + } + { + if s.PlanetAt.Set { + e.FieldStart("planet_at") + s.PlanetAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.Login.Set { + e.FieldStart("login") + s.Login.Encode(e) + } + } + { + if s.LoginAt.Set { + e.FieldStart("login_at") + s.LoginAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.LocationX.Set { + e.FieldStart("location_x") + s.LocationX.Encode(e) + } + } + { + if s.LocationY.Set { + e.FieldStart("location_y") + s.LocationY.Encode(e) + } + } + { + if s.LocationZ.Set { + e.FieldStart("location_z") + s.LocationZ.Encode(e) + } + } + { + if s.LocationN.Set { + e.FieldStart("location_n") + s.LocationN.Encode(e) + } + } } -var jsonFieldsNameOfGroupUsersList = [52]string{ +var jsonFieldsNameOfGroupUsersList = [60]string{ 0: "id", 1: "username", 2: "did", @@ -5581,6 +5903,14 @@ var jsonFieldsNameOfGroupUsersList = [52]string{ 49: "coin", 50: "coin_open", 51: "coin_at", + 52: "planet", + 53: "planet_at", + 54: "login", + 55: "login_at", + 56: "location_x", + 57: "location_y", + 58: "location_z", + 59: "location_n", } // Decode decodes GroupUsersList from json. @@ -5588,7 +5918,7 @@ func (s *GroupUsersList) Decode(d *jx.Decoder) error { if s == nil { return errors.New("invalid: unable to decode GroupUsersList to nil") } - var requiredBitSet [7]uint8 + var requiredBitSet [8]uint8 if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { @@ -6116,6 +6446,86 @@ func (s *GroupUsersList) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"coin_at\"") } + case "planet": + if err := func() error { + s.Planet.Reset() + if err := s.Planet.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet\"") + } + case "planet_at": + if err := func() error { + s.PlanetAt.Reset() + if err := s.PlanetAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet_at\"") + } + case "login": + if err := func() error { + s.Login.Reset() + if err := s.Login.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login\"") + } + case "login_at": + if err := func() error { + s.LoginAt.Reset() + if err := s.LoginAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login_at\"") + } + case "location_x": + if err := func() error { + s.LocationX.Reset() + if err := s.LocationX.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_x\"") + } + case "location_y": + if err := func() error { + s.LocationY.Reset() + if err := s.LocationY.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_y\"") + } + case "location_z": + if err := func() error { + s.LocationZ.Reset() + if err := s.LocationZ.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_z\"") + } + case "location_n": + if err := func() error { + s.LocationN.Reset() + if err := s.LocationN.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_n\"") + } default: return d.Skip() } @@ -6125,7 +6535,7 @@ func (s *GroupUsersList) Decode(d *jx.Decoder) error { } // Validate required fields. var failures []validate.FieldError - for i, mask := range [7]uint8{ + for i, mask := range [8]uint8{ 0b00000011, 0b00000000, 0b00000000, @@ -6133,6 +6543,7 @@ func (s *GroupUsersList) 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. @@ -7959,9 +8370,57 @@ func (s *MaOwnerRead) encodeFields(e *jx.Encoder) { s.CoinAt.Encode(e, json.EncodeDateTime) } } + { + if s.Planet.Set { + e.FieldStart("planet") + s.Planet.Encode(e) + } + } + { + if s.PlanetAt.Set { + e.FieldStart("planet_at") + s.PlanetAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.Login.Set { + e.FieldStart("login") + s.Login.Encode(e) + } + } + { + if s.LoginAt.Set { + e.FieldStart("login_at") + s.LoginAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.LocationX.Set { + e.FieldStart("location_x") + s.LocationX.Encode(e) + } + } + { + if s.LocationY.Set { + e.FieldStart("location_y") + s.LocationY.Encode(e) + } + } + { + if s.LocationZ.Set { + e.FieldStart("location_z") + s.LocationZ.Encode(e) + } + } + { + if s.LocationN.Set { + e.FieldStart("location_n") + s.LocationN.Encode(e) + } + } } -var jsonFieldsNameOfMaOwnerRead = [52]string{ +var jsonFieldsNameOfMaOwnerRead = [60]string{ 0: "id", 1: "username", 2: "did", @@ -8014,6 +8473,14 @@ var jsonFieldsNameOfMaOwnerRead = [52]string{ 49: "coin", 50: "coin_open", 51: "coin_at", + 52: "planet", + 53: "planet_at", + 54: "login", + 55: "login_at", + 56: "location_x", + 57: "location_y", + 58: "location_z", + 59: "location_n", } // Decode decodes MaOwnerRead from json. @@ -8021,7 +8488,7 @@ func (s *MaOwnerRead) Decode(d *jx.Decoder) error { if s == nil { return errors.New("invalid: unable to decode MaOwnerRead to nil") } - var requiredBitSet [7]uint8 + var requiredBitSet [8]uint8 if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { @@ -8549,6 +9016,86 @@ func (s *MaOwnerRead) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"coin_at\"") } + case "planet": + if err := func() error { + s.Planet.Reset() + if err := s.Planet.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet\"") + } + case "planet_at": + if err := func() error { + s.PlanetAt.Reset() + if err := s.PlanetAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet_at\"") + } + case "login": + if err := func() error { + s.Login.Reset() + if err := s.Login.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login\"") + } + case "login_at": + if err := func() error { + s.LoginAt.Reset() + if err := s.LoginAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login_at\"") + } + case "location_x": + if err := func() error { + s.LocationX.Reset() + if err := s.LocationX.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_x\"") + } + case "location_y": + if err := func() error { + s.LocationY.Reset() + if err := s.LocationY.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_y\"") + } + case "location_z": + if err := func() error { + s.LocationZ.Reset() + if err := s.LocationZ.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_z\"") + } + case "location_n": + if err := func() error { + s.LocationN.Reset() + if err := s.LocationN.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_n\"") + } default: return d.Skip() } @@ -8558,7 +9105,7 @@ func (s *MaOwnerRead) Decode(d *jx.Decoder) error { } // Validate required fields. var failures []validate.FieldError - for i, mask := range [7]uint8{ + for i, mask := range [8]uint8{ 0b00000011, 0b00000000, 0b00000000, @@ -8566,6 +9113,7 @@ func (s *MaOwnerRead) 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. @@ -11054,9 +11602,57 @@ func (s *SevOwnerRead) encodeFields(e *jx.Encoder) { s.CoinAt.Encode(e, json.EncodeDateTime) } } + { + if s.Planet.Set { + e.FieldStart("planet") + s.Planet.Encode(e) + } + } + { + if s.PlanetAt.Set { + e.FieldStart("planet_at") + s.PlanetAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.Login.Set { + e.FieldStart("login") + s.Login.Encode(e) + } + } + { + if s.LoginAt.Set { + e.FieldStart("login_at") + s.LoginAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.LocationX.Set { + e.FieldStart("location_x") + s.LocationX.Encode(e) + } + } + { + if s.LocationY.Set { + e.FieldStart("location_y") + s.LocationY.Encode(e) + } + } + { + if s.LocationZ.Set { + e.FieldStart("location_z") + s.LocationZ.Encode(e) + } + } + { + if s.LocationN.Set { + e.FieldStart("location_n") + s.LocationN.Encode(e) + } + } } -var jsonFieldsNameOfSevOwnerRead = [52]string{ +var jsonFieldsNameOfSevOwnerRead = [60]string{ 0: "id", 1: "username", 2: "did", @@ -11109,6 +11705,14 @@ var jsonFieldsNameOfSevOwnerRead = [52]string{ 49: "coin", 50: "coin_open", 51: "coin_at", + 52: "planet", + 53: "planet_at", + 54: "login", + 55: "login_at", + 56: "location_x", + 57: "location_y", + 58: "location_z", + 59: "location_n", } // Decode decodes SevOwnerRead from json. @@ -11116,7 +11720,7 @@ func (s *SevOwnerRead) Decode(d *jx.Decoder) error { if s == nil { return errors.New("invalid: unable to decode SevOwnerRead to nil") } - var requiredBitSet [7]uint8 + var requiredBitSet [8]uint8 if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { @@ -11644,6 +12248,86 @@ func (s *SevOwnerRead) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"coin_at\"") } + case "planet": + if err := func() error { + s.Planet.Reset() + if err := s.Planet.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet\"") + } + case "planet_at": + if err := func() error { + s.PlanetAt.Reset() + if err := s.PlanetAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet_at\"") + } + case "login": + if err := func() error { + s.Login.Reset() + if err := s.Login.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login\"") + } + case "login_at": + if err := func() error { + s.LoginAt.Reset() + if err := s.LoginAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login_at\"") + } + case "location_x": + if err := func() error { + s.LocationX.Reset() + if err := s.LocationX.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_x\"") + } + case "location_y": + if err := func() error { + s.LocationY.Reset() + if err := s.LocationY.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_y\"") + } + case "location_z": + if err := func() error { + s.LocationZ.Reset() + if err := s.LocationZ.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_z\"") + } + case "location_n": + if err := func() error { + s.LocationN.Reset() + if err := s.LocationN.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_n\"") + } default: return d.Skip() } @@ -11653,7 +12337,7 @@ func (s *SevOwnerRead) Decode(d *jx.Decoder) error { } // Validate required fields. var failures []validate.FieldError - for i, mask := range [7]uint8{ + for i, mask := range [8]uint8{ 0b00000011, 0b00000000, 0b00000000, @@ -11661,6 +12345,7 @@ func (s *SevOwnerRead) 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. @@ -13507,9 +14192,57 @@ func (s *UeOwnerRead) encodeFields(e *jx.Encoder) { s.CoinAt.Encode(e, json.EncodeDateTime) } } + { + if s.Planet.Set { + e.FieldStart("planet") + s.Planet.Encode(e) + } + } + { + if s.PlanetAt.Set { + e.FieldStart("planet_at") + s.PlanetAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.Login.Set { + e.FieldStart("login") + s.Login.Encode(e) + } + } + { + if s.LoginAt.Set { + e.FieldStart("login_at") + s.LoginAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.LocationX.Set { + e.FieldStart("location_x") + s.LocationX.Encode(e) + } + } + { + if s.LocationY.Set { + e.FieldStart("location_y") + s.LocationY.Encode(e) + } + } + { + if s.LocationZ.Set { + e.FieldStart("location_z") + s.LocationZ.Encode(e) + } + } + { + if s.LocationN.Set { + e.FieldStart("location_n") + s.LocationN.Encode(e) + } + } } -var jsonFieldsNameOfUeOwnerRead = [52]string{ +var jsonFieldsNameOfUeOwnerRead = [60]string{ 0: "id", 1: "username", 2: "did", @@ -13562,6 +14295,14 @@ var jsonFieldsNameOfUeOwnerRead = [52]string{ 49: "coin", 50: "coin_open", 51: "coin_at", + 52: "planet", + 53: "planet_at", + 54: "login", + 55: "login_at", + 56: "location_x", + 57: "location_y", + 58: "location_z", + 59: "location_n", } // Decode decodes UeOwnerRead from json. @@ -13569,7 +14310,7 @@ func (s *UeOwnerRead) Decode(d *jx.Decoder) error { if s == nil { return errors.New("invalid: unable to decode UeOwnerRead to nil") } - var requiredBitSet [7]uint8 + var requiredBitSet [8]uint8 if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { @@ -14097,6 +14838,86 @@ func (s *UeOwnerRead) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"coin_at\"") } + case "planet": + if err := func() error { + s.Planet.Reset() + if err := s.Planet.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet\"") + } + case "planet_at": + if err := func() error { + s.PlanetAt.Reset() + if err := s.PlanetAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet_at\"") + } + case "login": + if err := func() error { + s.Login.Reset() + if err := s.Login.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login\"") + } + case "login_at": + if err := func() error { + s.LoginAt.Reset() + if err := s.LoginAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login_at\"") + } + case "location_x": + if err := func() error { + s.LocationX.Reset() + if err := s.LocationX.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_x\"") + } + case "location_y": + if err := func() error { + s.LocationY.Reset() + if err := s.LocationY.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_y\"") + } + case "location_z": + if err := func() error { + s.LocationZ.Reset() + if err := s.LocationZ.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_z\"") + } + case "location_n": + if err := func() error { + s.LocationN.Reset() + if err := s.LocationN.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_n\"") + } default: return d.Skip() } @@ -14106,7 +14927,7 @@ func (s *UeOwnerRead) Decode(d *jx.Decoder) error { } // Validate required fields. var failures []validate.FieldError - for i, mask := range [7]uint8{ + for i, mask := range [8]uint8{ 0b00000011, 0b00000000, 0b00000000, @@ -14114,6 +14935,7 @@ func (s *UeOwnerRead) 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. @@ -16796,6 +17618,54 @@ func (s *UpdateUserReq) encodeFields(e *jx.Encoder) { s.CoinAt.Encode(e, json.EncodeDateTime) } } + { + if s.Planet.Set { + e.FieldStart("planet") + s.Planet.Encode(e) + } + } + { + if s.PlanetAt.Set { + e.FieldStart("planet_at") + s.PlanetAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.Login.Set { + e.FieldStart("login") + s.Login.Encode(e) + } + } + { + if s.LoginAt.Set { + e.FieldStart("login_at") + s.LoginAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.LocationX.Set { + e.FieldStart("location_x") + s.LocationX.Encode(e) + } + } + { + if s.LocationY.Set { + e.FieldStart("location_y") + s.LocationY.Encode(e) + } + } + { + if s.LocationZ.Set { + e.FieldStart("location_z") + s.LocationZ.Encode(e) + } + } + { + if s.LocationN.Set { + e.FieldStart("location_n") + s.LocationN.Encode(e) + } + } { if s.Card != nil { e.FieldStart("card") @@ -16838,7 +17708,7 @@ func (s *UpdateUserReq) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfUpdateUserReq = [54]string{ +var jsonFieldsNameOfUpdateUserReq = [62]string{ 0: "did", 1: "member", 2: "book", @@ -16889,10 +17759,18 @@ var jsonFieldsNameOfUpdateUserReq = [54]string{ 47: "coin", 48: "coin_open", 49: "coin_at", - 50: "card", - 51: "ue", - 52: "ma", - 53: "sev", + 50: "planet", + 51: "planet_at", + 52: "login", + 53: "login_at", + 54: "location_x", + 55: "location_y", + 56: "location_z", + 57: "location_n", + 58: "card", + 59: "ue", + 60: "ma", + 61: "sev", } // Decode decodes UpdateUserReq from json. @@ -17403,6 +18281,86 @@ func (s *UpdateUserReq) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"coin_at\"") } + case "planet": + if err := func() error { + s.Planet.Reset() + if err := s.Planet.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet\"") + } + case "planet_at": + if err := func() error { + s.PlanetAt.Reset() + if err := s.PlanetAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet_at\"") + } + case "login": + if err := func() error { + s.Login.Reset() + if err := s.Login.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login\"") + } + case "login_at": + if err := func() error { + s.LoginAt.Reset() + if err := s.LoginAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login_at\"") + } + case "location_x": + if err := func() error { + s.LocationX.Reset() + if err := s.LocationX.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_x\"") + } + case "location_y": + if err := func() error { + s.LocationY.Reset() + if err := s.LocationY.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_y\"") + } + case "location_z": + if err := func() error { + s.LocationZ.Reset() + if err := s.LocationZ.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_z\"") + } + case "location_n": + if err := func() error { + s.LocationN.Reset() + if err := s.LocationN.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_n\"") + } case "card": if err := func() error { s.Card = make([]int, 0) @@ -18056,9 +19014,57 @@ func (s *UserCreate) encodeFields(e *jx.Encoder) { s.CoinAt.Encode(e, json.EncodeDateTime) } } + { + if s.Planet.Set { + e.FieldStart("planet") + s.Planet.Encode(e) + } + } + { + if s.PlanetAt.Set { + e.FieldStart("planet_at") + s.PlanetAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.Login.Set { + e.FieldStart("login") + s.Login.Encode(e) + } + } + { + if s.LoginAt.Set { + e.FieldStart("login_at") + s.LoginAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.LocationX.Set { + e.FieldStart("location_x") + s.LocationX.Encode(e) + } + } + { + if s.LocationY.Set { + e.FieldStart("location_y") + s.LocationY.Encode(e) + } + } + { + if s.LocationZ.Set { + e.FieldStart("location_z") + s.LocationZ.Encode(e) + } + } + { + if s.LocationN.Set { + e.FieldStart("location_n") + s.LocationN.Encode(e) + } + } } -var jsonFieldsNameOfUserCreate = [52]string{ +var jsonFieldsNameOfUserCreate = [60]string{ 0: "id", 1: "username", 2: "did", @@ -18111,6 +19117,14 @@ var jsonFieldsNameOfUserCreate = [52]string{ 49: "coin", 50: "coin_open", 51: "coin_at", + 52: "planet", + 53: "planet_at", + 54: "login", + 55: "login_at", + 56: "location_x", + 57: "location_y", + 58: "location_z", + 59: "location_n", } // Decode decodes UserCreate from json. @@ -18118,7 +19132,7 @@ func (s *UserCreate) Decode(d *jx.Decoder) error { if s == nil { return errors.New("invalid: unable to decode UserCreate to nil") } - var requiredBitSet [7]uint8 + var requiredBitSet [8]uint8 if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { @@ -18646,6 +19660,86 @@ func (s *UserCreate) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"coin_at\"") } + case "planet": + if err := func() error { + s.Planet.Reset() + if err := s.Planet.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet\"") + } + case "planet_at": + if err := func() error { + s.PlanetAt.Reset() + if err := s.PlanetAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet_at\"") + } + case "login": + if err := func() error { + s.Login.Reset() + if err := s.Login.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login\"") + } + case "login_at": + if err := func() error { + s.LoginAt.Reset() + if err := s.LoginAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login_at\"") + } + case "location_x": + if err := func() error { + s.LocationX.Reset() + if err := s.LocationX.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_x\"") + } + case "location_y": + if err := func() error { + s.LocationY.Reset() + if err := s.LocationY.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_y\"") + } + case "location_z": + if err := func() error { + s.LocationZ.Reset() + if err := s.LocationZ.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_z\"") + } + case "location_n": + if err := func() error { + s.LocationN.Reset() + if err := s.LocationN.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_n\"") + } default: return d.Skip() } @@ -18655,7 +19749,7 @@ func (s *UserCreate) Decode(d *jx.Decoder) error { } // Validate required fields. var failures []validate.FieldError - for i, mask := range [7]uint8{ + for i, mask := range [8]uint8{ 0b00000011, 0b00000000, 0b00000000, @@ -18663,6 +19757,7 @@ func (s *UserCreate) 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. @@ -19027,9 +20122,57 @@ func (s *UserList) encodeFields(e *jx.Encoder) { s.CoinAt.Encode(e, json.EncodeDateTime) } } + { + if s.Planet.Set { + e.FieldStart("planet") + s.Planet.Encode(e) + } + } + { + if s.PlanetAt.Set { + e.FieldStart("planet_at") + s.PlanetAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.Login.Set { + e.FieldStart("login") + s.Login.Encode(e) + } + } + { + if s.LoginAt.Set { + e.FieldStart("login_at") + s.LoginAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.LocationX.Set { + e.FieldStart("location_x") + s.LocationX.Encode(e) + } + } + { + if s.LocationY.Set { + e.FieldStart("location_y") + s.LocationY.Encode(e) + } + } + { + if s.LocationZ.Set { + e.FieldStart("location_z") + s.LocationZ.Encode(e) + } + } + { + if s.LocationN.Set { + e.FieldStart("location_n") + s.LocationN.Encode(e) + } + } } -var jsonFieldsNameOfUserList = [52]string{ +var jsonFieldsNameOfUserList = [60]string{ 0: "id", 1: "username", 2: "did", @@ -19082,6 +20225,14 @@ var jsonFieldsNameOfUserList = [52]string{ 49: "coin", 50: "coin_open", 51: "coin_at", + 52: "planet", + 53: "planet_at", + 54: "login", + 55: "login_at", + 56: "location_x", + 57: "location_y", + 58: "location_z", + 59: "location_n", } // Decode decodes UserList from json. @@ -19089,7 +20240,7 @@ func (s *UserList) Decode(d *jx.Decoder) error { if s == nil { return errors.New("invalid: unable to decode UserList to nil") } - var requiredBitSet [7]uint8 + var requiredBitSet [8]uint8 if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { @@ -19617,6 +20768,86 @@ func (s *UserList) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"coin_at\"") } + case "planet": + if err := func() error { + s.Planet.Reset() + if err := s.Planet.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet\"") + } + case "planet_at": + if err := func() error { + s.PlanetAt.Reset() + if err := s.PlanetAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet_at\"") + } + case "login": + if err := func() error { + s.Login.Reset() + if err := s.Login.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login\"") + } + case "login_at": + if err := func() error { + s.LoginAt.Reset() + if err := s.LoginAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login_at\"") + } + case "location_x": + if err := func() error { + s.LocationX.Reset() + if err := s.LocationX.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_x\"") + } + case "location_y": + if err := func() error { + s.LocationY.Reset() + if err := s.LocationY.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_y\"") + } + case "location_z": + if err := func() error { + s.LocationZ.Reset() + if err := s.LocationZ.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_z\"") + } + case "location_n": + if err := func() error { + s.LocationN.Reset() + if err := s.LocationN.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_n\"") + } default: return d.Skip() } @@ -19626,7 +20857,7 @@ func (s *UserList) Decode(d *jx.Decoder) error { } // Validate required fields. var failures []validate.FieldError - for i, mask := range [7]uint8{ + for i, mask := range [8]uint8{ 0b00000011, 0b00000000, 0b00000000, @@ -19634,6 +20865,7 @@ func (s *UserList) 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. @@ -20454,9 +21686,57 @@ func (s *UserRead) encodeFields(e *jx.Encoder) { s.CoinAt.Encode(e, json.EncodeDateTime) } } + { + if s.Planet.Set { + e.FieldStart("planet") + s.Planet.Encode(e) + } + } + { + if s.PlanetAt.Set { + e.FieldStart("planet_at") + s.PlanetAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.Login.Set { + e.FieldStart("login") + s.Login.Encode(e) + } + } + { + if s.LoginAt.Set { + e.FieldStart("login_at") + s.LoginAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.LocationX.Set { + e.FieldStart("location_x") + s.LocationX.Encode(e) + } + } + { + if s.LocationY.Set { + e.FieldStart("location_y") + s.LocationY.Encode(e) + } + } + { + if s.LocationZ.Set { + e.FieldStart("location_z") + s.LocationZ.Encode(e) + } + } + { + if s.LocationN.Set { + e.FieldStart("location_n") + s.LocationN.Encode(e) + } + } } -var jsonFieldsNameOfUserRead = [52]string{ +var jsonFieldsNameOfUserRead = [60]string{ 0: "id", 1: "username", 2: "did", @@ -20509,6 +21789,14 @@ var jsonFieldsNameOfUserRead = [52]string{ 49: "coin", 50: "coin_open", 51: "coin_at", + 52: "planet", + 53: "planet_at", + 54: "login", + 55: "login_at", + 56: "location_x", + 57: "location_y", + 58: "location_z", + 59: "location_n", } // Decode decodes UserRead from json. @@ -20516,7 +21804,7 @@ func (s *UserRead) Decode(d *jx.Decoder) error { if s == nil { return errors.New("invalid: unable to decode UserRead to nil") } - var requiredBitSet [7]uint8 + var requiredBitSet [8]uint8 if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { @@ -21044,6 +22332,86 @@ func (s *UserRead) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"coin_at\"") } + case "planet": + if err := func() error { + s.Planet.Reset() + if err := s.Planet.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet\"") + } + case "planet_at": + if err := func() error { + s.PlanetAt.Reset() + if err := s.PlanetAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet_at\"") + } + case "login": + if err := func() error { + s.Login.Reset() + if err := s.Login.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login\"") + } + case "login_at": + if err := func() error { + s.LoginAt.Reset() + if err := s.LoginAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login_at\"") + } + case "location_x": + if err := func() error { + s.LocationX.Reset() + if err := s.LocationX.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_x\"") + } + case "location_y": + if err := func() error { + s.LocationY.Reset() + if err := s.LocationY.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_y\"") + } + case "location_z": + if err := func() error { + s.LocationZ.Reset() + if err := s.LocationZ.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_z\"") + } + case "location_n": + if err := func() error { + s.LocationN.Reset() + if err := s.LocationN.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_n\"") + } default: return d.Skip() } @@ -21053,7 +22421,7 @@ func (s *UserRead) Decode(d *jx.Decoder) error { } // Validate required fields. var failures []validate.FieldError - for i, mask := range [7]uint8{ + for i, mask := range [8]uint8{ 0b00000011, 0b00000000, 0b00000000, @@ -21061,6 +22429,7 @@ func (s *UserRead) 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. @@ -22166,9 +23535,57 @@ func (s *UserUpdate) encodeFields(e *jx.Encoder) { s.CoinAt.Encode(e, json.EncodeDateTime) } } + { + if s.Planet.Set { + e.FieldStart("planet") + s.Planet.Encode(e) + } + } + { + if s.PlanetAt.Set { + e.FieldStart("planet_at") + s.PlanetAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.Login.Set { + e.FieldStart("login") + s.Login.Encode(e) + } + } + { + if s.LoginAt.Set { + e.FieldStart("login_at") + s.LoginAt.Encode(e, json.EncodeDateTime) + } + } + { + if s.LocationX.Set { + e.FieldStart("location_x") + s.LocationX.Encode(e) + } + } + { + if s.LocationY.Set { + e.FieldStart("location_y") + s.LocationY.Encode(e) + } + } + { + if s.LocationZ.Set { + e.FieldStart("location_z") + s.LocationZ.Encode(e) + } + } + { + if s.LocationN.Set { + e.FieldStart("location_n") + s.LocationN.Encode(e) + } + } } -var jsonFieldsNameOfUserUpdate = [52]string{ +var jsonFieldsNameOfUserUpdate = [60]string{ 0: "id", 1: "username", 2: "did", @@ -22221,6 +23638,14 @@ var jsonFieldsNameOfUserUpdate = [52]string{ 49: "coin", 50: "coin_open", 51: "coin_at", + 52: "planet", + 53: "planet_at", + 54: "login", + 55: "login_at", + 56: "location_x", + 57: "location_y", + 58: "location_z", + 59: "location_n", } // Decode decodes UserUpdate from json. @@ -22228,7 +23653,7 @@ func (s *UserUpdate) Decode(d *jx.Decoder) error { if s == nil { return errors.New("invalid: unable to decode UserUpdate to nil") } - var requiredBitSet [7]uint8 + var requiredBitSet [8]uint8 if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { @@ -22756,6 +24181,86 @@ func (s *UserUpdate) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"coin_at\"") } + case "planet": + if err := func() error { + s.Planet.Reset() + if err := s.Planet.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet\"") + } + case "planet_at": + if err := func() error { + s.PlanetAt.Reset() + if err := s.PlanetAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"planet_at\"") + } + case "login": + if err := func() error { + s.Login.Reset() + if err := s.Login.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login\"") + } + case "login_at": + if err := func() error { + s.LoginAt.Reset() + if err := s.LoginAt.Decode(d, json.DecodeDateTime); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"login_at\"") + } + case "location_x": + if err := func() error { + s.LocationX.Reset() + if err := s.LocationX.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_x\"") + } + case "location_y": + if err := func() error { + s.LocationY.Reset() + if err := s.LocationY.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_y\"") + } + case "location_z": + if err := func() error { + s.LocationZ.Reset() + if err := s.LocationZ.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_z\"") + } + case "location_n": + if err := func() error { + s.LocationN.Reset() + if err := s.LocationN.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"location_n\"") + } default: return d.Skip() } @@ -22765,7 +24270,7 @@ func (s *UserUpdate) Decode(d *jx.Decoder) error { } // Validate required fields. var failures []validate.FieldError - for i, mask := range [7]uint8{ + for i, mask := range [8]uint8{ 0b00000011, 0b00000000, 0b00000000, @@ -22773,6 +24278,7 @@ func (s *UserUpdate) 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. diff --git a/ent/ogent/oas_parameters_gen.go b/ent/ogent/oas_parameters_gen.go index 867cf82..f5745e8 100644 --- a/ent/ogent/oas_parameters_gen.go +++ b/ent/ogent/oas_parameters_gen.go @@ -645,7 +645,7 @@ func decodeListCardParams(args [0]string, r *http.Request) (params ListCardParam MinSet: true, Min: 1, MaxSet: true, - Max: 5000, + Max: 10000, MinExclusive: false, MaxExclusive: false, MultipleOfSet: false, @@ -810,7 +810,7 @@ func decodeListGroupParams(args [0]string, r *http.Request) (params ListGroupPar MinSet: true, Min: 1, MaxSet: true, - Max: 5000, + Max: 10000, MinExclusive: false, MaxExclusive: false, MultipleOfSet: false, @@ -1142,7 +1142,7 @@ func decodeListMaParams(args [0]string, r *http.Request) (params ListMaParams, _ MinSet: true, Min: 1, MaxSet: true, - Max: 5000, + Max: 10000, MinExclusive: false, MaxExclusive: false, MultipleOfSet: false, @@ -1307,7 +1307,7 @@ func decodeListSevParams(args [0]string, r *http.Request) (params ListSevParams, MinSet: true, Min: 1, MaxSet: true, - Max: 5000, + Max: 10000, MinExclusive: false, MaxExclusive: false, MultipleOfSet: false, @@ -1472,7 +1472,7 @@ func decodeListUeParams(args [0]string, r *http.Request) (params ListUeParams, _ MinSet: true, Min: 1, MaxSet: true, - Max: 5000, + Max: 10000, MinExclusive: false, MaxExclusive: false, MultipleOfSet: false, @@ -1637,7 +1637,7 @@ func decodeListUserParams(args [0]string, r *http.Request) (params ListUserParam MinSet: true, Min: 1, MaxSet: true, - Max: 5000, + Max: 10000, MinExclusive: false, MaxExclusive: false, MultipleOfSet: false, diff --git a/ent/ogent/oas_schemas_gen.go b/ent/ogent/oas_schemas_gen.go index 73f677d..5a0c42e 100644 --- a/ent/ogent/oas_schemas_gen.go +++ b/ent/ogent/oas_schemas_gen.go @@ -270,6 +270,14 @@ type CardOwnerRead struct { Coin OptInt `json:"coin"` CoinOpen OptBool `json:"coin_open"` CoinAt OptDateTime `json:"coin_at"` + Planet OptInt `json:"planet"` + PlanetAt OptDateTime `json:"planet_at"` + Login OptBool `json:"login"` + LoginAt OptDateTime `json:"login_at"` + LocationX OptInt `json:"location_x"` + LocationY OptInt `json:"location_y"` + LocationZ OptInt `json:"location_z"` + LocationN OptInt `json:"location_n"` } // GetID returns the value of ID. @@ -532,6 +540,46 @@ func (s *CardOwnerRead) GetCoinAt() OptDateTime { return s.CoinAt } +// GetPlanet returns the value of Planet. +func (s *CardOwnerRead) GetPlanet() OptInt { + return s.Planet +} + +// GetPlanetAt returns the value of PlanetAt. +func (s *CardOwnerRead) GetPlanetAt() OptDateTime { + return s.PlanetAt +} + +// GetLogin returns the value of Login. +func (s *CardOwnerRead) GetLogin() OptBool { + return s.Login +} + +// GetLoginAt returns the value of LoginAt. +func (s *CardOwnerRead) GetLoginAt() OptDateTime { + return s.LoginAt +} + +// GetLocationX returns the value of LocationX. +func (s *CardOwnerRead) GetLocationX() OptInt { + return s.LocationX +} + +// GetLocationY returns the value of LocationY. +func (s *CardOwnerRead) GetLocationY() OptInt { + return s.LocationY +} + +// GetLocationZ returns the value of LocationZ. +func (s *CardOwnerRead) GetLocationZ() OptInt { + return s.LocationZ +} + +// GetLocationN returns the value of LocationN. +func (s *CardOwnerRead) GetLocationN() OptInt { + return s.LocationN +} + // SetID sets the value of ID. func (s *CardOwnerRead) SetID(val int) { s.ID = val @@ -792,6 +840,46 @@ func (s *CardOwnerRead) SetCoinAt(val OptDateTime) { s.CoinAt = val } +// SetPlanet sets the value of Planet. +func (s *CardOwnerRead) SetPlanet(val OptInt) { + s.Planet = val +} + +// SetPlanetAt sets the value of PlanetAt. +func (s *CardOwnerRead) SetPlanetAt(val OptDateTime) { + s.PlanetAt = val +} + +// SetLogin sets the value of Login. +func (s *CardOwnerRead) SetLogin(val OptBool) { + s.Login = val +} + +// SetLoginAt sets the value of LoginAt. +func (s *CardOwnerRead) SetLoginAt(val OptDateTime) { + s.LoginAt = val +} + +// SetLocationX sets the value of LocationX. +func (s *CardOwnerRead) SetLocationX(val OptInt) { + s.LocationX = val +} + +// SetLocationY sets the value of LocationY. +func (s *CardOwnerRead) SetLocationY(val OptInt) { + s.LocationY = val +} + +// SetLocationZ sets the value of LocationZ. +func (s *CardOwnerRead) SetLocationZ(val OptInt) { + s.LocationZ = val +} + +// SetLocationN sets the value of LocationN. +func (s *CardOwnerRead) SetLocationN(val OptInt) { + s.LocationN = val +} + func (*CardOwnerRead) readCardOwnerRes() {} // Ref: #/components/schemas/CardRead @@ -1909,6 +1997,14 @@ type CreateUserReq struct { Coin OptInt `json:"coin"` CoinOpen OptBool `json:"coin_open"` CoinAt OptDateTime `json:"coin_at"` + Planet OptInt `json:"planet"` + PlanetAt OptDateTime `json:"planet_at"` + Login OptBool `json:"login"` + LoginAt OptDateTime `json:"login_at"` + LocationX OptInt `json:"location_x"` + LocationY OptInt `json:"location_y"` + LocationZ OptInt `json:"location_z"` + LocationN OptInt `json:"location_n"` Card []int `json:"card"` Ue []int `json:"ue"` Ma []int `json:"ma"` @@ -2180,6 +2276,46 @@ func (s *CreateUserReq) GetCoinAt() OptDateTime { return s.CoinAt } +// GetPlanet returns the value of Planet. +func (s *CreateUserReq) GetPlanet() OptInt { + return s.Planet +} + +// GetPlanetAt returns the value of PlanetAt. +func (s *CreateUserReq) GetPlanetAt() OptDateTime { + return s.PlanetAt +} + +// GetLogin returns the value of Login. +func (s *CreateUserReq) GetLogin() OptBool { + return s.Login +} + +// GetLoginAt returns the value of LoginAt. +func (s *CreateUserReq) GetLoginAt() OptDateTime { + return s.LoginAt +} + +// GetLocationX returns the value of LocationX. +func (s *CreateUserReq) GetLocationX() OptInt { + return s.LocationX +} + +// GetLocationY returns the value of LocationY. +func (s *CreateUserReq) GetLocationY() OptInt { + return s.LocationY +} + +// GetLocationZ returns the value of LocationZ. +func (s *CreateUserReq) GetLocationZ() OptInt { + return s.LocationZ +} + +// GetLocationN returns the value of LocationN. +func (s *CreateUserReq) GetLocationN() OptInt { + return s.LocationN +} + // GetCard returns the value of Card. func (s *CreateUserReq) GetCard() []int { return s.Card @@ -2465,6 +2601,46 @@ func (s *CreateUserReq) SetCoinAt(val OptDateTime) { s.CoinAt = val } +// SetPlanet sets the value of Planet. +func (s *CreateUserReq) SetPlanet(val OptInt) { + s.Planet = val +} + +// SetPlanetAt sets the value of PlanetAt. +func (s *CreateUserReq) SetPlanetAt(val OptDateTime) { + s.PlanetAt = val +} + +// SetLogin sets the value of Login. +func (s *CreateUserReq) SetLogin(val OptBool) { + s.Login = val +} + +// SetLoginAt sets the value of LoginAt. +func (s *CreateUserReq) SetLoginAt(val OptDateTime) { + s.LoginAt = val +} + +// SetLocationX sets the value of LocationX. +func (s *CreateUserReq) SetLocationX(val OptInt) { + s.LocationX = val +} + +// SetLocationY sets the value of LocationY. +func (s *CreateUserReq) SetLocationY(val OptInt) { + s.LocationY = val +} + +// SetLocationZ sets the value of LocationZ. +func (s *CreateUserReq) SetLocationZ(val OptInt) { + s.LocationZ = val +} + +// SetLocationN sets the value of LocationN. +func (s *CreateUserReq) SetLocationN(val OptInt) { + s.LocationN = val +} + // SetCard sets the value of Card. func (s *CreateUserReq) SetCard(val []int) { s.Card = val @@ -2685,6 +2861,14 @@ type GroupUsersList struct { Coin OptInt `json:"coin"` CoinOpen OptBool `json:"coin_open"` CoinAt OptDateTime `json:"coin_at"` + Planet OptInt `json:"planet"` + PlanetAt OptDateTime `json:"planet_at"` + Login OptBool `json:"login"` + LoginAt OptDateTime `json:"login_at"` + LocationX OptInt `json:"location_x"` + LocationY OptInt `json:"location_y"` + LocationZ OptInt `json:"location_z"` + LocationN OptInt `json:"location_n"` } // GetID returns the value of ID. @@ -2947,6 +3131,46 @@ func (s *GroupUsersList) GetCoinAt() OptDateTime { return s.CoinAt } +// GetPlanet returns the value of Planet. +func (s *GroupUsersList) GetPlanet() OptInt { + return s.Planet +} + +// GetPlanetAt returns the value of PlanetAt. +func (s *GroupUsersList) GetPlanetAt() OptDateTime { + return s.PlanetAt +} + +// GetLogin returns the value of Login. +func (s *GroupUsersList) GetLogin() OptBool { + return s.Login +} + +// GetLoginAt returns the value of LoginAt. +func (s *GroupUsersList) GetLoginAt() OptDateTime { + return s.LoginAt +} + +// GetLocationX returns the value of LocationX. +func (s *GroupUsersList) GetLocationX() OptInt { + return s.LocationX +} + +// GetLocationY returns the value of LocationY. +func (s *GroupUsersList) GetLocationY() OptInt { + return s.LocationY +} + +// GetLocationZ returns the value of LocationZ. +func (s *GroupUsersList) GetLocationZ() OptInt { + return s.LocationZ +} + +// GetLocationN returns the value of LocationN. +func (s *GroupUsersList) GetLocationN() OptInt { + return s.LocationN +} + // SetID sets the value of ID. func (s *GroupUsersList) SetID(val int) { s.ID = val @@ -3207,6 +3431,46 @@ func (s *GroupUsersList) SetCoinAt(val OptDateTime) { s.CoinAt = val } +// SetPlanet sets the value of Planet. +func (s *GroupUsersList) SetPlanet(val OptInt) { + s.Planet = val +} + +// SetPlanetAt sets the value of PlanetAt. +func (s *GroupUsersList) SetPlanetAt(val OptDateTime) { + s.PlanetAt = val +} + +// SetLogin sets the value of Login. +func (s *GroupUsersList) SetLogin(val OptBool) { + s.Login = val +} + +// SetLoginAt sets the value of LoginAt. +func (s *GroupUsersList) SetLoginAt(val OptDateTime) { + s.LoginAt = val +} + +// SetLocationX sets the value of LocationX. +func (s *GroupUsersList) SetLocationX(val OptInt) { + s.LocationX = val +} + +// SetLocationY sets the value of LocationY. +func (s *GroupUsersList) SetLocationY(val OptInt) { + s.LocationY = val +} + +// SetLocationZ sets the value of LocationZ. +func (s *GroupUsersList) SetLocationZ(val OptInt) { + s.LocationZ = val +} + +// SetLocationN sets the value of LocationN. +func (s *GroupUsersList) SetLocationN(val OptInt) { + s.LocationN = val +} + type ListCardOKApplicationJSON []CardList func (*ListCardOKApplicationJSON) listCardRes() {} @@ -3799,6 +4063,14 @@ type MaOwnerRead struct { Coin OptInt `json:"coin"` CoinOpen OptBool `json:"coin_open"` CoinAt OptDateTime `json:"coin_at"` + Planet OptInt `json:"planet"` + PlanetAt OptDateTime `json:"planet_at"` + Login OptBool `json:"login"` + LoginAt OptDateTime `json:"login_at"` + LocationX OptInt `json:"location_x"` + LocationY OptInt `json:"location_y"` + LocationZ OptInt `json:"location_z"` + LocationN OptInt `json:"location_n"` } // GetID returns the value of ID. @@ -4061,6 +4333,46 @@ func (s *MaOwnerRead) GetCoinAt() OptDateTime { return s.CoinAt } +// GetPlanet returns the value of Planet. +func (s *MaOwnerRead) GetPlanet() OptInt { + return s.Planet +} + +// GetPlanetAt returns the value of PlanetAt. +func (s *MaOwnerRead) GetPlanetAt() OptDateTime { + return s.PlanetAt +} + +// GetLogin returns the value of Login. +func (s *MaOwnerRead) GetLogin() OptBool { + return s.Login +} + +// GetLoginAt returns the value of LoginAt. +func (s *MaOwnerRead) GetLoginAt() OptDateTime { + return s.LoginAt +} + +// GetLocationX returns the value of LocationX. +func (s *MaOwnerRead) GetLocationX() OptInt { + return s.LocationX +} + +// GetLocationY returns the value of LocationY. +func (s *MaOwnerRead) GetLocationY() OptInt { + return s.LocationY +} + +// GetLocationZ returns the value of LocationZ. +func (s *MaOwnerRead) GetLocationZ() OptInt { + return s.LocationZ +} + +// GetLocationN returns the value of LocationN. +func (s *MaOwnerRead) GetLocationN() OptInt { + return s.LocationN +} + // SetID sets the value of ID. func (s *MaOwnerRead) SetID(val int) { s.ID = val @@ -4321,6 +4633,46 @@ func (s *MaOwnerRead) SetCoinAt(val OptDateTime) { s.CoinAt = val } +// SetPlanet sets the value of Planet. +func (s *MaOwnerRead) SetPlanet(val OptInt) { + s.Planet = val +} + +// SetPlanetAt sets the value of PlanetAt. +func (s *MaOwnerRead) SetPlanetAt(val OptDateTime) { + s.PlanetAt = val +} + +// SetLogin sets the value of Login. +func (s *MaOwnerRead) SetLogin(val OptBool) { + s.Login = val +} + +// SetLoginAt sets the value of LoginAt. +func (s *MaOwnerRead) SetLoginAt(val OptDateTime) { + s.LoginAt = val +} + +// SetLocationX sets the value of LocationX. +func (s *MaOwnerRead) SetLocationX(val OptInt) { + s.LocationX = val +} + +// SetLocationY sets the value of LocationY. +func (s *MaOwnerRead) SetLocationY(val OptInt) { + s.LocationY = val +} + +// SetLocationZ sets the value of LocationZ. +func (s *MaOwnerRead) SetLocationZ(val OptInt) { + s.LocationZ = val +} + +// SetLocationN sets the value of LocationN. +func (s *MaOwnerRead) SetLocationN(val OptInt) { + s.LocationN = val +} + func (*MaOwnerRead) readMaOwnerRes() {} // Ref: #/components/schemas/MaRead @@ -5607,6 +5959,14 @@ type SevOwnerRead struct { Coin OptInt `json:"coin"` CoinOpen OptBool `json:"coin_open"` CoinAt OptDateTime `json:"coin_at"` + Planet OptInt `json:"planet"` + PlanetAt OptDateTime `json:"planet_at"` + Login OptBool `json:"login"` + LoginAt OptDateTime `json:"login_at"` + LocationX OptInt `json:"location_x"` + LocationY OptInt `json:"location_y"` + LocationZ OptInt `json:"location_z"` + LocationN OptInt `json:"location_n"` } // GetID returns the value of ID. @@ -5869,6 +6229,46 @@ func (s *SevOwnerRead) GetCoinAt() OptDateTime { return s.CoinAt } +// GetPlanet returns the value of Planet. +func (s *SevOwnerRead) GetPlanet() OptInt { + return s.Planet +} + +// GetPlanetAt returns the value of PlanetAt. +func (s *SevOwnerRead) GetPlanetAt() OptDateTime { + return s.PlanetAt +} + +// GetLogin returns the value of Login. +func (s *SevOwnerRead) GetLogin() OptBool { + return s.Login +} + +// GetLoginAt returns the value of LoginAt. +func (s *SevOwnerRead) GetLoginAt() OptDateTime { + return s.LoginAt +} + +// GetLocationX returns the value of LocationX. +func (s *SevOwnerRead) GetLocationX() OptInt { + return s.LocationX +} + +// GetLocationY returns the value of LocationY. +func (s *SevOwnerRead) GetLocationY() OptInt { + return s.LocationY +} + +// GetLocationZ returns the value of LocationZ. +func (s *SevOwnerRead) GetLocationZ() OptInt { + return s.LocationZ +} + +// GetLocationN returns the value of LocationN. +func (s *SevOwnerRead) GetLocationN() OptInt { + return s.LocationN +} + // SetID sets the value of ID. func (s *SevOwnerRead) SetID(val int) { s.ID = val @@ -6129,6 +6529,46 @@ func (s *SevOwnerRead) SetCoinAt(val OptDateTime) { s.CoinAt = val } +// SetPlanet sets the value of Planet. +func (s *SevOwnerRead) SetPlanet(val OptInt) { + s.Planet = val +} + +// SetPlanetAt sets the value of PlanetAt. +func (s *SevOwnerRead) SetPlanetAt(val OptDateTime) { + s.PlanetAt = val +} + +// SetLogin sets the value of Login. +func (s *SevOwnerRead) SetLogin(val OptBool) { + s.Login = val +} + +// SetLoginAt sets the value of LoginAt. +func (s *SevOwnerRead) SetLoginAt(val OptDateTime) { + s.LoginAt = val +} + +// SetLocationX sets the value of LocationX. +func (s *SevOwnerRead) SetLocationX(val OptInt) { + s.LocationX = val +} + +// SetLocationY sets the value of LocationY. +func (s *SevOwnerRead) SetLocationY(val OptInt) { + s.LocationY = val +} + +// SetLocationZ sets the value of LocationZ. +func (s *SevOwnerRead) SetLocationZ(val OptInt) { + s.LocationZ = val +} + +// SetLocationN sets the value of LocationN. +func (s *SevOwnerRead) SetLocationN(val OptInt) { + s.LocationN = val +} + func (*SevOwnerRead) readSevOwnerRes() {} // Ref: #/components/schemas/SevRead @@ -6955,6 +7395,14 @@ type UeOwnerRead struct { Coin OptInt `json:"coin"` CoinOpen OptBool `json:"coin_open"` CoinAt OptDateTime `json:"coin_at"` + Planet OptInt `json:"planet"` + PlanetAt OptDateTime `json:"planet_at"` + Login OptBool `json:"login"` + LoginAt OptDateTime `json:"login_at"` + LocationX OptInt `json:"location_x"` + LocationY OptInt `json:"location_y"` + LocationZ OptInt `json:"location_z"` + LocationN OptInt `json:"location_n"` } // GetID returns the value of ID. @@ -7217,6 +7665,46 @@ func (s *UeOwnerRead) GetCoinAt() OptDateTime { return s.CoinAt } +// GetPlanet returns the value of Planet. +func (s *UeOwnerRead) GetPlanet() OptInt { + return s.Planet +} + +// GetPlanetAt returns the value of PlanetAt. +func (s *UeOwnerRead) GetPlanetAt() OptDateTime { + return s.PlanetAt +} + +// GetLogin returns the value of Login. +func (s *UeOwnerRead) GetLogin() OptBool { + return s.Login +} + +// GetLoginAt returns the value of LoginAt. +func (s *UeOwnerRead) GetLoginAt() OptDateTime { + return s.LoginAt +} + +// GetLocationX returns the value of LocationX. +func (s *UeOwnerRead) GetLocationX() OptInt { + return s.LocationX +} + +// GetLocationY returns the value of LocationY. +func (s *UeOwnerRead) GetLocationY() OptInt { + return s.LocationY +} + +// GetLocationZ returns the value of LocationZ. +func (s *UeOwnerRead) GetLocationZ() OptInt { + return s.LocationZ +} + +// GetLocationN returns the value of LocationN. +func (s *UeOwnerRead) GetLocationN() OptInt { + return s.LocationN +} + // SetID sets the value of ID. func (s *UeOwnerRead) SetID(val int) { s.ID = val @@ -7477,6 +7965,46 @@ func (s *UeOwnerRead) SetCoinAt(val OptDateTime) { s.CoinAt = val } +// SetPlanet sets the value of Planet. +func (s *UeOwnerRead) SetPlanet(val OptInt) { + s.Planet = val +} + +// SetPlanetAt sets the value of PlanetAt. +func (s *UeOwnerRead) SetPlanetAt(val OptDateTime) { + s.PlanetAt = val +} + +// SetLogin sets the value of Login. +func (s *UeOwnerRead) SetLogin(val OptBool) { + s.Login = val +} + +// SetLoginAt sets the value of LoginAt. +func (s *UeOwnerRead) SetLoginAt(val OptDateTime) { + s.LoginAt = val +} + +// SetLocationX sets the value of LocationX. +func (s *UeOwnerRead) SetLocationX(val OptInt) { + s.LocationX = val +} + +// SetLocationY sets the value of LocationY. +func (s *UeOwnerRead) SetLocationY(val OptInt) { + s.LocationY = val +} + +// SetLocationZ sets the value of LocationZ. +func (s *UeOwnerRead) SetLocationZ(val OptInt) { + s.LocationZ = val +} + +// SetLocationN sets the value of LocationN. +func (s *UeOwnerRead) SetLocationN(val OptInt) { + s.LocationN = val +} + func (*UeOwnerRead) readUeOwnerRes() {} // Ref: #/components/schemas/UeRead @@ -8800,6 +9328,14 @@ type UpdateUserReq struct { Coin OptInt `json:"coin"` CoinOpen OptBool `json:"coin_open"` CoinAt OptDateTime `json:"coin_at"` + Planet OptInt `json:"planet"` + PlanetAt OptDateTime `json:"planet_at"` + Login OptBool `json:"login"` + LoginAt OptDateTime `json:"login_at"` + LocationX OptInt `json:"location_x"` + LocationY OptInt `json:"location_y"` + LocationZ OptInt `json:"location_z"` + LocationN OptInt `json:"location_n"` Card []int `json:"card"` Ue []int `json:"ue"` Ma []int `json:"ma"` @@ -9056,6 +9592,46 @@ func (s *UpdateUserReq) GetCoinAt() OptDateTime { return s.CoinAt } +// GetPlanet returns the value of Planet. +func (s *UpdateUserReq) GetPlanet() OptInt { + return s.Planet +} + +// GetPlanetAt returns the value of PlanetAt. +func (s *UpdateUserReq) GetPlanetAt() OptDateTime { + return s.PlanetAt +} + +// GetLogin returns the value of Login. +func (s *UpdateUserReq) GetLogin() OptBool { + return s.Login +} + +// GetLoginAt returns the value of LoginAt. +func (s *UpdateUserReq) GetLoginAt() OptDateTime { + return s.LoginAt +} + +// GetLocationX returns the value of LocationX. +func (s *UpdateUserReq) GetLocationX() OptInt { + return s.LocationX +} + +// GetLocationY returns the value of LocationY. +func (s *UpdateUserReq) GetLocationY() OptInt { + return s.LocationY +} + +// GetLocationZ returns the value of LocationZ. +func (s *UpdateUserReq) GetLocationZ() OptInt { + return s.LocationZ +} + +// GetLocationN returns the value of LocationN. +func (s *UpdateUserReq) GetLocationN() OptInt { + return s.LocationN +} + // GetCard returns the value of Card. func (s *UpdateUserReq) GetCard() []int { return s.Card @@ -9326,6 +9902,46 @@ func (s *UpdateUserReq) SetCoinAt(val OptDateTime) { s.CoinAt = val } +// SetPlanet sets the value of Planet. +func (s *UpdateUserReq) SetPlanet(val OptInt) { + s.Planet = val +} + +// SetPlanetAt sets the value of PlanetAt. +func (s *UpdateUserReq) SetPlanetAt(val OptDateTime) { + s.PlanetAt = val +} + +// SetLogin sets the value of Login. +func (s *UpdateUserReq) SetLogin(val OptBool) { + s.Login = val +} + +// SetLoginAt sets the value of LoginAt. +func (s *UpdateUserReq) SetLoginAt(val OptDateTime) { + s.LoginAt = val +} + +// SetLocationX sets the value of LocationX. +func (s *UpdateUserReq) SetLocationX(val OptInt) { + s.LocationX = val +} + +// SetLocationY sets the value of LocationY. +func (s *UpdateUserReq) SetLocationY(val OptInt) { + s.LocationY = val +} + +// SetLocationZ sets the value of LocationZ. +func (s *UpdateUserReq) SetLocationZ(val OptInt) { + s.LocationZ = val +} + +// SetLocationN sets the value of LocationN. +func (s *UpdateUserReq) SetLocationN(val OptInt) { + s.LocationN = val +} + // SetCard sets the value of Card. func (s *UpdateUserReq) SetCard(val []int) { s.Card = val @@ -9503,6 +10119,14 @@ type UserCreate struct { Coin OptInt `json:"coin"` CoinOpen OptBool `json:"coin_open"` CoinAt OptDateTime `json:"coin_at"` + Planet OptInt `json:"planet"` + PlanetAt OptDateTime `json:"planet_at"` + Login OptBool `json:"login"` + LoginAt OptDateTime `json:"login_at"` + LocationX OptInt `json:"location_x"` + LocationY OptInt `json:"location_y"` + LocationZ OptInt `json:"location_z"` + LocationN OptInt `json:"location_n"` } // GetID returns the value of ID. @@ -9765,6 +10389,46 @@ func (s *UserCreate) GetCoinAt() OptDateTime { return s.CoinAt } +// GetPlanet returns the value of Planet. +func (s *UserCreate) GetPlanet() OptInt { + return s.Planet +} + +// GetPlanetAt returns the value of PlanetAt. +func (s *UserCreate) GetPlanetAt() OptDateTime { + return s.PlanetAt +} + +// GetLogin returns the value of Login. +func (s *UserCreate) GetLogin() OptBool { + return s.Login +} + +// GetLoginAt returns the value of LoginAt. +func (s *UserCreate) GetLoginAt() OptDateTime { + return s.LoginAt +} + +// GetLocationX returns the value of LocationX. +func (s *UserCreate) GetLocationX() OptInt { + return s.LocationX +} + +// GetLocationY returns the value of LocationY. +func (s *UserCreate) GetLocationY() OptInt { + return s.LocationY +} + +// GetLocationZ returns the value of LocationZ. +func (s *UserCreate) GetLocationZ() OptInt { + return s.LocationZ +} + +// GetLocationN returns the value of LocationN. +func (s *UserCreate) GetLocationN() OptInt { + return s.LocationN +} + // SetID sets the value of ID. func (s *UserCreate) SetID(val int) { s.ID = val @@ -10025,6 +10689,46 @@ func (s *UserCreate) SetCoinAt(val OptDateTime) { s.CoinAt = val } +// SetPlanet sets the value of Planet. +func (s *UserCreate) SetPlanet(val OptInt) { + s.Planet = val +} + +// SetPlanetAt sets the value of PlanetAt. +func (s *UserCreate) SetPlanetAt(val OptDateTime) { + s.PlanetAt = val +} + +// SetLogin sets the value of Login. +func (s *UserCreate) SetLogin(val OptBool) { + s.Login = val +} + +// SetLoginAt sets the value of LoginAt. +func (s *UserCreate) SetLoginAt(val OptDateTime) { + s.LoginAt = val +} + +// SetLocationX sets the value of LocationX. +func (s *UserCreate) SetLocationX(val OptInt) { + s.LocationX = val +} + +// SetLocationY sets the value of LocationY. +func (s *UserCreate) SetLocationY(val OptInt) { + s.LocationY = val +} + +// SetLocationZ sets the value of LocationZ. +func (s *UserCreate) SetLocationZ(val OptInt) { + s.LocationZ = val +} + +// SetLocationN sets the value of LocationN. +func (s *UserCreate) SetLocationN(val OptInt) { + s.LocationN = val +} + func (*UserCreate) createUserRes() {} // Ref: #/components/schemas/UserList @@ -10081,6 +10785,14 @@ type UserList struct { Coin OptInt `json:"coin"` CoinOpen OptBool `json:"coin_open"` CoinAt OptDateTime `json:"coin_at"` + Planet OptInt `json:"planet"` + PlanetAt OptDateTime `json:"planet_at"` + Login OptBool `json:"login"` + LoginAt OptDateTime `json:"login_at"` + LocationX OptInt `json:"location_x"` + LocationY OptInt `json:"location_y"` + LocationZ OptInt `json:"location_z"` + LocationN OptInt `json:"location_n"` } // GetID returns the value of ID. @@ -10343,6 +11055,46 @@ func (s *UserList) GetCoinAt() OptDateTime { return s.CoinAt } +// GetPlanet returns the value of Planet. +func (s *UserList) GetPlanet() OptInt { + return s.Planet +} + +// GetPlanetAt returns the value of PlanetAt. +func (s *UserList) GetPlanetAt() OptDateTime { + return s.PlanetAt +} + +// GetLogin returns the value of Login. +func (s *UserList) GetLogin() OptBool { + return s.Login +} + +// GetLoginAt returns the value of LoginAt. +func (s *UserList) GetLoginAt() OptDateTime { + return s.LoginAt +} + +// GetLocationX returns the value of LocationX. +func (s *UserList) GetLocationX() OptInt { + return s.LocationX +} + +// GetLocationY returns the value of LocationY. +func (s *UserList) GetLocationY() OptInt { + return s.LocationY +} + +// GetLocationZ returns the value of LocationZ. +func (s *UserList) GetLocationZ() OptInt { + return s.LocationZ +} + +// GetLocationN returns the value of LocationN. +func (s *UserList) GetLocationN() OptInt { + return s.LocationN +} + // SetID sets the value of ID. func (s *UserList) SetID(val int) { s.ID = val @@ -10603,6 +11355,46 @@ func (s *UserList) SetCoinAt(val OptDateTime) { s.CoinAt = val } +// SetPlanet sets the value of Planet. +func (s *UserList) SetPlanet(val OptInt) { + s.Planet = val +} + +// SetPlanetAt sets the value of PlanetAt. +func (s *UserList) SetPlanetAt(val OptDateTime) { + s.PlanetAt = val +} + +// SetLogin sets the value of Login. +func (s *UserList) SetLogin(val OptBool) { + s.Login = val +} + +// SetLoginAt sets the value of LoginAt. +func (s *UserList) SetLoginAt(val OptDateTime) { + s.LoginAt = val +} + +// SetLocationX sets the value of LocationX. +func (s *UserList) SetLocationX(val OptInt) { + s.LocationX = val +} + +// SetLocationY sets the value of LocationY. +func (s *UserList) SetLocationY(val OptInt) { + s.LocationY = val +} + +// SetLocationZ sets the value of LocationZ. +func (s *UserList) SetLocationZ(val OptInt) { + s.LocationZ = val +} + +// SetLocationN sets the value of LocationN. +func (s *UserList) SetLocationN(val OptInt) { + s.LocationN = val +} + // Ref: #/components/schemas/User_MaList type UserMaList struct { ID int `json:"id"` @@ -10903,6 +11695,14 @@ type UserRead struct { Coin OptInt `json:"coin"` CoinOpen OptBool `json:"coin_open"` CoinAt OptDateTime `json:"coin_at"` + Planet OptInt `json:"planet"` + PlanetAt OptDateTime `json:"planet_at"` + Login OptBool `json:"login"` + LoginAt OptDateTime `json:"login_at"` + LocationX OptInt `json:"location_x"` + LocationY OptInt `json:"location_y"` + LocationZ OptInt `json:"location_z"` + LocationN OptInt `json:"location_n"` } // GetID returns the value of ID. @@ -11165,6 +11965,46 @@ func (s *UserRead) GetCoinAt() OptDateTime { return s.CoinAt } +// GetPlanet returns the value of Planet. +func (s *UserRead) GetPlanet() OptInt { + return s.Planet +} + +// GetPlanetAt returns the value of PlanetAt. +func (s *UserRead) GetPlanetAt() OptDateTime { + return s.PlanetAt +} + +// GetLogin returns the value of Login. +func (s *UserRead) GetLogin() OptBool { + return s.Login +} + +// GetLoginAt returns the value of LoginAt. +func (s *UserRead) GetLoginAt() OptDateTime { + return s.LoginAt +} + +// GetLocationX returns the value of LocationX. +func (s *UserRead) GetLocationX() OptInt { + return s.LocationX +} + +// GetLocationY returns the value of LocationY. +func (s *UserRead) GetLocationY() OptInt { + return s.LocationY +} + +// GetLocationZ returns the value of LocationZ. +func (s *UserRead) GetLocationZ() OptInt { + return s.LocationZ +} + +// GetLocationN returns the value of LocationN. +func (s *UserRead) GetLocationN() OptInt { + return s.LocationN +} + // SetID sets the value of ID. func (s *UserRead) SetID(val int) { s.ID = val @@ -11425,6 +12265,46 @@ func (s *UserRead) SetCoinAt(val OptDateTime) { s.CoinAt = val } +// SetPlanet sets the value of Planet. +func (s *UserRead) SetPlanet(val OptInt) { + s.Planet = val +} + +// SetPlanetAt sets the value of PlanetAt. +func (s *UserRead) SetPlanetAt(val OptDateTime) { + s.PlanetAt = val +} + +// SetLogin sets the value of Login. +func (s *UserRead) SetLogin(val OptBool) { + s.Login = val +} + +// SetLoginAt sets the value of LoginAt. +func (s *UserRead) SetLoginAt(val OptDateTime) { + s.LoginAt = val +} + +// SetLocationX sets the value of LocationX. +func (s *UserRead) SetLocationX(val OptInt) { + s.LocationX = val +} + +// SetLocationY sets the value of LocationY. +func (s *UserRead) SetLocationY(val OptInt) { + s.LocationY = val +} + +// SetLocationZ sets the value of LocationZ. +func (s *UserRead) SetLocationZ(val OptInt) { + s.LocationZ = val +} + +// SetLocationN sets the value of LocationN. +func (s *UserRead) SetLocationN(val OptInt) { + s.LocationN = val +} + func (*UserRead) readUserRes() {} // Ref: #/components/schemas/User_SevList @@ -11863,6 +12743,14 @@ type UserUpdate struct { Coin OptInt `json:"coin"` CoinOpen OptBool `json:"coin_open"` CoinAt OptDateTime `json:"coin_at"` + Planet OptInt `json:"planet"` + PlanetAt OptDateTime `json:"planet_at"` + Login OptBool `json:"login"` + LoginAt OptDateTime `json:"login_at"` + LocationX OptInt `json:"location_x"` + LocationY OptInt `json:"location_y"` + LocationZ OptInt `json:"location_z"` + LocationN OptInt `json:"location_n"` } // GetID returns the value of ID. @@ -12125,6 +13013,46 @@ func (s *UserUpdate) GetCoinAt() OptDateTime { return s.CoinAt } +// GetPlanet returns the value of Planet. +func (s *UserUpdate) GetPlanet() OptInt { + return s.Planet +} + +// GetPlanetAt returns the value of PlanetAt. +func (s *UserUpdate) GetPlanetAt() OptDateTime { + return s.PlanetAt +} + +// GetLogin returns the value of Login. +func (s *UserUpdate) GetLogin() OptBool { + return s.Login +} + +// GetLoginAt returns the value of LoginAt. +func (s *UserUpdate) GetLoginAt() OptDateTime { + return s.LoginAt +} + +// GetLocationX returns the value of LocationX. +func (s *UserUpdate) GetLocationX() OptInt { + return s.LocationX +} + +// GetLocationY returns the value of LocationY. +func (s *UserUpdate) GetLocationY() OptInt { + return s.LocationY +} + +// GetLocationZ returns the value of LocationZ. +func (s *UserUpdate) GetLocationZ() OptInt { + return s.LocationZ +} + +// GetLocationN returns the value of LocationN. +func (s *UserUpdate) GetLocationN() OptInt { + return s.LocationN +} + // SetID sets the value of ID. func (s *UserUpdate) SetID(val int) { s.ID = val @@ -12385,4 +13313,44 @@ func (s *UserUpdate) SetCoinAt(val OptDateTime) { s.CoinAt = val } +// SetPlanet sets the value of Planet. +func (s *UserUpdate) SetPlanet(val OptInt) { + s.Planet = val +} + +// SetPlanetAt sets the value of PlanetAt. +func (s *UserUpdate) SetPlanetAt(val OptDateTime) { + s.PlanetAt = val +} + +// SetLogin sets the value of Login. +func (s *UserUpdate) SetLogin(val OptBool) { + s.Login = val +} + +// SetLoginAt sets the value of LoginAt. +func (s *UserUpdate) SetLoginAt(val OptDateTime) { + s.LoginAt = val +} + +// SetLocationX sets the value of LocationX. +func (s *UserUpdate) SetLocationX(val OptInt) { + s.LocationX = val +} + +// SetLocationY sets the value of LocationY. +func (s *UserUpdate) SetLocationY(val OptInt) { + s.LocationY = val +} + +// SetLocationZ sets the value of LocationZ. +func (s *UserUpdate) SetLocationZ(val OptInt) { + s.LocationZ = val +} + +// SetLocationN sets the value of LocationN. +func (s *UserUpdate) SetLocationN(val OptInt) { + s.LocationN = val +} + func (*UserUpdate) updateUserRes() {} diff --git a/ent/ogent/ogent.go b/ent/ogent/ogent.go index 5df8ecb..df6c765 100644 --- a/ent/ogent/ogent.go +++ b/ent/ogent/ogent.go @@ -1613,6 +1613,31 @@ func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (Crea if v, ok := req.CoinAt.Get(); ok { b.SetCoinAt(v) } + if v, ok := req.Planet.Get(); ok { + b.SetPlanet(v) + } + if v, ok := req.PlanetAt.Get(); ok { + b.SetPlanetAt(v) + } + if v, ok := req.Login.Get(); ok { + b.SetLogin(v) + } + if v, ok := req.LoginAt.Get(); ok { + b.SetLoginAt(v) + } + if v, ok := req.LocationX.Get(); ok { + b.SetLocationX(v) + } + if v, ok := req.LocationY.Get(); ok { + b.SetLocationY(v) + } + if v, ok := req.LocationZ.Get(); ok { + b.SetLocationZ(v) + } + if v, ok := req.LocationN.Get(); ok { + b.SetLocationN(v) + } + // Add all edges. b.AddCardIDs(req.Card...) b.AddUeIDs(req.Ue...) @@ -1831,6 +1856,31 @@ func (h *OgentHandler) UpdateUser(ctx context.Context, req *UpdateUserReq, param if v, ok := req.CoinAt.Get(); ok { b.SetCoinAt(v) } + if v, ok := req.Planet.Get(); ok { + b.SetPlanet(v) + } + if v, ok := req.PlanetAt.Get(); ok { + b.SetPlanetAt(v) + } + if v, ok := req.Login.Get(); ok { + b.SetLogin(v) + } + if v, ok := req.LoginAt.Get(); ok { + b.SetLoginAt(v) + } + if v, ok := req.LocationX.Get(); ok { + b.SetLocationX(v) + } + if v, ok := req.LocationY.Get(); ok { + b.SetLocationY(v) + } + if v, ok := req.LocationZ.Get(); ok { + b.SetLocationZ(v) + } + if v, ok := req.LocationN.Get(); ok { + b.SetLocationN(v) + } + // Add all edges. if req.Card != nil { b.ClearCard().AddCardIDs(req.Card...) diff --git a/ent/ogent/responses.go b/ent/ogent/responses.go index 014a73c..36415a2 100644 --- a/ent/ogent/responses.go +++ b/ent/ogent/responses.go @@ -201,6 +201,14 @@ func NewCardOwnerRead(e *ent.User) *CardOwnerRead { ret.Coin = NewOptInt(e.Coin) ret.CoinOpen = NewOptBool(e.CoinOpen) ret.CoinAt = NewOptDateTime(e.CoinAt) + ret.Planet = NewOptInt(e.Planet) + ret.PlanetAt = NewOptDateTime(e.PlanetAt) + ret.Login = NewOptBool(e.Login) + ret.LoginAt = NewOptDateTime(e.LoginAt) + ret.LocationX = NewOptInt(e.LocationX) + ret.LocationY = NewOptInt(e.LocationY) + ret.LocationZ = NewOptInt(e.LocationZ) + ret.LocationN = NewOptInt(e.LocationN) return &ret } @@ -391,6 +399,14 @@ func NewGroupUsersList(e *ent.User) *GroupUsersList { ret.Coin = NewOptInt(e.Coin) ret.CoinOpen = NewOptBool(e.CoinOpen) ret.CoinAt = NewOptDateTime(e.CoinAt) + ret.Planet = NewOptInt(e.Planet) + ret.PlanetAt = NewOptDateTime(e.PlanetAt) + ret.Login = NewOptBool(e.Login) + ret.LoginAt = NewOptDateTime(e.LoginAt) + ret.LocationX = NewOptInt(e.LocationX) + ret.LocationY = NewOptInt(e.LocationY) + ret.LocationZ = NewOptInt(e.LocationZ) + ret.LocationN = NewOptInt(e.LocationN) return &ret } @@ -661,6 +677,14 @@ func NewMaOwnerRead(e *ent.User) *MaOwnerRead { ret.Coin = NewOptInt(e.Coin) ret.CoinOpen = NewOptBool(e.CoinOpen) ret.CoinAt = NewOptDateTime(e.CoinAt) + ret.Planet = NewOptInt(e.Planet) + ret.PlanetAt = NewOptDateTime(e.PlanetAt) + ret.Login = NewOptBool(e.Login) + ret.LoginAt = NewOptDateTime(e.LoginAt) + ret.LocationX = NewOptInt(e.LocationX) + ret.LocationY = NewOptInt(e.LocationY) + ret.LocationZ = NewOptInt(e.LocationZ) + ret.LocationN = NewOptInt(e.LocationN) return &ret } @@ -887,6 +911,14 @@ func NewSevOwnerRead(e *ent.User) *SevOwnerRead { ret.Coin = NewOptInt(e.Coin) ret.CoinOpen = NewOptBool(e.CoinOpen) ret.CoinAt = NewOptDateTime(e.CoinAt) + ret.Planet = NewOptInt(e.Planet) + ret.PlanetAt = NewOptDateTime(e.PlanetAt) + ret.Login = NewOptBool(e.Login) + ret.LoginAt = NewOptDateTime(e.LoginAt) + ret.LocationX = NewOptInt(e.LocationX) + ret.LocationY = NewOptInt(e.LocationY) + ret.LocationZ = NewOptInt(e.LocationZ) + ret.LocationN = NewOptInt(e.LocationN) return &ret } @@ -1161,6 +1193,14 @@ func NewUeOwnerRead(e *ent.User) *UeOwnerRead { ret.Coin = NewOptInt(e.Coin) ret.CoinOpen = NewOptBool(e.CoinOpen) ret.CoinAt = NewOptDateTime(e.CoinAt) + ret.Planet = NewOptInt(e.Planet) + ret.PlanetAt = NewOptDateTime(e.PlanetAt) + ret.Login = NewOptBool(e.Login) + ret.LoginAt = NewOptDateTime(e.LoginAt) + ret.LocationX = NewOptInt(e.LocationX) + ret.LocationY = NewOptInt(e.LocationY) + ret.LocationZ = NewOptInt(e.LocationZ) + ret.LocationN = NewOptInt(e.LocationN) return &ret } @@ -1239,6 +1279,14 @@ func NewUserCreate(e *ent.User) *UserCreate { ret.Coin = NewOptInt(e.Coin) ret.CoinOpen = NewOptBool(e.CoinOpen) ret.CoinAt = NewOptDateTime(e.CoinAt) + ret.Planet = NewOptInt(e.Planet) + ret.PlanetAt = NewOptDateTime(e.PlanetAt) + ret.Login = NewOptBool(e.Login) + ret.LoginAt = NewOptDateTime(e.LoginAt) + ret.LocationX = NewOptInt(e.LocationX) + ret.LocationY = NewOptInt(e.LocationY) + ret.LocationZ = NewOptInt(e.LocationZ) + ret.LocationN = NewOptInt(e.LocationN) return &ret } @@ -1317,6 +1365,14 @@ func NewUserList(e *ent.User) *UserList { ret.Coin = NewOptInt(e.Coin) ret.CoinOpen = NewOptBool(e.CoinOpen) ret.CoinAt = NewOptDateTime(e.CoinAt) + ret.Planet = NewOptInt(e.Planet) + ret.PlanetAt = NewOptDateTime(e.PlanetAt) + ret.Login = NewOptBool(e.Login) + ret.LoginAt = NewOptDateTime(e.LoginAt) + ret.LocationX = NewOptInt(e.LocationX) + ret.LocationY = NewOptInt(e.LocationY) + ret.LocationZ = NewOptInt(e.LocationZ) + ret.LocationN = NewOptInt(e.LocationN) return &ret } @@ -1395,6 +1451,14 @@ func NewUserRead(e *ent.User) *UserRead { ret.Coin = NewOptInt(e.Coin) ret.CoinOpen = NewOptBool(e.CoinOpen) ret.CoinAt = NewOptDateTime(e.CoinAt) + ret.Planet = NewOptInt(e.Planet) + ret.PlanetAt = NewOptDateTime(e.PlanetAt) + ret.Login = NewOptBool(e.Login) + ret.LoginAt = NewOptDateTime(e.LoginAt) + ret.LocationX = NewOptInt(e.LocationX) + ret.LocationY = NewOptInt(e.LocationY) + ret.LocationZ = NewOptInt(e.LocationZ) + ret.LocationN = NewOptInt(e.LocationN) return &ret } @@ -1473,6 +1537,14 @@ func NewUserUpdate(e *ent.User) *UserUpdate { ret.Coin = NewOptInt(e.Coin) ret.CoinOpen = NewOptBool(e.CoinOpen) ret.CoinAt = NewOptDateTime(e.CoinAt) + ret.Planet = NewOptInt(e.Planet) + ret.PlanetAt = NewOptDateTime(e.PlanetAt) + ret.Login = NewOptBool(e.Login) + ret.LoginAt = NewOptDateTime(e.LoginAt) + ret.LocationX = NewOptInt(e.LocationX) + ret.LocationY = NewOptInt(e.LocationY) + ret.LocationZ = NewOptInt(e.LocationZ) + ret.LocationN = NewOptInt(e.LocationN) return &ret } diff --git a/ent/openapi.json b/ent/openapi.json index 907303c..aa8888b 100644 --- a/ent/openapi.json +++ b/ent/openapi.json @@ -30,7 +30,7 @@ "description": "item count to render per page", "schema": { "type": "integer", - "maximum": 5000, + "maximum": 10000, "minimum": 1 } } @@ -402,7 +402,7 @@ "description": "item count to render per page", "schema": { "type": "integer", - "maximum": 5000, + "maximum": 10000, "minimum": 1 } } @@ -728,7 +728,7 @@ "description": "item count to render per page", "schema": { "type": "integer", - "maximum": 5000, + "maximum": 10000, "minimum": 1 } } @@ -1155,7 +1155,7 @@ "description": "item count to render per page", "schema": { "type": "integer", - "maximum": 5000, + "maximum": 10000, "minimum": 1 } } @@ -1516,7 +1516,7 @@ "description": "item count to render per page", "schema": { "type": "integer", - "maximum": 5000, + "maximum": 10000, "minimum": 1 } } @@ -1947,7 +1947,7 @@ "description": "item count to render per page", "schema": { "type": "integer", - "maximum": 5000, + "maximum": 10000, "minimum": 1 } } @@ -2163,6 +2163,32 @@ "type": "string", "format": "date-time" }, + "planet": { + "type": "integer" + }, + "planet_at": { + "type": "string", + "format": "date-time" + }, + "login": { + "type": "boolean" + }, + "login_at": { + "type": "string", + "format": "date-time" + }, + "location_x": { + "type": "integer" + }, + "location_y": { + "type": "integer" + }, + "location_z": { + "type": "integer" + }, + "location_n": { + "type": "integer" + }, "card": { "type": "array", "items": { @@ -2484,6 +2510,32 @@ "type": "string", "format": "date-time" }, + "planet": { + "type": "integer" + }, + "planet_at": { + "type": "string", + "format": "date-time" + }, + "login": { + "type": "boolean" + }, + "login_at": { + "type": "string", + "format": "date-time" + }, + "location_x": { + "type": "integer" + }, + "location_y": { + "type": "integer" + }, + "location_z": { + "type": "integer" + }, + "location_n": { + "type": "integer" + }, "card": { "type": "array", "items": { @@ -3183,6 +3235,32 @@ "coin_at": { "type": "string", "format": "date-time" + }, + "planet": { + "type": "integer" + }, + "planet_at": { + "type": "string", + "format": "date-time" + }, + "login": { + "type": "boolean" + }, + "login_at": { + "type": "string", + "format": "date-time" + }, + "location_x": { + "type": "integer" + }, + "location_y": { + "type": "integer" + }, + "location_z": { + "type": "integer" + }, + "location_n": { + "type": "integer" } }, "required": [ @@ -3443,6 +3521,32 @@ "coin_at": { "type": "string", "format": "date-time" + }, + "planet": { + "type": "integer" + }, + "planet_at": { + "type": "string", + "format": "date-time" + }, + "login": { + "type": "boolean" + }, + "login_at": { + "type": "string", + "format": "date-time" + }, + "location_x": { + "type": "integer" + }, + "location_y": { + "type": "integer" + }, + "location_z": { + "type": "integer" + }, + "location_n": { + "type": "integer" } }, "required": [ @@ -4009,6 +4113,32 @@ "coin_at": { "type": "string", "format": "date-time" + }, + "planet": { + "type": "integer" + }, + "planet_at": { + "type": "string", + "format": "date-time" + }, + "login": { + "type": "boolean" + }, + "login_at": { + "type": "string", + "format": "date-time" + }, + "location_x": { + "type": "integer" + }, + "location_y": { + "type": "integer" + }, + "location_z": { + "type": "integer" + }, + "location_n": { + "type": "integer" } }, "required": [ @@ -4410,6 +4540,32 @@ "coin_at": { "type": "string", "format": "date-time" + }, + "planet": { + "type": "integer" + }, + "planet_at": { + "type": "string", + "format": "date-time" + }, + "login": { + "type": "boolean" + }, + "login_at": { + "type": "string", + "format": "date-time" + }, + "location_x": { + "type": "integer" + }, + "location_y": { + "type": "integer" + }, + "location_z": { + "type": "integer" + }, + "location_n": { + "type": "integer" } }, "required": [ @@ -4986,6 +5142,32 @@ "coin_at": { "type": "string", "format": "date-time" + }, + "planet": { + "type": "integer" + }, + "planet_at": { + "type": "string", + "format": "date-time" + }, + "login": { + "type": "boolean" + }, + "login_at": { + "type": "string", + "format": "date-time" + }, + "location_x": { + "type": "integer" + }, + "location_y": { + "type": "integer" + }, + "location_z": { + "type": "integer" + }, + "location_n": { + "type": "integer" } }, "required": [ @@ -5168,6 +5350,32 @@ "type": "string", "format": "date-time" }, + "planet": { + "type": "integer" + }, + "planet_at": { + "type": "string", + "format": "date-time" + }, + "login": { + "type": "boolean" + }, + "login_at": { + "type": "string", + "format": "date-time" + }, + "location_x": { + "type": "integer" + }, + "location_y": { + "type": "integer" + }, + "location_z": { + "type": "integer" + }, + "location_n": { + "type": "integer" + }, "card": { "type": "array", "items": { @@ -5367,6 +5575,32 @@ "coin_at": { "type": "string", "format": "date-time" + }, + "planet": { + "type": "integer" + }, + "planet_at": { + "type": "string", + "format": "date-time" + }, + "login": { + "type": "boolean" + }, + "login_at": { + "type": "string", + "format": "date-time" + }, + "location_x": { + "type": "integer" + }, + "location_y": { + "type": "integer" + }, + "location_z": { + "type": "integer" + }, + "location_n": { + "type": "integer" } }, "required": [ @@ -5542,6 +5776,32 @@ "coin_at": { "type": "string", "format": "date-time" + }, + "planet": { + "type": "integer" + }, + "planet_at": { + "type": "string", + "format": "date-time" + }, + "login": { + "type": "boolean" + }, + "login_at": { + "type": "string", + "format": "date-time" + }, + "location_x": { + "type": "integer" + }, + "location_y": { + "type": "integer" + }, + "location_z": { + "type": "integer" + }, + "location_n": { + "type": "integer" } }, "required": [ @@ -5717,6 +5977,32 @@ "coin_at": { "type": "string", "format": "date-time" + }, + "planet": { + "type": "integer" + }, + "planet_at": { + "type": "string", + "format": "date-time" + }, + "login": { + "type": "boolean" + }, + "login_at": { + "type": "string", + "format": "date-time" + }, + "location_x": { + "type": "integer" + }, + "location_y": { + "type": "integer" + }, + "location_z": { + "type": "integer" + }, + "location_n": { + "type": "integer" } }, "required": [ @@ -5892,6 +6178,32 @@ "coin_at": { "type": "string", "format": "date-time" + }, + "planet": { + "type": "integer" + }, + "planet_at": { + "type": "string", + "format": "date-time" + }, + "login": { + "type": "boolean" + }, + "login_at": { + "type": "string", + "format": "date-time" + }, + "location_x": { + "type": "integer" + }, + "location_y": { + "type": "integer" + }, + "location_z": { + "type": "integer" + }, + "location_n": { + "type": "integer" } }, "required": [ diff --git a/ent/runtime.go b/ent/runtime.go index be3e42f..8ee4d75 100644 --- a/ent/runtime.go +++ b/ent/runtime.go @@ -227,4 +227,16 @@ func init() { userDescCoinAt := userFields[52].Descriptor() // user.DefaultCoinAt holds the default value on creation for the coin_at field. user.DefaultCoinAt = userDescCoinAt.Default.(func() time.Time) + // userDescPlanetAt is the schema descriptor for planet_at field. + userDescPlanetAt := userFields[54].Descriptor() + // user.DefaultPlanetAt holds the default value on creation for the planet_at field. + user.DefaultPlanetAt = userDescPlanetAt.Default.(func() time.Time) + // userDescLogin is the schema descriptor for login field. + userDescLogin := userFields[55].Descriptor() + // user.DefaultLogin holds the default value on creation for the login field. + user.DefaultLogin = userDescLogin.Default.(bool) + // userDescLoginAt is the schema descriptor for login_at field. + userDescLoginAt := userFields[56].Descriptor() + // user.DefaultLoginAt holds the default value on creation for the login_at field. + user.DefaultLoginAt = userDescLoginAt.Default.(func() time.Time) } diff --git a/ent/schema/user.go b/ent/schema/user.go index 29a4cbb..0d3ad01 100644 --- a/ent/schema/user.go +++ b/ent/schema/user.go @@ -241,6 +241,37 @@ func (User) Fields() []ent.Field { return time.Now().In(jst) }), + field.Int("planet"). + Optional(), + + field.Time("planet_at"). + Optional(). + Default(func() time.Time { + return time.Now().In(jst) + }), + + field.Bool("login"). + Default(false). + Optional(), + + field.Time("login_at"). + Optional(). + Default(func() time.Time { + return time.Now().In(jst) + }), + + field.Int("location_x"). + Optional(), + + field.Int("location_y"). + Optional(), + + field.Int("location_z"). + Optional(), + + field.Int("location_n"). + Optional(), + } } diff --git a/ent/user.go b/ent/user.go index 52e5492..878a30c 100644 --- a/ent/user.go +++ b/ent/user.go @@ -123,6 +123,22 @@ type User struct { CoinOpen bool `json:"coin_open,omitempty"` // CoinAt holds the value of the "coin_at" field. CoinAt time.Time `json:"coin_at,omitempty"` + // Planet holds the value of the "planet" field. + Planet int `json:"planet,omitempty"` + // PlanetAt holds the value of the "planet_at" field. + PlanetAt time.Time `json:"planet_at,omitempty"` + // Login holds the value of the "login" field. + Login bool `json:"login,omitempty"` + // LoginAt holds the value of the "login_at" field. + LoginAt time.Time `json:"login_at,omitempty"` + // LocationX holds the value of the "location_x" field. + LocationX int `json:"location_x,omitempty"` + // LocationY holds the value of the "location_y" field. + LocationY int `json:"location_y,omitempty"` + // LocationZ holds the value of the "location_z" field. + LocationZ int `json:"location_z,omitempty"` + // LocationN holds the value of the "location_n" field. + LocationN int `json:"location_n,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the UserQuery when eager-loading is set. Edges UserEdges `json:"edges"` @@ -186,13 +202,13 @@ 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.FieldGameLimit, 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, user.FieldLogin: 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.FieldGameStory, 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, user.FieldPlanet, user.FieldLocationX, user.FieldLocationY, user.FieldLocationZ, user.FieldLocationN: 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) - case user.FieldCreatedAt, user.FieldUpdatedAt, user.FieldRaidAt, user.FieldServerAt, user.FieldEggAt, user.FieldLuckAt, user.FieldLikeAt, user.FieldTenAt, user.FieldModelAt, user.FieldCoinAt: + case user.FieldCreatedAt, user.FieldUpdatedAt, user.FieldRaidAt, user.FieldServerAt, user.FieldEggAt, user.FieldLuckAt, user.FieldLikeAt, user.FieldTenAt, user.FieldModelAt, user.FieldCoinAt, user.FieldPlanetAt, user.FieldLoginAt: values[i] = new(sql.NullTime) case user.ForeignKeys[0]: // group_users values[i] = new(sql.NullInt64) @@ -535,6 +551,54 @@ func (u *User) assignValues(columns []string, values []any) error { } else if value.Valid { u.CoinAt = value.Time } + case user.FieldPlanet: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field planet", values[i]) + } else if value.Valid { + u.Planet = int(value.Int64) + } + case user.FieldPlanetAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field planet_at", values[i]) + } else if value.Valid { + u.PlanetAt = value.Time + } + case user.FieldLogin: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field login", values[i]) + } else if value.Valid { + u.Login = value.Bool + } + case user.FieldLoginAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field login_at", values[i]) + } else if value.Valid { + u.LoginAt = value.Time + } + case user.FieldLocationX: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field location_x", values[i]) + } else if value.Valid { + u.LocationX = int(value.Int64) + } + case user.FieldLocationY: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field location_y", values[i]) + } else if value.Valid { + u.LocationY = int(value.Int64) + } + case user.FieldLocationZ: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field location_z", values[i]) + } else if value.Valid { + u.LocationZ = int(value.Int64) + } + case user.FieldLocationN: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field location_n", values[i]) + } else if value.Valid { + u.LocationN = int(value.Int64) + } case user.ForeignKeys[0]: if value, ok := values[i].(*sql.NullInt64); !ok { return fmt.Errorf("unexpected type %T for edge-field group_users", value) @@ -754,6 +818,30 @@ func (u *User) String() string { builder.WriteString(", ") builder.WriteString("coin_at=") builder.WriteString(u.CoinAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("planet=") + builder.WriteString(fmt.Sprintf("%v", u.Planet)) + builder.WriteString(", ") + builder.WriteString("planet_at=") + builder.WriteString(u.PlanetAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("login=") + builder.WriteString(fmt.Sprintf("%v", u.Login)) + builder.WriteString(", ") + builder.WriteString("login_at=") + builder.WriteString(u.LoginAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("location_x=") + builder.WriteString(fmt.Sprintf("%v", u.LocationX)) + builder.WriteString(", ") + builder.WriteString("location_y=") + builder.WriteString(fmt.Sprintf("%v", u.LocationY)) + builder.WriteString(", ") + builder.WriteString("location_z=") + builder.WriteString(fmt.Sprintf("%v", u.LocationZ)) + builder.WriteString(", ") + builder.WriteString("location_n=") + builder.WriteString(fmt.Sprintf("%v", u.LocationN)) builder.WriteByte(')') return builder.String() } diff --git a/ent/user/user.go b/ent/user/user.go index df915c7..6c74c0d 100644 --- a/ent/user/user.go +++ b/ent/user/user.go @@ -120,6 +120,22 @@ const ( FieldCoinOpen = "coin_open" // FieldCoinAt holds the string denoting the coin_at field in the database. FieldCoinAt = "coin_at" + // FieldPlanet holds the string denoting the planet field in the database. + FieldPlanet = "planet" + // FieldPlanetAt holds the string denoting the planet_at field in the database. + FieldPlanetAt = "planet_at" + // FieldLogin holds the string denoting the login field in the database. + FieldLogin = "login" + // FieldLoginAt holds the string denoting the login_at field in the database. + FieldLoginAt = "login_at" + // FieldLocationX holds the string denoting the location_x field in the database. + FieldLocationX = "location_x" + // FieldLocationY holds the string denoting the location_y field in the database. + FieldLocationY = "location_y" + // FieldLocationZ holds the string denoting the location_z field in the database. + FieldLocationZ = "location_z" + // FieldLocationN holds the string denoting the location_n field in the database. + FieldLocationN = "location_n" // EdgeCard holds the string denoting the card edge name in mutations. EdgeCard = "card" // EdgeUe holds the string denoting the ue edge name in mutations. @@ -216,6 +232,14 @@ var Columns = []string{ FieldCoin, FieldCoinOpen, FieldCoinAt, + FieldPlanet, + FieldPlanetAt, + FieldLogin, + FieldLoginAt, + FieldLocationX, + FieldLocationY, + FieldLocationZ, + FieldLocationN, } // ForeignKeys holds the SQL foreign-keys that are owned by the "users" @@ -294,6 +318,12 @@ var ( DefaultCoinOpen bool // DefaultCoinAt holds the default value on creation for the "coin_at" field. DefaultCoinAt func() time.Time + // DefaultPlanetAt holds the default value on creation for the "planet_at" field. + DefaultPlanetAt func() time.Time + // DefaultLogin holds the default value on creation for the "login" field. + DefaultLogin bool + // DefaultLoginAt holds the default value on creation for the "login_at" field. + DefaultLoginAt func() time.Time ) // OrderOption defines the ordering options for the User queries. @@ -569,6 +599,46 @@ func ByCoinAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCoinAt, opts...).ToFunc() } +// ByPlanet orders the results by the planet field. +func ByPlanet(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPlanet, opts...).ToFunc() +} + +// ByPlanetAt orders the results by the planet_at field. +func ByPlanetAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPlanetAt, opts...).ToFunc() +} + +// ByLogin orders the results by the login field. +func ByLogin(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLogin, opts...).ToFunc() +} + +// ByLoginAt orders the results by the login_at field. +func ByLoginAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLoginAt, opts...).ToFunc() +} + +// ByLocationX orders the results by the location_x field. +func ByLocationX(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLocationX, opts...).ToFunc() +} + +// ByLocationY orders the results by the location_y field. +func ByLocationY(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLocationY, opts...).ToFunc() +} + +// ByLocationZ orders the results by the location_z field. +func ByLocationZ(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLocationZ, opts...).ToFunc() +} + +// ByLocationN orders the results by the location_n field. +func ByLocationN(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLocationN, opts...).ToFunc() +} + // ByCardCount orders the results by card count. func ByCardCount(opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { diff --git a/ent/user/where.go b/ent/user/where.go index 15a52e7..31b7813 100644 --- a/ent/user/where.go +++ b/ent/user/where.go @@ -320,6 +320,46 @@ func CoinAt(v time.Time) predicate.User { return predicate.User(sql.FieldEQ(FieldCoinAt, v)) } +// Planet applies equality check predicate on the "planet" field. It's identical to PlanetEQ. +func Planet(v int) predicate.User { + return predicate.User(sql.FieldEQ(FieldPlanet, v)) +} + +// PlanetAt applies equality check predicate on the "planet_at" field. It's identical to PlanetAtEQ. +func PlanetAt(v time.Time) predicate.User { + return predicate.User(sql.FieldEQ(FieldPlanetAt, v)) +} + +// Login applies equality check predicate on the "login" field. It's identical to LoginEQ. +func Login(v bool) predicate.User { + return predicate.User(sql.FieldEQ(FieldLogin, v)) +} + +// LoginAt applies equality check predicate on the "login_at" field. It's identical to LoginAtEQ. +func LoginAt(v time.Time) predicate.User { + return predicate.User(sql.FieldEQ(FieldLoginAt, v)) +} + +// LocationX applies equality check predicate on the "location_x" field. It's identical to LocationXEQ. +func LocationX(v int) predicate.User { + return predicate.User(sql.FieldEQ(FieldLocationX, v)) +} + +// LocationY applies equality check predicate on the "location_y" field. It's identical to LocationYEQ. +func LocationY(v int) predicate.User { + return predicate.User(sql.FieldEQ(FieldLocationY, v)) +} + +// LocationZ applies equality check predicate on the "location_z" field. It's identical to LocationZEQ. +func LocationZ(v int) predicate.User { + return predicate.User(sql.FieldEQ(FieldLocationZ, v)) +} + +// LocationN applies equality check predicate on the "location_n" field. It's identical to LocationNEQ. +func LocationN(v int) predicate.User { + return predicate.User(sql.FieldEQ(FieldLocationN, v)) +} + // UsernameEQ applies the EQ predicate on the "username" field. func UsernameEQ(v string) predicate.User { return predicate.User(sql.FieldEQ(FieldUsername, v)) @@ -2695,6 +2735,376 @@ func CoinAtNotNil() predicate.User { return predicate.User(sql.FieldNotNull(FieldCoinAt)) } +// PlanetEQ applies the EQ predicate on the "planet" field. +func PlanetEQ(v int) predicate.User { + return predicate.User(sql.FieldEQ(FieldPlanet, v)) +} + +// PlanetNEQ applies the NEQ predicate on the "planet" field. +func PlanetNEQ(v int) predicate.User { + return predicate.User(sql.FieldNEQ(FieldPlanet, v)) +} + +// PlanetIn applies the In predicate on the "planet" field. +func PlanetIn(vs ...int) predicate.User { + return predicate.User(sql.FieldIn(FieldPlanet, vs...)) +} + +// PlanetNotIn applies the NotIn predicate on the "planet" field. +func PlanetNotIn(vs ...int) predicate.User { + return predicate.User(sql.FieldNotIn(FieldPlanet, vs...)) +} + +// PlanetGT applies the GT predicate on the "planet" field. +func PlanetGT(v int) predicate.User { + return predicate.User(sql.FieldGT(FieldPlanet, v)) +} + +// PlanetGTE applies the GTE predicate on the "planet" field. +func PlanetGTE(v int) predicate.User { + return predicate.User(sql.FieldGTE(FieldPlanet, v)) +} + +// PlanetLT applies the LT predicate on the "planet" field. +func PlanetLT(v int) predicate.User { + return predicate.User(sql.FieldLT(FieldPlanet, v)) +} + +// PlanetLTE applies the LTE predicate on the "planet" field. +func PlanetLTE(v int) predicate.User { + return predicate.User(sql.FieldLTE(FieldPlanet, v)) +} + +// PlanetIsNil applies the IsNil predicate on the "planet" field. +func PlanetIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldPlanet)) +} + +// PlanetNotNil applies the NotNil predicate on the "planet" field. +func PlanetNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldPlanet)) +} + +// PlanetAtEQ applies the EQ predicate on the "planet_at" field. +func PlanetAtEQ(v time.Time) predicate.User { + return predicate.User(sql.FieldEQ(FieldPlanetAt, v)) +} + +// PlanetAtNEQ applies the NEQ predicate on the "planet_at" field. +func PlanetAtNEQ(v time.Time) predicate.User { + return predicate.User(sql.FieldNEQ(FieldPlanetAt, v)) +} + +// PlanetAtIn applies the In predicate on the "planet_at" field. +func PlanetAtIn(vs ...time.Time) predicate.User { + return predicate.User(sql.FieldIn(FieldPlanetAt, vs...)) +} + +// PlanetAtNotIn applies the NotIn predicate on the "planet_at" field. +func PlanetAtNotIn(vs ...time.Time) predicate.User { + return predicate.User(sql.FieldNotIn(FieldPlanetAt, vs...)) +} + +// PlanetAtGT applies the GT predicate on the "planet_at" field. +func PlanetAtGT(v time.Time) predicate.User { + return predicate.User(sql.FieldGT(FieldPlanetAt, v)) +} + +// PlanetAtGTE applies the GTE predicate on the "planet_at" field. +func PlanetAtGTE(v time.Time) predicate.User { + return predicate.User(sql.FieldGTE(FieldPlanetAt, v)) +} + +// PlanetAtLT applies the LT predicate on the "planet_at" field. +func PlanetAtLT(v time.Time) predicate.User { + return predicate.User(sql.FieldLT(FieldPlanetAt, v)) +} + +// PlanetAtLTE applies the LTE predicate on the "planet_at" field. +func PlanetAtLTE(v time.Time) predicate.User { + return predicate.User(sql.FieldLTE(FieldPlanetAt, v)) +} + +// PlanetAtIsNil applies the IsNil predicate on the "planet_at" field. +func PlanetAtIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldPlanetAt)) +} + +// PlanetAtNotNil applies the NotNil predicate on the "planet_at" field. +func PlanetAtNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldPlanetAt)) +} + +// LoginEQ applies the EQ predicate on the "login" field. +func LoginEQ(v bool) predicate.User { + return predicate.User(sql.FieldEQ(FieldLogin, v)) +} + +// LoginNEQ applies the NEQ predicate on the "login" field. +func LoginNEQ(v bool) predicate.User { + return predicate.User(sql.FieldNEQ(FieldLogin, v)) +} + +// LoginIsNil applies the IsNil predicate on the "login" field. +func LoginIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldLogin)) +} + +// LoginNotNil applies the NotNil predicate on the "login" field. +func LoginNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldLogin)) +} + +// LoginAtEQ applies the EQ predicate on the "login_at" field. +func LoginAtEQ(v time.Time) predicate.User { + return predicate.User(sql.FieldEQ(FieldLoginAt, v)) +} + +// LoginAtNEQ applies the NEQ predicate on the "login_at" field. +func LoginAtNEQ(v time.Time) predicate.User { + return predicate.User(sql.FieldNEQ(FieldLoginAt, v)) +} + +// LoginAtIn applies the In predicate on the "login_at" field. +func LoginAtIn(vs ...time.Time) predicate.User { + return predicate.User(sql.FieldIn(FieldLoginAt, vs...)) +} + +// LoginAtNotIn applies the NotIn predicate on the "login_at" field. +func LoginAtNotIn(vs ...time.Time) predicate.User { + return predicate.User(sql.FieldNotIn(FieldLoginAt, vs...)) +} + +// LoginAtGT applies the GT predicate on the "login_at" field. +func LoginAtGT(v time.Time) predicate.User { + return predicate.User(sql.FieldGT(FieldLoginAt, v)) +} + +// LoginAtGTE applies the GTE predicate on the "login_at" field. +func LoginAtGTE(v time.Time) predicate.User { + return predicate.User(sql.FieldGTE(FieldLoginAt, v)) +} + +// LoginAtLT applies the LT predicate on the "login_at" field. +func LoginAtLT(v time.Time) predicate.User { + return predicate.User(sql.FieldLT(FieldLoginAt, v)) +} + +// LoginAtLTE applies the LTE predicate on the "login_at" field. +func LoginAtLTE(v time.Time) predicate.User { + return predicate.User(sql.FieldLTE(FieldLoginAt, v)) +} + +// LoginAtIsNil applies the IsNil predicate on the "login_at" field. +func LoginAtIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldLoginAt)) +} + +// LoginAtNotNil applies the NotNil predicate on the "login_at" field. +func LoginAtNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldLoginAt)) +} + +// LocationXEQ applies the EQ predicate on the "location_x" field. +func LocationXEQ(v int) predicate.User { + return predicate.User(sql.FieldEQ(FieldLocationX, v)) +} + +// LocationXNEQ applies the NEQ predicate on the "location_x" field. +func LocationXNEQ(v int) predicate.User { + return predicate.User(sql.FieldNEQ(FieldLocationX, v)) +} + +// LocationXIn applies the In predicate on the "location_x" field. +func LocationXIn(vs ...int) predicate.User { + return predicate.User(sql.FieldIn(FieldLocationX, vs...)) +} + +// LocationXNotIn applies the NotIn predicate on the "location_x" field. +func LocationXNotIn(vs ...int) predicate.User { + return predicate.User(sql.FieldNotIn(FieldLocationX, vs...)) +} + +// LocationXGT applies the GT predicate on the "location_x" field. +func LocationXGT(v int) predicate.User { + return predicate.User(sql.FieldGT(FieldLocationX, v)) +} + +// LocationXGTE applies the GTE predicate on the "location_x" field. +func LocationXGTE(v int) predicate.User { + return predicate.User(sql.FieldGTE(FieldLocationX, v)) +} + +// LocationXLT applies the LT predicate on the "location_x" field. +func LocationXLT(v int) predicate.User { + return predicate.User(sql.FieldLT(FieldLocationX, v)) +} + +// LocationXLTE applies the LTE predicate on the "location_x" field. +func LocationXLTE(v int) predicate.User { + return predicate.User(sql.FieldLTE(FieldLocationX, v)) +} + +// LocationXIsNil applies the IsNil predicate on the "location_x" field. +func LocationXIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldLocationX)) +} + +// LocationXNotNil applies the NotNil predicate on the "location_x" field. +func LocationXNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldLocationX)) +} + +// LocationYEQ applies the EQ predicate on the "location_y" field. +func LocationYEQ(v int) predicate.User { + return predicate.User(sql.FieldEQ(FieldLocationY, v)) +} + +// LocationYNEQ applies the NEQ predicate on the "location_y" field. +func LocationYNEQ(v int) predicate.User { + return predicate.User(sql.FieldNEQ(FieldLocationY, v)) +} + +// LocationYIn applies the In predicate on the "location_y" field. +func LocationYIn(vs ...int) predicate.User { + return predicate.User(sql.FieldIn(FieldLocationY, vs...)) +} + +// LocationYNotIn applies the NotIn predicate on the "location_y" field. +func LocationYNotIn(vs ...int) predicate.User { + return predicate.User(sql.FieldNotIn(FieldLocationY, vs...)) +} + +// LocationYGT applies the GT predicate on the "location_y" field. +func LocationYGT(v int) predicate.User { + return predicate.User(sql.FieldGT(FieldLocationY, v)) +} + +// LocationYGTE applies the GTE predicate on the "location_y" field. +func LocationYGTE(v int) predicate.User { + return predicate.User(sql.FieldGTE(FieldLocationY, v)) +} + +// LocationYLT applies the LT predicate on the "location_y" field. +func LocationYLT(v int) predicate.User { + return predicate.User(sql.FieldLT(FieldLocationY, v)) +} + +// LocationYLTE applies the LTE predicate on the "location_y" field. +func LocationYLTE(v int) predicate.User { + return predicate.User(sql.FieldLTE(FieldLocationY, v)) +} + +// LocationYIsNil applies the IsNil predicate on the "location_y" field. +func LocationYIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldLocationY)) +} + +// LocationYNotNil applies the NotNil predicate on the "location_y" field. +func LocationYNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldLocationY)) +} + +// LocationZEQ applies the EQ predicate on the "location_z" field. +func LocationZEQ(v int) predicate.User { + return predicate.User(sql.FieldEQ(FieldLocationZ, v)) +} + +// LocationZNEQ applies the NEQ predicate on the "location_z" field. +func LocationZNEQ(v int) predicate.User { + return predicate.User(sql.FieldNEQ(FieldLocationZ, v)) +} + +// LocationZIn applies the In predicate on the "location_z" field. +func LocationZIn(vs ...int) predicate.User { + return predicate.User(sql.FieldIn(FieldLocationZ, vs...)) +} + +// LocationZNotIn applies the NotIn predicate on the "location_z" field. +func LocationZNotIn(vs ...int) predicate.User { + return predicate.User(sql.FieldNotIn(FieldLocationZ, vs...)) +} + +// LocationZGT applies the GT predicate on the "location_z" field. +func LocationZGT(v int) predicate.User { + return predicate.User(sql.FieldGT(FieldLocationZ, v)) +} + +// LocationZGTE applies the GTE predicate on the "location_z" field. +func LocationZGTE(v int) predicate.User { + return predicate.User(sql.FieldGTE(FieldLocationZ, v)) +} + +// LocationZLT applies the LT predicate on the "location_z" field. +func LocationZLT(v int) predicate.User { + return predicate.User(sql.FieldLT(FieldLocationZ, v)) +} + +// LocationZLTE applies the LTE predicate on the "location_z" field. +func LocationZLTE(v int) predicate.User { + return predicate.User(sql.FieldLTE(FieldLocationZ, v)) +} + +// LocationZIsNil applies the IsNil predicate on the "location_z" field. +func LocationZIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldLocationZ)) +} + +// LocationZNotNil applies the NotNil predicate on the "location_z" field. +func LocationZNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldLocationZ)) +} + +// LocationNEQ applies the EQ predicate on the "location_n" field. +func LocationNEQ(v int) predicate.User { + return predicate.User(sql.FieldEQ(FieldLocationN, v)) +} + +// LocationNNEQ applies the NEQ predicate on the "location_n" field. +func LocationNNEQ(v int) predicate.User { + return predicate.User(sql.FieldNEQ(FieldLocationN, v)) +} + +// LocationNIn applies the In predicate on the "location_n" field. +func LocationNIn(vs ...int) predicate.User { + return predicate.User(sql.FieldIn(FieldLocationN, vs...)) +} + +// LocationNNotIn applies the NotIn predicate on the "location_n" field. +func LocationNNotIn(vs ...int) predicate.User { + return predicate.User(sql.FieldNotIn(FieldLocationN, vs...)) +} + +// LocationNGT applies the GT predicate on the "location_n" field. +func LocationNGT(v int) predicate.User { + return predicate.User(sql.FieldGT(FieldLocationN, v)) +} + +// LocationNGTE applies the GTE predicate on the "location_n" field. +func LocationNGTE(v int) predicate.User { + return predicate.User(sql.FieldGTE(FieldLocationN, v)) +} + +// LocationNLT applies the LT predicate on the "location_n" field. +func LocationNLT(v int) predicate.User { + return predicate.User(sql.FieldLT(FieldLocationN, v)) +} + +// LocationNLTE applies the LTE predicate on the "location_n" field. +func LocationNLTE(v int) predicate.User { + return predicate.User(sql.FieldLTE(FieldLocationN, v)) +} + +// LocationNIsNil applies the IsNil predicate on the "location_n" field. +func LocationNIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldLocationN)) +} + +// LocationNNotNil applies the NotNil predicate on the "location_n" field. +func LocationNNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldLocationN)) +} + // HasCard applies the HasEdge predicate on the "card" edge. func HasCard() predicate.User { return predicate.User(func(s *sql.Selector) { diff --git a/ent/user_create.go b/ent/user_create.go index e914763..84711f9 100644 --- a/ent/user_create.go +++ b/ent/user_create.go @@ -750,6 +750,118 @@ func (uc *UserCreate) SetNillableCoinAt(t *time.Time) *UserCreate { return uc } +// SetPlanet sets the "planet" field. +func (uc *UserCreate) SetPlanet(i int) *UserCreate { + uc.mutation.SetPlanet(i) + return uc +} + +// SetNillablePlanet sets the "planet" field if the given value is not nil. +func (uc *UserCreate) SetNillablePlanet(i *int) *UserCreate { + if i != nil { + uc.SetPlanet(*i) + } + return uc +} + +// SetPlanetAt sets the "planet_at" field. +func (uc *UserCreate) SetPlanetAt(t time.Time) *UserCreate { + uc.mutation.SetPlanetAt(t) + return uc +} + +// SetNillablePlanetAt sets the "planet_at" field if the given value is not nil. +func (uc *UserCreate) SetNillablePlanetAt(t *time.Time) *UserCreate { + if t != nil { + uc.SetPlanetAt(*t) + } + return uc +} + +// SetLogin sets the "login" field. +func (uc *UserCreate) SetLogin(b bool) *UserCreate { + uc.mutation.SetLogin(b) + return uc +} + +// SetNillableLogin sets the "login" field if the given value is not nil. +func (uc *UserCreate) SetNillableLogin(b *bool) *UserCreate { + if b != nil { + uc.SetLogin(*b) + } + return uc +} + +// SetLoginAt sets the "login_at" field. +func (uc *UserCreate) SetLoginAt(t time.Time) *UserCreate { + uc.mutation.SetLoginAt(t) + return uc +} + +// SetNillableLoginAt sets the "login_at" field if the given value is not nil. +func (uc *UserCreate) SetNillableLoginAt(t *time.Time) *UserCreate { + if t != nil { + uc.SetLoginAt(*t) + } + return uc +} + +// SetLocationX sets the "location_x" field. +func (uc *UserCreate) SetLocationX(i int) *UserCreate { + uc.mutation.SetLocationX(i) + return uc +} + +// SetNillableLocationX sets the "location_x" field if the given value is not nil. +func (uc *UserCreate) SetNillableLocationX(i *int) *UserCreate { + if i != nil { + uc.SetLocationX(*i) + } + return uc +} + +// SetLocationY sets the "location_y" field. +func (uc *UserCreate) SetLocationY(i int) *UserCreate { + uc.mutation.SetLocationY(i) + return uc +} + +// SetNillableLocationY sets the "location_y" field if the given value is not nil. +func (uc *UserCreate) SetNillableLocationY(i *int) *UserCreate { + if i != nil { + uc.SetLocationY(*i) + } + return uc +} + +// SetLocationZ sets the "location_z" field. +func (uc *UserCreate) SetLocationZ(i int) *UserCreate { + uc.mutation.SetLocationZ(i) + return uc +} + +// SetNillableLocationZ sets the "location_z" field if the given value is not nil. +func (uc *UserCreate) SetNillableLocationZ(i *int) *UserCreate { + if i != nil { + uc.SetLocationZ(*i) + } + return uc +} + +// SetLocationN sets the "location_n" field. +func (uc *UserCreate) SetLocationN(i int) *UserCreate { + uc.mutation.SetLocationN(i) + return uc +} + +// SetNillableLocationN sets the "location_n" field if the given value is not nil. +func (uc *UserCreate) SetNillableLocationN(i *int) *UserCreate { + if i != nil { + uc.SetLocationN(*i) + } + return uc +} + // AddCardIDs adds the "card" edge to the Card entity by IDs. func (uc *UserCreate) AddCardIDs(ids ...int) *UserCreate { uc.mutation.AddCardIDs(ids...) @@ -945,6 +1057,18 @@ func (uc *UserCreate) defaults() { v := user.DefaultCoinAt() uc.mutation.SetCoinAt(v) } + if _, ok := uc.mutation.PlanetAt(); !ok { + v := user.DefaultPlanetAt() + uc.mutation.SetPlanetAt(v) + } + if _, ok := uc.mutation.Login(); !ok { + v := user.DefaultLogin + uc.mutation.SetLogin(v) + } + if _, ok := uc.mutation.LoginAt(); !ok { + v := user.DefaultLoginAt() + uc.mutation.SetLoginAt(v) + } } // check runs all checks and user-defined validators on the builder. @@ -1203,6 +1327,38 @@ func (uc *UserCreate) createSpec() (*User, *sqlgraph.CreateSpec) { _spec.SetField(user.FieldCoinAt, field.TypeTime, value) _node.CoinAt = value } + if value, ok := uc.mutation.Planet(); ok { + _spec.SetField(user.FieldPlanet, field.TypeInt, value) + _node.Planet = value + } + if value, ok := uc.mutation.PlanetAt(); ok { + _spec.SetField(user.FieldPlanetAt, field.TypeTime, value) + _node.PlanetAt = value + } + if value, ok := uc.mutation.Login(); ok { + _spec.SetField(user.FieldLogin, field.TypeBool, value) + _node.Login = value + } + if value, ok := uc.mutation.LoginAt(); ok { + _spec.SetField(user.FieldLoginAt, field.TypeTime, value) + _node.LoginAt = value + } + if value, ok := uc.mutation.LocationX(); ok { + _spec.SetField(user.FieldLocationX, field.TypeInt, value) + _node.LocationX = value + } + if value, ok := uc.mutation.LocationY(); ok { + _spec.SetField(user.FieldLocationY, field.TypeInt, value) + _node.LocationY = value + } + if value, ok := uc.mutation.LocationZ(); ok { + _spec.SetField(user.FieldLocationZ, field.TypeInt, value) + _node.LocationZ = value + } + if value, ok := uc.mutation.LocationN(); ok { + _spec.SetField(user.FieldLocationN, field.TypeInt, value) + _node.LocationN = value + } if nodes := uc.mutation.CardIDs(); len(nodes) > 0 { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.O2M, diff --git a/ent/user_update.go b/ent/user_update.go index f4d4237..8340742 100644 --- a/ent/user_update.go +++ b/ent/user_update.go @@ -1158,6 +1158,201 @@ func (uu *UserUpdate) ClearCoinAt() *UserUpdate { return uu } +// SetPlanet sets the "planet" field. +func (uu *UserUpdate) SetPlanet(i int) *UserUpdate { + uu.mutation.ResetPlanet() + uu.mutation.SetPlanet(i) + return uu +} + +// SetNillablePlanet sets the "planet" field if the given value is not nil. +func (uu *UserUpdate) SetNillablePlanet(i *int) *UserUpdate { + if i != nil { + uu.SetPlanet(*i) + } + return uu +} + +// AddPlanet adds i to the "planet" field. +func (uu *UserUpdate) AddPlanet(i int) *UserUpdate { + uu.mutation.AddPlanet(i) + return uu +} + +// ClearPlanet clears the value of the "planet" field. +func (uu *UserUpdate) ClearPlanet() *UserUpdate { + uu.mutation.ClearPlanet() + return uu +} + +// SetPlanetAt sets the "planet_at" field. +func (uu *UserUpdate) SetPlanetAt(t time.Time) *UserUpdate { + uu.mutation.SetPlanetAt(t) + return uu +} + +// SetNillablePlanetAt sets the "planet_at" field if the given value is not nil. +func (uu *UserUpdate) SetNillablePlanetAt(t *time.Time) *UserUpdate { + if t != nil { + uu.SetPlanetAt(*t) + } + return uu +} + +// ClearPlanetAt clears the value of the "planet_at" field. +func (uu *UserUpdate) ClearPlanetAt() *UserUpdate { + uu.mutation.ClearPlanetAt() + return uu +} + +// SetLogin sets the "login" field. +func (uu *UserUpdate) SetLogin(b bool) *UserUpdate { + uu.mutation.SetLogin(b) + return uu +} + +// SetNillableLogin sets the "login" field if the given value is not nil. +func (uu *UserUpdate) SetNillableLogin(b *bool) *UserUpdate { + if b != nil { + uu.SetLogin(*b) + } + return uu +} + +// ClearLogin clears the value of the "login" field. +func (uu *UserUpdate) ClearLogin() *UserUpdate { + uu.mutation.ClearLogin() + return uu +} + +// SetLoginAt sets the "login_at" field. +func (uu *UserUpdate) SetLoginAt(t time.Time) *UserUpdate { + uu.mutation.SetLoginAt(t) + return uu +} + +// SetNillableLoginAt sets the "login_at" field if the given value is not nil. +func (uu *UserUpdate) SetNillableLoginAt(t *time.Time) *UserUpdate { + if t != nil { + uu.SetLoginAt(*t) + } + return uu +} + +// ClearLoginAt clears the value of the "login_at" field. +func (uu *UserUpdate) ClearLoginAt() *UserUpdate { + uu.mutation.ClearLoginAt() + return uu +} + +// SetLocationX sets the "location_x" field. +func (uu *UserUpdate) SetLocationX(i int) *UserUpdate { + uu.mutation.ResetLocationX() + uu.mutation.SetLocationX(i) + return uu +} + +// SetNillableLocationX sets the "location_x" field if the given value is not nil. +func (uu *UserUpdate) SetNillableLocationX(i *int) *UserUpdate { + if i != nil { + uu.SetLocationX(*i) + } + return uu +} + +// AddLocationX adds i to the "location_x" field. +func (uu *UserUpdate) AddLocationX(i int) *UserUpdate { + uu.mutation.AddLocationX(i) + return uu +} + +// ClearLocationX clears the value of the "location_x" field. +func (uu *UserUpdate) ClearLocationX() *UserUpdate { + uu.mutation.ClearLocationX() + return uu +} + +// SetLocationY sets the "location_y" field. +func (uu *UserUpdate) SetLocationY(i int) *UserUpdate { + uu.mutation.ResetLocationY() + uu.mutation.SetLocationY(i) + return uu +} + +// SetNillableLocationY sets the "location_y" field if the given value is not nil. +func (uu *UserUpdate) SetNillableLocationY(i *int) *UserUpdate { + if i != nil { + uu.SetLocationY(*i) + } + return uu +} + +// AddLocationY adds i to the "location_y" field. +func (uu *UserUpdate) AddLocationY(i int) *UserUpdate { + uu.mutation.AddLocationY(i) + return uu +} + +// ClearLocationY clears the value of the "location_y" field. +func (uu *UserUpdate) ClearLocationY() *UserUpdate { + uu.mutation.ClearLocationY() + return uu +} + +// SetLocationZ sets the "location_z" field. +func (uu *UserUpdate) SetLocationZ(i int) *UserUpdate { + uu.mutation.ResetLocationZ() + uu.mutation.SetLocationZ(i) + return uu +} + +// SetNillableLocationZ sets the "location_z" field if the given value is not nil. +func (uu *UserUpdate) SetNillableLocationZ(i *int) *UserUpdate { + if i != nil { + uu.SetLocationZ(*i) + } + return uu +} + +// AddLocationZ adds i to the "location_z" field. +func (uu *UserUpdate) AddLocationZ(i int) *UserUpdate { + uu.mutation.AddLocationZ(i) + return uu +} + +// ClearLocationZ clears the value of the "location_z" field. +func (uu *UserUpdate) ClearLocationZ() *UserUpdate { + uu.mutation.ClearLocationZ() + return uu +} + +// SetLocationN sets the "location_n" field. +func (uu *UserUpdate) SetLocationN(i int) *UserUpdate { + uu.mutation.ResetLocationN() + uu.mutation.SetLocationN(i) + return uu +} + +// SetNillableLocationN sets the "location_n" field if the given value is not nil. +func (uu *UserUpdate) SetNillableLocationN(i *int) *UserUpdate { + if i != nil { + uu.SetLocationN(*i) + } + return uu +} + +// AddLocationN adds i to the "location_n" field. +func (uu *UserUpdate) AddLocationN(i int) *UserUpdate { + uu.mutation.AddLocationN(i) + return uu +} + +// ClearLocationN clears the value of the "location_n" field. +func (uu *UserUpdate) ClearLocationN() *UserUpdate { + uu.mutation.ClearLocationN() + return uu +} + // AddCardIDs adds the "card" edge to the Card entity by IDs. func (uu *UserUpdate) AddCardIDs(ids ...int) *UserUpdate { uu.mutation.AddCardIDs(ids...) @@ -1700,6 +1895,69 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { if uu.mutation.CoinAtCleared() { _spec.ClearField(user.FieldCoinAt, field.TypeTime) } + if value, ok := uu.mutation.Planet(); ok { + _spec.SetField(user.FieldPlanet, field.TypeInt, value) + } + if value, ok := uu.mutation.AddedPlanet(); ok { + _spec.AddField(user.FieldPlanet, field.TypeInt, value) + } + if uu.mutation.PlanetCleared() { + _spec.ClearField(user.FieldPlanet, field.TypeInt) + } + if value, ok := uu.mutation.PlanetAt(); ok { + _spec.SetField(user.FieldPlanetAt, field.TypeTime, value) + } + if uu.mutation.PlanetAtCleared() { + _spec.ClearField(user.FieldPlanetAt, field.TypeTime) + } + if value, ok := uu.mutation.Login(); ok { + _spec.SetField(user.FieldLogin, field.TypeBool, value) + } + if uu.mutation.LoginCleared() { + _spec.ClearField(user.FieldLogin, field.TypeBool) + } + if value, ok := uu.mutation.LoginAt(); ok { + _spec.SetField(user.FieldLoginAt, field.TypeTime, value) + } + if uu.mutation.LoginAtCleared() { + _spec.ClearField(user.FieldLoginAt, field.TypeTime) + } + if value, ok := uu.mutation.LocationX(); ok { + _spec.SetField(user.FieldLocationX, field.TypeInt, value) + } + if value, ok := uu.mutation.AddedLocationX(); ok { + _spec.AddField(user.FieldLocationX, field.TypeInt, value) + } + if uu.mutation.LocationXCleared() { + _spec.ClearField(user.FieldLocationX, field.TypeInt) + } + if value, ok := uu.mutation.LocationY(); ok { + _spec.SetField(user.FieldLocationY, field.TypeInt, value) + } + if value, ok := uu.mutation.AddedLocationY(); ok { + _spec.AddField(user.FieldLocationY, field.TypeInt, value) + } + if uu.mutation.LocationYCleared() { + _spec.ClearField(user.FieldLocationY, field.TypeInt) + } + if value, ok := uu.mutation.LocationZ(); ok { + _spec.SetField(user.FieldLocationZ, field.TypeInt, value) + } + if value, ok := uu.mutation.AddedLocationZ(); ok { + _spec.AddField(user.FieldLocationZ, field.TypeInt, value) + } + if uu.mutation.LocationZCleared() { + _spec.ClearField(user.FieldLocationZ, field.TypeInt) + } + if value, ok := uu.mutation.LocationN(); ok { + _spec.SetField(user.FieldLocationN, field.TypeInt, value) + } + if value, ok := uu.mutation.AddedLocationN(); ok { + _spec.AddField(user.FieldLocationN, field.TypeInt, value) + } + if uu.mutation.LocationNCleared() { + _spec.ClearField(user.FieldLocationN, field.TypeInt) + } if uu.mutation.CardCleared() { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.O2M, @@ -3026,6 +3284,201 @@ func (uuo *UserUpdateOne) ClearCoinAt() *UserUpdateOne { return uuo } +// SetPlanet sets the "planet" field. +func (uuo *UserUpdateOne) SetPlanet(i int) *UserUpdateOne { + uuo.mutation.ResetPlanet() + uuo.mutation.SetPlanet(i) + return uuo +} + +// SetNillablePlanet sets the "planet" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillablePlanet(i *int) *UserUpdateOne { + if i != nil { + uuo.SetPlanet(*i) + } + return uuo +} + +// AddPlanet adds i to the "planet" field. +func (uuo *UserUpdateOne) AddPlanet(i int) *UserUpdateOne { + uuo.mutation.AddPlanet(i) + return uuo +} + +// ClearPlanet clears the value of the "planet" field. +func (uuo *UserUpdateOne) ClearPlanet() *UserUpdateOne { + uuo.mutation.ClearPlanet() + return uuo +} + +// SetPlanetAt sets the "planet_at" field. +func (uuo *UserUpdateOne) SetPlanetAt(t time.Time) *UserUpdateOne { + uuo.mutation.SetPlanetAt(t) + return uuo +} + +// SetNillablePlanetAt sets the "planet_at" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillablePlanetAt(t *time.Time) *UserUpdateOne { + if t != nil { + uuo.SetPlanetAt(*t) + } + return uuo +} + +// ClearPlanetAt clears the value of the "planet_at" field. +func (uuo *UserUpdateOne) ClearPlanetAt() *UserUpdateOne { + uuo.mutation.ClearPlanetAt() + return uuo +} + +// SetLogin sets the "login" field. +func (uuo *UserUpdateOne) SetLogin(b bool) *UserUpdateOne { + uuo.mutation.SetLogin(b) + return uuo +} + +// SetNillableLogin sets the "login" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableLogin(b *bool) *UserUpdateOne { + if b != nil { + uuo.SetLogin(*b) + } + return uuo +} + +// ClearLogin clears the value of the "login" field. +func (uuo *UserUpdateOne) ClearLogin() *UserUpdateOne { + uuo.mutation.ClearLogin() + return uuo +} + +// SetLoginAt sets the "login_at" field. +func (uuo *UserUpdateOne) SetLoginAt(t time.Time) *UserUpdateOne { + uuo.mutation.SetLoginAt(t) + return uuo +} + +// SetNillableLoginAt sets the "login_at" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableLoginAt(t *time.Time) *UserUpdateOne { + if t != nil { + uuo.SetLoginAt(*t) + } + return uuo +} + +// ClearLoginAt clears the value of the "login_at" field. +func (uuo *UserUpdateOne) ClearLoginAt() *UserUpdateOne { + uuo.mutation.ClearLoginAt() + return uuo +} + +// SetLocationX sets the "location_x" field. +func (uuo *UserUpdateOne) SetLocationX(i int) *UserUpdateOne { + uuo.mutation.ResetLocationX() + uuo.mutation.SetLocationX(i) + return uuo +} + +// SetNillableLocationX sets the "location_x" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableLocationX(i *int) *UserUpdateOne { + if i != nil { + uuo.SetLocationX(*i) + } + return uuo +} + +// AddLocationX adds i to the "location_x" field. +func (uuo *UserUpdateOne) AddLocationX(i int) *UserUpdateOne { + uuo.mutation.AddLocationX(i) + return uuo +} + +// ClearLocationX clears the value of the "location_x" field. +func (uuo *UserUpdateOne) ClearLocationX() *UserUpdateOne { + uuo.mutation.ClearLocationX() + return uuo +} + +// SetLocationY sets the "location_y" field. +func (uuo *UserUpdateOne) SetLocationY(i int) *UserUpdateOne { + uuo.mutation.ResetLocationY() + uuo.mutation.SetLocationY(i) + return uuo +} + +// SetNillableLocationY sets the "location_y" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableLocationY(i *int) *UserUpdateOne { + if i != nil { + uuo.SetLocationY(*i) + } + return uuo +} + +// AddLocationY adds i to the "location_y" field. +func (uuo *UserUpdateOne) AddLocationY(i int) *UserUpdateOne { + uuo.mutation.AddLocationY(i) + return uuo +} + +// ClearLocationY clears the value of the "location_y" field. +func (uuo *UserUpdateOne) ClearLocationY() *UserUpdateOne { + uuo.mutation.ClearLocationY() + return uuo +} + +// SetLocationZ sets the "location_z" field. +func (uuo *UserUpdateOne) SetLocationZ(i int) *UserUpdateOne { + uuo.mutation.ResetLocationZ() + uuo.mutation.SetLocationZ(i) + return uuo +} + +// SetNillableLocationZ sets the "location_z" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableLocationZ(i *int) *UserUpdateOne { + if i != nil { + uuo.SetLocationZ(*i) + } + return uuo +} + +// AddLocationZ adds i to the "location_z" field. +func (uuo *UserUpdateOne) AddLocationZ(i int) *UserUpdateOne { + uuo.mutation.AddLocationZ(i) + return uuo +} + +// ClearLocationZ clears the value of the "location_z" field. +func (uuo *UserUpdateOne) ClearLocationZ() *UserUpdateOne { + uuo.mutation.ClearLocationZ() + return uuo +} + +// SetLocationN sets the "location_n" field. +func (uuo *UserUpdateOne) SetLocationN(i int) *UserUpdateOne { + uuo.mutation.ResetLocationN() + uuo.mutation.SetLocationN(i) + return uuo +} + +// SetNillableLocationN sets the "location_n" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableLocationN(i *int) *UserUpdateOne { + if i != nil { + uuo.SetLocationN(*i) + } + return uuo +} + +// AddLocationN adds i to the "location_n" field. +func (uuo *UserUpdateOne) AddLocationN(i int) *UserUpdateOne { + uuo.mutation.AddLocationN(i) + return uuo +} + +// ClearLocationN clears the value of the "location_n" field. +func (uuo *UserUpdateOne) ClearLocationN() *UserUpdateOne { + uuo.mutation.ClearLocationN() + return uuo +} + // AddCardIDs adds the "card" edge to the Card entity by IDs. func (uuo *UserUpdateOne) AddCardIDs(ids ...int) *UserUpdateOne { uuo.mutation.AddCardIDs(ids...) @@ -3598,6 +4051,69 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) if uuo.mutation.CoinAtCleared() { _spec.ClearField(user.FieldCoinAt, field.TypeTime) } + if value, ok := uuo.mutation.Planet(); ok { + _spec.SetField(user.FieldPlanet, field.TypeInt, value) + } + if value, ok := uuo.mutation.AddedPlanet(); ok { + _spec.AddField(user.FieldPlanet, field.TypeInt, value) + } + if uuo.mutation.PlanetCleared() { + _spec.ClearField(user.FieldPlanet, field.TypeInt) + } + if value, ok := uuo.mutation.PlanetAt(); ok { + _spec.SetField(user.FieldPlanetAt, field.TypeTime, value) + } + if uuo.mutation.PlanetAtCleared() { + _spec.ClearField(user.FieldPlanetAt, field.TypeTime) + } + if value, ok := uuo.mutation.Login(); ok { + _spec.SetField(user.FieldLogin, field.TypeBool, value) + } + if uuo.mutation.LoginCleared() { + _spec.ClearField(user.FieldLogin, field.TypeBool) + } + if value, ok := uuo.mutation.LoginAt(); ok { + _spec.SetField(user.FieldLoginAt, field.TypeTime, value) + } + if uuo.mutation.LoginAtCleared() { + _spec.ClearField(user.FieldLoginAt, field.TypeTime) + } + if value, ok := uuo.mutation.LocationX(); ok { + _spec.SetField(user.FieldLocationX, field.TypeInt, value) + } + if value, ok := uuo.mutation.AddedLocationX(); ok { + _spec.AddField(user.FieldLocationX, field.TypeInt, value) + } + if uuo.mutation.LocationXCleared() { + _spec.ClearField(user.FieldLocationX, field.TypeInt) + } + if value, ok := uuo.mutation.LocationY(); ok { + _spec.SetField(user.FieldLocationY, field.TypeInt, value) + } + if value, ok := uuo.mutation.AddedLocationY(); ok { + _spec.AddField(user.FieldLocationY, field.TypeInt, value) + } + if uuo.mutation.LocationYCleared() { + _spec.ClearField(user.FieldLocationY, field.TypeInt) + } + if value, ok := uuo.mutation.LocationZ(); ok { + _spec.SetField(user.FieldLocationZ, field.TypeInt, value) + } + if value, ok := uuo.mutation.AddedLocationZ(); ok { + _spec.AddField(user.FieldLocationZ, field.TypeInt, value) + } + if uuo.mutation.LocationZCleared() { + _spec.ClearField(user.FieldLocationZ, field.TypeInt) + } + if value, ok := uuo.mutation.LocationN(); ok { + _spec.SetField(user.FieldLocationN, field.TypeInt, value) + } + if value, ok := uuo.mutation.AddedLocationN(); ok { + _spec.AddField(user.FieldLocationN, field.TypeInt, value) + } + if uuo.mutation.LocationNCleared() { + _spec.ClearField(user.FieldLocationN, field.TypeInt) + } if uuo.mutation.CardCleared() { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.O2M, diff --git a/tmp/ogent/ogent.go b/tmp/ogent/ogent.go index 5df8ecb..df6c765 100644 --- a/tmp/ogent/ogent.go +++ b/tmp/ogent/ogent.go @@ -1613,6 +1613,31 @@ func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (Crea if v, ok := req.CoinAt.Get(); ok { b.SetCoinAt(v) } + if v, ok := req.Planet.Get(); ok { + b.SetPlanet(v) + } + if v, ok := req.PlanetAt.Get(); ok { + b.SetPlanetAt(v) + } + if v, ok := req.Login.Get(); ok { + b.SetLogin(v) + } + if v, ok := req.LoginAt.Get(); ok { + b.SetLoginAt(v) + } + if v, ok := req.LocationX.Get(); ok { + b.SetLocationX(v) + } + if v, ok := req.LocationY.Get(); ok { + b.SetLocationY(v) + } + if v, ok := req.LocationZ.Get(); ok { + b.SetLocationZ(v) + } + if v, ok := req.LocationN.Get(); ok { + b.SetLocationN(v) + } + // Add all edges. b.AddCardIDs(req.Card...) b.AddUeIDs(req.Ue...) @@ -1831,6 +1856,31 @@ func (h *OgentHandler) UpdateUser(ctx context.Context, req *UpdateUserReq, param if v, ok := req.CoinAt.Get(); ok { b.SetCoinAt(v) } + if v, ok := req.Planet.Get(); ok { + b.SetPlanet(v) + } + if v, ok := req.PlanetAt.Get(); ok { + b.SetPlanetAt(v) + } + if v, ok := req.Login.Get(); ok { + b.SetLogin(v) + } + if v, ok := req.LoginAt.Get(); ok { + b.SetLoginAt(v) + } + if v, ok := req.LocationX.Get(); ok { + b.SetLocationX(v) + } + if v, ok := req.LocationY.Get(); ok { + b.SetLocationY(v) + } + if v, ok := req.LocationZ.Get(); ok { + b.SetLocationZ(v) + } + if v, ok := req.LocationN.Get(); ok { + b.SetLocationN(v) + } + // Add all edges. if req.Card != nil { b.ClearCard().AddCardIDs(req.Card...)