feat: 新增工作流执行模块
新增流程执行记录的实体、DTO、DAO、控制器和服务层,支持工作流的执行、回调及结果树状列表查询;同时更新服务名称为 ai-agent。
This commit is contained in:
41
workflow/controller/flow/flow_template_controller.go
Normal file
41
workflow/controller/flow/flow_template_controller.go
Normal file
@@ -0,0 +1,41 @@
|
||||
package flow
|
||||
|
||||
import (
|
||||
flowDto "ai-agent/workflow/model/dto/flow"
|
||||
flowService "ai-agent/workflow/service/flow"
|
||||
"context"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type flowTemplate struct{}
|
||||
|
||||
var FlowTemplate = new(flowTemplate)
|
||||
|
||||
func (c *flowTemplate) Create(ctx context.Context, req *flowDto.CreateFlowTemplateReq) (res *flowDto.CreateFlowTemplateRes, err error) {
|
||||
res, err = flowService.FlowTemplateService.Create(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *flowTemplate) Update(ctx context.Context, req *flowDto.UpdateFlowTemplateReq) (res *beans.ResponseEmpty, err error) {
|
||||
err = flowService.FlowTemplateService.Update(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *flowTemplate) Delete(ctx context.Context, req *flowDto.DeleteFlowTemplateReq) (res *beans.ResponseEmpty, err error) {
|
||||
err = flowService.FlowTemplateService.Delete(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *flowTemplate) Get(ctx context.Context, req *flowDto.GetFlowTemplateReq) (res *flowDto.FlowTemplateVO, err error) {
|
||||
return flowService.FlowTemplateService.Get(ctx, req)
|
||||
}
|
||||
|
||||
func (c *flowTemplate) List(ctx context.Context, req *flowDto.ListFlowTemplateReq) (res *flowDto.ListFlowTemplateRes, err error) {
|
||||
if !g.IsEmpty(req.Page) {
|
||||
req.Page = &beans.Page{PageNum: 1, PageSize: 20}
|
||||
}
|
||||
res, err = flowService.FlowTemplateService.List(ctx, req)
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user