refactor(workflow): Move domain resources events into the application layer (#729)
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
package vo
|
||||
|
||||
import (
|
||||
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin"
|
||||
model "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/workflow"
|
||||
)
|
||||
|
||||
type Page struct {
|
||||
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
"github.com/cloudwego/eino/compose"
|
||||
"github.com/cloudwego/eino/schema"
|
||||
|
||||
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin"
|
||||
workflowModel "github.com/coze-dev/coze-studio/backend/api/model/crossdomain/workflow"
|
||||
"github.com/coze-dev/coze-studio/backend/pkg/errorx"
|
||||
"github.com/coze-dev/coze-studio/backend/pkg/sonic"
|
||||
"github.com/coze-dev/coze-studio/backend/types/errno"
|
||||
@@ -93,7 +93,7 @@ type wfErr struct {
|
||||
|
||||
func (w *wfErr) DebugURL() string {
|
||||
if w.StatusError.Extra() == nil {
|
||||
return fmt.Sprintf(plugin.DebugURLTpl, w.exeID, w.spaceID, w.workflowID)
|
||||
return fmt.Sprintf(workflowModel.DebugURLTpl, w.exeID, w.spaceID, w.workflowID)
|
||||
}
|
||||
|
||||
debugURL, ok := w.StatusError.Extra()["debug_url"]
|
||||
@@ -101,7 +101,7 @@ func (w *wfErr) DebugURL() string {
|
||||
return debugURL
|
||||
}
|
||||
|
||||
return fmt.Sprintf(plugin.DebugURLTpl, w.exeID, w.spaceID, w.workflowID)
|
||||
return fmt.Sprintf(workflowModel.DebugURLTpl, w.exeID, w.spaceID, w.workflowID)
|
||||
}
|
||||
|
||||
func (w *wfErr) Level() ErrorLevel {
|
||||
@@ -170,7 +170,7 @@ func WrapError(code int, err error, opts ...errorx.Option) WorkflowError {
|
||||
}
|
||||
|
||||
func WrapWithDebug(code int, err error, exeID, spaceID, workflowID int64, opts ...errorx.Option) WorkflowError {
|
||||
debugURL := fmt.Sprintf(plugin.DebugURLTpl, exeID, spaceID, workflowID)
|
||||
debugURL := fmt.Sprintf(workflowModel.DebugURLTpl, exeID, spaceID, workflowID)
|
||||
opts = append(opts, errorx.Extra("debug_url", debugURL))
|
||||
return WrapError(code, err, opts...)
|
||||
}
|
||||
|
||||
42
backend/domain/workflow/entity/vo/workflow_copy.go
Normal file
42
backend/domain/workflow/entity/vo/workflow_copy.go
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2025 coze-dev Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package vo
|
||||
|
||||
import (
|
||||
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin"
|
||||
)
|
||||
|
||||
type ExternalResourceRelated struct {
|
||||
PluginMap map[int64]*plugin.PluginEntity
|
||||
PluginToolMap map[int64]int64
|
||||
|
||||
KnowledgeMap map[int64]int64
|
||||
DatabaseMap map[int64]int64
|
||||
}
|
||||
|
||||
type CopyWorkflowPolicy struct {
|
||||
TargetSpaceID *int64
|
||||
TargetAppID *int64
|
||||
ModifiedCanvasSchema *string
|
||||
ShouldModifyWorkflowName bool
|
||||
}
|
||||
|
||||
type DependenceResource struct {
|
||||
PluginIDs []int64
|
||||
KnowledgeIDs []int64
|
||||
DatabaseIDs []int64
|
||||
}
|
||||
Reference in New Issue
Block a user