feat: 新增工作流执行模块
新增流程执行记录的实体、DTO、DAO、控制器和服务层,支持工作流的执行、回调及结果树状列表查询;同时更新服务名称为 ai-agent。
This commit is contained in:
28
workflow/consts/flow/flow_execution_status.go
Normal file
28
workflow/consts/flow/flow_execution_status.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package flow
|
||||
|
||||
import "github.com/gogf/gf/v2/util/gconv"
|
||||
|
||||
var (
|
||||
FlowExecutionStatusRunning = newFlowExecutionStatus(gconv.PtrInt8(1), "running") // 运行中
|
||||
FlowExecutionStatusSuccess = newFlowExecutionStatus(gconv.PtrInt8(2), "success") // 成功
|
||||
FlowExecutionStatusFailed = newFlowExecutionStatus(gconv.PtrInt8(3), "failed") // 失败
|
||||
FlowExecutionStatusPaused = newFlowExecutionStatus(gconv.PtrInt8(4), "paused") // 暂停
|
||||
)
|
||||
|
||||
type FlowExecutionStatus *int8
|
||||
|
||||
type flowExecutionStatus struct {
|
||||
code FlowExecutionStatus
|
||||
desc string
|
||||
}
|
||||
|
||||
func (s flowExecutionStatus) Code() FlowExecutionStatus {
|
||||
return s.code
|
||||
}
|
||||
func (s flowExecutionStatus) Desc() string {
|
||||
return s.desc
|
||||
}
|
||||
|
||||
func newFlowExecutionStatus(code FlowExecutionStatus, desc string) flowExecutionStatus {
|
||||
return flowExecutionStatus{code: code, desc: desc}
|
||||
}
|
||||
27
workflow/consts/flow/flow_execution_trigger_type.go
Normal file
27
workflow/consts/flow/flow_execution_trigger_type.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package flow
|
||||
|
||||
import "github.com/gogf/gf/v2/util/gconv"
|
||||
|
||||
type FlowExecutionTriggerType *int8
|
||||
|
||||
var (
|
||||
FlowExecutionTriggerTypeManual = newFlowExecutionTriggerType(gconv.PtrInt8(1), "manual")
|
||||
FlowExecutionTriggerTypeAuto = newFlowExecutionTriggerType(gconv.PtrInt8(2), "auto")
|
||||
FlowExecutionTriggerTypeTime = newFlowExecutionTriggerType(gconv.PtrInt8(3), "time")
|
||||
)
|
||||
|
||||
type flowExecutionTriggerType struct {
|
||||
code FlowExecutionTriggerType
|
||||
desc string
|
||||
}
|
||||
|
||||
func (s flowExecutionTriggerType) Code() FlowExecutionTriggerType {
|
||||
return s.code
|
||||
}
|
||||
func (s flowExecutionTriggerType) Desc() string {
|
||||
return s.desc
|
||||
}
|
||||
|
||||
func newFlowExecutionTriggerType(code FlowExecutionTriggerType, desc string) flowExecutionTriggerType {
|
||||
return flowExecutionTriggerType{code: code, desc: desc}
|
||||
}
|
||||
26
workflow/consts/flow/flow_template_status.go
Normal file
26
workflow/consts/flow/flow_template_status.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package flow
|
||||
|
||||
import "github.com/gogf/gf/v2/util/gconv"
|
||||
|
||||
var (
|
||||
FlowTemplateStatusDisable = newFlowTemplateStatus(gconv.PtrInt8(0), "disable")
|
||||
FlowTemplateStatusEnable = newFlowTemplateStatus(gconv.PtrInt8(1), "enable")
|
||||
)
|
||||
|
||||
type FlowTemplateStatus *int8
|
||||
|
||||
type flowTemplateStatus struct {
|
||||
code FlowTemplateStatus
|
||||
desc string
|
||||
}
|
||||
|
||||
func (s flowTemplateStatus) Code() FlowTemplateStatus {
|
||||
return s.code
|
||||
}
|
||||
func (s flowTemplateStatus) Desc() string {
|
||||
return s.desc
|
||||
}
|
||||
|
||||
func newFlowTemplateStatus(code FlowTemplateStatus, desc string) flowTemplateStatus {
|
||||
return flowTemplateStatus{code: code, desc: desc}
|
||||
}
|
||||
27
workflow/consts/flow/flow_user_access_level.go
Normal file
27
workflow/consts/flow/flow_user_access_level.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package flow
|
||||
|
||||
import "github.com/gogf/gf/v2/util/gconv"
|
||||
|
||||
var (
|
||||
FlowUserAccessLevelPrivate = newFlowUserAccessLevel(gconv.PtrInt8(1), "private")
|
||||
FlowUserAccessLevelTeam = newFlowUserAccessLevel(gconv.PtrInt8(2), "team")
|
||||
FlowUserAccessLevelPublic = newFlowUserAccessLevel(gconv.PtrInt8(3), "public")
|
||||
)
|
||||
|
||||
type FlowUserAccessLevel *int8
|
||||
|
||||
type flowUserAccessLevel struct {
|
||||
code FlowUserAccessLevel
|
||||
desc string
|
||||
}
|
||||
|
||||
func (s flowUserAccessLevel) Code() FlowUserAccessLevel {
|
||||
return s.code
|
||||
}
|
||||
func (s flowUserAccessLevel) Desc() string {
|
||||
return s.desc
|
||||
}
|
||||
|
||||
func newFlowUserAccessLevel(code FlowUserAccessLevel, desc string) flowUserAccessLevel {
|
||||
return flowUserAccessLevel{code: code, desc: desc}
|
||||
}
|
||||
Reference in New Issue
Block a user