1
0

add planet

This commit is contained in:
2024-08-01 06:01:28 +09:00
parent a4cd0e0f9a
commit 4c0c396086
17 changed files with 5062 additions and 59 deletions

View File

@@ -1158,6 +1158,201 @@ func (uu *UserUpdate) ClearCoinAt() *UserUpdate {
return uu
}
// SetPlanet sets the "planet" field.
func (uu *UserUpdate) SetPlanet(i int) *UserUpdate {
uu.mutation.ResetPlanet()
uu.mutation.SetPlanet(i)
return uu
}
// SetNillablePlanet sets the "planet" field if the given value is not nil.
func (uu *UserUpdate) SetNillablePlanet(i *int) *UserUpdate {
if i != nil {
uu.SetPlanet(*i)
}
return uu
}
// AddPlanet adds i to the "planet" field.
func (uu *UserUpdate) AddPlanet(i int) *UserUpdate {
uu.mutation.AddPlanet(i)
return uu
}
// ClearPlanet clears the value of the "planet" field.
func (uu *UserUpdate) ClearPlanet() *UserUpdate {
uu.mutation.ClearPlanet()
return uu
}
// SetPlanetAt sets the "planet_at" field.
func (uu *UserUpdate) SetPlanetAt(t time.Time) *UserUpdate {
uu.mutation.SetPlanetAt(t)
return uu
}
// SetNillablePlanetAt sets the "planet_at" field if the given value is not nil.
func (uu *UserUpdate) SetNillablePlanetAt(t *time.Time) *UserUpdate {
if t != nil {
uu.SetPlanetAt(*t)
}
return uu
}
// ClearPlanetAt clears the value of the "planet_at" field.
func (uu *UserUpdate) ClearPlanetAt() *UserUpdate {
uu.mutation.ClearPlanetAt()
return uu
}
// SetLogin sets the "login" field.
func (uu *UserUpdate) SetLogin(b bool) *UserUpdate {
uu.mutation.SetLogin(b)
return uu
}
// SetNillableLogin sets the "login" field if the given value is not nil.
func (uu *UserUpdate) SetNillableLogin(b *bool) *UserUpdate {
if b != nil {
uu.SetLogin(*b)
}
return uu
}
// ClearLogin clears the value of the "login" field.
func (uu *UserUpdate) ClearLogin() *UserUpdate {
uu.mutation.ClearLogin()
return uu
}
// SetLoginAt sets the "login_at" field.
func (uu *UserUpdate) SetLoginAt(t time.Time) *UserUpdate {
uu.mutation.SetLoginAt(t)
return uu
}
// SetNillableLoginAt sets the "login_at" field if the given value is not nil.
func (uu *UserUpdate) SetNillableLoginAt(t *time.Time) *UserUpdate {
if t != nil {
uu.SetLoginAt(*t)
}
return uu
}
// ClearLoginAt clears the value of the "login_at" field.
func (uu *UserUpdate) ClearLoginAt() *UserUpdate {
uu.mutation.ClearLoginAt()
return uu
}
// SetLocationX sets the "location_x" field.
func (uu *UserUpdate) SetLocationX(i int) *UserUpdate {
uu.mutation.ResetLocationX()
uu.mutation.SetLocationX(i)
return uu
}
// SetNillableLocationX sets the "location_x" field if the given value is not nil.
func (uu *UserUpdate) SetNillableLocationX(i *int) *UserUpdate {
if i != nil {
uu.SetLocationX(*i)
}
return uu
}
// AddLocationX adds i to the "location_x" field.
func (uu *UserUpdate) AddLocationX(i int) *UserUpdate {
uu.mutation.AddLocationX(i)
return uu
}
// ClearLocationX clears the value of the "location_x" field.
func (uu *UserUpdate) ClearLocationX() *UserUpdate {
uu.mutation.ClearLocationX()
return uu
}
// SetLocationY sets the "location_y" field.
func (uu *UserUpdate) SetLocationY(i int) *UserUpdate {
uu.mutation.ResetLocationY()
uu.mutation.SetLocationY(i)
return uu
}
// SetNillableLocationY sets the "location_y" field if the given value is not nil.
func (uu *UserUpdate) SetNillableLocationY(i *int) *UserUpdate {
if i != nil {
uu.SetLocationY(*i)
}
return uu
}
// AddLocationY adds i to the "location_y" field.
func (uu *UserUpdate) AddLocationY(i int) *UserUpdate {
uu.mutation.AddLocationY(i)
return uu
}
// ClearLocationY clears the value of the "location_y" field.
func (uu *UserUpdate) ClearLocationY() *UserUpdate {
uu.mutation.ClearLocationY()
return uu
}
// SetLocationZ sets the "location_z" field.
func (uu *UserUpdate) SetLocationZ(i int) *UserUpdate {
uu.mutation.ResetLocationZ()
uu.mutation.SetLocationZ(i)
return uu
}
// SetNillableLocationZ sets the "location_z" field if the given value is not nil.
func (uu *UserUpdate) SetNillableLocationZ(i *int) *UserUpdate {
if i != nil {
uu.SetLocationZ(*i)
}
return uu
}
// AddLocationZ adds i to the "location_z" field.
func (uu *UserUpdate) AddLocationZ(i int) *UserUpdate {
uu.mutation.AddLocationZ(i)
return uu
}
// ClearLocationZ clears the value of the "location_z" field.
func (uu *UserUpdate) ClearLocationZ() *UserUpdate {
uu.mutation.ClearLocationZ()
return uu
}
// SetLocationN sets the "location_n" field.
func (uu *UserUpdate) SetLocationN(i int) *UserUpdate {
uu.mutation.ResetLocationN()
uu.mutation.SetLocationN(i)
return uu
}
// SetNillableLocationN sets the "location_n" field if the given value is not nil.
func (uu *UserUpdate) SetNillableLocationN(i *int) *UserUpdate {
if i != nil {
uu.SetLocationN(*i)
}
return uu
}
// AddLocationN adds i to the "location_n" field.
func (uu *UserUpdate) AddLocationN(i int) *UserUpdate {
uu.mutation.AddLocationN(i)
return uu
}
// ClearLocationN clears the value of the "location_n" field.
func (uu *UserUpdate) ClearLocationN() *UserUpdate {
uu.mutation.ClearLocationN()
return uu
}
// AddCardIDs adds the "card" edge to the Card entity by IDs.
func (uu *UserUpdate) AddCardIDs(ids ...int) *UserUpdate {
uu.mutation.AddCardIDs(ids...)
@@ -1700,6 +1895,69 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) {
if uu.mutation.CoinAtCleared() {
_spec.ClearField(user.FieldCoinAt, field.TypeTime)
}
if value, ok := uu.mutation.Planet(); ok {
_spec.SetField(user.FieldPlanet, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedPlanet(); ok {
_spec.AddField(user.FieldPlanet, field.TypeInt, value)
}
if uu.mutation.PlanetCleared() {
_spec.ClearField(user.FieldPlanet, field.TypeInt)
}
if value, ok := uu.mutation.PlanetAt(); ok {
_spec.SetField(user.FieldPlanetAt, field.TypeTime, value)
}
if uu.mutation.PlanetAtCleared() {
_spec.ClearField(user.FieldPlanetAt, field.TypeTime)
}
if value, ok := uu.mutation.Login(); ok {
_spec.SetField(user.FieldLogin, field.TypeBool, value)
}
if uu.mutation.LoginCleared() {
_spec.ClearField(user.FieldLogin, field.TypeBool)
}
if value, ok := uu.mutation.LoginAt(); ok {
_spec.SetField(user.FieldLoginAt, field.TypeTime, value)
}
if uu.mutation.LoginAtCleared() {
_spec.ClearField(user.FieldLoginAt, field.TypeTime)
}
if value, ok := uu.mutation.LocationX(); ok {
_spec.SetField(user.FieldLocationX, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedLocationX(); ok {
_spec.AddField(user.FieldLocationX, field.TypeInt, value)
}
if uu.mutation.LocationXCleared() {
_spec.ClearField(user.FieldLocationX, field.TypeInt)
}
if value, ok := uu.mutation.LocationY(); ok {
_spec.SetField(user.FieldLocationY, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedLocationY(); ok {
_spec.AddField(user.FieldLocationY, field.TypeInt, value)
}
if uu.mutation.LocationYCleared() {
_spec.ClearField(user.FieldLocationY, field.TypeInt)
}
if value, ok := uu.mutation.LocationZ(); ok {
_spec.SetField(user.FieldLocationZ, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedLocationZ(); ok {
_spec.AddField(user.FieldLocationZ, field.TypeInt, value)
}
if uu.mutation.LocationZCleared() {
_spec.ClearField(user.FieldLocationZ, field.TypeInt)
}
if value, ok := uu.mutation.LocationN(); ok {
_spec.SetField(user.FieldLocationN, field.TypeInt, value)
}
if value, ok := uu.mutation.AddedLocationN(); ok {
_spec.AddField(user.FieldLocationN, field.TypeInt, value)
}
if uu.mutation.LocationNCleared() {
_spec.ClearField(user.FieldLocationN, field.TypeInt)
}
if uu.mutation.CardCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
@@ -3026,6 +3284,201 @@ func (uuo *UserUpdateOne) ClearCoinAt() *UserUpdateOne {
return uuo
}
// SetPlanet sets the "planet" field.
func (uuo *UserUpdateOne) SetPlanet(i int) *UserUpdateOne {
uuo.mutation.ResetPlanet()
uuo.mutation.SetPlanet(i)
return uuo
}
// SetNillablePlanet sets the "planet" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillablePlanet(i *int) *UserUpdateOne {
if i != nil {
uuo.SetPlanet(*i)
}
return uuo
}
// AddPlanet adds i to the "planet" field.
func (uuo *UserUpdateOne) AddPlanet(i int) *UserUpdateOne {
uuo.mutation.AddPlanet(i)
return uuo
}
// ClearPlanet clears the value of the "planet" field.
func (uuo *UserUpdateOne) ClearPlanet() *UserUpdateOne {
uuo.mutation.ClearPlanet()
return uuo
}
// SetPlanetAt sets the "planet_at" field.
func (uuo *UserUpdateOne) SetPlanetAt(t time.Time) *UserUpdateOne {
uuo.mutation.SetPlanetAt(t)
return uuo
}
// SetNillablePlanetAt sets the "planet_at" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillablePlanetAt(t *time.Time) *UserUpdateOne {
if t != nil {
uuo.SetPlanetAt(*t)
}
return uuo
}
// ClearPlanetAt clears the value of the "planet_at" field.
func (uuo *UserUpdateOne) ClearPlanetAt() *UserUpdateOne {
uuo.mutation.ClearPlanetAt()
return uuo
}
// SetLogin sets the "login" field.
func (uuo *UserUpdateOne) SetLogin(b bool) *UserUpdateOne {
uuo.mutation.SetLogin(b)
return uuo
}
// SetNillableLogin sets the "login" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableLogin(b *bool) *UserUpdateOne {
if b != nil {
uuo.SetLogin(*b)
}
return uuo
}
// ClearLogin clears the value of the "login" field.
func (uuo *UserUpdateOne) ClearLogin() *UserUpdateOne {
uuo.mutation.ClearLogin()
return uuo
}
// SetLoginAt sets the "login_at" field.
func (uuo *UserUpdateOne) SetLoginAt(t time.Time) *UserUpdateOne {
uuo.mutation.SetLoginAt(t)
return uuo
}
// SetNillableLoginAt sets the "login_at" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableLoginAt(t *time.Time) *UserUpdateOne {
if t != nil {
uuo.SetLoginAt(*t)
}
return uuo
}
// ClearLoginAt clears the value of the "login_at" field.
func (uuo *UserUpdateOne) ClearLoginAt() *UserUpdateOne {
uuo.mutation.ClearLoginAt()
return uuo
}
// SetLocationX sets the "location_x" field.
func (uuo *UserUpdateOne) SetLocationX(i int) *UserUpdateOne {
uuo.mutation.ResetLocationX()
uuo.mutation.SetLocationX(i)
return uuo
}
// SetNillableLocationX sets the "location_x" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableLocationX(i *int) *UserUpdateOne {
if i != nil {
uuo.SetLocationX(*i)
}
return uuo
}
// AddLocationX adds i to the "location_x" field.
func (uuo *UserUpdateOne) AddLocationX(i int) *UserUpdateOne {
uuo.mutation.AddLocationX(i)
return uuo
}
// ClearLocationX clears the value of the "location_x" field.
func (uuo *UserUpdateOne) ClearLocationX() *UserUpdateOne {
uuo.mutation.ClearLocationX()
return uuo
}
// SetLocationY sets the "location_y" field.
func (uuo *UserUpdateOne) SetLocationY(i int) *UserUpdateOne {
uuo.mutation.ResetLocationY()
uuo.mutation.SetLocationY(i)
return uuo
}
// SetNillableLocationY sets the "location_y" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableLocationY(i *int) *UserUpdateOne {
if i != nil {
uuo.SetLocationY(*i)
}
return uuo
}
// AddLocationY adds i to the "location_y" field.
func (uuo *UserUpdateOne) AddLocationY(i int) *UserUpdateOne {
uuo.mutation.AddLocationY(i)
return uuo
}
// ClearLocationY clears the value of the "location_y" field.
func (uuo *UserUpdateOne) ClearLocationY() *UserUpdateOne {
uuo.mutation.ClearLocationY()
return uuo
}
// SetLocationZ sets the "location_z" field.
func (uuo *UserUpdateOne) SetLocationZ(i int) *UserUpdateOne {
uuo.mutation.ResetLocationZ()
uuo.mutation.SetLocationZ(i)
return uuo
}
// SetNillableLocationZ sets the "location_z" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableLocationZ(i *int) *UserUpdateOne {
if i != nil {
uuo.SetLocationZ(*i)
}
return uuo
}
// AddLocationZ adds i to the "location_z" field.
func (uuo *UserUpdateOne) AddLocationZ(i int) *UserUpdateOne {
uuo.mutation.AddLocationZ(i)
return uuo
}
// ClearLocationZ clears the value of the "location_z" field.
func (uuo *UserUpdateOne) ClearLocationZ() *UserUpdateOne {
uuo.mutation.ClearLocationZ()
return uuo
}
// SetLocationN sets the "location_n" field.
func (uuo *UserUpdateOne) SetLocationN(i int) *UserUpdateOne {
uuo.mutation.ResetLocationN()
uuo.mutation.SetLocationN(i)
return uuo
}
// SetNillableLocationN sets the "location_n" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableLocationN(i *int) *UserUpdateOne {
if i != nil {
uuo.SetLocationN(*i)
}
return uuo
}
// AddLocationN adds i to the "location_n" field.
func (uuo *UserUpdateOne) AddLocationN(i int) *UserUpdateOne {
uuo.mutation.AddLocationN(i)
return uuo
}
// ClearLocationN clears the value of the "location_n" field.
func (uuo *UserUpdateOne) ClearLocationN() *UserUpdateOne {
uuo.mutation.ClearLocationN()
return uuo
}
// AddCardIDs adds the "card" edge to the Card entity by IDs.
func (uuo *UserUpdateOne) AddCardIDs(ids ...int) *UserUpdateOne {
uuo.mutation.AddCardIDs(ids...)
@@ -3598,6 +4051,69 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error)
if uuo.mutation.CoinAtCleared() {
_spec.ClearField(user.FieldCoinAt, field.TypeTime)
}
if value, ok := uuo.mutation.Planet(); ok {
_spec.SetField(user.FieldPlanet, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedPlanet(); ok {
_spec.AddField(user.FieldPlanet, field.TypeInt, value)
}
if uuo.mutation.PlanetCleared() {
_spec.ClearField(user.FieldPlanet, field.TypeInt)
}
if value, ok := uuo.mutation.PlanetAt(); ok {
_spec.SetField(user.FieldPlanetAt, field.TypeTime, value)
}
if uuo.mutation.PlanetAtCleared() {
_spec.ClearField(user.FieldPlanetAt, field.TypeTime)
}
if value, ok := uuo.mutation.Login(); ok {
_spec.SetField(user.FieldLogin, field.TypeBool, value)
}
if uuo.mutation.LoginCleared() {
_spec.ClearField(user.FieldLogin, field.TypeBool)
}
if value, ok := uuo.mutation.LoginAt(); ok {
_spec.SetField(user.FieldLoginAt, field.TypeTime, value)
}
if uuo.mutation.LoginAtCleared() {
_spec.ClearField(user.FieldLoginAt, field.TypeTime)
}
if value, ok := uuo.mutation.LocationX(); ok {
_spec.SetField(user.FieldLocationX, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedLocationX(); ok {
_spec.AddField(user.FieldLocationX, field.TypeInt, value)
}
if uuo.mutation.LocationXCleared() {
_spec.ClearField(user.FieldLocationX, field.TypeInt)
}
if value, ok := uuo.mutation.LocationY(); ok {
_spec.SetField(user.FieldLocationY, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedLocationY(); ok {
_spec.AddField(user.FieldLocationY, field.TypeInt, value)
}
if uuo.mutation.LocationYCleared() {
_spec.ClearField(user.FieldLocationY, field.TypeInt)
}
if value, ok := uuo.mutation.LocationZ(); ok {
_spec.SetField(user.FieldLocationZ, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedLocationZ(); ok {
_spec.AddField(user.FieldLocationZ, field.TypeInt, value)
}
if uuo.mutation.LocationZCleared() {
_spec.ClearField(user.FieldLocationZ, field.TypeInt)
}
if value, ok := uuo.mutation.LocationN(); ok {
_spec.SetField(user.FieldLocationN, field.TypeInt, value)
}
if value, ok := uuo.mutation.AddedLocationN(); ok {
_spec.AddField(user.FieldLocationN, field.TypeInt, value)
}
if uuo.mutation.LocationNCleared() {
_spec.ClearField(user.FieldLocationN, field.TypeInt)
}
if uuo.mutation.CardCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,