feat: 升级 samber/do v1 → v2
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package base
|
||||
|
||||
// DataType 定义参数数据类型
|
||||
type DataType string
|
||||
|
||||
const (
|
||||
DataTypeString DataType = "string" // 字符串类型
|
||||
DataTypeInteger DataType = "integer" // 整数类型
|
||||
DataTypeFloat DataType = "float" // 浮点数类型
|
||||
DataTypeBoolean DataType = "boolean" // 布尔类型
|
||||
DataTypeJSON DataType = "json" // JSON类型
|
||||
)
|
||||
|
||||
// SchemaParam 工作流参数
|
||||
type SchemaParam struct {
|
||||
Name string `db:"name" json:"name"`
|
||||
Code string `db:"code" json:"code"`
|
||||
DataType DataType `db:"data_type" json:"data_type"`
|
||||
Required bool `db:"required" json:"required"`
|
||||
Comment string `db:"comment" json:"comment"`
|
||||
Fields SchemaParams `db:"fields" json:"fields,omitempty"`
|
||||
}
|
||||
|
||||
type SchemaParams []SchemaParam
|
||||
|
||||
// Condflow 工作流
|
||||
type Condflow struct {
|
||||
Uuid string `db:"uuid" json:"uuid"`
|
||||
Name string `db:"name" json:"name"`
|
||||
Code string `db:"code" json:"code"`
|
||||
Comment string `db:"comment" json:"comment"`
|
||||
Params SchemaParams `db:"params" json:"params"`
|
||||
CreatedAt string `db:"created_at" json:"created_at"`
|
||||
UpdatedAt string `db:"updated_at" json:"updated_at"`
|
||||
}
|
||||
|
||||
type GetCondflow func(code string) (Condflow, bool)
|
||||
Reference in New Issue
Block a user