From bfb96411280ce8089be95d4b1efffa493edb02d1 Mon Sep 17 00:00:00 2001 From: euvre <93761161+euvre@users.noreply.github.com> Date: Mon, 6 Jul 2026 19:01:32 +0800 Subject: [PATCH] fix(go): uploaded documents should be enabled by default (#16674) --- internal/service/document.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/service/document.go b/internal/service/document.go index cb6b3a3f9..23cc5bc2e 100644 --- a/internal/service/document.go +++ b/internal/service/document.go @@ -569,7 +569,7 @@ func (s *DocumentService) CreateDocument(req *CreateDocumentRequest) (*entity.Do Type: req.Type, SourceType: req.Source, Suffix: ".doc", - Status: func() *string { s := "0"; return &s }(), + Status: func() *string { s := "1"; return &s }(), } if err := s.InsertDocument(document); err != nil { @@ -3466,7 +3466,8 @@ func normalizeWebDocumentName(name, contentType string, blob []byte) string { // suffix and content hash. blob may be nil for the empty/virtual document. func (s *DocumentService) newDatasetDocument(kb *entity.Knowledgebase, tenantID, filename, location, filetype string, parserConfig entity.JSONMap, src string, size int64, blob []byte) *entity.Document { docID := strings.ReplaceAll(uuid.New().String(), "-", "") - zero := "0" + run := "0" + status := "1" suffix := "" if i := strings.LastIndex(filename, "."); i >= 0 { suffix = filename[i+1:] @@ -3485,8 +3486,8 @@ func (s *DocumentService) newDatasetDocument(kb *entity.Knowledgebase, tenantID, Location: &loc, Size: size, Suffix: suffix, - Run: &zero, - Status: &zero, + Run: &run, + Status: &status, } if blob != nil { hash := contentHashHex(blob)