18 lines
No EOL
613 B
Python
18 lines
No EOL
613 B
Python
import ast
|
|
from packages.v1.administrativo.schemas.user_schema import UserIdSchema
|
|
from packages.v1.administrativo.actions.user.user_get_by_user_id_action import GetByuserIdAction
|
|
|
|
class MeService:
|
|
|
|
def execute(self, current_user):
|
|
|
|
get_by_user_id_action = GetByuserIdAction()
|
|
|
|
# Converte a string para dict de forma segura
|
|
usuario_data = ast.literal_eval(current_user["data"])
|
|
|
|
# Define os dados do schema
|
|
user_schema = UserIdSchema(user_id=int(usuario_data["user_id"]))
|
|
|
|
# Executa a ação em questão
|
|
return get_by_user_id_action.execute(user_schema) |