Newer
Older
<?php
namespace App\Controller;
use App\Service\Action\ActionServiceInterface;
use App\Service\Dto\Classes\RecoveryCodeDto;
use App\Service\Dto\Classes\RecoveryDto;
use App\Service\Response\Classes\ProfileResponse;
use App\Service\Response\Classes\Response;
use Nelmio\ApiDocBundle\Annotation\Model;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Attribute\Route;
class ProfileController extends AbstractController
{
#[Route('/profile', name: 'profile', methods: ['GET'])]
#[OA\Response(
response: 200,
description: 'Ответ',
content: new OA\JsonContent(
ref: new Model(type: ProfileResponse::class, groups: ["message", "data", "profile"])
)
)]
public function profile(
ActionServiceInterface $profileService
): JsonResponse
{
return $profileService->getResponse();
}
#[Route('/profile/delete', name: 'profile_delete', methods: ['GET'])]
#[OA\Response(
response: 200,
description: 'Ответ',
content: new OA\JsonContent(
ref: new Model(type: Response::class, groups: ["message"])
)
)]
public function deleteProfile(
ActionServiceInterface $deleteProfileService,
): JsonResponse
{
return $deleteProfileService->getResponse();
}
#[Route('/profile/recovery', name: 'profile_recovery', methods: ['POST'])]
#[OA\RequestBody(
content: new OA\JsonContent(ref: new Model(type: RecoveryDto::class))
)]
#[OA\Response(
response: 200,
description: 'Ответ',
content: new OA\JsonContent(
ref: new Model(type: Response::class, groups: ["message"])
)
)]
public function recoveryProfile(
ActionServiceInterface $recoveryProfileService,
): JsonResponse
{
return $recoveryProfileService->getResponse();
}
#[Route('/profile/recovery/check', name: 'profile_recovery_check', methods: ['POST'])]
#[OA\RequestBody(
content: new OA\JsonContent(ref: new Model(type: RecoveryCodeDto::class))
)]
#[OA\Response(
response: 200,
description: 'Ответ',
content: new OA\JsonContent(
ref: new Model(type: Response::class, groups: ["message"])
)
)]
public function recoveryCodeProfile(
ActionServiceInterface $checkRecoveryService,
): JsonResponse
{
return $checkRecoveryService->getResponse();
}
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#[Route('/profile/change', name: 'profile_change', methods: ['POST'])]
#[OA\RequestBody(
content: new OA\JsonContent(ref: new Model(type: ChangeProfileDto::class))
)]
#[OA\Response(
response: 200,
description: 'Ответ',
content: new OA\JsonContent(
ref: new Model(type: ProfileResponse::class, groups: ["message", "data", "profile"])
)
)]
public function changeProfile(
ActionServiceInterface $profileChangeService,
): JsonResponse
{
return $profileChangeService->getResponse();
}
#[Route('/profile/reset/email', name: 'profile_reset_email', methods: ['GET'])]
#[OA\Response(
response: 200,
description: 'Ответ',
content: new OA\JsonContent(
ref: new Model(type: Response::class, groups: ["message"])
)
)]
public function resetLastConfirmEmail(
ActionServiceInterface $resetEmailService,
): JsonResponse
{
return $resetEmailService->getResponse();
}