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

@@ -53,7 +53,7 @@ def get_latest_article(db: Session):
)
article = result.scalar_one_or_none()
return article
return article.content
def query_recipe_agent(db: Session):
@@ -97,9 +97,9 @@ def get_latest_recipe(db: Session):
result = db.execute(
select(Recipe).where(Recipe.date == today)
)
article = result.scalar_one_or_none()
recipe = result.scalar_one_or_none()
return article
return recipe.content
def query_report_agent(req: ReportAgentRequest):

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