feat: 更新接口返回值

This commit is contained in:
2026-09-04 21:28:19 +08:00
parent 86a0d64182
commit abacbe7a5d
4 changed files with 10 additions and 8 deletions

View File

@@ -14,11 +14,13 @@ def upload_report(report: str, db: Session):
db.commit()
db.refresh(report)
return True
return report.id
def query_report(id: int, db: Session):
result = db.execute(
select(Report).where(Report.id == id)
)
return result.scalar_one_or_none()
report = result.scalar_one_or_none()
return report.content