feat: 支持复制知识库时指定任务ID
This commit is contained in:
@@ -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"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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{
|
||||||
|
|||||||
Reference in New Issue
Block a user