feat(auth、user):新增用户的粉丝数、关注数、简介
This commit is contained in:
@@ -18,6 +18,7 @@ from core.routers.auth.schema import LoginUser
|
||||
from core.routers.auth.services import get_current_user_form_http
|
||||
|
||||
from . import schema
|
||||
from .actions import update_user_follower_total
|
||||
|
||||
user_router = APIRouter(prefix='/user', tags=['用户模块'])
|
||||
|
||||
@@ -158,10 +159,15 @@ async def follow_user(
|
||||
}
|
||||
if action == 'follower':
|
||||
await db_crud.create(data=record, filters=record)
|
||||
|
||||
if action == 'unfollower':
|
||||
elif action == 'unfollower':
|
||||
await db_crud.delete(filters=record)
|
||||
|
||||
await update_user_follower_total(
|
||||
follower_id=login_user.user_id,
|
||||
followed_id=follower_user.user_id,
|
||||
db_session=db_session
|
||||
)
|
||||
|
||||
return {'message': 'ok'}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user