fix planet float
This commit is contained in:
parent
4c0c396086
commit
9222892c61
@ -228,7 +228,7 @@ 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", Type: field.TypeFloat64, Nullable: true},
|
||||||
{Name: "planet_at", Type: field.TypeTime, Nullable: true},
|
{Name: "planet_at", Type: field.TypeTime, Nullable: true},
|
||||||
{Name: "login", Type: field.TypeBool, Nullable: true, Default: false},
|
{Name: "login", Type: field.TypeBool, Nullable: true, Default: false},
|
||||||
{Name: "login_at", Type: field.TypeTime, Nullable: true},
|
{Name: "login_at", Type: field.TypeTime, Nullable: true},
|
||||||
|
@ -7642,8 +7642,8 @@ type UserMutation struct {
|
|||||||
addcoin *int
|
addcoin *int
|
||||||
coin_open *bool
|
coin_open *bool
|
||||||
coin_at *time.Time
|
coin_at *time.Time
|
||||||
planet *int
|
planet *float64
|
||||||
addplanet *int
|
addplanet *float64
|
||||||
planet_at *time.Time
|
planet_at *time.Time
|
||||||
login *bool
|
login *bool
|
||||||
login_at *time.Time
|
login_at *time.Time
|
||||||
@ -10721,13 +10721,13 @@ func (m *UserMutation) ResetCoinAt() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetPlanet sets the "planet" field.
|
// SetPlanet sets the "planet" field.
|
||||||
func (m *UserMutation) SetPlanet(i int) {
|
func (m *UserMutation) SetPlanet(f float64) {
|
||||||
m.planet = &i
|
m.planet = &f
|
||||||
m.addplanet = nil
|
m.addplanet = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Planet returns the value of the "planet" field in the mutation.
|
// Planet returns the value of the "planet" field in the mutation.
|
||||||
func (m *UserMutation) Planet() (r int, exists bool) {
|
func (m *UserMutation) Planet() (r float64, exists bool) {
|
||||||
v := m.planet
|
v := m.planet
|
||||||
if v == nil {
|
if v == nil {
|
||||||
return
|
return
|
||||||
@ -10738,7 +10738,7 @@ func (m *UserMutation) Planet() (r int, exists bool) {
|
|||||||
// OldPlanet returns the old "planet" field's value of the User entity.
|
// 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.
|
// 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.
|
// 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) {
|
func (m *UserMutation) OldPlanet(ctx context.Context) (v float64, err error) {
|
||||||
if !m.op.Is(OpUpdateOne) {
|
if !m.op.Is(OpUpdateOne) {
|
||||||
return v, errors.New("OldPlanet is only allowed on UpdateOne operations")
|
return v, errors.New("OldPlanet is only allowed on UpdateOne operations")
|
||||||
}
|
}
|
||||||
@ -10752,17 +10752,17 @@ func (m *UserMutation) OldPlanet(ctx context.Context) (v int, err error) {
|
|||||||
return oldValue.Planet, nil
|
return oldValue.Planet, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddPlanet adds i to the "planet" field.
|
// AddPlanet adds f to the "planet" field.
|
||||||
func (m *UserMutation) AddPlanet(i int) {
|
func (m *UserMutation) AddPlanet(f float64) {
|
||||||
if m.addplanet != nil {
|
if m.addplanet != nil {
|
||||||
*m.addplanet += i
|
*m.addplanet += f
|
||||||
} else {
|
} else {
|
||||||
m.addplanet = &i
|
m.addplanet = &f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddedPlanet returns the value that was added to the "planet" field in this mutation.
|
// AddedPlanet returns the value that was added to the "planet" field in this mutation.
|
||||||
func (m *UserMutation) AddedPlanet() (r int, exists bool) {
|
func (m *UserMutation) AddedPlanet() (r float64, exists bool) {
|
||||||
v := m.addplanet
|
v := m.addplanet
|
||||||
if v == nil {
|
if v == nil {
|
||||||
return
|
return
|
||||||
@ -12293,7 +12293,7 @@ func (m *UserMutation) SetField(name string, value ent.Value) error {
|
|||||||
m.SetCoinAt(v)
|
m.SetCoinAt(v)
|
||||||
return nil
|
return nil
|
||||||
case user.FieldPlanet:
|
case user.FieldPlanet:
|
||||||
v, ok := value.(int)
|
v, ok := value.(float64)
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||||
}
|
}
|
||||||
@ -12615,7 +12615,7 @@ func (m *UserMutation) AddField(name string, value ent.Value) error {
|
|||||||
m.AddCoin(v)
|
m.AddCoin(v)
|
||||||
return nil
|
return nil
|
||||||
case user.FieldPlanet:
|
case user.FieldPlanet:
|
||||||
v, ok := value.(int)
|
v, ok := value.(float64)
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||||
}
|
}
|
||||||
|
@ -429,6 +429,15 @@ func (c *Client) sendCreateUser(ctx context.Context, request *CreateUserReq) (re
|
|||||||
otelAttrs := []attribute.KeyValue{
|
otelAttrs := []attribute.KeyValue{
|
||||||
otelogen.OperationID("createUser"),
|
otelogen.OperationID("createUser"),
|
||||||
}
|
}
|
||||||
|
// Validate request before sending.
|
||||||
|
if err := func() error {
|
||||||
|
if err := request.Validate(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
return res, errors.Wrap(err, "validate")
|
||||||
|
}
|
||||||
|
|
||||||
// Run stopwatch.
|
// Run stopwatch.
|
||||||
startTime := time.Now()
|
startTime := time.Now()
|
||||||
@ -3648,6 +3657,15 @@ func (c *Client) sendUpdateUser(ctx context.Context, request *UpdateUserReq, par
|
|||||||
otelAttrs := []attribute.KeyValue{
|
otelAttrs := []attribute.KeyValue{
|
||||||
otelogen.OperationID("updateUser"),
|
otelogen.OperationID("updateUser"),
|
||||||
}
|
}
|
||||||
|
// Validate request before sending.
|
||||||
|
if err := func() error {
|
||||||
|
if err := request.Validate(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
return res, errors.Wrap(err, "validate")
|
||||||
|
}
|
||||||
|
|
||||||
// Run stopwatch.
|
// Run stopwatch.
|
||||||
startTime := time.Now()
|
startTime := time.Now()
|
||||||
|
@ -10141,6 +10141,41 @@ func (s *OptDateTime) UnmarshalJSON(data []byte) error {
|
|||||||
return s.Decode(d, json.DecodeDateTime)
|
return s.Decode(d, json.DecodeDateTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Encode encodes float64 as json.
|
||||||
|
func (o OptFloat64) Encode(e *jx.Encoder) {
|
||||||
|
if !o.Set {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
e.Float64(float64(o.Value))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Decode decodes float64 from json.
|
||||||
|
func (o *OptFloat64) Decode(d *jx.Decoder) error {
|
||||||
|
if o == nil {
|
||||||
|
return errors.New("invalid: unable to decode OptFloat64 to nil")
|
||||||
|
}
|
||||||
|
o.Set = true
|
||||||
|
v, err := d.Float64()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
o.Value = float64(v)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalJSON implements stdjson.Marshaler.
|
||||||
|
func (s OptFloat64) MarshalJSON() ([]byte, error) {
|
||||||
|
e := jx.Encoder{}
|
||||||
|
s.Encode(&e)
|
||||||
|
return e.Bytes(), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON implements stdjson.Unmarshaler.
|
||||||
|
func (s *OptFloat64) UnmarshalJSON(data []byte) error {
|
||||||
|
d := jx.DecodeBytes(data)
|
||||||
|
return s.Decode(d)
|
||||||
|
}
|
||||||
|
|
||||||
// Encode encodes int as json.
|
// Encode encodes int as json.
|
||||||
func (o OptInt) Encode(e *jx.Encoder) {
|
func (o OptInt) Encode(e *jx.Encoder) {
|
||||||
if !o.Set {
|
if !o.Set {
|
||||||
|
@ -387,6 +387,14 @@ func (s *Server) decodeCreateUserRequest(r *http.Request) (
|
|||||||
}
|
}
|
||||||
return req, close, err
|
return req, close, err
|
||||||
}
|
}
|
||||||
|
if err := func() error {
|
||||||
|
if err := request.Validate(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
return req, close, errors.Wrap(err, "validate")
|
||||||
|
}
|
||||||
return &request, close, nil
|
return &request, close, nil
|
||||||
default:
|
default:
|
||||||
return req, close, validate.InvalidContentType(ct)
|
return req, close, validate.InvalidContentType(ct)
|
||||||
@ -765,6 +773,14 @@ func (s *Server) decodeUpdateUserRequest(r *http.Request) (
|
|||||||
}
|
}
|
||||||
return req, close, err
|
return req, close, err
|
||||||
}
|
}
|
||||||
|
if err := func() error {
|
||||||
|
if err := request.Validate(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
return req, close, errors.Wrap(err, "validate")
|
||||||
|
}
|
||||||
return &request, close, nil
|
return &request, close, nil
|
||||||
default:
|
default:
|
||||||
return req, close, validate.InvalidContentType(ct)
|
return req, close, validate.InvalidContentType(ct)
|
||||||
|
@ -270,7 +270,7 @@ type CardOwnerRead struct {
|
|||||||
Coin OptInt `json:"coin"`
|
Coin OptInt `json:"coin"`
|
||||||
CoinOpen OptBool `json:"coin_open"`
|
CoinOpen OptBool `json:"coin_open"`
|
||||||
CoinAt OptDateTime `json:"coin_at"`
|
CoinAt OptDateTime `json:"coin_at"`
|
||||||
Planet OptInt `json:"planet"`
|
Planet OptFloat64 `json:"planet"`
|
||||||
PlanetAt OptDateTime `json:"planet_at"`
|
PlanetAt OptDateTime `json:"planet_at"`
|
||||||
Login OptBool `json:"login"`
|
Login OptBool `json:"login"`
|
||||||
LoginAt OptDateTime `json:"login_at"`
|
LoginAt OptDateTime `json:"login_at"`
|
||||||
@ -541,7 +541,7 @@ func (s *CardOwnerRead) GetCoinAt() OptDateTime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetPlanet returns the value of Planet.
|
// GetPlanet returns the value of Planet.
|
||||||
func (s *CardOwnerRead) GetPlanet() OptInt {
|
func (s *CardOwnerRead) GetPlanet() OptFloat64 {
|
||||||
return s.Planet
|
return s.Planet
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -841,7 +841,7 @@ func (s *CardOwnerRead) SetCoinAt(val OptDateTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetPlanet sets the value of Planet.
|
// SetPlanet sets the value of Planet.
|
||||||
func (s *CardOwnerRead) SetPlanet(val OptInt) {
|
func (s *CardOwnerRead) SetPlanet(val OptFloat64) {
|
||||||
s.Planet = val
|
s.Planet = val
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1997,7 +1997,7 @@ type CreateUserReq struct {
|
|||||||
Coin OptInt `json:"coin"`
|
Coin OptInt `json:"coin"`
|
||||||
CoinOpen OptBool `json:"coin_open"`
|
CoinOpen OptBool `json:"coin_open"`
|
||||||
CoinAt OptDateTime `json:"coin_at"`
|
CoinAt OptDateTime `json:"coin_at"`
|
||||||
Planet OptInt `json:"planet"`
|
Planet OptFloat64 `json:"planet"`
|
||||||
PlanetAt OptDateTime `json:"planet_at"`
|
PlanetAt OptDateTime `json:"planet_at"`
|
||||||
Login OptBool `json:"login"`
|
Login OptBool `json:"login"`
|
||||||
LoginAt OptDateTime `json:"login_at"`
|
LoginAt OptDateTime `json:"login_at"`
|
||||||
@ -2277,7 +2277,7 @@ func (s *CreateUserReq) GetCoinAt() OptDateTime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetPlanet returns the value of Planet.
|
// GetPlanet returns the value of Planet.
|
||||||
func (s *CreateUserReq) GetPlanet() OptInt {
|
func (s *CreateUserReq) GetPlanet() OptFloat64 {
|
||||||
return s.Planet
|
return s.Planet
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2602,7 +2602,7 @@ func (s *CreateUserReq) SetCoinAt(val OptDateTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetPlanet sets the value of Planet.
|
// SetPlanet sets the value of Planet.
|
||||||
func (s *CreateUserReq) SetPlanet(val OptInt) {
|
func (s *CreateUserReq) SetPlanet(val OptFloat64) {
|
||||||
s.Planet = val
|
s.Planet = val
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2861,7 +2861,7 @@ type GroupUsersList struct {
|
|||||||
Coin OptInt `json:"coin"`
|
Coin OptInt `json:"coin"`
|
||||||
CoinOpen OptBool `json:"coin_open"`
|
CoinOpen OptBool `json:"coin_open"`
|
||||||
CoinAt OptDateTime `json:"coin_at"`
|
CoinAt OptDateTime `json:"coin_at"`
|
||||||
Planet OptInt `json:"planet"`
|
Planet OptFloat64 `json:"planet"`
|
||||||
PlanetAt OptDateTime `json:"planet_at"`
|
PlanetAt OptDateTime `json:"planet_at"`
|
||||||
Login OptBool `json:"login"`
|
Login OptBool `json:"login"`
|
||||||
LoginAt OptDateTime `json:"login_at"`
|
LoginAt OptDateTime `json:"login_at"`
|
||||||
@ -3132,7 +3132,7 @@ func (s *GroupUsersList) GetCoinAt() OptDateTime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetPlanet returns the value of Planet.
|
// GetPlanet returns the value of Planet.
|
||||||
func (s *GroupUsersList) GetPlanet() OptInt {
|
func (s *GroupUsersList) GetPlanet() OptFloat64 {
|
||||||
return s.Planet
|
return s.Planet
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3432,7 +3432,7 @@ func (s *GroupUsersList) SetCoinAt(val OptDateTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetPlanet sets the value of Planet.
|
// SetPlanet sets the value of Planet.
|
||||||
func (s *GroupUsersList) SetPlanet(val OptInt) {
|
func (s *GroupUsersList) SetPlanet(val OptFloat64) {
|
||||||
s.Planet = val
|
s.Planet = val
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4063,7 +4063,7 @@ type MaOwnerRead struct {
|
|||||||
Coin OptInt `json:"coin"`
|
Coin OptInt `json:"coin"`
|
||||||
CoinOpen OptBool `json:"coin_open"`
|
CoinOpen OptBool `json:"coin_open"`
|
||||||
CoinAt OptDateTime `json:"coin_at"`
|
CoinAt OptDateTime `json:"coin_at"`
|
||||||
Planet OptInt `json:"planet"`
|
Planet OptFloat64 `json:"planet"`
|
||||||
PlanetAt OptDateTime `json:"planet_at"`
|
PlanetAt OptDateTime `json:"planet_at"`
|
||||||
Login OptBool `json:"login"`
|
Login OptBool `json:"login"`
|
||||||
LoginAt OptDateTime `json:"login_at"`
|
LoginAt OptDateTime `json:"login_at"`
|
||||||
@ -4334,7 +4334,7 @@ func (s *MaOwnerRead) GetCoinAt() OptDateTime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetPlanet returns the value of Planet.
|
// GetPlanet returns the value of Planet.
|
||||||
func (s *MaOwnerRead) GetPlanet() OptInt {
|
func (s *MaOwnerRead) GetPlanet() OptFloat64 {
|
||||||
return s.Planet
|
return s.Planet
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4634,7 +4634,7 @@ func (s *MaOwnerRead) SetCoinAt(val OptDateTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetPlanet sets the value of Planet.
|
// SetPlanet sets the value of Planet.
|
||||||
func (s *MaOwnerRead) SetPlanet(val OptInt) {
|
func (s *MaOwnerRead) SetPlanet(val OptFloat64) {
|
||||||
s.Planet = val
|
s.Planet = val
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5263,6 +5263,52 @@ func (o OptDateTime) Or(d time.Time) time.Time {
|
|||||||
return d
|
return d
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewOptFloat64 returns new OptFloat64 with value set to v.
|
||||||
|
func NewOptFloat64(v float64) OptFloat64 {
|
||||||
|
return OptFloat64{
|
||||||
|
Value: v,
|
||||||
|
Set: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// OptFloat64 is optional float64.
|
||||||
|
type OptFloat64 struct {
|
||||||
|
Value float64
|
||||||
|
Set bool
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSet returns true if OptFloat64 was set.
|
||||||
|
func (o OptFloat64) IsSet() bool { return o.Set }
|
||||||
|
|
||||||
|
// Reset unsets value.
|
||||||
|
func (o *OptFloat64) Reset() {
|
||||||
|
var v float64
|
||||||
|
o.Value = v
|
||||||
|
o.Set = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTo sets value to v.
|
||||||
|
func (o *OptFloat64) SetTo(v float64) {
|
||||||
|
o.Set = true
|
||||||
|
o.Value = v
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get returns value and boolean that denotes whether value was set.
|
||||||
|
func (o OptFloat64) Get() (v float64, ok bool) {
|
||||||
|
if !o.Set {
|
||||||
|
return v, false
|
||||||
|
}
|
||||||
|
return o.Value, true
|
||||||
|
}
|
||||||
|
|
||||||
|
// Or returns value if set, or given parameter if does not.
|
||||||
|
func (o OptFloat64) Or(d float64) float64 {
|
||||||
|
if v, ok := o.Get(); ok {
|
||||||
|
return v
|
||||||
|
}
|
||||||
|
return d
|
||||||
|
}
|
||||||
|
|
||||||
// NewOptInt returns new OptInt with value set to v.
|
// NewOptInt returns new OptInt with value set to v.
|
||||||
func NewOptInt(v int) OptInt {
|
func NewOptInt(v int) OptInt {
|
||||||
return OptInt{
|
return OptInt{
|
||||||
@ -5959,7 +6005,7 @@ type SevOwnerRead struct {
|
|||||||
Coin OptInt `json:"coin"`
|
Coin OptInt `json:"coin"`
|
||||||
CoinOpen OptBool `json:"coin_open"`
|
CoinOpen OptBool `json:"coin_open"`
|
||||||
CoinAt OptDateTime `json:"coin_at"`
|
CoinAt OptDateTime `json:"coin_at"`
|
||||||
Planet OptInt `json:"planet"`
|
Planet OptFloat64 `json:"planet"`
|
||||||
PlanetAt OptDateTime `json:"planet_at"`
|
PlanetAt OptDateTime `json:"planet_at"`
|
||||||
Login OptBool `json:"login"`
|
Login OptBool `json:"login"`
|
||||||
LoginAt OptDateTime `json:"login_at"`
|
LoginAt OptDateTime `json:"login_at"`
|
||||||
@ -6230,7 +6276,7 @@ func (s *SevOwnerRead) GetCoinAt() OptDateTime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetPlanet returns the value of Planet.
|
// GetPlanet returns the value of Planet.
|
||||||
func (s *SevOwnerRead) GetPlanet() OptInt {
|
func (s *SevOwnerRead) GetPlanet() OptFloat64 {
|
||||||
return s.Planet
|
return s.Planet
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6530,7 +6576,7 @@ func (s *SevOwnerRead) SetCoinAt(val OptDateTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetPlanet sets the value of Planet.
|
// SetPlanet sets the value of Planet.
|
||||||
func (s *SevOwnerRead) SetPlanet(val OptInt) {
|
func (s *SevOwnerRead) SetPlanet(val OptFloat64) {
|
||||||
s.Planet = val
|
s.Planet = val
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7395,7 +7441,7 @@ type UeOwnerRead struct {
|
|||||||
Coin OptInt `json:"coin"`
|
Coin OptInt `json:"coin"`
|
||||||
CoinOpen OptBool `json:"coin_open"`
|
CoinOpen OptBool `json:"coin_open"`
|
||||||
CoinAt OptDateTime `json:"coin_at"`
|
CoinAt OptDateTime `json:"coin_at"`
|
||||||
Planet OptInt `json:"planet"`
|
Planet OptFloat64 `json:"planet"`
|
||||||
PlanetAt OptDateTime `json:"planet_at"`
|
PlanetAt OptDateTime `json:"planet_at"`
|
||||||
Login OptBool `json:"login"`
|
Login OptBool `json:"login"`
|
||||||
LoginAt OptDateTime `json:"login_at"`
|
LoginAt OptDateTime `json:"login_at"`
|
||||||
@ -7666,7 +7712,7 @@ func (s *UeOwnerRead) GetCoinAt() OptDateTime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetPlanet returns the value of Planet.
|
// GetPlanet returns the value of Planet.
|
||||||
func (s *UeOwnerRead) GetPlanet() OptInt {
|
func (s *UeOwnerRead) GetPlanet() OptFloat64 {
|
||||||
return s.Planet
|
return s.Planet
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7966,7 +8012,7 @@ func (s *UeOwnerRead) SetCoinAt(val OptDateTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetPlanet sets the value of Planet.
|
// SetPlanet sets the value of Planet.
|
||||||
func (s *UeOwnerRead) SetPlanet(val OptInt) {
|
func (s *UeOwnerRead) SetPlanet(val OptFloat64) {
|
||||||
s.Planet = val
|
s.Planet = val
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9328,7 +9374,7 @@ type UpdateUserReq struct {
|
|||||||
Coin OptInt `json:"coin"`
|
Coin OptInt `json:"coin"`
|
||||||
CoinOpen OptBool `json:"coin_open"`
|
CoinOpen OptBool `json:"coin_open"`
|
||||||
CoinAt OptDateTime `json:"coin_at"`
|
CoinAt OptDateTime `json:"coin_at"`
|
||||||
Planet OptInt `json:"planet"`
|
Planet OptFloat64 `json:"planet"`
|
||||||
PlanetAt OptDateTime `json:"planet_at"`
|
PlanetAt OptDateTime `json:"planet_at"`
|
||||||
Login OptBool `json:"login"`
|
Login OptBool `json:"login"`
|
||||||
LoginAt OptDateTime `json:"login_at"`
|
LoginAt OptDateTime `json:"login_at"`
|
||||||
@ -9593,7 +9639,7 @@ func (s *UpdateUserReq) GetCoinAt() OptDateTime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetPlanet returns the value of Planet.
|
// GetPlanet returns the value of Planet.
|
||||||
func (s *UpdateUserReq) GetPlanet() OptInt {
|
func (s *UpdateUserReq) GetPlanet() OptFloat64 {
|
||||||
return s.Planet
|
return s.Planet
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9903,7 +9949,7 @@ func (s *UpdateUserReq) SetCoinAt(val OptDateTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetPlanet sets the value of Planet.
|
// SetPlanet sets the value of Planet.
|
||||||
func (s *UpdateUserReq) SetPlanet(val OptInt) {
|
func (s *UpdateUserReq) SetPlanet(val OptFloat64) {
|
||||||
s.Planet = val
|
s.Planet = val
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10119,7 +10165,7 @@ type UserCreate struct {
|
|||||||
Coin OptInt `json:"coin"`
|
Coin OptInt `json:"coin"`
|
||||||
CoinOpen OptBool `json:"coin_open"`
|
CoinOpen OptBool `json:"coin_open"`
|
||||||
CoinAt OptDateTime `json:"coin_at"`
|
CoinAt OptDateTime `json:"coin_at"`
|
||||||
Planet OptInt `json:"planet"`
|
Planet OptFloat64 `json:"planet"`
|
||||||
PlanetAt OptDateTime `json:"planet_at"`
|
PlanetAt OptDateTime `json:"planet_at"`
|
||||||
Login OptBool `json:"login"`
|
Login OptBool `json:"login"`
|
||||||
LoginAt OptDateTime `json:"login_at"`
|
LoginAt OptDateTime `json:"login_at"`
|
||||||
@ -10390,7 +10436,7 @@ func (s *UserCreate) GetCoinAt() OptDateTime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetPlanet returns the value of Planet.
|
// GetPlanet returns the value of Planet.
|
||||||
func (s *UserCreate) GetPlanet() OptInt {
|
func (s *UserCreate) GetPlanet() OptFloat64 {
|
||||||
return s.Planet
|
return s.Planet
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10690,7 +10736,7 @@ func (s *UserCreate) SetCoinAt(val OptDateTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetPlanet sets the value of Planet.
|
// SetPlanet sets the value of Planet.
|
||||||
func (s *UserCreate) SetPlanet(val OptInt) {
|
func (s *UserCreate) SetPlanet(val OptFloat64) {
|
||||||
s.Planet = val
|
s.Planet = val
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10785,7 +10831,7 @@ type UserList struct {
|
|||||||
Coin OptInt `json:"coin"`
|
Coin OptInt `json:"coin"`
|
||||||
CoinOpen OptBool `json:"coin_open"`
|
CoinOpen OptBool `json:"coin_open"`
|
||||||
CoinAt OptDateTime `json:"coin_at"`
|
CoinAt OptDateTime `json:"coin_at"`
|
||||||
Planet OptInt `json:"planet"`
|
Planet OptFloat64 `json:"planet"`
|
||||||
PlanetAt OptDateTime `json:"planet_at"`
|
PlanetAt OptDateTime `json:"planet_at"`
|
||||||
Login OptBool `json:"login"`
|
Login OptBool `json:"login"`
|
||||||
LoginAt OptDateTime `json:"login_at"`
|
LoginAt OptDateTime `json:"login_at"`
|
||||||
@ -11056,7 +11102,7 @@ func (s *UserList) GetCoinAt() OptDateTime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetPlanet returns the value of Planet.
|
// GetPlanet returns the value of Planet.
|
||||||
func (s *UserList) GetPlanet() OptInt {
|
func (s *UserList) GetPlanet() OptFloat64 {
|
||||||
return s.Planet
|
return s.Planet
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -11356,7 +11402,7 @@ func (s *UserList) SetCoinAt(val OptDateTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetPlanet sets the value of Planet.
|
// SetPlanet sets the value of Planet.
|
||||||
func (s *UserList) SetPlanet(val OptInt) {
|
func (s *UserList) SetPlanet(val OptFloat64) {
|
||||||
s.Planet = val
|
s.Planet = val
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -11695,7 +11741,7 @@ type UserRead struct {
|
|||||||
Coin OptInt `json:"coin"`
|
Coin OptInt `json:"coin"`
|
||||||
CoinOpen OptBool `json:"coin_open"`
|
CoinOpen OptBool `json:"coin_open"`
|
||||||
CoinAt OptDateTime `json:"coin_at"`
|
CoinAt OptDateTime `json:"coin_at"`
|
||||||
Planet OptInt `json:"planet"`
|
Planet OptFloat64 `json:"planet"`
|
||||||
PlanetAt OptDateTime `json:"planet_at"`
|
PlanetAt OptDateTime `json:"planet_at"`
|
||||||
Login OptBool `json:"login"`
|
Login OptBool `json:"login"`
|
||||||
LoginAt OptDateTime `json:"login_at"`
|
LoginAt OptDateTime `json:"login_at"`
|
||||||
@ -11966,7 +12012,7 @@ func (s *UserRead) GetCoinAt() OptDateTime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetPlanet returns the value of Planet.
|
// GetPlanet returns the value of Planet.
|
||||||
func (s *UserRead) GetPlanet() OptInt {
|
func (s *UserRead) GetPlanet() OptFloat64 {
|
||||||
return s.Planet
|
return s.Planet
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12266,7 +12312,7 @@ func (s *UserRead) SetCoinAt(val OptDateTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetPlanet sets the value of Planet.
|
// SetPlanet sets the value of Planet.
|
||||||
func (s *UserRead) SetPlanet(val OptInt) {
|
func (s *UserRead) SetPlanet(val OptFloat64) {
|
||||||
s.Planet = val
|
s.Planet = val
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12743,7 +12789,7 @@ type UserUpdate struct {
|
|||||||
Coin OptInt `json:"coin"`
|
Coin OptInt `json:"coin"`
|
||||||
CoinOpen OptBool `json:"coin_open"`
|
CoinOpen OptBool `json:"coin_open"`
|
||||||
CoinAt OptDateTime `json:"coin_at"`
|
CoinAt OptDateTime `json:"coin_at"`
|
||||||
Planet OptInt `json:"planet"`
|
Planet OptFloat64 `json:"planet"`
|
||||||
PlanetAt OptDateTime `json:"planet_at"`
|
PlanetAt OptDateTime `json:"planet_at"`
|
||||||
Login OptBool `json:"login"`
|
Login OptBool `json:"login"`
|
||||||
LoginAt OptDateTime `json:"login_at"`
|
LoginAt OptDateTime `json:"login_at"`
|
||||||
@ -13014,7 +13060,7 @@ func (s *UserUpdate) GetCoinAt() OptDateTime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetPlanet returns the value of Planet.
|
// GetPlanet returns the value of Planet.
|
||||||
func (s *UserUpdate) GetPlanet() OptInt {
|
func (s *UserUpdate) GetPlanet() OptFloat64 {
|
||||||
return s.Planet
|
return s.Planet
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -13314,7 +13360,7 @@ func (s *UserUpdate) SetCoinAt(val OptDateTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetPlanet sets the value of Planet.
|
// SetPlanet sets the value of Planet.
|
||||||
func (s *UserUpdate) SetPlanet(val OptInt) {
|
func (s *UserUpdate) SetPlanet(val OptFloat64) {
|
||||||
s.Planet = val
|
s.Planet = val
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,9 +3,88 @@
|
|||||||
package ogent
|
package ogent
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/go-faster/errors"
|
"github.com/go-faster/errors"
|
||||||
|
|
||||||
|
"github.com/ogen-go/ogen/validate"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (s *CardOwnerRead) Validate() error {
|
||||||
|
var failures []validate.FieldError
|
||||||
|
if err := func() error {
|
||||||
|
if s.Planet.Set {
|
||||||
|
if err := func() error {
|
||||||
|
if err := (validate.Float{}).Validate(float64(s.Planet.Value)); err != nil {
|
||||||
|
return errors.Wrap(err, "float")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
failures = append(failures, validate.FieldError{
|
||||||
|
Name: "planet",
|
||||||
|
Error: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if len(failures) > 0 {
|
||||||
|
return &validate.Error{Fields: failures}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (s *CreateUserReq) Validate() error {
|
||||||
|
var failures []validate.FieldError
|
||||||
|
if err := func() error {
|
||||||
|
if s.Planet.Set {
|
||||||
|
if err := func() error {
|
||||||
|
if err := (validate.Float{}).Validate(float64(s.Planet.Value)); err != nil {
|
||||||
|
return errors.Wrap(err, "float")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
failures = append(failures, validate.FieldError{
|
||||||
|
Name: "planet",
|
||||||
|
Error: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if len(failures) > 0 {
|
||||||
|
return &validate.Error{Fields: failures}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (s *GroupUsersList) Validate() error {
|
||||||
|
var failures []validate.FieldError
|
||||||
|
if err := func() error {
|
||||||
|
if s.Planet.Set {
|
||||||
|
if err := func() error {
|
||||||
|
if err := (validate.Float{}).Validate(float64(s.Planet.Value)); err != nil {
|
||||||
|
return errors.Wrap(err, "float")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
failures = append(failures, validate.FieldError{
|
||||||
|
Name: "planet",
|
||||||
|
Error: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if len(failures) > 0 {
|
||||||
|
return &validate.Error{Fields: failures}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (s ListCardOKApplicationJSON) Validate() error {
|
func (s ListCardOKApplicationJSON) Validate() error {
|
||||||
if s == nil {
|
if s == nil {
|
||||||
return errors.New("nil is invalid value")
|
return errors.New("nil is invalid value")
|
||||||
@ -22,6 +101,23 @@ func (s ListGroupUsersOKApplicationJSON) Validate() error {
|
|||||||
if s == nil {
|
if s == nil {
|
||||||
return errors.New("nil is invalid value")
|
return errors.New("nil is invalid value")
|
||||||
}
|
}
|
||||||
|
var failures []validate.FieldError
|
||||||
|
for i, elem := range s {
|
||||||
|
if err := func() error {
|
||||||
|
if err := elem.Validate(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
failures = append(failures, validate.FieldError{
|
||||||
|
Name: fmt.Sprintf("[%d]", i),
|
||||||
|
Error: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(failures) > 0 {
|
||||||
|
return &validate.Error{Fields: failures}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (s ListMaOKApplicationJSON) Validate() error {
|
func (s ListMaOKApplicationJSON) Validate() error {
|
||||||
@ -58,6 +154,23 @@ func (s ListUserOKApplicationJSON) Validate() error {
|
|||||||
if s == nil {
|
if s == nil {
|
||||||
return errors.New("nil is invalid value")
|
return errors.New("nil is invalid value")
|
||||||
}
|
}
|
||||||
|
var failures []validate.FieldError
|
||||||
|
for i, elem := range s {
|
||||||
|
if err := func() error {
|
||||||
|
if err := elem.Validate(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
failures = append(failures, validate.FieldError{
|
||||||
|
Name: fmt.Sprintf("[%d]", i),
|
||||||
|
Error: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(failures) > 0 {
|
||||||
|
return &validate.Error{Fields: failures}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (s ListUserSevOKApplicationJSON) Validate() error {
|
func (s ListUserSevOKApplicationJSON) Validate() error {
|
||||||
@ -72,3 +185,204 @@ func (s ListUserUeOKApplicationJSON) Validate() error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (s *MaOwnerRead) Validate() error {
|
||||||
|
var failures []validate.FieldError
|
||||||
|
if err := func() error {
|
||||||
|
if s.Planet.Set {
|
||||||
|
if err := func() error {
|
||||||
|
if err := (validate.Float{}).Validate(float64(s.Planet.Value)); err != nil {
|
||||||
|
return errors.Wrap(err, "float")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
failures = append(failures, validate.FieldError{
|
||||||
|
Name: "planet",
|
||||||
|
Error: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if len(failures) > 0 {
|
||||||
|
return &validate.Error{Fields: failures}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *SevOwnerRead) Validate() error {
|
||||||
|
var failures []validate.FieldError
|
||||||
|
if err := func() error {
|
||||||
|
if s.Planet.Set {
|
||||||
|
if err := func() error {
|
||||||
|
if err := (validate.Float{}).Validate(float64(s.Planet.Value)); err != nil {
|
||||||
|
return errors.Wrap(err, "float")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
failures = append(failures, validate.FieldError{
|
||||||
|
Name: "planet",
|
||||||
|
Error: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if len(failures) > 0 {
|
||||||
|
return &validate.Error{Fields: failures}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (s *UeOwnerRead) Validate() error {
|
||||||
|
var failures []validate.FieldError
|
||||||
|
if err := func() error {
|
||||||
|
if s.Planet.Set {
|
||||||
|
if err := func() error {
|
||||||
|
if err := (validate.Float{}).Validate(float64(s.Planet.Value)); err != nil {
|
||||||
|
return errors.Wrap(err, "float")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
failures = append(failures, validate.FieldError{
|
||||||
|
Name: "planet",
|
||||||
|
Error: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if len(failures) > 0 {
|
||||||
|
return &validate.Error{Fields: failures}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (s *UpdateUserReq) Validate() error {
|
||||||
|
var failures []validate.FieldError
|
||||||
|
if err := func() error {
|
||||||
|
if s.Planet.Set {
|
||||||
|
if err := func() error {
|
||||||
|
if err := (validate.Float{}).Validate(float64(s.Planet.Value)); err != nil {
|
||||||
|
return errors.Wrap(err, "float")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
failures = append(failures, validate.FieldError{
|
||||||
|
Name: "planet",
|
||||||
|
Error: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if len(failures) > 0 {
|
||||||
|
return &validate.Error{Fields: failures}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (s *UserCreate) Validate() error {
|
||||||
|
var failures []validate.FieldError
|
||||||
|
if err := func() error {
|
||||||
|
if s.Planet.Set {
|
||||||
|
if err := func() error {
|
||||||
|
if err := (validate.Float{}).Validate(float64(s.Planet.Value)); err != nil {
|
||||||
|
return errors.Wrap(err, "float")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
failures = append(failures, validate.FieldError{
|
||||||
|
Name: "planet",
|
||||||
|
Error: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if len(failures) > 0 {
|
||||||
|
return &validate.Error{Fields: failures}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (s *UserList) Validate() error {
|
||||||
|
var failures []validate.FieldError
|
||||||
|
if err := func() error {
|
||||||
|
if s.Planet.Set {
|
||||||
|
if err := func() error {
|
||||||
|
if err := (validate.Float{}).Validate(float64(s.Planet.Value)); err != nil {
|
||||||
|
return errors.Wrap(err, "float")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
failures = append(failures, validate.FieldError{
|
||||||
|
Name: "planet",
|
||||||
|
Error: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if len(failures) > 0 {
|
||||||
|
return &validate.Error{Fields: failures}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (s *UserRead) Validate() error {
|
||||||
|
var failures []validate.FieldError
|
||||||
|
if err := func() error {
|
||||||
|
if s.Planet.Set {
|
||||||
|
if err := func() error {
|
||||||
|
if err := (validate.Float{}).Validate(float64(s.Planet.Value)); err != nil {
|
||||||
|
return errors.Wrap(err, "float")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
failures = append(failures, validate.FieldError{
|
||||||
|
Name: "planet",
|
||||||
|
Error: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if len(failures) > 0 {
|
||||||
|
return &validate.Error{Fields: failures}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (s *UserUpdate) Validate() error {
|
||||||
|
var failures []validate.FieldError
|
||||||
|
if err := func() error {
|
||||||
|
if s.Planet.Set {
|
||||||
|
if err := func() error {
|
||||||
|
if err := (validate.Float{}).Validate(float64(s.Planet.Value)); err != nil {
|
||||||
|
return errors.Wrap(err, "float")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
failures = append(failures, validate.FieldError{
|
||||||
|
Name: "planet",
|
||||||
|
Error: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if len(failures) > 0 {
|
||||||
|
return &validate.Error{Fields: failures}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
@ -201,7 +201,7 @@ 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.Planet = NewOptFloat64(e.Planet)
|
||||||
ret.PlanetAt = NewOptDateTime(e.PlanetAt)
|
ret.PlanetAt = NewOptDateTime(e.PlanetAt)
|
||||||
ret.Login = NewOptBool(e.Login)
|
ret.Login = NewOptBool(e.Login)
|
||||||
ret.LoginAt = NewOptDateTime(e.LoginAt)
|
ret.LoginAt = NewOptDateTime(e.LoginAt)
|
||||||
@ -399,7 +399,7 @@ 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.Planet = NewOptFloat64(e.Planet)
|
||||||
ret.PlanetAt = NewOptDateTime(e.PlanetAt)
|
ret.PlanetAt = NewOptDateTime(e.PlanetAt)
|
||||||
ret.Login = NewOptBool(e.Login)
|
ret.Login = NewOptBool(e.Login)
|
||||||
ret.LoginAt = NewOptDateTime(e.LoginAt)
|
ret.LoginAt = NewOptDateTime(e.LoginAt)
|
||||||
@ -677,7 +677,7 @@ 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.Planet = NewOptFloat64(e.Planet)
|
||||||
ret.PlanetAt = NewOptDateTime(e.PlanetAt)
|
ret.PlanetAt = NewOptDateTime(e.PlanetAt)
|
||||||
ret.Login = NewOptBool(e.Login)
|
ret.Login = NewOptBool(e.Login)
|
||||||
ret.LoginAt = NewOptDateTime(e.LoginAt)
|
ret.LoginAt = NewOptDateTime(e.LoginAt)
|
||||||
@ -911,7 +911,7 @@ 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.Planet = NewOptFloat64(e.Planet)
|
||||||
ret.PlanetAt = NewOptDateTime(e.PlanetAt)
|
ret.PlanetAt = NewOptDateTime(e.PlanetAt)
|
||||||
ret.Login = NewOptBool(e.Login)
|
ret.Login = NewOptBool(e.Login)
|
||||||
ret.LoginAt = NewOptDateTime(e.LoginAt)
|
ret.LoginAt = NewOptDateTime(e.LoginAt)
|
||||||
@ -1193,7 +1193,7 @@ 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.Planet = NewOptFloat64(e.Planet)
|
||||||
ret.PlanetAt = NewOptDateTime(e.PlanetAt)
|
ret.PlanetAt = NewOptDateTime(e.PlanetAt)
|
||||||
ret.Login = NewOptBool(e.Login)
|
ret.Login = NewOptBool(e.Login)
|
||||||
ret.LoginAt = NewOptDateTime(e.LoginAt)
|
ret.LoginAt = NewOptDateTime(e.LoginAt)
|
||||||
@ -1279,7 +1279,7 @@ 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.Planet = NewOptFloat64(e.Planet)
|
||||||
ret.PlanetAt = NewOptDateTime(e.PlanetAt)
|
ret.PlanetAt = NewOptDateTime(e.PlanetAt)
|
||||||
ret.Login = NewOptBool(e.Login)
|
ret.Login = NewOptBool(e.Login)
|
||||||
ret.LoginAt = NewOptDateTime(e.LoginAt)
|
ret.LoginAt = NewOptDateTime(e.LoginAt)
|
||||||
@ -1365,7 +1365,7 @@ 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.Planet = NewOptFloat64(e.Planet)
|
||||||
ret.PlanetAt = NewOptDateTime(e.PlanetAt)
|
ret.PlanetAt = NewOptDateTime(e.PlanetAt)
|
||||||
ret.Login = NewOptBool(e.Login)
|
ret.Login = NewOptBool(e.Login)
|
||||||
ret.LoginAt = NewOptDateTime(e.LoginAt)
|
ret.LoginAt = NewOptDateTime(e.LoginAt)
|
||||||
@ -1451,7 +1451,7 @@ 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.Planet = NewOptFloat64(e.Planet)
|
||||||
ret.PlanetAt = NewOptDateTime(e.PlanetAt)
|
ret.PlanetAt = NewOptDateTime(e.PlanetAt)
|
||||||
ret.Login = NewOptBool(e.Login)
|
ret.Login = NewOptBool(e.Login)
|
||||||
ret.LoginAt = NewOptDateTime(e.LoginAt)
|
ret.LoginAt = NewOptDateTime(e.LoginAt)
|
||||||
@ -1537,7 +1537,7 @@ 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.Planet = NewOptFloat64(e.Planet)
|
||||||
ret.PlanetAt = NewOptDateTime(e.PlanetAt)
|
ret.PlanetAt = NewOptDateTime(e.PlanetAt)
|
||||||
ret.Login = NewOptBool(e.Login)
|
ret.Login = NewOptBool(e.Login)
|
||||||
ret.LoginAt = NewOptDateTime(e.LoginAt)
|
ret.LoginAt = NewOptDateTime(e.LoginAt)
|
||||||
|
@ -2164,7 +2164,8 @@
|
|||||||
"format": "date-time"
|
"format": "date-time"
|
||||||
},
|
},
|
||||||
"planet": {
|
"planet": {
|
||||||
"type": "integer"
|
"type": "number",
|
||||||
|
"format": "double"
|
||||||
},
|
},
|
||||||
"planet_at": {
|
"planet_at": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@ -2511,7 +2512,8 @@
|
|||||||
"format": "date-time"
|
"format": "date-time"
|
||||||
},
|
},
|
||||||
"planet": {
|
"planet": {
|
||||||
"type": "integer"
|
"type": "number",
|
||||||
|
"format": "double"
|
||||||
},
|
},
|
||||||
"planet_at": {
|
"planet_at": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@ -3237,7 +3239,8 @@
|
|||||||
"format": "date-time"
|
"format": "date-time"
|
||||||
},
|
},
|
||||||
"planet": {
|
"planet": {
|
||||||
"type": "integer"
|
"type": "number",
|
||||||
|
"format": "double"
|
||||||
},
|
},
|
||||||
"planet_at": {
|
"planet_at": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@ -3523,7 +3526,8 @@
|
|||||||
"format": "date-time"
|
"format": "date-time"
|
||||||
},
|
},
|
||||||
"planet": {
|
"planet": {
|
||||||
"type": "integer"
|
"type": "number",
|
||||||
|
"format": "double"
|
||||||
},
|
},
|
||||||
"planet_at": {
|
"planet_at": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@ -4115,7 +4119,8 @@
|
|||||||
"format": "date-time"
|
"format": "date-time"
|
||||||
},
|
},
|
||||||
"planet": {
|
"planet": {
|
||||||
"type": "integer"
|
"type": "number",
|
||||||
|
"format": "double"
|
||||||
},
|
},
|
||||||
"planet_at": {
|
"planet_at": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@ -4542,7 +4547,8 @@
|
|||||||
"format": "date-time"
|
"format": "date-time"
|
||||||
},
|
},
|
||||||
"planet": {
|
"planet": {
|
||||||
"type": "integer"
|
"type": "number",
|
||||||
|
"format": "double"
|
||||||
},
|
},
|
||||||
"planet_at": {
|
"planet_at": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@ -5144,7 +5150,8 @@
|
|||||||
"format": "date-time"
|
"format": "date-time"
|
||||||
},
|
},
|
||||||
"planet": {
|
"planet": {
|
||||||
"type": "integer"
|
"type": "number",
|
||||||
|
"format": "double"
|
||||||
},
|
},
|
||||||
"planet_at": {
|
"planet_at": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@ -5351,7 +5358,8 @@
|
|||||||
"format": "date-time"
|
"format": "date-time"
|
||||||
},
|
},
|
||||||
"planet": {
|
"planet": {
|
||||||
"type": "integer"
|
"type": "number",
|
||||||
|
"format": "double"
|
||||||
},
|
},
|
||||||
"planet_at": {
|
"planet_at": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@ -5577,7 +5585,8 @@
|
|||||||
"format": "date-time"
|
"format": "date-time"
|
||||||
},
|
},
|
||||||
"planet": {
|
"planet": {
|
||||||
"type": "integer"
|
"type": "number",
|
||||||
|
"format": "double"
|
||||||
},
|
},
|
||||||
"planet_at": {
|
"planet_at": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@ -5778,7 +5787,8 @@
|
|||||||
"format": "date-time"
|
"format": "date-time"
|
||||||
},
|
},
|
||||||
"planet": {
|
"planet": {
|
||||||
"type": "integer"
|
"type": "number",
|
||||||
|
"format": "double"
|
||||||
},
|
},
|
||||||
"planet_at": {
|
"planet_at": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@ -5979,7 +5989,8 @@
|
|||||||
"format": "date-time"
|
"format": "date-time"
|
||||||
},
|
},
|
||||||
"planet": {
|
"planet": {
|
||||||
"type": "integer"
|
"type": "number",
|
||||||
|
"format": "double"
|
||||||
},
|
},
|
||||||
"planet_at": {
|
"planet_at": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@ -6180,7 +6191,8 @@
|
|||||||
"format": "date-time"
|
"format": "date-time"
|
||||||
},
|
},
|
||||||
"planet": {
|
"planet": {
|
||||||
"type": "integer"
|
"type": "number",
|
||||||
|
"format": "double"
|
||||||
},
|
},
|
||||||
"planet_at": {
|
"planet_at": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -241,7 +241,7 @@ func (User) Fields() []ent.Field {
|
|||||||
return time.Now().In(jst)
|
return time.Now().In(jst)
|
||||||
}),
|
}),
|
||||||
|
|
||||||
field.Int("planet").
|
field.Float("planet").
|
||||||
Optional(),
|
Optional(),
|
||||||
|
|
||||||
field.Time("planet_at").
|
field.Time("planet_at").
|
||||||
|
10
ent/user.go
10
ent/user.go
@ -124,7 +124,7 @@ type User struct {
|
|||||||
// 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 holds the value of the "planet" field.
|
||||||
Planet int `json:"planet,omitempty"`
|
Planet float64 `json:"planet,omitempty"`
|
||||||
// PlanetAt holds the value of the "planet_at" field.
|
// PlanetAt holds the value of the "planet_at" field.
|
||||||
PlanetAt time.Time `json:"planet_at,omitempty"`
|
PlanetAt time.Time `json:"planet_at,omitempty"`
|
||||||
// Login holds the value of the "login" field.
|
// Login holds the value of the "login" field.
|
||||||
@ -204,7 +204,9 @@ func (*User) scanValues(columns []string) ([]any, error) {
|
|||||||
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, user.FieldLogin:
|
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, user.FieldPlanet, user.FieldLocationX, user.FieldLocationY, user.FieldLocationZ, user.FieldLocationN:
|
case user.FieldPlanet:
|
||||||
|
values[i] = new(sql.NullFloat64)
|
||||||
|
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.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)
|
||||||
@ -552,10 +554,10 @@ func (u *User) assignValues(columns []string, values []any) error {
|
|||||||
u.CoinAt = value.Time
|
u.CoinAt = value.Time
|
||||||
}
|
}
|
||||||
case user.FieldPlanet:
|
case user.FieldPlanet:
|
||||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
if value, ok := values[i].(*sql.NullFloat64); !ok {
|
||||||
return fmt.Errorf("unexpected type %T for field planet", values[i])
|
return fmt.Errorf("unexpected type %T for field planet", values[i])
|
||||||
} else if value.Valid {
|
} else if value.Valid {
|
||||||
u.Planet = int(value.Int64)
|
u.Planet = value.Float64
|
||||||
}
|
}
|
||||||
case user.FieldPlanetAt:
|
case user.FieldPlanetAt:
|
||||||
if value, ok := values[i].(*sql.NullTime); !ok {
|
if value, ok := values[i].(*sql.NullTime); !ok {
|
||||||
|
@ -321,7 +321,7 @@ func CoinAt(v time.Time) predicate.User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Planet applies equality check predicate on the "planet" field. It's identical to PlanetEQ.
|
// Planet applies equality check predicate on the "planet" field. It's identical to PlanetEQ.
|
||||||
func Planet(v int) predicate.User {
|
func Planet(v float64) predicate.User {
|
||||||
return predicate.User(sql.FieldEQ(FieldPlanet, v))
|
return predicate.User(sql.FieldEQ(FieldPlanet, v))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2736,42 +2736,42 @@ func CoinAtNotNil() predicate.User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// PlanetEQ applies the EQ predicate on the "planet" field.
|
// PlanetEQ applies the EQ predicate on the "planet" field.
|
||||||
func PlanetEQ(v int) predicate.User {
|
func PlanetEQ(v float64) predicate.User {
|
||||||
return predicate.User(sql.FieldEQ(FieldPlanet, v))
|
return predicate.User(sql.FieldEQ(FieldPlanet, v))
|
||||||
}
|
}
|
||||||
|
|
||||||
// PlanetNEQ applies the NEQ predicate on the "planet" field.
|
// PlanetNEQ applies the NEQ predicate on the "planet" field.
|
||||||
func PlanetNEQ(v int) predicate.User {
|
func PlanetNEQ(v float64) predicate.User {
|
||||||
return predicate.User(sql.FieldNEQ(FieldPlanet, v))
|
return predicate.User(sql.FieldNEQ(FieldPlanet, v))
|
||||||
}
|
}
|
||||||
|
|
||||||
// PlanetIn applies the In predicate on the "planet" field.
|
// PlanetIn applies the In predicate on the "planet" field.
|
||||||
func PlanetIn(vs ...int) predicate.User {
|
func PlanetIn(vs ...float64) predicate.User {
|
||||||
return predicate.User(sql.FieldIn(FieldPlanet, vs...))
|
return predicate.User(sql.FieldIn(FieldPlanet, vs...))
|
||||||
}
|
}
|
||||||
|
|
||||||
// PlanetNotIn applies the NotIn predicate on the "planet" field.
|
// PlanetNotIn applies the NotIn predicate on the "planet" field.
|
||||||
func PlanetNotIn(vs ...int) predicate.User {
|
func PlanetNotIn(vs ...float64) predicate.User {
|
||||||
return predicate.User(sql.FieldNotIn(FieldPlanet, vs...))
|
return predicate.User(sql.FieldNotIn(FieldPlanet, vs...))
|
||||||
}
|
}
|
||||||
|
|
||||||
// PlanetGT applies the GT predicate on the "planet" field.
|
// PlanetGT applies the GT predicate on the "planet" field.
|
||||||
func PlanetGT(v int) predicate.User {
|
func PlanetGT(v float64) predicate.User {
|
||||||
return predicate.User(sql.FieldGT(FieldPlanet, v))
|
return predicate.User(sql.FieldGT(FieldPlanet, v))
|
||||||
}
|
}
|
||||||
|
|
||||||
// PlanetGTE applies the GTE predicate on the "planet" field.
|
// PlanetGTE applies the GTE predicate on the "planet" field.
|
||||||
func PlanetGTE(v int) predicate.User {
|
func PlanetGTE(v float64) predicate.User {
|
||||||
return predicate.User(sql.FieldGTE(FieldPlanet, v))
|
return predicate.User(sql.FieldGTE(FieldPlanet, v))
|
||||||
}
|
}
|
||||||
|
|
||||||
// PlanetLT applies the LT predicate on the "planet" field.
|
// PlanetLT applies the LT predicate on the "planet" field.
|
||||||
func PlanetLT(v int) predicate.User {
|
func PlanetLT(v float64) predicate.User {
|
||||||
return predicate.User(sql.FieldLT(FieldPlanet, v))
|
return predicate.User(sql.FieldLT(FieldPlanet, v))
|
||||||
}
|
}
|
||||||
|
|
||||||
// PlanetLTE applies the LTE predicate on the "planet" field.
|
// PlanetLTE applies the LTE predicate on the "planet" field.
|
||||||
func PlanetLTE(v int) predicate.User {
|
func PlanetLTE(v float64) predicate.User {
|
||||||
return predicate.User(sql.FieldLTE(FieldPlanet, v))
|
return predicate.User(sql.FieldLTE(FieldPlanet, v))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -751,15 +751,15 @@ func (uc *UserCreate) SetNillableCoinAt(t *time.Time) *UserCreate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetPlanet sets the "planet" field.
|
// SetPlanet sets the "planet" field.
|
||||||
func (uc *UserCreate) SetPlanet(i int) *UserCreate {
|
func (uc *UserCreate) SetPlanet(f float64) *UserCreate {
|
||||||
uc.mutation.SetPlanet(i)
|
uc.mutation.SetPlanet(f)
|
||||||
return uc
|
return uc
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetNillablePlanet sets the "planet" field if the given value is not nil.
|
// SetNillablePlanet sets the "planet" field if the given value is not nil.
|
||||||
func (uc *UserCreate) SetNillablePlanet(i *int) *UserCreate {
|
func (uc *UserCreate) SetNillablePlanet(f *float64) *UserCreate {
|
||||||
if i != nil {
|
if f != nil {
|
||||||
uc.SetPlanet(*i)
|
uc.SetPlanet(*f)
|
||||||
}
|
}
|
||||||
return uc
|
return uc
|
||||||
}
|
}
|
||||||
@ -1328,7 +1328,7 @@ func (uc *UserCreate) createSpec() (*User, *sqlgraph.CreateSpec) {
|
|||||||
_node.CoinAt = value
|
_node.CoinAt = value
|
||||||
}
|
}
|
||||||
if value, ok := uc.mutation.Planet(); ok {
|
if value, ok := uc.mutation.Planet(); ok {
|
||||||
_spec.SetField(user.FieldPlanet, field.TypeInt, value)
|
_spec.SetField(user.FieldPlanet, field.TypeFloat64, value)
|
||||||
_node.Planet = value
|
_node.Planet = value
|
||||||
}
|
}
|
||||||
if value, ok := uc.mutation.PlanetAt(); ok {
|
if value, ok := uc.mutation.PlanetAt(); ok {
|
||||||
|
@ -1159,23 +1159,23 @@ func (uu *UserUpdate) ClearCoinAt() *UserUpdate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetPlanet sets the "planet" field.
|
// SetPlanet sets the "planet" field.
|
||||||
func (uu *UserUpdate) SetPlanet(i int) *UserUpdate {
|
func (uu *UserUpdate) SetPlanet(f float64) *UserUpdate {
|
||||||
uu.mutation.ResetPlanet()
|
uu.mutation.ResetPlanet()
|
||||||
uu.mutation.SetPlanet(i)
|
uu.mutation.SetPlanet(f)
|
||||||
return uu
|
return uu
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetNillablePlanet sets the "planet" field if the given value is not nil.
|
// SetNillablePlanet sets the "planet" field if the given value is not nil.
|
||||||
func (uu *UserUpdate) SetNillablePlanet(i *int) *UserUpdate {
|
func (uu *UserUpdate) SetNillablePlanet(f *float64) *UserUpdate {
|
||||||
if i != nil {
|
if f != nil {
|
||||||
uu.SetPlanet(*i)
|
uu.SetPlanet(*f)
|
||||||
}
|
}
|
||||||
return uu
|
return uu
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddPlanet adds i to the "planet" field.
|
// AddPlanet adds f to the "planet" field.
|
||||||
func (uu *UserUpdate) AddPlanet(i int) *UserUpdate {
|
func (uu *UserUpdate) AddPlanet(f float64) *UserUpdate {
|
||||||
uu.mutation.AddPlanet(i)
|
uu.mutation.AddPlanet(f)
|
||||||
return uu
|
return uu
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1896,13 +1896,13 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
|||||||
_spec.ClearField(user.FieldCoinAt, field.TypeTime)
|
_spec.ClearField(user.FieldCoinAt, field.TypeTime)
|
||||||
}
|
}
|
||||||
if value, ok := uu.mutation.Planet(); ok {
|
if value, ok := uu.mutation.Planet(); ok {
|
||||||
_spec.SetField(user.FieldPlanet, field.TypeInt, value)
|
_spec.SetField(user.FieldPlanet, field.TypeFloat64, value)
|
||||||
}
|
}
|
||||||
if value, ok := uu.mutation.AddedPlanet(); ok {
|
if value, ok := uu.mutation.AddedPlanet(); ok {
|
||||||
_spec.AddField(user.FieldPlanet, field.TypeInt, value)
|
_spec.AddField(user.FieldPlanet, field.TypeFloat64, value)
|
||||||
}
|
}
|
||||||
if uu.mutation.PlanetCleared() {
|
if uu.mutation.PlanetCleared() {
|
||||||
_spec.ClearField(user.FieldPlanet, field.TypeInt)
|
_spec.ClearField(user.FieldPlanet, field.TypeFloat64)
|
||||||
}
|
}
|
||||||
if value, ok := uu.mutation.PlanetAt(); ok {
|
if value, ok := uu.mutation.PlanetAt(); ok {
|
||||||
_spec.SetField(user.FieldPlanetAt, field.TypeTime, value)
|
_spec.SetField(user.FieldPlanetAt, field.TypeTime, value)
|
||||||
@ -3285,23 +3285,23 @@ func (uuo *UserUpdateOne) ClearCoinAt() *UserUpdateOne {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetPlanet sets the "planet" field.
|
// SetPlanet sets the "planet" field.
|
||||||
func (uuo *UserUpdateOne) SetPlanet(i int) *UserUpdateOne {
|
func (uuo *UserUpdateOne) SetPlanet(f float64) *UserUpdateOne {
|
||||||
uuo.mutation.ResetPlanet()
|
uuo.mutation.ResetPlanet()
|
||||||
uuo.mutation.SetPlanet(i)
|
uuo.mutation.SetPlanet(f)
|
||||||
return uuo
|
return uuo
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetNillablePlanet sets the "planet" field if the given value is not nil.
|
// SetNillablePlanet sets the "planet" field if the given value is not nil.
|
||||||
func (uuo *UserUpdateOne) SetNillablePlanet(i *int) *UserUpdateOne {
|
func (uuo *UserUpdateOne) SetNillablePlanet(f *float64) *UserUpdateOne {
|
||||||
if i != nil {
|
if f != nil {
|
||||||
uuo.SetPlanet(*i)
|
uuo.SetPlanet(*f)
|
||||||
}
|
}
|
||||||
return uuo
|
return uuo
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddPlanet adds i to the "planet" field.
|
// AddPlanet adds f to the "planet" field.
|
||||||
func (uuo *UserUpdateOne) AddPlanet(i int) *UserUpdateOne {
|
func (uuo *UserUpdateOne) AddPlanet(f float64) *UserUpdateOne {
|
||||||
uuo.mutation.AddPlanet(i)
|
uuo.mutation.AddPlanet(f)
|
||||||
return uuo
|
return uuo
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4052,13 +4052,13 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error)
|
|||||||
_spec.ClearField(user.FieldCoinAt, field.TypeTime)
|
_spec.ClearField(user.FieldCoinAt, field.TypeTime)
|
||||||
}
|
}
|
||||||
if value, ok := uuo.mutation.Planet(); ok {
|
if value, ok := uuo.mutation.Planet(); ok {
|
||||||
_spec.SetField(user.FieldPlanet, field.TypeInt, value)
|
_spec.SetField(user.FieldPlanet, field.TypeFloat64, value)
|
||||||
}
|
}
|
||||||
if value, ok := uuo.mutation.AddedPlanet(); ok {
|
if value, ok := uuo.mutation.AddedPlanet(); ok {
|
||||||
_spec.AddField(user.FieldPlanet, field.TypeInt, value)
|
_spec.AddField(user.FieldPlanet, field.TypeFloat64, value)
|
||||||
}
|
}
|
||||||
if uuo.mutation.PlanetCleared() {
|
if uuo.mutation.PlanetCleared() {
|
||||||
_spec.ClearField(user.FieldPlanet, field.TypeInt)
|
_spec.ClearField(user.FieldPlanet, field.TypeFloat64)
|
||||||
}
|
}
|
||||||
if value, ok := uuo.mutation.PlanetAt(); ok {
|
if value, ok := uuo.mutation.PlanetAt(); ok {
|
||||||
_spec.SetField(user.FieldPlanetAt, field.TypeTime, value)
|
_spec.SetField(user.FieldPlanetAt, field.TypeTime, value)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user