Configure routes using annotation

This commit is contained in:
2023-08-02 16:26:25 +02:00
parent 4b20db7a9c
commit 009a0326d9
55 changed files with 215 additions and 772 deletions

View File

@@ -57,6 +57,7 @@ class AccompanyingPeriodController extends AbstractController
/**
* @throws \Exception
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/accompanying-period/close", name="chill_person_accompanying_period_close")
*/
public function closeAction(int $person_id, Request $request): Response
{
@@ -134,6 +135,9 @@ class AccompanyingPeriodController extends AbstractController
]);
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/accompanying-period/create", name="chill_person_accompanying_period_create")
*/
public function createAction(int $person_id, Request $request): Response
{
$person = $this->_getPerson($person_id);
@@ -199,6 +203,7 @@ class AccompanyingPeriodController extends AbstractController
/**
* @ParamConverter("person", options={"id": "person_id"})
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/accompanying-period", name="chill_person_accompanying_period_list")
*/
public function listAction(Person $person): Response
{
@@ -224,6 +229,9 @@ class AccompanyingPeriodController extends AbstractController
]);
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/accompanying-period/open", name="chill_person_accompanying_period_open")
*/
public function openAction(int $person_id, Request $request): Response
{
$person = $this->_getPerson($person_id);
@@ -306,6 +314,9 @@ class AccompanyingPeriodController extends AbstractController
]);
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/accompanying-period/{period_id}/re-open", name="chill_person_accompanying_period_re_open")
*/
public function reOpenAction(int $person_id, int $period_id, Request $request): Response
{
/** @var Person $person */
@@ -353,6 +364,7 @@ class AccompanyingPeriodController extends AbstractController
/**
* @throws Exception
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/accompanying-period/{period_id}/update", name="chill_person_accompanying_period_update")
*/
public function updateAction(int $person_id, int $period_id, Request $request): Response
{

View File

@@ -53,6 +53,7 @@ class AdminController extends AbstractController
/**
* @return \Symfony\Component\HttpFoundation\RedirectResponse
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/person_redirect_to_main", name="chill_person_admin_redirect_to_admin_index", options={null})
*/
public function redirectToAdminIndexAction()
{

View File

@@ -40,6 +40,9 @@ class PersonAddressController extends AbstractController
$this->validator = $validator;
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/address/create", name="chill_person_address_create", methods={"POST"})
*/
public function createAction($person_id, Request $request)
{
$person = $this->getDoctrine()->getManager()
@@ -95,6 +98,9 @@ class PersonAddressController extends AbstractController
]);
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/address/{address_id}/edit", name="chill_person_address_edit")
*/
public function editAction($person_id, $address_id)
{
$person = $this->getDoctrine()->getManager()
@@ -123,6 +129,9 @@ class PersonAddressController extends AbstractController
]);
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/address/list", name="chill_person_address_list")
*/
public function listAction($person_id)
{
$person = $this->getDoctrine()->getManager()
@@ -145,6 +154,9 @@ class PersonAddressController extends AbstractController
]);
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/address/new", name="chill_person_address_new")
*/
public function newAction($person_id)
{
$person = $this->getDoctrine()->getManager()
@@ -172,6 +184,9 @@ class PersonAddressController extends AbstractController
]);
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/address/{address_id}/update", name="chill_person_address_update")
*/
public function updateAction($person_id, $address_id, Request $request)
{
$person = $this->getDoctrine()->getManager()

View File

@@ -59,6 +59,9 @@ final class PersonController extends AbstractController
) {
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/general/edit", name="chill_person_general_edit")
*/
public function editAction($person_id, Request $request)
{
$person = $this->_getPerson($person_id);
@@ -157,6 +160,7 @@ final class PersonController extends AbstractController
*
* The next post compare the data with previous one and, if yes, show a
* review page if there are "alternate persons".
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/new", name="chill_person_new")
*/
public function newAction(Request $request): Response
{
@@ -252,6 +256,9 @@ final class PersonController extends AbstractController
);
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/general", name="chill_person_view")
*/
public function viewAction(int $person_id)
{
$person = $this->_getPerson($person_id);

View File

@@ -38,6 +38,9 @@ class PersonDuplicateController extends \Symfony\Bundle\FrameworkBundle\Controll
{
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person1_id}/duplicate/{person2_id}/confirm", name="chill_person_duplicate_confirm")
*/
public function confirmAction($person1_id, $person2_id, Request $request)
{
if ($person1_id === $person2_id) {
@@ -99,6 +102,9 @@ class PersonDuplicateController extends \Symfony\Bundle\FrameworkBundle\Controll
]);
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/find-manually", name="chill_person_find_manually_duplicate")
*/
public function findManuallyDuplicateAction($person_id, Request $request)
{
$person = $this->_getPerson($person_id);
@@ -149,6 +155,9 @@ class PersonDuplicateController extends \Symfony\Bundle\FrameworkBundle\Controll
]);
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person1_id}/duplicate/{person2_id}/not-duplicate", name="chill_person_duplicate_not_duplicate")
*/
public function notDuplicateAction($person1_id, $person2_id)
{
[$person1, $person2] = $this->_getPersonsByPriority($person1_id, $person2_id);
@@ -175,6 +184,9 @@ class PersonDuplicateController extends \Symfony\Bundle\FrameworkBundle\Controll
return $this->redirectToRoute('chill_person_duplicate_view', ['person_id' => $person1->getId()]);
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person1_id}/duplicate/{person2_id}/remove-not-duplicate", name="chill_person_remove_duplicate_not_duplicate")
*/
public function removeNotDuplicateAction($person1_id, $person2_id)
{
[$person1, $person2] = $this->_getPersonsByPriority($person1_id, $person2_id);
@@ -196,6 +208,9 @@ class PersonDuplicateController extends \Symfony\Bundle\FrameworkBundle\Controll
return $this->redirectToRoute('chill_person_duplicate_view', ['person_id' => $person1->getId()]);
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/duplicate/view", name="chill_person_duplicate_view")
*/
public function viewAction($person_id, PersonNotDuplicateRepository $personNotDuplicateRepository)
{
$person = $this->_getPerson($person_id);

View File

@@ -29,6 +29,9 @@ final class PersonResourceController extends AbstractController
{
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/resources/{resource_id}/delete", name="chill_person_resource_delete")
*/
public function deleteAction(Request $request, $person_id, $resource_id): Response
{
$personOwner = $this->personRepository->find($person_id);
@@ -75,6 +78,9 @@ final class PersonResourceController extends AbstractController
);
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/resources/{resource_id}/edit", name="chill_person_resource_edit")
*/
public function editAction(Request $request, $resource_id, $person_id): Response
{
$resource = $this->personResourceRepository->find($resource_id);
@@ -109,6 +115,9 @@ final class PersonResourceController extends AbstractController
);
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/resources/list", name="chill_person_resource_list")
*/
public function listAction(Request $request, $person_id)
{
$personOwner = $this->personRepository->find($person_id);
@@ -126,6 +135,9 @@ final class PersonResourceController extends AbstractController
);
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/resources/new", name="chill_person_resource_new")
*/
public function newAction(Request $request, $person_id)
{
$personOwner = $this->personRepository->find($person_id);

View File

@@ -26,6 +26,9 @@ class TimelinePersonController extends AbstractController
{
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/timeline", name="chill_person_timeline")
*/
public function personAction(Request $request, $person_id)
{
$person = $this->getDoctrine()