- 新增过程巡检按步骤上报、数量不符上报、工位退料功能 - 增加工单工程编号三级归属字段 - 新增物料安全库存与缺货预警 - 新增附件管理、退库单管理模块 - 优化生产看板展示逻辑与前端页面文案 - 清理冗余的工艺路线相关代码与备份文件
526 lines
17 KiB
Go
526 lines
17 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package ent
|
|
|
|
import (
|
|
"bj_power_mes/ent/predicate"
|
|
"bj_power_mes/ent/torqueauditlog"
|
|
"context"
|
|
"errors"
|
|
"fmt"
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
"entgo.io/ent/schema/field"
|
|
)
|
|
|
|
// TorqueAuditLogUpdate is the builder for updating TorqueAuditLog entities.
|
|
type TorqueAuditLogUpdate struct {
|
|
config
|
|
hooks []Hook
|
|
mutation *TorqueAuditLogMutation
|
|
modifiers []func(*sql.UpdateBuilder)
|
|
}
|
|
|
|
// Where appends a list predicates to the TorqueAuditLogUpdate builder.
|
|
func (_u *TorqueAuditLogUpdate) Where(ps ...predicate.TorqueAuditLog) *TorqueAuditLogUpdate {
|
|
_u.mutation.Where(ps...)
|
|
return _u
|
|
}
|
|
|
|
// SetTorqueRecordId sets the "torqueRecordId" field.
|
|
func (_u *TorqueAuditLogUpdate) SetTorqueRecordId(v int) *TorqueAuditLogUpdate {
|
|
_u.mutation.ResetTorqueRecordId()
|
|
_u.mutation.SetTorqueRecordId(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableTorqueRecordId sets the "torqueRecordId" field if the given value is not nil.
|
|
func (_u *TorqueAuditLogUpdate) SetNillableTorqueRecordId(v *int) *TorqueAuditLogUpdate {
|
|
if v != nil {
|
|
_u.SetTorqueRecordId(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// AddTorqueRecordId adds value to the "torqueRecordId" field.
|
|
func (_u *TorqueAuditLogUpdate) AddTorqueRecordId(v int) *TorqueAuditLogUpdate {
|
|
_u.mutation.AddTorqueRecordId(v)
|
|
return _u
|
|
}
|
|
|
|
// SetAction sets the "action" field.
|
|
func (_u *TorqueAuditLogUpdate) SetAction(v string) *TorqueAuditLogUpdate {
|
|
_u.mutation.SetAction(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableAction sets the "action" field if the given value is not nil.
|
|
func (_u *TorqueAuditLogUpdate) SetNillableAction(v *string) *TorqueAuditLogUpdate {
|
|
if v != nil {
|
|
_u.SetAction(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetFieldName sets the "fieldName" field.
|
|
func (_u *TorqueAuditLogUpdate) SetFieldName(v string) *TorqueAuditLogUpdate {
|
|
_u.mutation.SetFieldName(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableFieldName sets the "fieldName" field if the given value is not nil.
|
|
func (_u *TorqueAuditLogUpdate) SetNillableFieldName(v *string) *TorqueAuditLogUpdate {
|
|
if v != nil {
|
|
_u.SetFieldName(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetOldVal sets the "oldVal" field.
|
|
func (_u *TorqueAuditLogUpdate) SetOldVal(v string) *TorqueAuditLogUpdate {
|
|
_u.mutation.SetOldVal(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableOldVal sets the "oldVal" field if the given value is not nil.
|
|
func (_u *TorqueAuditLogUpdate) SetNillableOldVal(v *string) *TorqueAuditLogUpdate {
|
|
if v != nil {
|
|
_u.SetOldVal(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetNewVal sets the "newVal" field.
|
|
func (_u *TorqueAuditLogUpdate) SetNewVal(v string) *TorqueAuditLogUpdate {
|
|
_u.mutation.SetNewVal(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableNewVal sets the "newVal" field if the given value is not nil.
|
|
func (_u *TorqueAuditLogUpdate) SetNillableNewVal(v *string) *TorqueAuditLogUpdate {
|
|
if v != nil {
|
|
_u.SetNewVal(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetOperator sets the "operator" field.
|
|
func (_u *TorqueAuditLogUpdate) SetOperator(v string) *TorqueAuditLogUpdate {
|
|
_u.mutation.SetOperator(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableOperator sets the "operator" field if the given value is not nil.
|
|
func (_u *TorqueAuditLogUpdate) SetNillableOperator(v *string) *TorqueAuditLogUpdate {
|
|
if v != nil {
|
|
_u.SetOperator(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetRemark sets the "remark" field.
|
|
func (_u *TorqueAuditLogUpdate) SetRemark(v string) *TorqueAuditLogUpdate {
|
|
_u.mutation.SetRemark(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableRemark sets the "remark" field if the given value is not nil.
|
|
func (_u *TorqueAuditLogUpdate) SetNillableRemark(v *string) *TorqueAuditLogUpdate {
|
|
if v != nil {
|
|
_u.SetRemark(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// Mutation returns the TorqueAuditLogMutation object of the builder.
|
|
func (_u *TorqueAuditLogUpdate) Mutation() *TorqueAuditLogMutation {
|
|
return _u.mutation
|
|
}
|
|
|
|
// Save executes the query and returns the number of nodes affected by the update operation.
|
|
func (_u *TorqueAuditLogUpdate) Save(ctx context.Context) (int, error) {
|
|
return withHooks(ctx, _u.sqlSave, _u.mutation, _u.hooks)
|
|
}
|
|
|
|
// SaveX is like Save, but panics if an error occurs.
|
|
func (_u *TorqueAuditLogUpdate) SaveX(ctx context.Context) int {
|
|
affected, err := _u.Save(ctx)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return affected
|
|
}
|
|
|
|
// Exec executes the query.
|
|
func (_u *TorqueAuditLogUpdate) Exec(ctx context.Context) error {
|
|
_, err := _u.Save(ctx)
|
|
return err
|
|
}
|
|
|
|
// ExecX is like Exec, but panics if an error occurs.
|
|
func (_u *TorqueAuditLogUpdate) ExecX(ctx context.Context) {
|
|
if err := _u.Exec(ctx); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
|
|
// check runs all checks and user-defined validators on the builder.
|
|
func (_u *TorqueAuditLogUpdate) check() error {
|
|
if v, ok := _u.mutation.Action(); ok {
|
|
if err := torqueauditlog.ActionValidator(v); err != nil {
|
|
return &ValidationError{Name: "action", err: fmt.Errorf(`ent: validator failed for field "TorqueAuditLog.action": %w`, err)}
|
|
}
|
|
}
|
|
if v, ok := _u.mutation.FieldName(); ok {
|
|
if err := torqueauditlog.FieldNameValidator(v); err != nil {
|
|
return &ValidationError{Name: "fieldName", err: fmt.Errorf(`ent: validator failed for field "TorqueAuditLog.fieldName": %w`, err)}
|
|
}
|
|
}
|
|
if v, ok := _u.mutation.OldVal(); ok {
|
|
if err := torqueauditlog.OldValValidator(v); err != nil {
|
|
return &ValidationError{Name: "oldVal", err: fmt.Errorf(`ent: validator failed for field "TorqueAuditLog.oldVal": %w`, err)}
|
|
}
|
|
}
|
|
if v, ok := _u.mutation.NewVal(); ok {
|
|
if err := torqueauditlog.NewValValidator(v); err != nil {
|
|
return &ValidationError{Name: "newVal", err: fmt.Errorf(`ent: validator failed for field "TorqueAuditLog.newVal": %w`, err)}
|
|
}
|
|
}
|
|
if v, ok := _u.mutation.Operator(); ok {
|
|
if err := torqueauditlog.OperatorValidator(v); err != nil {
|
|
return &ValidationError{Name: "operator", err: fmt.Errorf(`ent: validator failed for field "TorqueAuditLog.operator": %w`, err)}
|
|
}
|
|
}
|
|
if v, ok := _u.mutation.Remark(); ok {
|
|
if err := torqueauditlog.RemarkValidator(v); err != nil {
|
|
return &ValidationError{Name: "remark", err: fmt.Errorf(`ent: validator failed for field "TorqueAuditLog.remark": %w`, err)}
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
|
|
func (_u *TorqueAuditLogUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *TorqueAuditLogUpdate {
|
|
_u.modifiers = append(_u.modifiers, modifiers...)
|
|
return _u
|
|
}
|
|
|
|
func (_u *TorqueAuditLogUpdate) sqlSave(ctx context.Context) (_node int, err error) {
|
|
if err := _u.check(); err != nil {
|
|
return _node, err
|
|
}
|
|
_spec := sqlgraph.NewUpdateSpec(torqueauditlog.Table, torqueauditlog.Columns, sqlgraph.NewFieldSpec(torqueauditlog.FieldID, field.TypeInt))
|
|
if ps := _u.mutation.predicates; len(ps) > 0 {
|
|
_spec.Predicate = func(selector *sql.Selector) {
|
|
for i := range ps {
|
|
ps[i](selector)
|
|
}
|
|
}
|
|
}
|
|
if value, ok := _u.mutation.TorqueRecordId(); ok {
|
|
_spec.SetField(torqueauditlog.FieldTorqueRecordId, field.TypeInt, value)
|
|
}
|
|
if value, ok := _u.mutation.AddedTorqueRecordId(); ok {
|
|
_spec.AddField(torqueauditlog.FieldTorqueRecordId, field.TypeInt, value)
|
|
}
|
|
if value, ok := _u.mutation.Action(); ok {
|
|
_spec.SetField(torqueauditlog.FieldAction, field.TypeString, value)
|
|
}
|
|
if value, ok := _u.mutation.FieldName(); ok {
|
|
_spec.SetField(torqueauditlog.FieldFieldName, field.TypeString, value)
|
|
}
|
|
if value, ok := _u.mutation.OldVal(); ok {
|
|
_spec.SetField(torqueauditlog.FieldOldVal, field.TypeString, value)
|
|
}
|
|
if value, ok := _u.mutation.NewVal(); ok {
|
|
_spec.SetField(torqueauditlog.FieldNewVal, field.TypeString, value)
|
|
}
|
|
if value, ok := _u.mutation.Operator(); ok {
|
|
_spec.SetField(torqueauditlog.FieldOperator, field.TypeString, value)
|
|
}
|
|
if value, ok := _u.mutation.Remark(); ok {
|
|
_spec.SetField(torqueauditlog.FieldRemark, field.TypeString, value)
|
|
}
|
|
_spec.AddModifiers(_u.modifiers...)
|
|
if _node, err = sqlgraph.UpdateNodes(ctx, _u.driver, _spec); err != nil {
|
|
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
|
err = &NotFoundError{torqueauditlog.Label}
|
|
} else if sqlgraph.IsConstraintError(err) {
|
|
err = &ConstraintError{msg: err.Error(), wrap: err}
|
|
}
|
|
return 0, err
|
|
}
|
|
_u.mutation.done = true
|
|
return _node, nil
|
|
}
|
|
|
|
// TorqueAuditLogUpdateOne is the builder for updating a single TorqueAuditLog entity.
|
|
type TorqueAuditLogUpdateOne struct {
|
|
config
|
|
fields []string
|
|
hooks []Hook
|
|
mutation *TorqueAuditLogMutation
|
|
modifiers []func(*sql.UpdateBuilder)
|
|
}
|
|
|
|
// SetTorqueRecordId sets the "torqueRecordId" field.
|
|
func (_u *TorqueAuditLogUpdateOne) SetTorqueRecordId(v int) *TorqueAuditLogUpdateOne {
|
|
_u.mutation.ResetTorqueRecordId()
|
|
_u.mutation.SetTorqueRecordId(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableTorqueRecordId sets the "torqueRecordId" field if the given value is not nil.
|
|
func (_u *TorqueAuditLogUpdateOne) SetNillableTorqueRecordId(v *int) *TorqueAuditLogUpdateOne {
|
|
if v != nil {
|
|
_u.SetTorqueRecordId(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// AddTorqueRecordId adds value to the "torqueRecordId" field.
|
|
func (_u *TorqueAuditLogUpdateOne) AddTorqueRecordId(v int) *TorqueAuditLogUpdateOne {
|
|
_u.mutation.AddTorqueRecordId(v)
|
|
return _u
|
|
}
|
|
|
|
// SetAction sets the "action" field.
|
|
func (_u *TorqueAuditLogUpdateOne) SetAction(v string) *TorqueAuditLogUpdateOne {
|
|
_u.mutation.SetAction(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableAction sets the "action" field if the given value is not nil.
|
|
func (_u *TorqueAuditLogUpdateOne) SetNillableAction(v *string) *TorqueAuditLogUpdateOne {
|
|
if v != nil {
|
|
_u.SetAction(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetFieldName sets the "fieldName" field.
|
|
func (_u *TorqueAuditLogUpdateOne) SetFieldName(v string) *TorqueAuditLogUpdateOne {
|
|
_u.mutation.SetFieldName(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableFieldName sets the "fieldName" field if the given value is not nil.
|
|
func (_u *TorqueAuditLogUpdateOne) SetNillableFieldName(v *string) *TorqueAuditLogUpdateOne {
|
|
if v != nil {
|
|
_u.SetFieldName(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetOldVal sets the "oldVal" field.
|
|
func (_u *TorqueAuditLogUpdateOne) SetOldVal(v string) *TorqueAuditLogUpdateOne {
|
|
_u.mutation.SetOldVal(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableOldVal sets the "oldVal" field if the given value is not nil.
|
|
func (_u *TorqueAuditLogUpdateOne) SetNillableOldVal(v *string) *TorqueAuditLogUpdateOne {
|
|
if v != nil {
|
|
_u.SetOldVal(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetNewVal sets the "newVal" field.
|
|
func (_u *TorqueAuditLogUpdateOne) SetNewVal(v string) *TorqueAuditLogUpdateOne {
|
|
_u.mutation.SetNewVal(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableNewVal sets the "newVal" field if the given value is not nil.
|
|
func (_u *TorqueAuditLogUpdateOne) SetNillableNewVal(v *string) *TorqueAuditLogUpdateOne {
|
|
if v != nil {
|
|
_u.SetNewVal(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetOperator sets the "operator" field.
|
|
func (_u *TorqueAuditLogUpdateOne) SetOperator(v string) *TorqueAuditLogUpdateOne {
|
|
_u.mutation.SetOperator(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableOperator sets the "operator" field if the given value is not nil.
|
|
func (_u *TorqueAuditLogUpdateOne) SetNillableOperator(v *string) *TorqueAuditLogUpdateOne {
|
|
if v != nil {
|
|
_u.SetOperator(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetRemark sets the "remark" field.
|
|
func (_u *TorqueAuditLogUpdateOne) SetRemark(v string) *TorqueAuditLogUpdateOne {
|
|
_u.mutation.SetRemark(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableRemark sets the "remark" field if the given value is not nil.
|
|
func (_u *TorqueAuditLogUpdateOne) SetNillableRemark(v *string) *TorqueAuditLogUpdateOne {
|
|
if v != nil {
|
|
_u.SetRemark(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// Mutation returns the TorqueAuditLogMutation object of the builder.
|
|
func (_u *TorqueAuditLogUpdateOne) Mutation() *TorqueAuditLogMutation {
|
|
return _u.mutation
|
|
}
|
|
|
|
// Where appends a list predicates to the TorqueAuditLogUpdate builder.
|
|
func (_u *TorqueAuditLogUpdateOne) Where(ps ...predicate.TorqueAuditLog) *TorqueAuditLogUpdateOne {
|
|
_u.mutation.Where(ps...)
|
|
return _u
|
|
}
|
|
|
|
// Select allows selecting one or more fields (columns) of the returned entity.
|
|
// The default is selecting all fields defined in the entity schema.
|
|
func (_u *TorqueAuditLogUpdateOne) Select(field string, fields ...string) *TorqueAuditLogUpdateOne {
|
|
_u.fields = append([]string{field}, fields...)
|
|
return _u
|
|
}
|
|
|
|
// Save executes the query and returns the updated TorqueAuditLog entity.
|
|
func (_u *TorqueAuditLogUpdateOne) Save(ctx context.Context) (*TorqueAuditLog, error) {
|
|
return withHooks(ctx, _u.sqlSave, _u.mutation, _u.hooks)
|
|
}
|
|
|
|
// SaveX is like Save, but panics if an error occurs.
|
|
func (_u *TorqueAuditLogUpdateOne) SaveX(ctx context.Context) *TorqueAuditLog {
|
|
node, err := _u.Save(ctx)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return node
|
|
}
|
|
|
|
// Exec executes the query on the entity.
|
|
func (_u *TorqueAuditLogUpdateOne) Exec(ctx context.Context) error {
|
|
_, err := _u.Save(ctx)
|
|
return err
|
|
}
|
|
|
|
// ExecX is like Exec, but panics if an error occurs.
|
|
func (_u *TorqueAuditLogUpdateOne) ExecX(ctx context.Context) {
|
|
if err := _u.Exec(ctx); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
|
|
// check runs all checks and user-defined validators on the builder.
|
|
func (_u *TorqueAuditLogUpdateOne) check() error {
|
|
if v, ok := _u.mutation.Action(); ok {
|
|
if err := torqueauditlog.ActionValidator(v); err != nil {
|
|
return &ValidationError{Name: "action", err: fmt.Errorf(`ent: validator failed for field "TorqueAuditLog.action": %w`, err)}
|
|
}
|
|
}
|
|
if v, ok := _u.mutation.FieldName(); ok {
|
|
if err := torqueauditlog.FieldNameValidator(v); err != nil {
|
|
return &ValidationError{Name: "fieldName", err: fmt.Errorf(`ent: validator failed for field "TorqueAuditLog.fieldName": %w`, err)}
|
|
}
|
|
}
|
|
if v, ok := _u.mutation.OldVal(); ok {
|
|
if err := torqueauditlog.OldValValidator(v); err != nil {
|
|
return &ValidationError{Name: "oldVal", err: fmt.Errorf(`ent: validator failed for field "TorqueAuditLog.oldVal": %w`, err)}
|
|
}
|
|
}
|
|
if v, ok := _u.mutation.NewVal(); ok {
|
|
if err := torqueauditlog.NewValValidator(v); err != nil {
|
|
return &ValidationError{Name: "newVal", err: fmt.Errorf(`ent: validator failed for field "TorqueAuditLog.newVal": %w`, err)}
|
|
}
|
|
}
|
|
if v, ok := _u.mutation.Operator(); ok {
|
|
if err := torqueauditlog.OperatorValidator(v); err != nil {
|
|
return &ValidationError{Name: "operator", err: fmt.Errorf(`ent: validator failed for field "TorqueAuditLog.operator": %w`, err)}
|
|
}
|
|
}
|
|
if v, ok := _u.mutation.Remark(); ok {
|
|
if err := torqueauditlog.RemarkValidator(v); err != nil {
|
|
return &ValidationError{Name: "remark", err: fmt.Errorf(`ent: validator failed for field "TorqueAuditLog.remark": %w`, err)}
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
|
|
func (_u *TorqueAuditLogUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *TorqueAuditLogUpdateOne {
|
|
_u.modifiers = append(_u.modifiers, modifiers...)
|
|
return _u
|
|
}
|
|
|
|
func (_u *TorqueAuditLogUpdateOne) sqlSave(ctx context.Context) (_node *TorqueAuditLog, err error) {
|
|
if err := _u.check(); err != nil {
|
|
return _node, err
|
|
}
|
|
_spec := sqlgraph.NewUpdateSpec(torqueauditlog.Table, torqueauditlog.Columns, sqlgraph.NewFieldSpec(torqueauditlog.FieldID, field.TypeInt))
|
|
id, ok := _u.mutation.ID()
|
|
if !ok {
|
|
return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "TorqueAuditLog.id" for update`)}
|
|
}
|
|
_spec.Node.ID.Value = id
|
|
if fields := _u.fields; len(fields) > 0 {
|
|
_spec.Node.Columns = make([]string, 0, len(fields))
|
|
_spec.Node.Columns = append(_spec.Node.Columns, torqueauditlog.FieldID)
|
|
for _, f := range fields {
|
|
if !torqueauditlog.ValidColumn(f) {
|
|
return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
|
|
}
|
|
if f != torqueauditlog.FieldID {
|
|
_spec.Node.Columns = append(_spec.Node.Columns, f)
|
|
}
|
|
}
|
|
}
|
|
if ps := _u.mutation.predicates; len(ps) > 0 {
|
|
_spec.Predicate = func(selector *sql.Selector) {
|
|
for i := range ps {
|
|
ps[i](selector)
|
|
}
|
|
}
|
|
}
|
|
if value, ok := _u.mutation.TorqueRecordId(); ok {
|
|
_spec.SetField(torqueauditlog.FieldTorqueRecordId, field.TypeInt, value)
|
|
}
|
|
if value, ok := _u.mutation.AddedTorqueRecordId(); ok {
|
|
_spec.AddField(torqueauditlog.FieldTorqueRecordId, field.TypeInt, value)
|
|
}
|
|
if value, ok := _u.mutation.Action(); ok {
|
|
_spec.SetField(torqueauditlog.FieldAction, field.TypeString, value)
|
|
}
|
|
if value, ok := _u.mutation.FieldName(); ok {
|
|
_spec.SetField(torqueauditlog.FieldFieldName, field.TypeString, value)
|
|
}
|
|
if value, ok := _u.mutation.OldVal(); ok {
|
|
_spec.SetField(torqueauditlog.FieldOldVal, field.TypeString, value)
|
|
}
|
|
if value, ok := _u.mutation.NewVal(); ok {
|
|
_spec.SetField(torqueauditlog.FieldNewVal, field.TypeString, value)
|
|
}
|
|
if value, ok := _u.mutation.Operator(); ok {
|
|
_spec.SetField(torqueauditlog.FieldOperator, field.TypeString, value)
|
|
}
|
|
if value, ok := _u.mutation.Remark(); ok {
|
|
_spec.SetField(torqueauditlog.FieldRemark, field.TypeString, value)
|
|
}
|
|
_spec.AddModifiers(_u.modifiers...)
|
|
_node = &TorqueAuditLog{config: _u.config}
|
|
_spec.Assign = _node.assignValues
|
|
_spec.ScanValues = _node.scanValues
|
|
if err = sqlgraph.UpdateNode(ctx, _u.driver, _spec); err != nil {
|
|
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
|
err = &NotFoundError{torqueauditlog.Label}
|
|
} else if sqlgraph.IsConstraintError(err) {
|
|
err = &ConstraintError{msg: err.Error(), wrap: err}
|
|
}
|
|
return nil, err
|
|
}
|
|
_u.mutation.done = true
|
|
return _node, nil
|
|
}
|