feat(account): GET /me user endpoint only, disable cache and extra routers
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
17
src/application/commands/get_me.py
Normal file
17
src/application/commands/get_me.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from src.application.abstractions import IUnitOfWork
|
||||
from src.application.contracts import ILogger, ICache
|
||||
from src.application.domain.entities import UserEntity
|
||||
from src.infrastructure.database.decorators import transactional
|
||||
|
||||
|
||||
class GetMeCommand:
|
||||
def __init__(self, unit_of_work: IUnitOfWork, logger: ILogger, cache: ICache):
|
||||
self._unit_of_work = unit_of_work
|
||||
self._logger = logger
|
||||
self._cache = cache
|
||||
|
||||
@transactional
|
||||
async def __call__(self, user_id: str) -> UserEntity:
|
||||
user = await self._unit_of_work.user_repository.get_user_by_id(user_id=user_id)
|
||||
self._logger.info(f'User ID: {user.id}')
|
||||
return user
|
||||
Reference in New Issue
Block a user