1
0

add planet

This commit is contained in:
syui 2024-08-01 06:01:28 +09:00
parent a4cd0e0f9a
commit 4c0c396086
Signed by: syui
GPG Key ID: 5417CFEBAD92DF56
17 changed files with 5062 additions and 59 deletions

View File

@ -2,7 +2,7 @@
d=${0:a:h} d=${0:a:h}
cd $d cd $d
su=5000 su=10000
go1.21.8 generate ./... go1.21.8 generate ./...
#go generate ./... #go generate ./...
@ -20,6 +20,6 @@ case $OSTYPE in
esac esac
cp -rf $d/tmp/ogent ent/ 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 build
#PASS=`cat $f|jq -r .password` TOKEN=`cat $f|jq -r .token` go run -mod=mod main.go #PASS=`cat $f|jq -r .password` TOKEN=`cat $f|jq -r .token` go run -mod=mod main.go

View File

@ -207,7 +207,7 @@ var (
{Name: "ten_post", Type: field.TypeString, Nullable: true}, {Name: "ten_post", Type: field.TypeString, Nullable: true},
{Name: "ten_get", Type: field.TypeString, Nullable: true}, {Name: "ten_get", Type: field.TypeString, Nullable: true},
{Name: "ten_at", Type: field.TypeTime, 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: "room", Type: field.TypeInt, Nullable: true},
{Name: "model", Type: field.TypeBool, Nullable: true}, {Name: "model", Type: field.TypeBool, Nullable: true},
{Name: "model_at", Type: field.TypeTime, Nullable: true}, {Name: "model_at", Type: field.TypeTime, Nullable: true},
@ -228,6 +228,14 @@ var (
{Name: "coin", Type: field.TypeInt, Nullable: true}, {Name: "coin", Type: field.TypeInt, Nullable: true},
{Name: "coin_open", Type: field.TypeBool, Nullable: true, Default: false}, {Name: "coin_open", Type: field.TypeBool, Nullable: true, Default: false},
{Name: "coin_at", Type: field.TypeTime, Nullable: true}, {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}, {Name: "group_users", Type: field.TypeInt, Nullable: true},
} }
// UsersTable holds the schema information for the "users" table. // UsersTable holds the schema information for the "users" table.
@ -238,7 +246,7 @@ var (
ForeignKeys: []*schema.ForeignKey{ ForeignKeys: []*schema.ForeignKey{
{ {
Symbol: "users_groups_users", Symbol: "users_groups_users",
Columns: []*schema.Column{UsersColumns[54]}, Columns: []*schema.Column{UsersColumns[62]},
RefColumns: []*schema.Column{GroupsColumns[0]}, RefColumns: []*schema.Column{GroupsColumns[0]},
OnDelete: schema.SetNull, OnDelete: schema.SetNull,
}, },

View File

@ -7642,6 +7642,19 @@ type UserMutation struct {
addcoin *int addcoin *int
coin_open *bool coin_open *bool
coin_at *time.Time 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{} clearedFields map[string]struct{}
card map[int]struct{} card map[int]struct{}
removedcard map[int]struct{} removedcard map[int]struct{}
@ -10707,6 +10720,503 @@ func (m *UserMutation) ResetCoinAt() {
delete(m.clearedFields, user.FieldCoinAt) 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. // AddCardIDs adds the "card" edge to the Card entity by ids.
func (m *UserMutation) AddCardIDs(ids ...int) { func (m *UserMutation) AddCardIDs(ids ...int) {
if m.card == nil { if m.card == nil {
@ -10957,7 +11467,7 @@ func (m *UserMutation) Type() string {
// order to get all numeric fields that were incremented/decremented, call // order to get all numeric fields that were incremented/decremented, call
// AddedFields(). // AddedFields().
func (m *UserMutation) Fields() []string { func (m *UserMutation) Fields() []string {
fields := make([]string, 0, 53) fields := make([]string, 0, 61)
if m.username != nil { if m.username != nil {
fields = append(fields, user.FieldUsername) fields = append(fields, user.FieldUsername)
} }
@ -11117,6 +11627,30 @@ func (m *UserMutation) Fields() []string {
if m.coin_at != nil { if m.coin_at != nil {
fields = append(fields, user.FieldCoinAt) 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 return fields
} }
@ -11231,6 +11765,22 @@ func (m *UserMutation) Field(name string) (ent.Value, bool) {
return m.CoinOpen() return m.CoinOpen()
case user.FieldCoinAt: case user.FieldCoinAt:
return m.CoinAt() 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 return nil, false
} }
@ -11346,6 +11896,22 @@ func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, er
return m.OldCoinOpen(ctx) return m.OldCoinOpen(ctx)
case user.FieldCoinAt: case user.FieldCoinAt:
return m.OldCoinAt(ctx) 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) 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) m.SetCoinAt(v)
return nil 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) return fmt.Errorf("unknown User field %s", name)
} }
@ -11788,6 +12410,21 @@ func (m *UserMutation) AddedFields() []string {
if m.addcoin != nil { if m.addcoin != nil {
fields = append(fields, user.FieldCoin) 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 return fields
} }
@ -11832,6 +12469,16 @@ func (m *UserMutation) AddedField(name string) (ent.Value, bool) {
return m.AddedGameStory() return m.AddedGameStory()
case user.FieldCoin: case user.FieldCoin:
return m.AddedCoin() 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 return nil, false
} }
@ -11967,6 +12614,41 @@ func (m *UserMutation) AddField(name string, value ent.Value) error {
} }
m.AddCoin(v) m.AddCoin(v)
return nil 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) return fmt.Errorf("unknown User numeric field %s", name)
} }
@ -12128,6 +12810,30 @@ func (m *UserMutation) ClearedFields() []string {
if m.FieldCleared(user.FieldCoinAt) { if m.FieldCleared(user.FieldCoinAt) {
fields = append(fields, 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 return fields
} }
@ -12295,6 +13001,30 @@ func (m *UserMutation) ClearField(name string) error {
case user.FieldCoinAt: case user.FieldCoinAt:
m.ClearCoinAt() m.ClearCoinAt()
return nil 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) return fmt.Errorf("unknown User nullable field %s", name)
} }
@ -12462,6 +13192,30 @@ func (m *UserMutation) ResetField(name string) error {
case user.FieldCoinAt: case user.FieldCoinAt:
m.ResetCoinAt() m.ResetCoinAt()
return nil 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) return fmt.Errorf("unknown User field %s", name)
} }

File diff suppressed because it is too large Load Diff

View File

@ -645,7 +645,7 @@ func decodeListCardParams(args [0]string, r *http.Request) (params ListCardParam
MinSet: true, MinSet: true,
Min: 1, Min: 1,
MaxSet: true, MaxSet: true,
Max: 5000, Max: 10000,
MinExclusive: false, MinExclusive: false,
MaxExclusive: false, MaxExclusive: false,
MultipleOfSet: false, MultipleOfSet: false,
@ -810,7 +810,7 @@ func decodeListGroupParams(args [0]string, r *http.Request) (params ListGroupPar
MinSet: true, MinSet: true,
Min: 1, Min: 1,
MaxSet: true, MaxSet: true,
Max: 5000, Max: 10000,
MinExclusive: false, MinExclusive: false,
MaxExclusive: false, MaxExclusive: false,
MultipleOfSet: false, MultipleOfSet: false,
@ -1142,7 +1142,7 @@ func decodeListMaParams(args [0]string, r *http.Request) (params ListMaParams, _
MinSet: true, MinSet: true,
Min: 1, Min: 1,
MaxSet: true, MaxSet: true,
Max: 5000, Max: 10000,
MinExclusive: false, MinExclusive: false,
MaxExclusive: false, MaxExclusive: false,
MultipleOfSet: false, MultipleOfSet: false,
@ -1307,7 +1307,7 @@ func decodeListSevParams(args [0]string, r *http.Request) (params ListSevParams,
MinSet: true, MinSet: true,
Min: 1, Min: 1,
MaxSet: true, MaxSet: true,
Max: 5000, Max: 10000,
MinExclusive: false, MinExclusive: false,
MaxExclusive: false, MaxExclusive: false,
MultipleOfSet: false, MultipleOfSet: false,
@ -1472,7 +1472,7 @@ func decodeListUeParams(args [0]string, r *http.Request) (params ListUeParams, _
MinSet: true, MinSet: true,
Min: 1, Min: 1,
MaxSet: true, MaxSet: true,
Max: 5000, Max: 10000,
MinExclusive: false, MinExclusive: false,
MaxExclusive: false, MaxExclusive: false,
MultipleOfSet: false, MultipleOfSet: false,
@ -1637,7 +1637,7 @@ func decodeListUserParams(args [0]string, r *http.Request) (params ListUserParam
MinSet: true, MinSet: true,
Min: 1, Min: 1,
MaxSet: true, MaxSet: true,
Max: 5000, Max: 10000,
MinExclusive: false, MinExclusive: false,
MaxExclusive: false, MaxExclusive: false,
MultipleOfSet: false, MultipleOfSet: false,

File diff suppressed because it is too large Load Diff

View File

@ -1613,6 +1613,31 @@ func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (Crea
if v, ok := req.CoinAt.Get(); ok { if v, ok := req.CoinAt.Get(); ok {
b.SetCoinAt(v) 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. // Add all edges.
b.AddCardIDs(req.Card...) b.AddCardIDs(req.Card...)
b.AddUeIDs(req.Ue...) 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 { if v, ok := req.CoinAt.Get(); ok {
b.SetCoinAt(v) 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. // Add all edges.
if req.Card != nil { if req.Card != nil {
b.ClearCard().AddCardIDs(req.Card...) b.ClearCard().AddCardIDs(req.Card...)

View File

@ -201,6 +201,14 @@ func NewCardOwnerRead(e *ent.User) *CardOwnerRead {
ret.Coin = NewOptInt(e.Coin) ret.Coin = NewOptInt(e.Coin)
ret.CoinOpen = NewOptBool(e.CoinOpen) ret.CoinOpen = NewOptBool(e.CoinOpen)
ret.CoinAt = NewOptDateTime(e.CoinAt) 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 return &ret
} }
@ -391,6 +399,14 @@ func NewGroupUsersList(e *ent.User) *GroupUsersList {
ret.Coin = NewOptInt(e.Coin) ret.Coin = NewOptInt(e.Coin)
ret.CoinOpen = NewOptBool(e.CoinOpen) ret.CoinOpen = NewOptBool(e.CoinOpen)
ret.CoinAt = NewOptDateTime(e.CoinAt) 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 return &ret
} }
@ -661,6 +677,14 @@ func NewMaOwnerRead(e *ent.User) *MaOwnerRead {
ret.Coin = NewOptInt(e.Coin) ret.Coin = NewOptInt(e.Coin)
ret.CoinOpen = NewOptBool(e.CoinOpen) ret.CoinOpen = NewOptBool(e.CoinOpen)
ret.CoinAt = NewOptDateTime(e.CoinAt) 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 return &ret
} }
@ -887,6 +911,14 @@ func NewSevOwnerRead(e *ent.User) *SevOwnerRead {
ret.Coin = NewOptInt(e.Coin) ret.Coin = NewOptInt(e.Coin)
ret.CoinOpen = NewOptBool(e.CoinOpen) ret.CoinOpen = NewOptBool(e.CoinOpen)
ret.CoinAt = NewOptDateTime(e.CoinAt) 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 return &ret
} }
@ -1161,6 +1193,14 @@ func NewUeOwnerRead(e *ent.User) *UeOwnerRead {
ret.Coin = NewOptInt(e.Coin) ret.Coin = NewOptInt(e.Coin)
ret.CoinOpen = NewOptBool(e.CoinOpen) ret.CoinOpen = NewOptBool(e.CoinOpen)
ret.CoinAt = NewOptDateTime(e.CoinAt) 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 return &ret
} }
@ -1239,6 +1279,14 @@ func NewUserCreate(e *ent.User) *UserCreate {
ret.Coin = NewOptInt(e.Coin) ret.Coin = NewOptInt(e.Coin)
ret.CoinOpen = NewOptBool(e.CoinOpen) ret.CoinOpen = NewOptBool(e.CoinOpen)
ret.CoinAt = NewOptDateTime(e.CoinAt) 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 return &ret
} }
@ -1317,6 +1365,14 @@ func NewUserList(e *ent.User) *UserList {
ret.Coin = NewOptInt(e.Coin) ret.Coin = NewOptInt(e.Coin)
ret.CoinOpen = NewOptBool(e.CoinOpen) ret.CoinOpen = NewOptBool(e.CoinOpen)
ret.CoinAt = NewOptDateTime(e.CoinAt) 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 return &ret
} }
@ -1395,6 +1451,14 @@ func NewUserRead(e *ent.User) *UserRead {
ret.Coin = NewOptInt(e.Coin) ret.Coin = NewOptInt(e.Coin)
ret.CoinOpen = NewOptBool(e.CoinOpen) ret.CoinOpen = NewOptBool(e.CoinOpen)
ret.CoinAt = NewOptDateTime(e.CoinAt) 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 return &ret
} }
@ -1473,6 +1537,14 @@ func NewUserUpdate(e *ent.User) *UserUpdate {
ret.Coin = NewOptInt(e.Coin) ret.Coin = NewOptInt(e.Coin)
ret.CoinOpen = NewOptBool(e.CoinOpen) ret.CoinOpen = NewOptBool(e.CoinOpen)
ret.CoinAt = NewOptDateTime(e.CoinAt) 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 return &ret
} }

View File

@ -30,7 +30,7 @@
"description": "item count to render per page", "description": "item count to render per page",
"schema": { "schema": {
"type": "integer", "type": "integer",
"maximum": 5000, "maximum": 10000,
"minimum": 1 "minimum": 1
} }
} }
@ -402,7 +402,7 @@
"description": "item count to render per page", "description": "item count to render per page",
"schema": { "schema": {
"type": "integer", "type": "integer",
"maximum": 5000, "maximum": 10000,
"minimum": 1 "minimum": 1
} }
} }
@ -728,7 +728,7 @@
"description": "item count to render per page", "description": "item count to render per page",
"schema": { "schema": {
"type": "integer", "type": "integer",
"maximum": 5000, "maximum": 10000,
"minimum": 1 "minimum": 1
} }
} }
@ -1155,7 +1155,7 @@
"description": "item count to render per page", "description": "item count to render per page",
"schema": { "schema": {
"type": "integer", "type": "integer",
"maximum": 5000, "maximum": 10000,
"minimum": 1 "minimum": 1
} }
} }
@ -1516,7 +1516,7 @@
"description": "item count to render per page", "description": "item count to render per page",
"schema": { "schema": {
"type": "integer", "type": "integer",
"maximum": 5000, "maximum": 10000,
"minimum": 1 "minimum": 1
} }
} }
@ -1947,7 +1947,7 @@
"description": "item count to render per page", "description": "item count to render per page",
"schema": { "schema": {
"type": "integer", "type": "integer",
"maximum": 5000, "maximum": 10000,
"minimum": 1 "minimum": 1
} }
} }
@ -2163,6 +2163,32 @@
"type": "string", "type": "string",
"format": "date-time" "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": { "card": {
"type": "array", "type": "array",
"items": { "items": {
@ -2484,6 +2510,32 @@
"type": "string", "type": "string",
"format": "date-time" "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": { "card": {
"type": "array", "type": "array",
"items": { "items": {
@ -3183,6 +3235,32 @@
"coin_at": { "coin_at": {
"type": "string", "type": "string",
"format": "date-time" "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": [ "required": [
@ -3443,6 +3521,32 @@
"coin_at": { "coin_at": {
"type": "string", "type": "string",
"format": "date-time" "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": [ "required": [
@ -4009,6 +4113,32 @@
"coin_at": { "coin_at": {
"type": "string", "type": "string",
"format": "date-time" "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": [ "required": [
@ -4410,6 +4540,32 @@
"coin_at": { "coin_at": {
"type": "string", "type": "string",
"format": "date-time" "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": [ "required": [
@ -4986,6 +5142,32 @@
"coin_at": { "coin_at": {
"type": "string", "type": "string",
"format": "date-time" "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": [ "required": [
@ -5168,6 +5350,32 @@
"type": "string", "type": "string",
"format": "date-time" "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": { "card": {
"type": "array", "type": "array",
"items": { "items": {
@ -5367,6 +5575,32 @@
"coin_at": { "coin_at": {
"type": "string", "type": "string",
"format": "date-time" "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": [ "required": [
@ -5542,6 +5776,32 @@
"coin_at": { "coin_at": {
"type": "string", "type": "string",
"format": "date-time" "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": [ "required": [
@ -5717,6 +5977,32 @@
"coin_at": { "coin_at": {
"type": "string", "type": "string",
"format": "date-time" "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": [ "required": [
@ -5892,6 +6178,32 @@
"coin_at": { "coin_at": {
"type": "string", "type": "string",
"format": "date-time" "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": [ "required": [

View File

@ -227,4 +227,16 @@ func init() {
userDescCoinAt := userFields[52].Descriptor() userDescCoinAt := userFields[52].Descriptor()
// user.DefaultCoinAt holds the default value on creation for the coin_at field. // user.DefaultCoinAt holds the default value on creation for the coin_at field.
user.DefaultCoinAt = userDescCoinAt.Default.(func() time.Time) 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)
} }

View File

@ -241,6 +241,37 @@ func (User) Fields() []ent.Field {
return time.Now().In(jst) 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(),
} }
} }

View File

@ -123,6 +123,22 @@ type User struct {
CoinOpen bool `json:"coin_open,omitempty"` CoinOpen bool `json:"coin_open,omitempty"`
// CoinAt holds the value of the "coin_at" field. // CoinAt holds the value of the "coin_at" field.
CoinAt time.Time `json:"coin_at,omitempty"` 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. // Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the UserQuery when eager-loading is set. // The values are being populated by the UserQuery when eager-loading is set.
Edges UserEdges `json:"edges"` Edges UserEdges `json:"edges"`
@ -186,13 +202,13 @@ func (*User) scanValues(columns []string) ([]any, error) {
values := make([]any, len(columns)) values := make([]any, len(columns))
for i := range columns { for i := range columns {
switch columns[i] { 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) 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) values[i] = new(sql.NullInt64)
case user.FieldUsername, user.FieldDid, user.FieldToken, user.FieldPassword, user.FieldTenCard, user.FieldTenDelete, user.FieldTenPost, user.FieldTenGet, user.FieldNext: case user.FieldUsername, user.FieldDid, user.FieldToken, user.FieldPassword, user.FieldTenCard, user.FieldTenDelete, user.FieldTenPost, user.FieldTenGet, user.FieldNext:
values[i] = new(sql.NullString) 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) values[i] = new(sql.NullTime)
case user.ForeignKeys[0]: // group_users case user.ForeignKeys[0]: // group_users
values[i] = new(sql.NullInt64) values[i] = new(sql.NullInt64)
@ -535,6 +551,54 @@ func (u *User) assignValues(columns []string, values []any) error {
} else if value.Valid { } else if value.Valid {
u.CoinAt = value.Time 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]: case user.ForeignKeys[0]:
if value, ok := values[i].(*sql.NullInt64); !ok { if value, ok := values[i].(*sql.NullInt64); !ok {
return fmt.Errorf("unexpected type %T for edge-field group_users", value) 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(", ")
builder.WriteString("coin_at=") builder.WriteString("coin_at=")
builder.WriteString(u.CoinAt.Format(time.ANSIC)) 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(')') builder.WriteByte(')')
return builder.String() return builder.String()
} }

View File

@ -120,6 +120,22 @@ const (
FieldCoinOpen = "coin_open" FieldCoinOpen = "coin_open"
// FieldCoinAt holds the string denoting the coin_at field in the database. // FieldCoinAt holds the string denoting the coin_at field in the database.
FieldCoinAt = "coin_at" 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 holds the string denoting the card edge name in mutations.
EdgeCard = "card" EdgeCard = "card"
// EdgeUe holds the string denoting the ue edge name in mutations. // EdgeUe holds the string denoting the ue edge name in mutations.
@ -216,6 +232,14 @@ var Columns = []string{
FieldCoin, FieldCoin,
FieldCoinOpen, FieldCoinOpen,
FieldCoinAt, FieldCoinAt,
FieldPlanet,
FieldPlanetAt,
FieldLogin,
FieldLoginAt,
FieldLocationX,
FieldLocationY,
FieldLocationZ,
FieldLocationN,
} }
// ForeignKeys holds the SQL foreign-keys that are owned by the "users" // ForeignKeys holds the SQL foreign-keys that are owned by the "users"
@ -294,6 +318,12 @@ var (
DefaultCoinOpen bool DefaultCoinOpen bool
// DefaultCoinAt holds the default value on creation for the "coin_at" field. // DefaultCoinAt holds the default value on creation for the "coin_at" field.
DefaultCoinAt func() time.Time 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. // 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() 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. // ByCardCount orders the results by card count.
func ByCardCount(opts ...sql.OrderTermOption) OrderOption { func ByCardCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) { return func(s *sql.Selector) {

View File

@ -320,6 +320,46 @@ func CoinAt(v time.Time) predicate.User {
return predicate.User(sql.FieldEQ(FieldCoinAt, v)) 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. // UsernameEQ applies the EQ predicate on the "username" field.
func UsernameEQ(v string) predicate.User { func UsernameEQ(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldUsername, v)) return predicate.User(sql.FieldEQ(FieldUsername, v))
@ -2695,6 +2735,376 @@ func CoinAtNotNil() predicate.User {
return predicate.User(sql.FieldNotNull(FieldCoinAt)) 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. // HasCard applies the HasEdge predicate on the "card" edge.
func HasCard() predicate.User { func HasCard() predicate.User {
return predicate.User(func(s *sql.Selector) { return predicate.User(func(s *sql.Selector) {

View File

@ -750,6 +750,118 @@ func (uc *UserCreate) SetNillableCoinAt(t *time.Time) *UserCreate {
return uc 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. // AddCardIDs adds the "card" edge to the Card entity by IDs.
func (uc *UserCreate) AddCardIDs(ids ...int) *UserCreate { func (uc *UserCreate) AddCardIDs(ids ...int) *UserCreate {
uc.mutation.AddCardIDs(ids...) uc.mutation.AddCardIDs(ids...)
@ -945,6 +1057,18 @@ func (uc *UserCreate) defaults() {
v := user.DefaultCoinAt() v := user.DefaultCoinAt()
uc.mutation.SetCoinAt(v) 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. // 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) _spec.SetField(user.FieldCoinAt, field.TypeTime, value)
_node.CoinAt = 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 { if nodes := uc.mutation.CardIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{ edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M, Rel: sqlgraph.O2M,

View File

@ -1158,6 +1158,201 @@ func (uu *UserUpdate) ClearCoinAt() *UserUpdate {
return uu 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. // AddCardIDs adds the "card" edge to the Card entity by IDs.
func (uu *UserUpdate) AddCardIDs(ids ...int) *UserUpdate { func (uu *UserUpdate) AddCardIDs(ids ...int) *UserUpdate {
uu.mutation.AddCardIDs(ids...) uu.mutation.AddCardIDs(ids...)
@ -1700,6 +1895,69 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) {
if uu.mutation.CoinAtCleared() { if uu.mutation.CoinAtCleared() {
_spec.ClearField(user.FieldCoinAt, field.TypeTime) _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() { if uu.mutation.CardCleared() {
edge := &sqlgraph.EdgeSpec{ edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M, Rel: sqlgraph.O2M,
@ -3026,6 +3284,201 @@ func (uuo *UserUpdateOne) ClearCoinAt() *UserUpdateOne {
return uuo 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. // AddCardIDs adds the "card" edge to the Card entity by IDs.
func (uuo *UserUpdateOne) AddCardIDs(ids ...int) *UserUpdateOne { func (uuo *UserUpdateOne) AddCardIDs(ids ...int) *UserUpdateOne {
uuo.mutation.AddCardIDs(ids...) uuo.mutation.AddCardIDs(ids...)
@ -3598,6 +4051,69 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error)
if uuo.mutation.CoinAtCleared() { if uuo.mutation.CoinAtCleared() {
_spec.ClearField(user.FieldCoinAt, field.TypeTime) _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() { if uuo.mutation.CardCleared() {
edge := &sqlgraph.EdgeSpec{ edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M, Rel: sqlgraph.O2M,

View File

@ -1613,6 +1613,31 @@ func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (Crea
if v, ok := req.CoinAt.Get(); ok { if v, ok := req.CoinAt.Get(); ok {
b.SetCoinAt(v) 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. // Add all edges.
b.AddCardIDs(req.Card...) b.AddCardIDs(req.Card...)
b.AddUeIDs(req.Ue...) 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 { if v, ok := req.CoinAt.Get(); ok {
b.SetCoinAt(v) 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. // Add all edges.
if req.Card != nil { if req.Card != nil {
b.ClearCard().AddCardIDs(req.Card...) b.ClearCard().AddCardIDs(req.Card...)