feat: 支持删除文档类型标签

This commit is contained in:
wizardchen
2026-01-15 19:38:16 +08:00
parent 57d6fea8bc
commit 0ea9acfc2f
15 changed files with 188 additions and 33 deletions
@@ -401,3 +401,16 @@ func (r *knowledgeRepository) SearchKnowledge(
}
return knowledges, hasMore, nil
}
// ListIDsByTagID returns all knowledge IDs that have the specified tag ID
func (r *knowledgeRepository) ListIDsByTagID(
ctx context.Context,
tenantID uint64,
kbID, tagID string,
) ([]string, error) {
var ids []string
err := r.db.WithContext(ctx).Model(&types.Knowledge{}).
Where("tenant_id = ? AND knowledge_base_id = ? AND tag_id = ?", tenantID, kbID, tagID).
Pluck("id", &ids).Error
return ids, err
}