refactor: Clean up code by removing unnecessary blank lines and improving comments for better readability and maintainability

This commit is contained in:
wizardchen
2025-11-28 16:10:37 +08:00
parent a318a08ab7
commit 135e33eca4
38 changed files with 318 additions and 545 deletions
+3 -2
View File
@@ -138,7 +138,8 @@ func (r *knowledgeRepository) CheckKnowledgeExists(
query := r.db.WithContext(ctx).Model(&types.Knowledge{}).
Where("tenant_id = ? AND knowledge_base_id = ? AND parse_status <> ?", tenantID, kbID, "failed")
if params.Type == "file" {
switch params.Type {
case "file":
// If file hash exists, prioritize exact match using hash
if params.FileHash != "" {
var knowledge types.Knowledge
@@ -167,7 +168,7 @@ func (r *knowledgeRepository) CheckKnowledgeExists(
}
return true, &knowledge, nil
}
} else if params.Type == "url" {
case "url":
// If file hash exists, prioritize exact match using hash
if params.FileHash != "" {
var knowledge types.Knowledge