初始化
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
package schema
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/field"
|
||||
"entgo.io/ent/schema/index"
|
||||
)
|
||||
|
||||
// AgvTask 海康 RCS AGV 任务记录
|
||||
type AgvTask struct {
|
||||
ent.Schema
|
||||
}
|
||||
|
||||
func (AgvTask) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.String("task_no").Unique().Comment("本地任务号"),
|
||||
field.String("rcs_task_id").Optional().Comment("RCS 返回的任务ID"),
|
||||
field.String("order_no").Optional(),
|
||||
field.String("dock_from").Optional().Comment("起始点(接驳台号或库位点)"),
|
||||
field.String("dock_to").Optional(),
|
||||
field.Int("priority").Default(4).Comment("任务优先级 0~14"),
|
||||
field.String("status").Default("待下发").Comment("待下发/执行中/完成/失败"),
|
||||
field.Bool("sim").Default(true).Comment("模拟模式"),
|
||||
field.String("resp_text").Optional(),
|
||||
field.Time("created_at").Default(time.Now).Immutable(),
|
||||
field.Time("updated_at").Default(time.Now).UpdateDefault(time.Now).Optional().Nillable(),
|
||||
}
|
||||
}
|
||||
|
||||
func (AgvTask) Indexes() []ent.Index {
|
||||
return []ent.Index{
|
||||
index.Fields("status"),
|
||||
index.Fields("created_at"),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user