fix planet float
This commit is contained in:
@@ -270,7 +270,7 @@ type CardOwnerRead struct {
|
||||
Coin OptInt `json:"coin"`
|
||||
CoinOpen OptBool `json:"coin_open"`
|
||||
CoinAt OptDateTime `json:"coin_at"`
|
||||
Planet OptInt `json:"planet"`
|
||||
Planet OptFloat64 `json:"planet"`
|
||||
PlanetAt OptDateTime `json:"planet_at"`
|
||||
Login OptBool `json:"login"`
|
||||
LoginAt OptDateTime `json:"login_at"`
|
||||
@@ -541,7 +541,7 @@ func (s *CardOwnerRead) GetCoinAt() OptDateTime {
|
||||
}
|
||||
|
||||
// GetPlanet returns the value of Planet.
|
||||
func (s *CardOwnerRead) GetPlanet() OptInt {
|
||||
func (s *CardOwnerRead) GetPlanet() OptFloat64 {
|
||||
return s.Planet
|
||||
}
|
||||
|
||||
@@ -841,7 +841,7 @@ func (s *CardOwnerRead) SetCoinAt(val OptDateTime) {
|
||||
}
|
||||
|
||||
// SetPlanet sets the value of Planet.
|
||||
func (s *CardOwnerRead) SetPlanet(val OptInt) {
|
||||
func (s *CardOwnerRead) SetPlanet(val OptFloat64) {
|
||||
s.Planet = val
|
||||
}
|
||||
|
||||
@@ -1997,7 +1997,7 @@ type CreateUserReq struct {
|
||||
Coin OptInt `json:"coin"`
|
||||
CoinOpen OptBool `json:"coin_open"`
|
||||
CoinAt OptDateTime `json:"coin_at"`
|
||||
Planet OptInt `json:"planet"`
|
||||
Planet OptFloat64 `json:"planet"`
|
||||
PlanetAt OptDateTime `json:"planet_at"`
|
||||
Login OptBool `json:"login"`
|
||||
LoginAt OptDateTime `json:"login_at"`
|
||||
@@ -2277,7 +2277,7 @@ func (s *CreateUserReq) GetCoinAt() OptDateTime {
|
||||
}
|
||||
|
||||
// GetPlanet returns the value of Planet.
|
||||
func (s *CreateUserReq) GetPlanet() OptInt {
|
||||
func (s *CreateUserReq) GetPlanet() OptFloat64 {
|
||||
return s.Planet
|
||||
}
|
||||
|
||||
@@ -2602,7 +2602,7 @@ func (s *CreateUserReq) SetCoinAt(val OptDateTime) {
|
||||
}
|
||||
|
||||
// SetPlanet sets the value of Planet.
|
||||
func (s *CreateUserReq) SetPlanet(val OptInt) {
|
||||
func (s *CreateUserReq) SetPlanet(val OptFloat64) {
|
||||
s.Planet = val
|
||||
}
|
||||
|
||||
@@ -2861,7 +2861,7 @@ type GroupUsersList struct {
|
||||
Coin OptInt `json:"coin"`
|
||||
CoinOpen OptBool `json:"coin_open"`
|
||||
CoinAt OptDateTime `json:"coin_at"`
|
||||
Planet OptInt `json:"planet"`
|
||||
Planet OptFloat64 `json:"planet"`
|
||||
PlanetAt OptDateTime `json:"planet_at"`
|
||||
Login OptBool `json:"login"`
|
||||
LoginAt OptDateTime `json:"login_at"`
|
||||
@@ -3132,7 +3132,7 @@ func (s *GroupUsersList) GetCoinAt() OptDateTime {
|
||||
}
|
||||
|
||||
// GetPlanet returns the value of Planet.
|
||||
func (s *GroupUsersList) GetPlanet() OptInt {
|
||||
func (s *GroupUsersList) GetPlanet() OptFloat64 {
|
||||
return s.Planet
|
||||
}
|
||||
|
||||
@@ -3432,7 +3432,7 @@ func (s *GroupUsersList) SetCoinAt(val OptDateTime) {
|
||||
}
|
||||
|
||||
// SetPlanet sets the value of Planet.
|
||||
func (s *GroupUsersList) SetPlanet(val OptInt) {
|
||||
func (s *GroupUsersList) SetPlanet(val OptFloat64) {
|
||||
s.Planet = val
|
||||
}
|
||||
|
||||
@@ -4063,7 +4063,7 @@ type MaOwnerRead struct {
|
||||
Coin OptInt `json:"coin"`
|
||||
CoinOpen OptBool `json:"coin_open"`
|
||||
CoinAt OptDateTime `json:"coin_at"`
|
||||
Planet OptInt `json:"planet"`
|
||||
Planet OptFloat64 `json:"planet"`
|
||||
PlanetAt OptDateTime `json:"planet_at"`
|
||||
Login OptBool `json:"login"`
|
||||
LoginAt OptDateTime `json:"login_at"`
|
||||
@@ -4334,7 +4334,7 @@ func (s *MaOwnerRead) GetCoinAt() OptDateTime {
|
||||
}
|
||||
|
||||
// GetPlanet returns the value of Planet.
|
||||
func (s *MaOwnerRead) GetPlanet() OptInt {
|
||||
func (s *MaOwnerRead) GetPlanet() OptFloat64 {
|
||||
return s.Planet
|
||||
}
|
||||
|
||||
@@ -4634,7 +4634,7 @@ func (s *MaOwnerRead) SetCoinAt(val OptDateTime) {
|
||||
}
|
||||
|
||||
// SetPlanet sets the value of Planet.
|
||||
func (s *MaOwnerRead) SetPlanet(val OptInt) {
|
||||
func (s *MaOwnerRead) SetPlanet(val OptFloat64) {
|
||||
s.Planet = val
|
||||
}
|
||||
|
||||
@@ -5263,6 +5263,52 @@ func (o OptDateTime) Or(d time.Time) time.Time {
|
||||
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.
|
||||
func NewOptInt(v int) OptInt {
|
||||
return OptInt{
|
||||
@@ -5959,7 +6005,7 @@ type SevOwnerRead struct {
|
||||
Coin OptInt `json:"coin"`
|
||||
CoinOpen OptBool `json:"coin_open"`
|
||||
CoinAt OptDateTime `json:"coin_at"`
|
||||
Planet OptInt `json:"planet"`
|
||||
Planet OptFloat64 `json:"planet"`
|
||||
PlanetAt OptDateTime `json:"planet_at"`
|
||||
Login OptBool `json:"login"`
|
||||
LoginAt OptDateTime `json:"login_at"`
|
||||
@@ -6230,7 +6276,7 @@ func (s *SevOwnerRead) GetCoinAt() OptDateTime {
|
||||
}
|
||||
|
||||
// GetPlanet returns the value of Planet.
|
||||
func (s *SevOwnerRead) GetPlanet() OptInt {
|
||||
func (s *SevOwnerRead) GetPlanet() OptFloat64 {
|
||||
return s.Planet
|
||||
}
|
||||
|
||||
@@ -6530,7 +6576,7 @@ func (s *SevOwnerRead) SetCoinAt(val OptDateTime) {
|
||||
}
|
||||
|
||||
// SetPlanet sets the value of Planet.
|
||||
func (s *SevOwnerRead) SetPlanet(val OptInt) {
|
||||
func (s *SevOwnerRead) SetPlanet(val OptFloat64) {
|
||||
s.Planet = val
|
||||
}
|
||||
|
||||
@@ -7395,7 +7441,7 @@ type UeOwnerRead struct {
|
||||
Coin OptInt `json:"coin"`
|
||||
CoinOpen OptBool `json:"coin_open"`
|
||||
CoinAt OptDateTime `json:"coin_at"`
|
||||
Planet OptInt `json:"planet"`
|
||||
Planet OptFloat64 `json:"planet"`
|
||||
PlanetAt OptDateTime `json:"planet_at"`
|
||||
Login OptBool `json:"login"`
|
||||
LoginAt OptDateTime `json:"login_at"`
|
||||
@@ -7666,7 +7712,7 @@ func (s *UeOwnerRead) GetCoinAt() OptDateTime {
|
||||
}
|
||||
|
||||
// GetPlanet returns the value of Planet.
|
||||
func (s *UeOwnerRead) GetPlanet() OptInt {
|
||||
func (s *UeOwnerRead) GetPlanet() OptFloat64 {
|
||||
return s.Planet
|
||||
}
|
||||
|
||||
@@ -7966,7 +8012,7 @@ func (s *UeOwnerRead) SetCoinAt(val OptDateTime) {
|
||||
}
|
||||
|
||||
// SetPlanet sets the value of Planet.
|
||||
func (s *UeOwnerRead) SetPlanet(val OptInt) {
|
||||
func (s *UeOwnerRead) SetPlanet(val OptFloat64) {
|
||||
s.Planet = val
|
||||
}
|
||||
|
||||
@@ -9328,7 +9374,7 @@ type UpdateUserReq struct {
|
||||
Coin OptInt `json:"coin"`
|
||||
CoinOpen OptBool `json:"coin_open"`
|
||||
CoinAt OptDateTime `json:"coin_at"`
|
||||
Planet OptInt `json:"planet"`
|
||||
Planet OptFloat64 `json:"planet"`
|
||||
PlanetAt OptDateTime `json:"planet_at"`
|
||||
Login OptBool `json:"login"`
|
||||
LoginAt OptDateTime `json:"login_at"`
|
||||
@@ -9593,7 +9639,7 @@ func (s *UpdateUserReq) GetCoinAt() OptDateTime {
|
||||
}
|
||||
|
||||
// GetPlanet returns the value of Planet.
|
||||
func (s *UpdateUserReq) GetPlanet() OptInt {
|
||||
func (s *UpdateUserReq) GetPlanet() OptFloat64 {
|
||||
return s.Planet
|
||||
}
|
||||
|
||||
@@ -9903,7 +9949,7 @@ func (s *UpdateUserReq) SetCoinAt(val OptDateTime) {
|
||||
}
|
||||
|
||||
// SetPlanet sets the value of Planet.
|
||||
func (s *UpdateUserReq) SetPlanet(val OptInt) {
|
||||
func (s *UpdateUserReq) SetPlanet(val OptFloat64) {
|
||||
s.Planet = val
|
||||
}
|
||||
|
||||
@@ -10119,7 +10165,7 @@ type UserCreate struct {
|
||||
Coin OptInt `json:"coin"`
|
||||
CoinOpen OptBool `json:"coin_open"`
|
||||
CoinAt OptDateTime `json:"coin_at"`
|
||||
Planet OptInt `json:"planet"`
|
||||
Planet OptFloat64 `json:"planet"`
|
||||
PlanetAt OptDateTime `json:"planet_at"`
|
||||
Login OptBool `json:"login"`
|
||||
LoginAt OptDateTime `json:"login_at"`
|
||||
@@ -10390,7 +10436,7 @@ func (s *UserCreate) GetCoinAt() OptDateTime {
|
||||
}
|
||||
|
||||
// GetPlanet returns the value of Planet.
|
||||
func (s *UserCreate) GetPlanet() OptInt {
|
||||
func (s *UserCreate) GetPlanet() OptFloat64 {
|
||||
return s.Planet
|
||||
}
|
||||
|
||||
@@ -10690,7 +10736,7 @@ func (s *UserCreate) SetCoinAt(val OptDateTime) {
|
||||
}
|
||||
|
||||
// SetPlanet sets the value of Planet.
|
||||
func (s *UserCreate) SetPlanet(val OptInt) {
|
||||
func (s *UserCreate) SetPlanet(val OptFloat64) {
|
||||
s.Planet = val
|
||||
}
|
||||
|
||||
@@ -10785,7 +10831,7 @@ type UserList struct {
|
||||
Coin OptInt `json:"coin"`
|
||||
CoinOpen OptBool `json:"coin_open"`
|
||||
CoinAt OptDateTime `json:"coin_at"`
|
||||
Planet OptInt `json:"planet"`
|
||||
Planet OptFloat64 `json:"planet"`
|
||||
PlanetAt OptDateTime `json:"planet_at"`
|
||||
Login OptBool `json:"login"`
|
||||
LoginAt OptDateTime `json:"login_at"`
|
||||
@@ -11056,7 +11102,7 @@ func (s *UserList) GetCoinAt() OptDateTime {
|
||||
}
|
||||
|
||||
// GetPlanet returns the value of Planet.
|
||||
func (s *UserList) GetPlanet() OptInt {
|
||||
func (s *UserList) GetPlanet() OptFloat64 {
|
||||
return s.Planet
|
||||
}
|
||||
|
||||
@@ -11356,7 +11402,7 @@ func (s *UserList) SetCoinAt(val OptDateTime) {
|
||||
}
|
||||
|
||||
// SetPlanet sets the value of Planet.
|
||||
func (s *UserList) SetPlanet(val OptInt) {
|
||||
func (s *UserList) SetPlanet(val OptFloat64) {
|
||||
s.Planet = val
|
||||
}
|
||||
|
||||
@@ -11695,7 +11741,7 @@ type UserRead struct {
|
||||
Coin OptInt `json:"coin"`
|
||||
CoinOpen OptBool `json:"coin_open"`
|
||||
CoinAt OptDateTime `json:"coin_at"`
|
||||
Planet OptInt `json:"planet"`
|
||||
Planet OptFloat64 `json:"planet"`
|
||||
PlanetAt OptDateTime `json:"planet_at"`
|
||||
Login OptBool `json:"login"`
|
||||
LoginAt OptDateTime `json:"login_at"`
|
||||
@@ -11966,7 +12012,7 @@ func (s *UserRead) GetCoinAt() OptDateTime {
|
||||
}
|
||||
|
||||
// GetPlanet returns the value of Planet.
|
||||
func (s *UserRead) GetPlanet() OptInt {
|
||||
func (s *UserRead) GetPlanet() OptFloat64 {
|
||||
return s.Planet
|
||||
}
|
||||
|
||||
@@ -12266,7 +12312,7 @@ func (s *UserRead) SetCoinAt(val OptDateTime) {
|
||||
}
|
||||
|
||||
// SetPlanet sets the value of Planet.
|
||||
func (s *UserRead) SetPlanet(val OptInt) {
|
||||
func (s *UserRead) SetPlanet(val OptFloat64) {
|
||||
s.Planet = val
|
||||
}
|
||||
|
||||
@@ -12743,7 +12789,7 @@ type UserUpdate struct {
|
||||
Coin OptInt `json:"coin"`
|
||||
CoinOpen OptBool `json:"coin_open"`
|
||||
CoinAt OptDateTime `json:"coin_at"`
|
||||
Planet OptInt `json:"planet"`
|
||||
Planet OptFloat64 `json:"planet"`
|
||||
PlanetAt OptDateTime `json:"planet_at"`
|
||||
Login OptBool `json:"login"`
|
||||
LoginAt OptDateTime `json:"login_at"`
|
||||
@@ -13014,7 +13060,7 @@ func (s *UserUpdate) GetCoinAt() OptDateTime {
|
||||
}
|
||||
|
||||
// GetPlanet returns the value of Planet.
|
||||
func (s *UserUpdate) GetPlanet() OptInt {
|
||||
func (s *UserUpdate) GetPlanet() OptFloat64 {
|
||||
return s.Planet
|
||||
}
|
||||
|
||||
@@ -13314,7 +13360,7 @@ func (s *UserUpdate) SetCoinAt(val OptDateTime) {
|
||||
}
|
||||
|
||||
// SetPlanet sets the value of Planet.
|
||||
func (s *UserUpdate) SetPlanet(val OptInt) {
|
||||
func (s *UserUpdate) SetPlanet(val OptFloat64) {
|
||||
s.Planet = val
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user