feat: 增加用户信息接口
This commit is contained in:
@@ -53,6 +53,16 @@ def get_latest_article(db: Session):
|
||||
)
|
||||
article = result.scalar_one_or_none()
|
||||
|
||||
if article is None:
|
||||
return [
|
||||
{
|
||||
"title": "",
|
||||
"content": "",
|
||||
"summary": "",
|
||||
"category": ""
|
||||
}
|
||||
]
|
||||
|
||||
return article.content
|
||||
|
||||
|
||||
@@ -99,6 +109,15 @@ def get_latest_recipe(db: Session):
|
||||
)
|
||||
recipe = result.scalar_one_or_none()
|
||||
|
||||
if recipe is None:
|
||||
return [
|
||||
{
|
||||
"name": "",
|
||||
"tags": [],
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
|
||||
return recipe.content
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user