Skip to content
Snippets Groups Projects
ProfileController.php 1.3 KiB
Newer Older
i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
<?php

namespace App\Controller;

use App\Service\Action\ActionServiceInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Attribute\Route;

#[Route('/api', name: 'api_')]
class ProfileController extends AbstractController
{
    #[Route('/profile', name: 'profile', methods: ['GET'])]
    public function profile(
        ActionServiceInterface $profileService
    ): JsonResponse
    {
        return $profileService->getResponse();
    }

    #[Route('/profile/delete', name: 'profile_delete', methods: ['GET'])]
    public function deleteProfile(
        ActionServiceInterface $deleteProfileService,
    ): JsonResponse
    {
        return $deleteProfileService->getResponse();
    }

    #[Route('/profile/recovery', name: 'profile_recovery', methods: ['POST'])]
    public function recoveryProfile(
        ActionServiceInterface $recoveryProfileService,
    ): JsonResponse
    {
        return $recoveryProfileService->getResponse();
    }

    #[Route('/profile/recovery/check', name: 'profile_recovery_check', methods: ['POST'])]
    public function recoveryCodeProfile(
        ActionServiceInterface $checkRecoveryService,
    ): JsonResponse
    {
        return $checkRecoveryService->getResponse();
    }
}