feat: 更新接口返回值
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user