feat(library): Phase 2B 문서 상세 facet 편집 + 업로드 facet 전달

FileInfoView에 회사/주제/연도/문서유형 select 4개 추가.
facet 옵션은 /api/library/facets에서 로드, 세션 캐시.
업로드 엔드포인트에 facet Form 파라미터 4개 추가.
업로드 시 현재 선택 facet 자동 전달 + 미리보기 텍스트.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-04-15 10:27:03 +09:00
parent 776734c897
commit ef9687b0bf
3 changed files with 115 additions and 1 deletions
+8
View File
@@ -422,6 +422,10 @@ async def upload_document(
session: Annotated[AsyncSession, Depends(get_session)],
doc_purpose: str | None = Form(None, description="business | knowledge"),
library_path: str | None = Form(None, description="자료실 경로 (자동 @library/ 태깅)"),
facet_company: str | None = Form(None),
facet_topic: str | None = Form(None),
facet_year: int | None = Form(None),
facet_doctype: str | None = Form(None),
):
"""파일 업로드 → Inbox 저장 + DB 등록 + 처리 큐 등록"""
from core.library import DEFAULT_LIBRARY_PATH, LIBRARY_PREFIX, normalize_library_path
@@ -490,6 +494,10 @@ async def upload_document(
source_channel="manual",
doc_purpose=doc_purpose,
user_tags=[library_tag] if library_tag else [],
facet_company=facet_company or None,
facet_topic=facet_topic or None,
facet_year=facet_year,
facet_doctype=facet_doctype or None,
)
session.add(doc)
await session.flush()