This commit is contained in:
@ -14,6 +14,8 @@ from clients.vitacore import schema as vs
|
|||||||
from shared import exceptions as e
|
from shared import exceptions as e
|
||||||
from shared.redis import client as cache
|
from shared.redis import client as cache
|
||||||
|
|
||||||
|
from . import schema as s
|
||||||
|
|
||||||
logger = getLogger(__name__)
|
logger = getLogger(__name__)
|
||||||
router = APIRouter(
|
router = APIRouter(
|
||||||
prefix='/user',
|
prefix='/user',
|
||||||
@ -375,3 +377,31 @@ async def measurements(
|
|||||||
for key in await cache.keys(f'tdn:measurement:{user.id}:*')
|
for key in await cache.keys(f'tdn:measurement:{user.id}:*')
|
||||||
]
|
]
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
@router.delete('/account', status_code=status.HTTP_204_NO_CONTENT)
|
||||||
|
async def delete_account(user: Annotated[User, Depends(login)]):
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
@router.get('/notifications')
|
||||||
|
async def notifications(user: Annotated[User, Depends(login)]):
|
||||||
|
return s.Notifications(
|
||||||
|
notifications=[
|
||||||
|
{
|
||||||
|
'id': 1,
|
||||||
|
'title': 'Заголовок уведомления 1',
|
||||||
|
'description': 'Описание уведомления',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'id': 2,
|
||||||
|
'title': 'Заголовок уведомления 2',
|
||||||
|
'description': 'Описание уведомления',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'id': 3,
|
||||||
|
'title': 'Заголовок уведомления 3',
|
||||||
|
'description': 'Описание уведомления',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|||||||
11
src/apps/users/v1/schema.py
Normal file
11
src/apps/users/v1/schema.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
from typing import TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class Notification(TypedDict):
|
||||||
|
id: int
|
||||||
|
title: str
|
||||||
|
description: str
|
||||||
|
|
||||||
|
|
||||||
|
class Notifications(TypedDict):
|
||||||
|
notifications: list[Notification]
|
||||||
Reference in New Issue
Block a user