Files
ai-agent/workflow/controller/flow/flow_user_controller.go
T
19904408334 8936a4c921 fix: 修复更新流程用户时的返回值和逻辑
- 调整 Update 接口返回创建结果 ID
- 修复管理员更新流程模板和普通用户更新流程的归属逻辑
2026-08-24 17:18:53 +08:00

41 lines
1.2 KiB
Go

package flow
import (
flowDto "ai-agent/workflow/model/dto/flow"
flowService "ai-agent/workflow/service/flow"
"context"
"gitea.redpowerfuture.com/red-future/common/beans"
"github.com/gogf/gf/v2/frame/g"
)
type flowUser struct{}
var FlowUser = new(flowUser)
func (c *flowUser) Create(ctx context.Context, req *flowDto.CreateFlowUserReq) (res *flowDto.CreateFlowUserRes, err error) {
res, err = flowService.FlowUserService.Create(ctx, req)
return
}
func (c *flowUser) Update(ctx context.Context, req *flowDto.UpdateFlowUserReq) (res *flowDto.CreateFlowUserRes, err error) {
return flowService.FlowUserService.Update(ctx, req)
}
func (c *flowUser) Delete(ctx context.Context, req *flowDto.DeleteFlowUserReq) (res *beans.ResponseEmpty, err error) {
err = flowService.FlowUserService.Delete(ctx, req)
return
}
func (c *flowUser) Get(ctx context.Context, req *flowDto.GetFlowUserReq) (res *flowDto.FlowUserVO, err error) {
return flowService.FlowUserService.Get(ctx, req)
}
func (c *flowUser) List(ctx context.Context, req *flowDto.ListFlowUserReq) (res *flowDto.ListFlowRes, err error) {
if !g.IsEmpty(req.Page) {
req.Page = &beans.Page{PageNum: 1, PageSize: 20}
}
res, err = flowService.FlowUserService.List(ctx, req)
return
}