add planet
This commit is contained in:
756
ent/mutation.go
756
ent/mutation.go
@@ -7642,6 +7642,19 @@ type UserMutation struct {
|
||||
addcoin *int
|
||||
coin_open *bool
|
||||
coin_at *time.Time
|
||||
planet *int
|
||||
addplanet *int
|
||||
planet_at *time.Time
|
||||
login *bool
|
||||
login_at *time.Time
|
||||
location_x *int
|
||||
addlocation_x *int
|
||||
location_y *int
|
||||
addlocation_y *int
|
||||
location_z *int
|
||||
addlocation_z *int
|
||||
location_n *int
|
||||
addlocation_n *int
|
||||
clearedFields map[string]struct{}
|
||||
card map[int]struct{}
|
||||
removedcard map[int]struct{}
|
||||
@@ -10707,6 +10720,503 @@ func (m *UserMutation) ResetCoinAt() {
|
||||
delete(m.clearedFields, user.FieldCoinAt)
|
||||
}
|
||||
|
||||
// SetPlanet sets the "planet" field.
|
||||
func (m *UserMutation) SetPlanet(i int) {
|
||||
m.planet = &i
|
||||
m.addplanet = nil
|
||||
}
|
||||
|
||||
// Planet returns the value of the "planet" field in the mutation.
|
||||
func (m *UserMutation) Planet() (r int, exists bool) {
|
||||
v := m.planet
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldPlanet returns the old "planet" field's value of the User entity.
|
||||
// If the User object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *UserMutation) OldPlanet(ctx context.Context) (v int, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldPlanet is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldPlanet requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldPlanet: %w", err)
|
||||
}
|
||||
return oldValue.Planet, nil
|
||||
}
|
||||
|
||||
// AddPlanet adds i to the "planet" field.
|
||||
func (m *UserMutation) AddPlanet(i int) {
|
||||
if m.addplanet != nil {
|
||||
*m.addplanet += i
|
||||
} else {
|
||||
m.addplanet = &i
|
||||
}
|
||||
}
|
||||
|
||||
// AddedPlanet returns the value that was added to the "planet" field in this mutation.
|
||||
func (m *UserMutation) AddedPlanet() (r int, exists bool) {
|
||||
v := m.addplanet
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearPlanet clears the value of the "planet" field.
|
||||
func (m *UserMutation) ClearPlanet() {
|
||||
m.planet = nil
|
||||
m.addplanet = nil
|
||||
m.clearedFields[user.FieldPlanet] = struct{}{}
|
||||
}
|
||||
|
||||
// PlanetCleared returns if the "planet" field was cleared in this mutation.
|
||||
func (m *UserMutation) PlanetCleared() bool {
|
||||
_, ok := m.clearedFields[user.FieldPlanet]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetPlanet resets all changes to the "planet" field.
|
||||
func (m *UserMutation) ResetPlanet() {
|
||||
m.planet = nil
|
||||
m.addplanet = nil
|
||||
delete(m.clearedFields, user.FieldPlanet)
|
||||
}
|
||||
|
||||
// SetPlanetAt sets the "planet_at" field.
|
||||
func (m *UserMutation) SetPlanetAt(t time.Time) {
|
||||
m.planet_at = &t
|
||||
}
|
||||
|
||||
// PlanetAt returns the value of the "planet_at" field in the mutation.
|
||||
func (m *UserMutation) PlanetAt() (r time.Time, exists bool) {
|
||||
v := m.planet_at
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldPlanetAt returns the old "planet_at" field's value of the User entity.
|
||||
// If the User object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *UserMutation) OldPlanetAt(ctx context.Context) (v time.Time, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldPlanetAt is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldPlanetAt requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldPlanetAt: %w", err)
|
||||
}
|
||||
return oldValue.PlanetAt, nil
|
||||
}
|
||||
|
||||
// ClearPlanetAt clears the value of the "planet_at" field.
|
||||
func (m *UserMutation) ClearPlanetAt() {
|
||||
m.planet_at = nil
|
||||
m.clearedFields[user.FieldPlanetAt] = struct{}{}
|
||||
}
|
||||
|
||||
// PlanetAtCleared returns if the "planet_at" field was cleared in this mutation.
|
||||
func (m *UserMutation) PlanetAtCleared() bool {
|
||||
_, ok := m.clearedFields[user.FieldPlanetAt]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetPlanetAt resets all changes to the "planet_at" field.
|
||||
func (m *UserMutation) ResetPlanetAt() {
|
||||
m.planet_at = nil
|
||||
delete(m.clearedFields, user.FieldPlanetAt)
|
||||
}
|
||||
|
||||
// SetLogin sets the "login" field.
|
||||
func (m *UserMutation) SetLogin(b bool) {
|
||||
m.login = &b
|
||||
}
|
||||
|
||||
// Login returns the value of the "login" field in the mutation.
|
||||
func (m *UserMutation) Login() (r bool, exists bool) {
|
||||
v := m.login
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldLogin returns the old "login" field's value of the User entity.
|
||||
// If the User object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *UserMutation) OldLogin(ctx context.Context) (v bool, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldLogin is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldLogin requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldLogin: %w", err)
|
||||
}
|
||||
return oldValue.Login, nil
|
||||
}
|
||||
|
||||
// ClearLogin clears the value of the "login" field.
|
||||
func (m *UserMutation) ClearLogin() {
|
||||
m.login = nil
|
||||
m.clearedFields[user.FieldLogin] = struct{}{}
|
||||
}
|
||||
|
||||
// LoginCleared returns if the "login" field was cleared in this mutation.
|
||||
func (m *UserMutation) LoginCleared() bool {
|
||||
_, ok := m.clearedFields[user.FieldLogin]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetLogin resets all changes to the "login" field.
|
||||
func (m *UserMutation) ResetLogin() {
|
||||
m.login = nil
|
||||
delete(m.clearedFields, user.FieldLogin)
|
||||
}
|
||||
|
||||
// SetLoginAt sets the "login_at" field.
|
||||
func (m *UserMutation) SetLoginAt(t time.Time) {
|
||||
m.login_at = &t
|
||||
}
|
||||
|
||||
// LoginAt returns the value of the "login_at" field in the mutation.
|
||||
func (m *UserMutation) LoginAt() (r time.Time, exists bool) {
|
||||
v := m.login_at
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldLoginAt returns the old "login_at" field's value of the User entity.
|
||||
// If the User object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *UserMutation) OldLoginAt(ctx context.Context) (v time.Time, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldLoginAt is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldLoginAt requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldLoginAt: %w", err)
|
||||
}
|
||||
return oldValue.LoginAt, nil
|
||||
}
|
||||
|
||||
// ClearLoginAt clears the value of the "login_at" field.
|
||||
func (m *UserMutation) ClearLoginAt() {
|
||||
m.login_at = nil
|
||||
m.clearedFields[user.FieldLoginAt] = struct{}{}
|
||||
}
|
||||
|
||||
// LoginAtCleared returns if the "login_at" field was cleared in this mutation.
|
||||
func (m *UserMutation) LoginAtCleared() bool {
|
||||
_, ok := m.clearedFields[user.FieldLoginAt]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetLoginAt resets all changes to the "login_at" field.
|
||||
func (m *UserMutation) ResetLoginAt() {
|
||||
m.login_at = nil
|
||||
delete(m.clearedFields, user.FieldLoginAt)
|
||||
}
|
||||
|
||||
// SetLocationX sets the "location_x" field.
|
||||
func (m *UserMutation) SetLocationX(i int) {
|
||||
m.location_x = &i
|
||||
m.addlocation_x = nil
|
||||
}
|
||||
|
||||
// LocationX returns the value of the "location_x" field in the mutation.
|
||||
func (m *UserMutation) LocationX() (r int, exists bool) {
|
||||
v := m.location_x
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldLocationX returns the old "location_x" field's value of the User entity.
|
||||
// If the User object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *UserMutation) OldLocationX(ctx context.Context) (v int, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldLocationX is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldLocationX requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldLocationX: %w", err)
|
||||
}
|
||||
return oldValue.LocationX, nil
|
||||
}
|
||||
|
||||
// AddLocationX adds i to the "location_x" field.
|
||||
func (m *UserMutation) AddLocationX(i int) {
|
||||
if m.addlocation_x != nil {
|
||||
*m.addlocation_x += i
|
||||
} else {
|
||||
m.addlocation_x = &i
|
||||
}
|
||||
}
|
||||
|
||||
// AddedLocationX returns the value that was added to the "location_x" field in this mutation.
|
||||
func (m *UserMutation) AddedLocationX() (r int, exists bool) {
|
||||
v := m.addlocation_x
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearLocationX clears the value of the "location_x" field.
|
||||
func (m *UserMutation) ClearLocationX() {
|
||||
m.location_x = nil
|
||||
m.addlocation_x = nil
|
||||
m.clearedFields[user.FieldLocationX] = struct{}{}
|
||||
}
|
||||
|
||||
// LocationXCleared returns if the "location_x" field was cleared in this mutation.
|
||||
func (m *UserMutation) LocationXCleared() bool {
|
||||
_, ok := m.clearedFields[user.FieldLocationX]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetLocationX resets all changes to the "location_x" field.
|
||||
func (m *UserMutation) ResetLocationX() {
|
||||
m.location_x = nil
|
||||
m.addlocation_x = nil
|
||||
delete(m.clearedFields, user.FieldLocationX)
|
||||
}
|
||||
|
||||
// SetLocationY sets the "location_y" field.
|
||||
func (m *UserMutation) SetLocationY(i int) {
|
||||
m.location_y = &i
|
||||
m.addlocation_y = nil
|
||||
}
|
||||
|
||||
// LocationY returns the value of the "location_y" field in the mutation.
|
||||
func (m *UserMutation) LocationY() (r int, exists bool) {
|
||||
v := m.location_y
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldLocationY returns the old "location_y" field's value of the User entity.
|
||||
// If the User object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *UserMutation) OldLocationY(ctx context.Context) (v int, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldLocationY is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldLocationY requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldLocationY: %w", err)
|
||||
}
|
||||
return oldValue.LocationY, nil
|
||||
}
|
||||
|
||||
// AddLocationY adds i to the "location_y" field.
|
||||
func (m *UserMutation) AddLocationY(i int) {
|
||||
if m.addlocation_y != nil {
|
||||
*m.addlocation_y += i
|
||||
} else {
|
||||
m.addlocation_y = &i
|
||||
}
|
||||
}
|
||||
|
||||
// AddedLocationY returns the value that was added to the "location_y" field in this mutation.
|
||||
func (m *UserMutation) AddedLocationY() (r int, exists bool) {
|
||||
v := m.addlocation_y
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearLocationY clears the value of the "location_y" field.
|
||||
func (m *UserMutation) ClearLocationY() {
|
||||
m.location_y = nil
|
||||
m.addlocation_y = nil
|
||||
m.clearedFields[user.FieldLocationY] = struct{}{}
|
||||
}
|
||||
|
||||
// LocationYCleared returns if the "location_y" field was cleared in this mutation.
|
||||
func (m *UserMutation) LocationYCleared() bool {
|
||||
_, ok := m.clearedFields[user.FieldLocationY]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetLocationY resets all changes to the "location_y" field.
|
||||
func (m *UserMutation) ResetLocationY() {
|
||||
m.location_y = nil
|
||||
m.addlocation_y = nil
|
||||
delete(m.clearedFields, user.FieldLocationY)
|
||||
}
|
||||
|
||||
// SetLocationZ sets the "location_z" field.
|
||||
func (m *UserMutation) SetLocationZ(i int) {
|
||||
m.location_z = &i
|
||||
m.addlocation_z = nil
|
||||
}
|
||||
|
||||
// LocationZ returns the value of the "location_z" field in the mutation.
|
||||
func (m *UserMutation) LocationZ() (r int, exists bool) {
|
||||
v := m.location_z
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldLocationZ returns the old "location_z" field's value of the User entity.
|
||||
// If the User object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *UserMutation) OldLocationZ(ctx context.Context) (v int, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldLocationZ is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldLocationZ requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldLocationZ: %w", err)
|
||||
}
|
||||
return oldValue.LocationZ, nil
|
||||
}
|
||||
|
||||
// AddLocationZ adds i to the "location_z" field.
|
||||
func (m *UserMutation) AddLocationZ(i int) {
|
||||
if m.addlocation_z != nil {
|
||||
*m.addlocation_z += i
|
||||
} else {
|
||||
m.addlocation_z = &i
|
||||
}
|
||||
}
|
||||
|
||||
// AddedLocationZ returns the value that was added to the "location_z" field in this mutation.
|
||||
func (m *UserMutation) AddedLocationZ() (r int, exists bool) {
|
||||
v := m.addlocation_z
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearLocationZ clears the value of the "location_z" field.
|
||||
func (m *UserMutation) ClearLocationZ() {
|
||||
m.location_z = nil
|
||||
m.addlocation_z = nil
|
||||
m.clearedFields[user.FieldLocationZ] = struct{}{}
|
||||
}
|
||||
|
||||
// LocationZCleared returns if the "location_z" field was cleared in this mutation.
|
||||
func (m *UserMutation) LocationZCleared() bool {
|
||||
_, ok := m.clearedFields[user.FieldLocationZ]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetLocationZ resets all changes to the "location_z" field.
|
||||
func (m *UserMutation) ResetLocationZ() {
|
||||
m.location_z = nil
|
||||
m.addlocation_z = nil
|
||||
delete(m.clearedFields, user.FieldLocationZ)
|
||||
}
|
||||
|
||||
// SetLocationN sets the "location_n" field.
|
||||
func (m *UserMutation) SetLocationN(i int) {
|
||||
m.location_n = &i
|
||||
m.addlocation_n = nil
|
||||
}
|
||||
|
||||
// LocationN returns the value of the "location_n" field in the mutation.
|
||||
func (m *UserMutation) LocationN() (r int, exists bool) {
|
||||
v := m.location_n
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldLocationN returns the old "location_n" field's value of the User entity.
|
||||
// If the User object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *UserMutation) OldLocationN(ctx context.Context) (v int, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldLocationN is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldLocationN requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldLocationN: %w", err)
|
||||
}
|
||||
return oldValue.LocationN, nil
|
||||
}
|
||||
|
||||
// AddLocationN adds i to the "location_n" field.
|
||||
func (m *UserMutation) AddLocationN(i int) {
|
||||
if m.addlocation_n != nil {
|
||||
*m.addlocation_n += i
|
||||
} else {
|
||||
m.addlocation_n = &i
|
||||
}
|
||||
}
|
||||
|
||||
// AddedLocationN returns the value that was added to the "location_n" field in this mutation.
|
||||
func (m *UserMutation) AddedLocationN() (r int, exists bool) {
|
||||
v := m.addlocation_n
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// ClearLocationN clears the value of the "location_n" field.
|
||||
func (m *UserMutation) ClearLocationN() {
|
||||
m.location_n = nil
|
||||
m.addlocation_n = nil
|
||||
m.clearedFields[user.FieldLocationN] = struct{}{}
|
||||
}
|
||||
|
||||
// LocationNCleared returns if the "location_n" field was cleared in this mutation.
|
||||
func (m *UserMutation) LocationNCleared() bool {
|
||||
_, ok := m.clearedFields[user.FieldLocationN]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetLocationN resets all changes to the "location_n" field.
|
||||
func (m *UserMutation) ResetLocationN() {
|
||||
m.location_n = nil
|
||||
m.addlocation_n = nil
|
||||
delete(m.clearedFields, user.FieldLocationN)
|
||||
}
|
||||
|
||||
// AddCardIDs adds the "card" edge to the Card entity by ids.
|
||||
func (m *UserMutation) AddCardIDs(ids ...int) {
|
||||
if m.card == nil {
|
||||
@@ -10957,7 +11467,7 @@ func (m *UserMutation) Type() string {
|
||||
// order to get all numeric fields that were incremented/decremented, call
|
||||
// AddedFields().
|
||||
func (m *UserMutation) Fields() []string {
|
||||
fields := make([]string, 0, 53)
|
||||
fields := make([]string, 0, 61)
|
||||
if m.username != nil {
|
||||
fields = append(fields, user.FieldUsername)
|
||||
}
|
||||
@@ -11117,6 +11627,30 @@ func (m *UserMutation) Fields() []string {
|
||||
if m.coin_at != nil {
|
||||
fields = append(fields, user.FieldCoinAt)
|
||||
}
|
||||
if m.planet != nil {
|
||||
fields = append(fields, user.FieldPlanet)
|
||||
}
|
||||
if m.planet_at != nil {
|
||||
fields = append(fields, user.FieldPlanetAt)
|
||||
}
|
||||
if m.login != nil {
|
||||
fields = append(fields, user.FieldLogin)
|
||||
}
|
||||
if m.login_at != nil {
|
||||
fields = append(fields, user.FieldLoginAt)
|
||||
}
|
||||
if m.location_x != nil {
|
||||
fields = append(fields, user.FieldLocationX)
|
||||
}
|
||||
if m.location_y != nil {
|
||||
fields = append(fields, user.FieldLocationY)
|
||||
}
|
||||
if m.location_z != nil {
|
||||
fields = append(fields, user.FieldLocationZ)
|
||||
}
|
||||
if m.location_n != nil {
|
||||
fields = append(fields, user.FieldLocationN)
|
||||
}
|
||||
return fields
|
||||
}
|
||||
|
||||
@@ -11231,6 +11765,22 @@ func (m *UserMutation) Field(name string) (ent.Value, bool) {
|
||||
return m.CoinOpen()
|
||||
case user.FieldCoinAt:
|
||||
return m.CoinAt()
|
||||
case user.FieldPlanet:
|
||||
return m.Planet()
|
||||
case user.FieldPlanetAt:
|
||||
return m.PlanetAt()
|
||||
case user.FieldLogin:
|
||||
return m.Login()
|
||||
case user.FieldLoginAt:
|
||||
return m.LoginAt()
|
||||
case user.FieldLocationX:
|
||||
return m.LocationX()
|
||||
case user.FieldLocationY:
|
||||
return m.LocationY()
|
||||
case user.FieldLocationZ:
|
||||
return m.LocationZ()
|
||||
case user.FieldLocationN:
|
||||
return m.LocationN()
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
@@ -11346,6 +11896,22 @@ func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, er
|
||||
return m.OldCoinOpen(ctx)
|
||||
case user.FieldCoinAt:
|
||||
return m.OldCoinAt(ctx)
|
||||
case user.FieldPlanet:
|
||||
return m.OldPlanet(ctx)
|
||||
case user.FieldPlanetAt:
|
||||
return m.OldPlanetAt(ctx)
|
||||
case user.FieldLogin:
|
||||
return m.OldLogin(ctx)
|
||||
case user.FieldLoginAt:
|
||||
return m.OldLoginAt(ctx)
|
||||
case user.FieldLocationX:
|
||||
return m.OldLocationX(ctx)
|
||||
case user.FieldLocationY:
|
||||
return m.OldLocationY(ctx)
|
||||
case user.FieldLocationZ:
|
||||
return m.OldLocationZ(ctx)
|
||||
case user.FieldLocationN:
|
||||
return m.OldLocationN(ctx)
|
||||
}
|
||||
return nil, fmt.Errorf("unknown User field %s", name)
|
||||
}
|
||||
@@ -11726,6 +12292,62 @@ func (m *UserMutation) SetField(name string, value ent.Value) error {
|
||||
}
|
||||
m.SetCoinAt(v)
|
||||
return nil
|
||||
case user.FieldPlanet:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetPlanet(v)
|
||||
return nil
|
||||
case user.FieldPlanetAt:
|
||||
v, ok := value.(time.Time)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetPlanetAt(v)
|
||||
return nil
|
||||
case user.FieldLogin:
|
||||
v, ok := value.(bool)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetLogin(v)
|
||||
return nil
|
||||
case user.FieldLoginAt:
|
||||
v, ok := value.(time.Time)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetLoginAt(v)
|
||||
return nil
|
||||
case user.FieldLocationX:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetLocationX(v)
|
||||
return nil
|
||||
case user.FieldLocationY:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetLocationY(v)
|
||||
return nil
|
||||
case user.FieldLocationZ:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetLocationZ(v)
|
||||
return nil
|
||||
case user.FieldLocationN:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetLocationN(v)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown User field %s", name)
|
||||
}
|
||||
@@ -11788,6 +12410,21 @@ func (m *UserMutation) AddedFields() []string {
|
||||
if m.addcoin != nil {
|
||||
fields = append(fields, user.FieldCoin)
|
||||
}
|
||||
if m.addplanet != nil {
|
||||
fields = append(fields, user.FieldPlanet)
|
||||
}
|
||||
if m.addlocation_x != nil {
|
||||
fields = append(fields, user.FieldLocationX)
|
||||
}
|
||||
if m.addlocation_y != nil {
|
||||
fields = append(fields, user.FieldLocationY)
|
||||
}
|
||||
if m.addlocation_z != nil {
|
||||
fields = append(fields, user.FieldLocationZ)
|
||||
}
|
||||
if m.addlocation_n != nil {
|
||||
fields = append(fields, user.FieldLocationN)
|
||||
}
|
||||
return fields
|
||||
}
|
||||
|
||||
@@ -11832,6 +12469,16 @@ func (m *UserMutation) AddedField(name string) (ent.Value, bool) {
|
||||
return m.AddedGameStory()
|
||||
case user.FieldCoin:
|
||||
return m.AddedCoin()
|
||||
case user.FieldPlanet:
|
||||
return m.AddedPlanet()
|
||||
case user.FieldLocationX:
|
||||
return m.AddedLocationX()
|
||||
case user.FieldLocationY:
|
||||
return m.AddedLocationY()
|
||||
case user.FieldLocationZ:
|
||||
return m.AddedLocationZ()
|
||||
case user.FieldLocationN:
|
||||
return m.AddedLocationN()
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
@@ -11967,6 +12614,41 @@ func (m *UserMutation) AddField(name string, value ent.Value) error {
|
||||
}
|
||||
m.AddCoin(v)
|
||||
return nil
|
||||
case user.FieldPlanet:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.AddPlanet(v)
|
||||
return nil
|
||||
case user.FieldLocationX:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.AddLocationX(v)
|
||||
return nil
|
||||
case user.FieldLocationY:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.AddLocationY(v)
|
||||
return nil
|
||||
case user.FieldLocationZ:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.AddLocationZ(v)
|
||||
return nil
|
||||
case user.FieldLocationN:
|
||||
v, ok := value.(int)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.AddLocationN(v)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown User numeric field %s", name)
|
||||
}
|
||||
@@ -12128,6 +12810,30 @@ func (m *UserMutation) ClearedFields() []string {
|
||||
if m.FieldCleared(user.FieldCoinAt) {
|
||||
fields = append(fields, user.FieldCoinAt)
|
||||
}
|
||||
if m.FieldCleared(user.FieldPlanet) {
|
||||
fields = append(fields, user.FieldPlanet)
|
||||
}
|
||||
if m.FieldCleared(user.FieldPlanetAt) {
|
||||
fields = append(fields, user.FieldPlanetAt)
|
||||
}
|
||||
if m.FieldCleared(user.FieldLogin) {
|
||||
fields = append(fields, user.FieldLogin)
|
||||
}
|
||||
if m.FieldCleared(user.FieldLoginAt) {
|
||||
fields = append(fields, user.FieldLoginAt)
|
||||
}
|
||||
if m.FieldCleared(user.FieldLocationX) {
|
||||
fields = append(fields, user.FieldLocationX)
|
||||
}
|
||||
if m.FieldCleared(user.FieldLocationY) {
|
||||
fields = append(fields, user.FieldLocationY)
|
||||
}
|
||||
if m.FieldCleared(user.FieldLocationZ) {
|
||||
fields = append(fields, user.FieldLocationZ)
|
||||
}
|
||||
if m.FieldCleared(user.FieldLocationN) {
|
||||
fields = append(fields, user.FieldLocationN)
|
||||
}
|
||||
return fields
|
||||
}
|
||||
|
||||
@@ -12295,6 +13001,30 @@ func (m *UserMutation) ClearField(name string) error {
|
||||
case user.FieldCoinAt:
|
||||
m.ClearCoinAt()
|
||||
return nil
|
||||
case user.FieldPlanet:
|
||||
m.ClearPlanet()
|
||||
return nil
|
||||
case user.FieldPlanetAt:
|
||||
m.ClearPlanetAt()
|
||||
return nil
|
||||
case user.FieldLogin:
|
||||
m.ClearLogin()
|
||||
return nil
|
||||
case user.FieldLoginAt:
|
||||
m.ClearLoginAt()
|
||||
return nil
|
||||
case user.FieldLocationX:
|
||||
m.ClearLocationX()
|
||||
return nil
|
||||
case user.FieldLocationY:
|
||||
m.ClearLocationY()
|
||||
return nil
|
||||
case user.FieldLocationZ:
|
||||
m.ClearLocationZ()
|
||||
return nil
|
||||
case user.FieldLocationN:
|
||||
m.ClearLocationN()
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown User nullable field %s", name)
|
||||
}
|
||||
@@ -12462,6 +13192,30 @@ func (m *UserMutation) ResetField(name string) error {
|
||||
case user.FieldCoinAt:
|
||||
m.ResetCoinAt()
|
||||
return nil
|
||||
case user.FieldPlanet:
|
||||
m.ResetPlanet()
|
||||
return nil
|
||||
case user.FieldPlanetAt:
|
||||
m.ResetPlanetAt()
|
||||
return nil
|
||||
case user.FieldLogin:
|
||||
m.ResetLogin()
|
||||
return nil
|
||||
case user.FieldLoginAt:
|
||||
m.ResetLoginAt()
|
||||
return nil
|
||||
case user.FieldLocationX:
|
||||
m.ResetLocationX()
|
||||
return nil
|
||||
case user.FieldLocationY:
|
||||
m.ResetLocationY()
|
||||
return nil
|
||||
case user.FieldLocationZ:
|
||||
m.ResetLocationZ()
|
||||
return nil
|
||||
case user.FieldLocationN:
|
||||
m.ResetLocationN()
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown User field %s", name)
|
||||
}
|
||||
|
Reference in New Issue
Block a user