refactor(runtime): update function signatures to use value receivers for models

This commit is contained in:
mlogclub
2026-04-19 11:38:05 +08:00
parent 680793f527
commit 3e98e9379c
9 changed files with 107 additions and 95 deletions
+2 -5
View File
@@ -54,7 +54,7 @@ func (s *index) IndexDocumentByID(ctx context.Context, documentID int64) error {
return s.IndexDocument(ctx, document)
}
func (s *index) IndexDocument(ctx context.Context, document *models.KnowledgeDocument) error {
func (s *index) IndexDocument(ctx context.Context, document models.KnowledgeDocument) error {
start := time.Now()
if err := s.markDocumentIndexPending(document.ID); err != nil {
slog.Error("Failed to mark knowledge document index as pending", "document_id", document.ID, "error", err)
@@ -302,10 +302,7 @@ func (s *index) RebuildKnowledgeBaseIndex(ctx context.Context, knowledgeBaseID i
return nil
}
func buildFAQChunkContent(faq *models.KnowledgeFAQ) string {
if faq == nil {
return ""
}
func buildFAQChunkContent(faq models.KnowledgeFAQ) string {
parts := []string{fmt.Sprintf("问题:%s", faq.Question)}
var similarQuestions []string
if faq.SimilarQuestions != "" {