refactor: clean code

This commit is contained in:
Fu Diwei
2025-01-19 03:34:38 +08:00
parent ce4c590b1c
commit c1f77dd92f
17 changed files with 50 additions and 43 deletions

View File

@@ -6,12 +6,12 @@ import (
"github.com/pocketbase/pocketbase/core"
"github.com/pocketbase/pocketbase/tools/router"
"github.com/usual2970/certimate/internal/domain"
"github.com/usual2970/certimate/internal/domain/dtos"
"github.com/usual2970/certimate/internal/rest/resp"
)
type workflowService interface {
Run(ctx context.Context, req *domain.WorkflowRunReq) error
Run(ctx context.Context, req *dtos.WorkflowRunReq) error
Stop(ctx context.Context)
}
@@ -29,7 +29,7 @@ func NewWorkflowHandler(router *router.RouterGroup[*core.RequestEvent], service
}
func (handler *WorkflowHandler) run(e *core.RequestEvent) error {
req := &domain.WorkflowRunReq{}
req := &dtos.WorkflowRunReq{}
req.WorkflowId = e.Request.PathValue("id")
if err := e.BindBody(req); err != nil {
return resp.Err(e, err)