Newer
Older
<?php
namespace App\Controller;
use App\Service\Action\ActionServiceInterface;
use App\Service\Dto\Classes\RecoveryCodeDto;
use App\Service\Dto\Classes\RecoveryDto;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
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"])
)
)]
#[Autowire(service: 'action.profile')]
ActionServiceInterface $actionService
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#[Route('/profile/favorites', name: 'favorites', methods: ['GET'])]
#[OA\Response(
response: 200,
description: 'Ответ',
content: new OA\JsonContent(
ref: new Model(type: FavoritesResponse::class, groups: ["message", "data", "card"])
)
)]
public function favorites(
#[Autowire(service: 'action.favorites')]
ActionServiceInterface $actionService
): JsonResponse
{
return $actionService->getResponse();
}
#[Route('/profile/reviews', name: 'reviews', methods: ['GET'])]
#[OA\Response(
response: 200,
description: 'Ответ',
content: new OA\JsonContent(
ref: new Model(type: ReviewsResponse::class, groups: ["message", "data", "card"])
)
)]
public function reviews(
#[Autowire(service: 'action.reviews')]
ActionServiceInterface $actionService
): JsonResponse
{
return $actionService->getResponse();
}
#[Route('/profile/quests', name: 'profile_quests', methods: ['GET'])]
#[OA\Response(
response: 200,
description: 'Ответ',
content: new OA\JsonContent(
ref: new Model(type: QuestsResponse::class, groups: ["message", "data", "card"])
)
)]
public function quests(
#[Autowire(service: 'action.profile.quests')]
ActionServiceInterface $actionService
): JsonResponse
{
return $actionService->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"])
)
)]
#[Autowire(service: 'action.profile.delete')]
ActionServiceInterface $actionService,
}
#[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"])
)
)]
#[Autowire(service: 'action.recovery.send')]
ActionServiceInterface $actionService,
}
#[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"])
)
)]
#[Autowire(service: 'action.recovery.code')]
ActionServiceInterface $actionService,
#[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(
#[Autowire(service: 'action.profile.change')]
ActionServiceInterface $actionService,
#[Route('/profile/email/reset', name: 'profile_email_reset', methods: ['GET'])]
#[OA\Response(
response: 200,
description: 'Ответ',
content: new OA\JsonContent(
ref: new Model(type: Response::class, groups: ["message"])
)
)]
public function resetLastConfirmEmail(
#[Autowire(service: 'action.reset.email')]
ActionServiceInterface $actionService,
#[Route('/profile/image', name: 'profile_image', methods: ['POST'])]
#[OA\RequestBody(
content: new OA\JsonContent(ref: new Model(type: ImageDto::class))
)]
#[OA\Response(
response: 200,
description: 'Ответ',
content: new OA\JsonContent(
ref: new Model(type: Response::class, groups: ["message"])
)
)]
public function saveImage(
#[Autowire(service: 'action.profile.image.save')]
ActionServiceInterface $actionService,
}
#[Route('/profile/image/delete', name: 'profile_image_delete', methods: ['GET'])]
#[OA\Response(
response: 200,
description: 'Ответ',
content: new OA\JsonContent(
ref: new Model(type: Response::class, groups: ["message"])
)
)]
public function deleteImage(
#[Autowire(service: 'action.profile.image.delete')]
ActionServiceInterface $actionService,