feat: 支持复制知识库时指定任务ID

This commit is contained in:
wizardchen
2026-01-05 17:03:50 +08:00
committed by lyingbug
parent bebeb2a643
commit 9af1fc18f5
2 changed files with 7 additions and 2 deletions
+1
View File
@@ -136,6 +136,7 @@ type HybridSearchResponse struct {
} }
type CopyKnowledgeBaseRequest struct { type CopyKnowledgeBaseRequest struct {
TaskID string `json:"task_id,omitempty"`
SourceID string `json:"source_id"` SourceID string `json:"source_id"`
TargetID string `json:"target_id"` TargetID string `json:"target_id"`
} }
+6 -2
View File
@@ -331,6 +331,7 @@ func (h *KnowledgeBaseHandler) DeleteKnowledgeBase(c *gin.Context) {
} }
type CopyKnowledgeBaseRequest struct { type CopyKnowledgeBaseRequest struct {
TaskID string `json:"task_id"`
SourceID string `json:"source_id" binding:"required"` SourceID string `json:"source_id" binding:"required"`
TargetID string `json:"target_id"` TargetID string `json:"target_id"`
} }
@@ -372,8 +373,11 @@ func (h *KnowledgeBaseHandler) CopyKnowledgeBase(c *gin.Context) {
return return
} }
// Generate task ID // Generate task ID if not provided
taskID := uuid.New().String() taskID := req.TaskID
if taskID == "" {
taskID = uuid.New().String()
}
// Create KB clone payload // Create KB clone payload
payload := types.KBClonePayload{ payload := types.KBClonePayload{