feat:多项功能优化
This commit is contained in:
@@ -118,6 +118,34 @@ func (_u *StationUpdate) SetNillableStatus(v *string) *StationUpdate {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetIsBuiltin sets the "isBuiltin" field.
|
||||
func (_u *StationUpdate) SetIsBuiltin(v bool) *StationUpdate {
|
||||
_u.mutation.SetIsBuiltin(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableIsBuiltin sets the "isBuiltin" field if the given value is not nil.
|
||||
func (_u *StationUpdate) SetNillableIsBuiltin(v *bool) *StationUpdate {
|
||||
if v != nil {
|
||||
_u.SetIsBuiltin(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetHasDock sets the "hasDock" field.
|
||||
func (_u *StationUpdate) SetHasDock(v bool) *StationUpdate {
|
||||
_u.mutation.SetHasDock(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableHasDock sets the "hasDock" field if the given value is not nil.
|
||||
func (_u *StationUpdate) SetNillableHasDock(v *bool) *StationUpdate {
|
||||
if v != nil {
|
||||
_u.SetHasDock(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// Mutation returns the StationMutation object of the builder.
|
||||
func (_u *StationUpdate) Mutation() *StationMutation {
|
||||
return _u.mutation
|
||||
@@ -212,6 +240,12 @@ func (_u *StationUpdate) sqlSave(ctx context.Context) (_node int, err error) {
|
||||
if value, ok := _u.mutation.Status(); ok {
|
||||
_spec.SetField(station.FieldStatus, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.IsBuiltin(); ok {
|
||||
_spec.SetField(station.FieldIsBuiltin, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := _u.mutation.HasDock(); ok {
|
||||
_spec.SetField(station.FieldHasDock, field.TypeBool, value)
|
||||
}
|
||||
_spec.AddModifiers(_u.modifiers...)
|
||||
if _node, err = sqlgraph.UpdateNodes(ctx, _u.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
@@ -324,6 +358,34 @@ func (_u *StationUpdateOne) SetNillableStatus(v *string) *StationUpdateOne {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetIsBuiltin sets the "isBuiltin" field.
|
||||
func (_u *StationUpdateOne) SetIsBuiltin(v bool) *StationUpdateOne {
|
||||
_u.mutation.SetIsBuiltin(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableIsBuiltin sets the "isBuiltin" field if the given value is not nil.
|
||||
func (_u *StationUpdateOne) SetNillableIsBuiltin(v *bool) *StationUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetIsBuiltin(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetHasDock sets the "hasDock" field.
|
||||
func (_u *StationUpdateOne) SetHasDock(v bool) *StationUpdateOne {
|
||||
_u.mutation.SetHasDock(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableHasDock sets the "hasDock" field if the given value is not nil.
|
||||
func (_u *StationUpdateOne) SetNillableHasDock(v *bool) *StationUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetHasDock(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// Mutation returns the StationMutation object of the builder.
|
||||
func (_u *StationUpdateOne) Mutation() *StationMutation {
|
||||
return _u.mutation
|
||||
@@ -448,6 +510,12 @@ func (_u *StationUpdateOne) sqlSave(ctx context.Context) (_node *Station, err er
|
||||
if value, ok := _u.mutation.Status(); ok {
|
||||
_spec.SetField(station.FieldStatus, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.IsBuiltin(); ok {
|
||||
_spec.SetField(station.FieldIsBuiltin, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := _u.mutation.HasDock(); ok {
|
||||
_spec.SetField(station.FieldHasDock, field.TypeBool, value)
|
||||
}
|
||||
_spec.AddModifiers(_u.modifiers...)
|
||||
_node = &Station{config: _u.config}
|
||||
_spec.Assign = _node.assignValues
|
||||
|
||||
Reference in New Issue
Block a user