mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2025-08-19 15:47:35 +08:00
update get_user_info to get_userinfo
This commit is contained in:
@ -72,7 +72,7 @@ class UserService:
|
||||
await UserDao.reset_password(db, obj.id, obj.password2)
|
||||
|
||||
@staticmethod
|
||||
async def get_user_info(username: str):
|
||||
async def get_userinfo(username: str):
|
||||
async with async_db_session() as db:
|
||||
user = await UserDao.get_user_by_username(db, username)
|
||||
if not user:
|
||||
|
@ -40,7 +40,7 @@ async def password_reset(obj: ResetPassword):
|
||||
|
||||
@router.get('/{username}', summary='查看用户信息', dependencies=[DependsUser])
|
||||
async def userinfo(username: str):
|
||||
current_user = await UserService.get_user_info(username)
|
||||
current_user = await UserService.get_userinfo(username)
|
||||
return response_base.response_200(data=current_user, exclude={'password'})
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user