Complete multi-document mode

This commit is contained in:
2025-07-01 18:16:05 +08:00
parent 70d88dabba
commit 1604564e63
15 changed files with 1368 additions and 431 deletions

View File

@@ -3,6 +3,7 @@ package services
import (
"context"
"database/sql"
"errors"
"fmt"
"path/filepath"
"sync"
@@ -191,7 +192,7 @@ func (ds *DocumentService) GetDocumentByID(id int64) (*models.Document, error) {
row := ds.db.QueryRow(sqlGetDocumentByID, id)
err := row.Scan(&doc.ID, &doc.Title, &doc.Content, &doc.CreatedAt, &doc.UpdatedAt)
if err != nil {
if err == sql.ErrNoRows {
if errors.Is(err, sql.ErrNoRows) {
return nil, nil
}
return nil, fmt.Errorf("failed to get document by ID: %w", err)