1. 新增装机绑定实体与相关CRUD逻辑,支持工件工序物料绑定/解绑 2. 为BOM物料新增装配工序字段,支持按工序校验绑定 3. 扩展权限表,新增父权限码字段支持菜单按钮关联 4. 统一各页面帮助弹窗参数,新增角色管理帮助文档 5. 新增公共格式化工具函数,优化侧边栏菜单展开逻辑 6. 新增工位终端绑定代理接口与MES内部绑定API 7. 修复主入口数据库连接与schema初始化逻辑,新增一键迁移工具
527 lines
16 KiB
Go
527 lines
16 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package ent
|
|
|
|
import (
|
|
"bj_power_mes/ent/workpiecebind"
|
|
"context"
|
|
"errors"
|
|
"fmt"
|
|
"time"
|
|
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
"entgo.io/ent/schema/field"
|
|
)
|
|
|
|
// WorkpieceBindCreate is the builder for creating a WorkpieceBind entity.
|
|
type WorkpieceBindCreate struct {
|
|
config
|
|
mutation *WorkpieceBindMutation
|
|
hooks []Hook
|
|
}
|
|
|
|
// SetSn sets the "sn" field.
|
|
func (_c *WorkpieceBindCreate) SetSn(v string) *WorkpieceBindCreate {
|
|
_c.mutation.SetSn(v)
|
|
return _c
|
|
}
|
|
|
|
// SetOrderNo sets the "orderNo" field.
|
|
func (_c *WorkpieceBindCreate) SetOrderNo(v string) *WorkpieceBindCreate {
|
|
_c.mutation.SetOrderNo(v)
|
|
return _c
|
|
}
|
|
|
|
// SetNillableOrderNo sets the "orderNo" field if the given value is not nil.
|
|
func (_c *WorkpieceBindCreate) SetNillableOrderNo(v *string) *WorkpieceBindCreate {
|
|
if v != nil {
|
|
_c.SetOrderNo(*v)
|
|
}
|
|
return _c
|
|
}
|
|
|
|
// SetProcessCode sets the "processCode" field.
|
|
func (_c *WorkpieceBindCreate) SetProcessCode(v int) *WorkpieceBindCreate {
|
|
_c.mutation.SetProcessCode(v)
|
|
return _c
|
|
}
|
|
|
|
// SetStationNo sets the "stationNo" field.
|
|
func (_c *WorkpieceBindCreate) SetStationNo(v string) *WorkpieceBindCreate {
|
|
_c.mutation.SetStationNo(v)
|
|
return _c
|
|
}
|
|
|
|
// SetNillableStationNo sets the "stationNo" field if the given value is not nil.
|
|
func (_c *WorkpieceBindCreate) SetNillableStationNo(v *string) *WorkpieceBindCreate {
|
|
if v != nil {
|
|
_c.SetStationNo(*v)
|
|
}
|
|
return _c
|
|
}
|
|
|
|
// SetMaterialCode sets the "materialCode" field.
|
|
func (_c *WorkpieceBindCreate) SetMaterialCode(v string) *WorkpieceBindCreate {
|
|
_c.mutation.SetMaterialCode(v)
|
|
return _c
|
|
}
|
|
|
|
// SetMaterialName sets the "materialName" field.
|
|
func (_c *WorkpieceBindCreate) SetMaterialName(v string) *WorkpieceBindCreate {
|
|
_c.mutation.SetMaterialName(v)
|
|
return _c
|
|
}
|
|
|
|
// SetNillableMaterialName sets the "materialName" field if the given value is not nil.
|
|
func (_c *WorkpieceBindCreate) SetNillableMaterialName(v *string) *WorkpieceBindCreate {
|
|
if v != nil {
|
|
_c.SetMaterialName(*v)
|
|
}
|
|
return _c
|
|
}
|
|
|
|
// SetSpec sets the "spec" field.
|
|
func (_c *WorkpieceBindCreate) SetSpec(v string) *WorkpieceBindCreate {
|
|
_c.mutation.SetSpec(v)
|
|
return _c
|
|
}
|
|
|
|
// SetNillableSpec sets the "spec" field if the given value is not nil.
|
|
func (_c *WorkpieceBindCreate) SetNillableSpec(v *string) *WorkpieceBindCreate {
|
|
if v != nil {
|
|
_c.SetSpec(*v)
|
|
}
|
|
return _c
|
|
}
|
|
|
|
// SetUnit sets the "unit" field.
|
|
func (_c *WorkpieceBindCreate) SetUnit(v string) *WorkpieceBindCreate {
|
|
_c.mutation.SetUnit(v)
|
|
return _c
|
|
}
|
|
|
|
// SetNillableUnit sets the "unit" field if the given value is not nil.
|
|
func (_c *WorkpieceBindCreate) SetNillableUnit(v *string) *WorkpieceBindCreate {
|
|
if v != nil {
|
|
_c.SetUnit(*v)
|
|
}
|
|
return _c
|
|
}
|
|
|
|
// SetManageMode sets the "manageMode" field.
|
|
func (_c *WorkpieceBindCreate) SetManageMode(v string) *WorkpieceBindCreate {
|
|
_c.mutation.SetManageMode(v)
|
|
return _c
|
|
}
|
|
|
|
// SetNillableManageMode sets the "manageMode" field if the given value is not nil.
|
|
func (_c *WorkpieceBindCreate) SetNillableManageMode(v *string) *WorkpieceBindCreate {
|
|
if v != nil {
|
|
_c.SetManageMode(*v)
|
|
}
|
|
return _c
|
|
}
|
|
|
|
// SetBindValue sets the "bindValue" field.
|
|
func (_c *WorkpieceBindCreate) SetBindValue(v string) *WorkpieceBindCreate {
|
|
_c.mutation.SetBindValue(v)
|
|
return _c
|
|
}
|
|
|
|
// SetBindType sets the "bindType" field.
|
|
func (_c *WorkpieceBindCreate) SetBindType(v string) *WorkpieceBindCreate {
|
|
_c.mutation.SetBindType(v)
|
|
return _c
|
|
}
|
|
|
|
// SetNillableBindType sets the "bindType" field if the given value is not nil.
|
|
func (_c *WorkpieceBindCreate) SetNillableBindType(v *string) *WorkpieceBindCreate {
|
|
if v != nil {
|
|
_c.SetBindType(*v)
|
|
}
|
|
return _c
|
|
}
|
|
|
|
// SetOperator sets the "operator" field.
|
|
func (_c *WorkpieceBindCreate) SetOperator(v string) *WorkpieceBindCreate {
|
|
_c.mutation.SetOperator(v)
|
|
return _c
|
|
}
|
|
|
|
// SetNillableOperator sets the "operator" field if the given value is not nil.
|
|
func (_c *WorkpieceBindCreate) SetNillableOperator(v *string) *WorkpieceBindCreate {
|
|
if v != nil {
|
|
_c.SetOperator(*v)
|
|
}
|
|
return _c
|
|
}
|
|
|
|
// SetCreatedAt sets the "createdAt" field.
|
|
func (_c *WorkpieceBindCreate) SetCreatedAt(v time.Time) *WorkpieceBindCreate {
|
|
_c.mutation.SetCreatedAt(v)
|
|
return _c
|
|
}
|
|
|
|
// SetNillableCreatedAt sets the "createdAt" field if the given value is not nil.
|
|
func (_c *WorkpieceBindCreate) SetNillableCreatedAt(v *time.Time) *WorkpieceBindCreate {
|
|
if v != nil {
|
|
_c.SetCreatedAt(*v)
|
|
}
|
|
return _c
|
|
}
|
|
|
|
// SetID sets the "id" field.
|
|
func (_c *WorkpieceBindCreate) SetID(v int) *WorkpieceBindCreate {
|
|
_c.mutation.SetID(v)
|
|
return _c
|
|
}
|
|
|
|
// Mutation returns the WorkpieceBindMutation object of the builder.
|
|
func (_c *WorkpieceBindCreate) Mutation() *WorkpieceBindMutation {
|
|
return _c.mutation
|
|
}
|
|
|
|
// Save creates the WorkpieceBind in the database.
|
|
func (_c *WorkpieceBindCreate) Save(ctx context.Context) (*WorkpieceBind, error) {
|
|
_c.defaults()
|
|
return withHooks(ctx, _c.sqlSave, _c.mutation, _c.hooks)
|
|
}
|
|
|
|
// SaveX calls Save and panics if Save returns an error.
|
|
func (_c *WorkpieceBindCreate) SaveX(ctx context.Context) *WorkpieceBind {
|
|
v, err := _c.Save(ctx)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return v
|
|
}
|
|
|
|
// Exec executes the query.
|
|
func (_c *WorkpieceBindCreate) Exec(ctx context.Context) error {
|
|
_, err := _c.Save(ctx)
|
|
return err
|
|
}
|
|
|
|
// ExecX is like Exec, but panics if an error occurs.
|
|
func (_c *WorkpieceBindCreate) ExecX(ctx context.Context) {
|
|
if err := _c.Exec(ctx); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
|
|
// defaults sets the default values of the builder before save.
|
|
func (_c *WorkpieceBindCreate) defaults() {
|
|
if _, ok := _c.mutation.OrderNo(); !ok {
|
|
v := workpiecebind.DefaultOrderNo
|
|
_c.mutation.SetOrderNo(v)
|
|
}
|
|
if _, ok := _c.mutation.StationNo(); !ok {
|
|
v := workpiecebind.DefaultStationNo
|
|
_c.mutation.SetStationNo(v)
|
|
}
|
|
if _, ok := _c.mutation.MaterialName(); !ok {
|
|
v := workpiecebind.DefaultMaterialName
|
|
_c.mutation.SetMaterialName(v)
|
|
}
|
|
if _, ok := _c.mutation.Spec(); !ok {
|
|
v := workpiecebind.DefaultSpec
|
|
_c.mutation.SetSpec(v)
|
|
}
|
|
if _, ok := _c.mutation.Unit(); !ok {
|
|
v := workpiecebind.DefaultUnit
|
|
_c.mutation.SetUnit(v)
|
|
}
|
|
if _, ok := _c.mutation.ManageMode(); !ok {
|
|
v := workpiecebind.DefaultManageMode
|
|
_c.mutation.SetManageMode(v)
|
|
}
|
|
if _, ok := _c.mutation.BindType(); !ok {
|
|
v := workpiecebind.DefaultBindType
|
|
_c.mutation.SetBindType(v)
|
|
}
|
|
if _, ok := _c.mutation.Operator(); !ok {
|
|
v := workpiecebind.DefaultOperator
|
|
_c.mutation.SetOperator(v)
|
|
}
|
|
if _, ok := _c.mutation.CreatedAt(); !ok {
|
|
v := workpiecebind.DefaultCreatedAt()
|
|
_c.mutation.SetCreatedAt(v)
|
|
}
|
|
}
|
|
|
|
// check runs all checks and user-defined validators on the builder.
|
|
func (_c *WorkpieceBindCreate) check() error {
|
|
if _, ok := _c.mutation.Sn(); !ok {
|
|
return &ValidationError{Name: "sn", err: errors.New(`ent: missing required field "WorkpieceBind.sn"`)}
|
|
}
|
|
if v, ok := _c.mutation.Sn(); ok {
|
|
if err := workpiecebind.SnValidator(v); err != nil {
|
|
return &ValidationError{Name: "sn", err: fmt.Errorf(`ent: validator failed for field "WorkpieceBind.sn": %w`, err)}
|
|
}
|
|
}
|
|
if _, ok := _c.mutation.OrderNo(); !ok {
|
|
return &ValidationError{Name: "orderNo", err: errors.New(`ent: missing required field "WorkpieceBind.orderNo"`)}
|
|
}
|
|
if v, ok := _c.mutation.OrderNo(); ok {
|
|
if err := workpiecebind.OrderNoValidator(v); err != nil {
|
|
return &ValidationError{Name: "orderNo", err: fmt.Errorf(`ent: validator failed for field "WorkpieceBind.orderNo": %w`, err)}
|
|
}
|
|
}
|
|
if _, ok := _c.mutation.ProcessCode(); !ok {
|
|
return &ValidationError{Name: "processCode", err: errors.New(`ent: missing required field "WorkpieceBind.processCode"`)}
|
|
}
|
|
if _, ok := _c.mutation.StationNo(); !ok {
|
|
return &ValidationError{Name: "stationNo", err: errors.New(`ent: missing required field "WorkpieceBind.stationNo"`)}
|
|
}
|
|
if v, ok := _c.mutation.StationNo(); ok {
|
|
if err := workpiecebind.StationNoValidator(v); err != nil {
|
|
return &ValidationError{Name: "stationNo", err: fmt.Errorf(`ent: validator failed for field "WorkpieceBind.stationNo": %w`, err)}
|
|
}
|
|
}
|
|
if _, ok := _c.mutation.MaterialCode(); !ok {
|
|
return &ValidationError{Name: "materialCode", err: errors.New(`ent: missing required field "WorkpieceBind.materialCode"`)}
|
|
}
|
|
if v, ok := _c.mutation.MaterialCode(); ok {
|
|
if err := workpiecebind.MaterialCodeValidator(v); err != nil {
|
|
return &ValidationError{Name: "materialCode", err: fmt.Errorf(`ent: validator failed for field "WorkpieceBind.materialCode": %w`, err)}
|
|
}
|
|
}
|
|
if _, ok := _c.mutation.MaterialName(); !ok {
|
|
return &ValidationError{Name: "materialName", err: errors.New(`ent: missing required field "WorkpieceBind.materialName"`)}
|
|
}
|
|
if v, ok := _c.mutation.MaterialName(); ok {
|
|
if err := workpiecebind.MaterialNameValidator(v); err != nil {
|
|
return &ValidationError{Name: "materialName", err: fmt.Errorf(`ent: validator failed for field "WorkpieceBind.materialName": %w`, err)}
|
|
}
|
|
}
|
|
if _, ok := _c.mutation.Spec(); !ok {
|
|
return &ValidationError{Name: "spec", err: errors.New(`ent: missing required field "WorkpieceBind.spec"`)}
|
|
}
|
|
if v, ok := _c.mutation.Spec(); ok {
|
|
if err := workpiecebind.SpecValidator(v); err != nil {
|
|
return &ValidationError{Name: "spec", err: fmt.Errorf(`ent: validator failed for field "WorkpieceBind.spec": %w`, err)}
|
|
}
|
|
}
|
|
if _, ok := _c.mutation.Unit(); !ok {
|
|
return &ValidationError{Name: "unit", err: errors.New(`ent: missing required field "WorkpieceBind.unit"`)}
|
|
}
|
|
if v, ok := _c.mutation.Unit(); ok {
|
|
if err := workpiecebind.UnitValidator(v); err != nil {
|
|
return &ValidationError{Name: "unit", err: fmt.Errorf(`ent: validator failed for field "WorkpieceBind.unit": %w`, err)}
|
|
}
|
|
}
|
|
if _, ok := _c.mutation.ManageMode(); !ok {
|
|
return &ValidationError{Name: "manageMode", err: errors.New(`ent: missing required field "WorkpieceBind.manageMode"`)}
|
|
}
|
|
if v, ok := _c.mutation.ManageMode(); ok {
|
|
if err := workpiecebind.ManageModeValidator(v); err != nil {
|
|
return &ValidationError{Name: "manageMode", err: fmt.Errorf(`ent: validator failed for field "WorkpieceBind.manageMode": %w`, err)}
|
|
}
|
|
}
|
|
if _, ok := _c.mutation.BindValue(); !ok {
|
|
return &ValidationError{Name: "bindValue", err: errors.New(`ent: missing required field "WorkpieceBind.bindValue"`)}
|
|
}
|
|
if v, ok := _c.mutation.BindValue(); ok {
|
|
if err := workpiecebind.BindValueValidator(v); err != nil {
|
|
return &ValidationError{Name: "bindValue", err: fmt.Errorf(`ent: validator failed for field "WorkpieceBind.bindValue": %w`, err)}
|
|
}
|
|
}
|
|
if _, ok := _c.mutation.BindType(); !ok {
|
|
return &ValidationError{Name: "bindType", err: errors.New(`ent: missing required field "WorkpieceBind.bindType"`)}
|
|
}
|
|
if v, ok := _c.mutation.BindType(); ok {
|
|
if err := workpiecebind.BindTypeValidator(v); err != nil {
|
|
return &ValidationError{Name: "bindType", err: fmt.Errorf(`ent: validator failed for field "WorkpieceBind.bindType": %w`, err)}
|
|
}
|
|
}
|
|
if _, ok := _c.mutation.Operator(); !ok {
|
|
return &ValidationError{Name: "operator", err: errors.New(`ent: missing required field "WorkpieceBind.operator"`)}
|
|
}
|
|
if v, ok := _c.mutation.Operator(); ok {
|
|
if err := workpiecebind.OperatorValidator(v); err != nil {
|
|
return &ValidationError{Name: "operator", err: fmt.Errorf(`ent: validator failed for field "WorkpieceBind.operator": %w`, err)}
|
|
}
|
|
}
|
|
if _, ok := _c.mutation.CreatedAt(); !ok {
|
|
return &ValidationError{Name: "createdAt", err: errors.New(`ent: missing required field "WorkpieceBind.createdAt"`)}
|
|
}
|
|
if v, ok := _c.mutation.ID(); ok {
|
|
if err := workpiecebind.IDValidator(v); err != nil {
|
|
return &ValidationError{Name: "id", err: fmt.Errorf(`ent: validator failed for field "WorkpieceBind.id": %w`, err)}
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (_c *WorkpieceBindCreate) sqlSave(ctx context.Context) (*WorkpieceBind, error) {
|
|
if err := _c.check(); err != nil {
|
|
return nil, err
|
|
}
|
|
_node, _spec := _c.createSpec()
|
|
if err := sqlgraph.CreateNode(ctx, _c.driver, _spec); err != nil {
|
|
if sqlgraph.IsConstraintError(err) {
|
|
err = &ConstraintError{msg: err.Error(), wrap: err}
|
|
}
|
|
return nil, err
|
|
}
|
|
if _spec.ID.Value != _node.ID {
|
|
id := _spec.ID.Value.(int64)
|
|
_node.ID = int(id)
|
|
}
|
|
_c.mutation.id = &_node.ID
|
|
_c.mutation.done = true
|
|
return _node, nil
|
|
}
|
|
|
|
func (_c *WorkpieceBindCreate) createSpec() (*WorkpieceBind, *sqlgraph.CreateSpec) {
|
|
var (
|
|
_node = &WorkpieceBind{config: _c.config}
|
|
_spec = sqlgraph.NewCreateSpec(workpiecebind.Table, sqlgraph.NewFieldSpec(workpiecebind.FieldID, field.TypeInt))
|
|
)
|
|
if id, ok := _c.mutation.ID(); ok {
|
|
_node.ID = id
|
|
_spec.ID.Value = id
|
|
}
|
|
if value, ok := _c.mutation.Sn(); ok {
|
|
_spec.SetField(workpiecebind.FieldSn, field.TypeString, value)
|
|
_node.Sn = value
|
|
}
|
|
if value, ok := _c.mutation.OrderNo(); ok {
|
|
_spec.SetField(workpiecebind.FieldOrderNo, field.TypeString, value)
|
|
_node.OrderNo = value
|
|
}
|
|
if value, ok := _c.mutation.ProcessCode(); ok {
|
|
_spec.SetField(workpiecebind.FieldProcessCode, field.TypeInt, value)
|
|
_node.ProcessCode = value
|
|
}
|
|
if value, ok := _c.mutation.StationNo(); ok {
|
|
_spec.SetField(workpiecebind.FieldStationNo, field.TypeString, value)
|
|
_node.StationNo = value
|
|
}
|
|
if value, ok := _c.mutation.MaterialCode(); ok {
|
|
_spec.SetField(workpiecebind.FieldMaterialCode, field.TypeString, value)
|
|
_node.MaterialCode = value
|
|
}
|
|
if value, ok := _c.mutation.MaterialName(); ok {
|
|
_spec.SetField(workpiecebind.FieldMaterialName, field.TypeString, value)
|
|
_node.MaterialName = value
|
|
}
|
|
if value, ok := _c.mutation.Spec(); ok {
|
|
_spec.SetField(workpiecebind.FieldSpec, field.TypeString, value)
|
|
_node.Spec = value
|
|
}
|
|
if value, ok := _c.mutation.Unit(); ok {
|
|
_spec.SetField(workpiecebind.FieldUnit, field.TypeString, value)
|
|
_node.Unit = value
|
|
}
|
|
if value, ok := _c.mutation.ManageMode(); ok {
|
|
_spec.SetField(workpiecebind.FieldManageMode, field.TypeString, value)
|
|
_node.ManageMode = value
|
|
}
|
|
if value, ok := _c.mutation.BindValue(); ok {
|
|
_spec.SetField(workpiecebind.FieldBindValue, field.TypeString, value)
|
|
_node.BindValue = value
|
|
}
|
|
if value, ok := _c.mutation.BindType(); ok {
|
|
_spec.SetField(workpiecebind.FieldBindType, field.TypeString, value)
|
|
_node.BindType = value
|
|
}
|
|
if value, ok := _c.mutation.Operator(); ok {
|
|
_spec.SetField(workpiecebind.FieldOperator, field.TypeString, value)
|
|
_node.Operator = value
|
|
}
|
|
if value, ok := _c.mutation.CreatedAt(); ok {
|
|
_spec.SetField(workpiecebind.FieldCreatedAt, field.TypeTime, value)
|
|
_node.CreatedAt = value
|
|
}
|
|
return _node, _spec
|
|
}
|
|
|
|
// WorkpieceBindCreateBulk is the builder for creating many WorkpieceBind entities in bulk.
|
|
type WorkpieceBindCreateBulk struct {
|
|
config
|
|
err error
|
|
builders []*WorkpieceBindCreate
|
|
}
|
|
|
|
// Save creates the WorkpieceBind entities in the database.
|
|
func (_c *WorkpieceBindCreateBulk) Save(ctx context.Context) ([]*WorkpieceBind, error) {
|
|
if _c.err != nil {
|
|
return nil, _c.err
|
|
}
|
|
specs := make([]*sqlgraph.CreateSpec, len(_c.builders))
|
|
nodes := make([]*WorkpieceBind, len(_c.builders))
|
|
mutators := make([]Mutator, len(_c.builders))
|
|
for i := range _c.builders {
|
|
func(i int, root context.Context) {
|
|
builder := _c.builders[i]
|
|
builder.defaults()
|
|
var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
|
|
mutation, ok := m.(*WorkpieceBindMutation)
|
|
if !ok {
|
|
return nil, fmt.Errorf("unexpected mutation type %T", m)
|
|
}
|
|
if err := builder.check(); err != nil {
|
|
return nil, err
|
|
}
|
|
builder.mutation = mutation
|
|
var err error
|
|
nodes[i], specs[i] = builder.createSpec()
|
|
if i < len(mutators)-1 {
|
|
_, err = mutators[i+1].Mutate(root, _c.builders[i+1].mutation)
|
|
} else {
|
|
spec := &sqlgraph.BatchCreateSpec{Nodes: specs}
|
|
// Invoke the actual operation on the latest mutation in the chain.
|
|
if err = sqlgraph.BatchCreate(ctx, _c.driver, spec); err != nil {
|
|
if sqlgraph.IsConstraintError(err) {
|
|
err = &ConstraintError{msg: err.Error(), wrap: err}
|
|
}
|
|
}
|
|
}
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
mutation.id = &nodes[i].ID
|
|
if specs[i].ID.Value != nil && nodes[i].ID == 0 {
|
|
id := specs[i].ID.Value.(int64)
|
|
nodes[i].ID = int(id)
|
|
}
|
|
mutation.done = true
|
|
return nodes[i], nil
|
|
})
|
|
for i := len(builder.hooks) - 1; i >= 0; i-- {
|
|
mut = builder.hooks[i](mut)
|
|
}
|
|
mutators[i] = mut
|
|
}(i, ctx)
|
|
}
|
|
if len(mutators) > 0 {
|
|
if _, err := mutators[0].Mutate(ctx, _c.builders[0].mutation); err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
return nodes, nil
|
|
}
|
|
|
|
// SaveX is like Save, but panics if an error occurs.
|
|
func (_c *WorkpieceBindCreateBulk) SaveX(ctx context.Context) []*WorkpieceBind {
|
|
v, err := _c.Save(ctx)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return v
|
|
}
|
|
|
|
// Exec executes the query.
|
|
func (_c *WorkpieceBindCreateBulk) Exec(ctx context.Context) error {
|
|
_, err := _c.Save(ctx)
|
|
return err
|
|
}
|
|
|
|
// ExecX is like Exec, but panics if an error occurs.
|
|
func (_c *WorkpieceBindCreateBulk) ExecX(ctx context.Context) {
|
|
if err := _c.Exec(ctx); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|