chore: finalize backend feature scope
This commit is contained in:
+1
-13
@@ -7,7 +7,7 @@ from sqlalchemy.orm import Session
|
||||
from app.core.response import ApiResponse, ok
|
||||
from app.core.user_context import UserContext, get_user_context
|
||||
from app.db.session import get_db
|
||||
from app.schemas.evaluation import EvaluationDetailResponse, EvaluationListResponse, ExportPdfResponse
|
||||
from app.schemas.evaluation import EvaluationDetailResponse, EvaluationListResponse
|
||||
from app.services.evaluation_service import EvaluationService
|
||||
from app.services.pdf_export_service import PdfExportService
|
||||
|
||||
@@ -35,18 +35,6 @@ def get_evaluation_detail(
|
||||
return ok(EvaluationService(db).get_detail(evaluation_id, ctx.user_id))
|
||||
|
||||
|
||||
@router.post("/{evaluation_id}/export-pdf", response_model=ApiResponse[ExportPdfResponse])
|
||||
def export_pdf(
|
||||
evaluation_id: int,
|
||||
ctx: UserContext = Depends(get_user_context),
|
||||
db: Session = Depends(get_db),
|
||||
):
|
||||
"""PDF 导出:生成评价报告 PDF 并保存导出记录。"""
|
||||
export = PdfExportService(db).export(evaluation_id, ctx.user_id)
|
||||
db.commit()
|
||||
return ok(ExportPdfResponse(export_id=export.id, file_path=export.file_path))
|
||||
|
||||
|
||||
@router.get("/{evaluation_id}/download-pdf", response_class=FileResponse)
|
||||
def download_pdf(
|
||||
evaluation_id: int,
|
||||
|
||||
Reference in New Issue
Block a user