feat: 更新接口返回值
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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