diff --git a/config/kbin_routes/ajax.yaml b/config/kbin_routes/ajax.yaml index 1e29cc2d0..642087898 100644 --- a/config/kbin_routes/ajax.yaml +++ b/config/kbin_routes/ajax.yaml @@ -21,30 +21,40 @@ ajax_fetch_post_comments: defaults: { _format: json } path: /ajax/fetch_post_comments/{id} methods: [GET] + requirements: + id: \d+ ajax_fetch_entry: controller: App\Controller\AjaxController::fetchEntry defaults: { _format: json } path: /ajax/fetch_entry/{id} methods: [GET] + requirements: + id: \d+ ajax_fetch_entry_comment: controller: App\Controller\AjaxController::fetchEntryComment defaults: { _format: json } path: /ajax/fetch_entry_comment/{id} methods: [GET] + requirements: + id: \d+ ajax_fetch_post: controller: App\Controller\AjaxController::fetchPost defaults: { _format: json } path: /ajax/fetch_post/{id} methods: [GET] + requirements: + id: \d+ ajax_fetch_post_comment: controller: App\Controller\AjaxController::fetchPostComment defaults: { _format: json } path: /ajax/fetch_post_comment/{id} methods: [GET] + requirements: + id: \d+ ajax_fetch_online: controller: App\Controller\AjaxController::fetchOnline diff --git a/config/kbin_routes/entry.yaml b/config/kbin_routes/entry.yaml index c99f2eda3..ff7f63d03 100644 --- a/config/kbin_routes/entry.yaml +++ b/config/kbin_routes/entry.yaml @@ -3,73 +3,109 @@ entry_comment_create: defaults: { slug: -, parent_comment_id: null } path: /m/{magazine_name}/t/{entry_id}/{slug}/comment/create/{parent_comment_id} methods: [ GET, POST ] + requirements: + entry_id: \d+ + parent_comment_id: \d+ entry_comment_view: - controller: App\Controller\Entry\Comment\EntryCommentViewController - defaults: { slug: -, comment_id: null } - path: /m/{magazine_name}/t/{entry_id}/{slug}/comment/{comment_id} - methods: [ GET ] + controller: App\Controller\Entry\Comment\EntryCommentViewController + defaults: { slug: -, comment_id: null } + path: /m/{magazine_name}/t/{entry_id}/{slug}/comment/{comment_id} + methods: [ GET ] + requirements: + entry_id: \d+ + comment_id: \d+ entry_comment_edit: controller: App\Controller\Entry\Comment\EntryCommentEditController defaults: { slug: -, } path: /m/{magazine_name}/t/{entry_id}/{slug}/comment/{comment_id}/edit methods: [ GET, POST ] + requirements: + entry_id: \d+ + comment_id: \d+ entry_comment_delete: controller: App\Controller\Entry\Comment\EntryCommentDeleteController::delete defaults: { slug: -, } path: /m/{magazine_name}/t/{entry_id}/{slug}/comments/{comment_id}/delete methods: [ POST ] + requirements: + entry_id: \d+ + comment_id: \d+ entry_comment_restore: controller: App\Controller\Entry\Comment\EntryCommentDeleteController::restore defaults: { slug: -, } path: /m/{magazine_name}/t/{entry_id}/{slug}/comments/{comment_id}/restore methods: [ POST ] + requirements: + entry_id: \d+ + comment_id: \d+ entry_comment_purge: controller: App\Controller\Entry\Comment\EntryCommentDeleteController::purge defaults: { slug: -, } path: /m/{magazine_name}/t/{entry_id}/{slug}/comments/{comment_id}/purge methods: [ POST ] + requirements: + entry_id: \d+ + comment_id: \d+ entry_comment_change_lang: controller: App\Controller\Entry\Comment\EntryCommentChangeLangController defaults: { slug: - } path: /m/{magazine_name}/t/{entry_id}/{slug}/comments/{comment_id}/change_lang methods: [ POST ] + requirements: + entry_id: \d+ + comment_id: \d+ entry_comment_change_adult: controller: App\Controller\Entry\Comment\EntryCommentChangeAdultController defaults: { slug: - } path: /m/{magazine_name}/t/{entry_id}/{slug}/comments/{comment_id}/change_adult methods: [ POST ] + requirements: + entry_id: \d+ + comment_id: \d+ entry_comment_image_delete: controller: App\Controller\Entry\Comment\EntryCommentDeleteImageController defaults: { slug: -, } path: /m/{magazine_name}/t/{entry_id}/{slug}/comments/{comment_id}/delete_image methods: [ POST ] + requirements: + entry_id: \d+ + comment_id: \d+ entry_comment_voters: controller: App\Controller\Entry\Comment\EntryCommentVotersController defaults: { slug: -, } - requirements: { type: 'up' } path: /m/{magazine_name}/t/{entry_id}/{slug}/comment/{comment_id}/votes/{type} methods: [ GET ] + requirements: + type: 'up' + entry_id: \d+ + comment_id: \d+ entry_comment_favourites: controller: App\Controller\Entry\Comment\EntryCommentFavouriteController defaults: { slug: -, } path: /m/{magazine_name}/t/{entry_id}/{slug}/comment/{comment_id}/favourites methods: [ GET ] + requirements: + entry_id: \d+ + comment_id: \d+ entry_comment_moderate: controller: App\Controller\Entry\Comment\EntryCommentModerateController defaults: { slug: -, } path: /m/{magazine_name}/t/{entry_id}/{slug}/comment/{comment_id}/moderate methods: [ GET ] + requirements: + entry_id: \d+ + comment_id: \d+ entry_comments_front: controller: App\Controller\Entry\Comment\EntryCommentFrontController::front @@ -121,24 +157,32 @@ entry_comment_vote: defaults: { entityClass: App\Entity\EntryComment } path: /ecv/{id}/{choice} methods: [ POST ] + requirements: + id: \d+ entry_comment_report: controller: App\Controller\ReportController defaults: { entityClass: App\Entity\EntryComment } path: /ecr/{id} methods: [ GET, POST ] + requirements: + id: \d+ entry_comment_favourite: controller: App\Controller\FavouriteController defaults: { entityClass: App\Entity\EntryComment } path: /ecf/{id} methods: [ POST ] + requirements: + id: \d+ entry_comment_boost: controller: App\Controller\BoostController defaults: { entityClass: App\Entity\EntryComment } path: /ecb/{id} methods: [ POST ] + requirements: + id: \d+ entry_create: controller: App\Controller\Entry\EntryCreateController @@ -157,79 +201,105 @@ entry_edit: defaults: { slug: -, sortBy: hot } path: /m/{magazine_name}/t/{entry_id}/{slug}/edit methods: [ GET, POST ] + requirements: + entry_id: \d+ entry_moderate: controller: App\Controller\Entry\EntryModerateController defaults: { slug: -, sortBy: hot } path: /m/{magazine_name}/t/{entry_id}/{slug}/moderate methods: [ GET ] + requirements: + entry_id: \d+ entry_delete: controller: App\Controller\Entry\EntryDeleteController::delete defaults: { slug: -, sortBy: hot } path: /m/{magazine_name}/t/{entry_id}/{slug}/delete methods: [ POST ] + requirements: + entry_id: \d+ entry_restore: controller: App\Controller\Entry\EntryDeleteController::restore defaults: { slug: -, sortBy: hot } path: /m/{magazine_name}/t/{entry_id}/{slug}/restore methods: [ POST ] + requirements: + entry_id: \d+ entry_purge: controller: App\Controller\Entry\EntryDeleteController::purge defaults: { slug: -, sortBy: hot } path: /m/{magazine_name}/t/{entry_id}/{slug}/purge methods: [ POST ] + requirements: + entry_id: \d+ entry_image_delete: controller: App\Controller\Entry\EntryDeleteImageController defaults: { slug: -, } path: /m/{magazine_name}/e/{entry_id}/{slug}/delete_image methods: [ POST ] + requirements: + entry_id: \d+ entry_change_magazine: controller: App\Controller\Entry\EntryChangeMagazineController defaults: { slug: - } path: /m/{magazine_name}/e/{entry_id}/{slug}/change_magazine methods: [ POST ] + requirements: + entry_id: \d+ entry_change_lang: controller: App\Controller\Entry\EntryChangeLangController defaults: { slug: - } path: /m/{magazine_name}/e/{entry_id}/{slug}/change_lang methods: [ POST ] + requirements: + entry_id: \d+ entry_change_adult: controller: App\Controller\Entry\EntryChangeAdultController defaults: { slug: - } path: /m/{magazine_name}/e/{entry_id}/{slug}/change_adult methods: [ POST ] + requirements: + entry_id: \d+ entry_pin: controller: App\Controller\Entry\EntryPinController defaults: { slug: -, sortBy: hot } path: /m/{magazine_name}/t/{entry_id}/{slug}/pin methods: [ POST ] + requirements: + entry_id: \d+ entry_voters: controller: App\Controller\Entry\EntryVotersController defaults: { slug: -, sortBy: hot } - requirements: { type: 'up' } path: /m/{magazine_name}/t/{entry_id}/{slug}/votes/{type} methods: [ GET ] + requirements: + type: 'up' + entry_id: \d+ entry_fav: controller: App\Controller\Entry\EntryFavouriteController defaults: { slug: -, sortBy: hot } path: /m/{magazine_name}/t/{entry_id}/{slug}/favourites methods: [ GET ] + requirements: + entry_id: \d+ entry_tips: controller: App\Controller\Entry\EntryTipController defaults: { slug: -, sortBy: hot } path: /m/{magazine_name}/t/{entry_id}/{slug}/tips methods: [ GET ] + requirements: + entry_id: \d+ entry_single: controller: App\Controller\Entry\EntrySingleController @@ -238,6 +308,7 @@ entry_single: methods: [ GET ] requirements: sortBy: "%comment_sort_options%" + entry_id: \d+ entry_single_comments: controller: App\Controller\Entry\EntrySingleController @@ -246,27 +317,36 @@ entry_single_comments: methods: [ GET ] requirements: sortBy: "%comment_sort_options%" + entry_id: \d+ entry_vote: controller: App\Controller\VoteController defaults: { entityClass: App\Entity\Entry } path: /ev/{id}/{choice} methods: [ POST ] + requirements: + id: \d+ entry_report: controller: App\Controller\ReportController defaults: { entityClass: App\Entity\Entry } path: /er/{id} methods: [ GET, POST ] + requirements: + id: \d+ entry_favourite: controller: App\Controller\FavouriteController defaults: { entityClass: App\Entity\Entry } path: /ef/{id} methods: [ POST ] + requirements: + id: \d+ entry_boost: controller: App\Controller\BoostController defaults: { entityClass: App\Entity\Entry } path: /eb/{id} methods: [ POST ] + requirements: + id: \d+ diff --git a/config/kbin_routes/message.yaml b/config/kbin_routes/message.yaml index 447b4adf5..cc6bb1e36 100644 --- a/config/kbin_routes/message.yaml +++ b/config/kbin_routes/message.yaml @@ -7,6 +7,8 @@ messages_single: controller: App\Controller\Message\MessageThreadController path: /profile/messages/{id} methods: [ GET, POST ] + requirements: + id: \d+ messages_create: controller: App\Controller\Message\MessageCreateThreadController diff --git a/config/kbin_routes/post.yaml b/config/kbin_routes/post.yaml index e371ce2cc..64dc08392 100644 --- a/config/kbin_routes/post.yaml +++ b/config/kbin_routes/post.yaml @@ -3,108 +3,155 @@ post_comment_create: defaults: { slug: -, parent_comment_id: null } path: /m/{magazine_name}/p/{post_id}/{slug}/reply/{parent_comment_id} methods: [ GET, POST ] + requirements: + post_id: \d+ + parent_comment_id: \d+ post_comment_edit: controller: App\Controller\Post\Comment\PostCommentEditController defaults: { slug: -, } path: /m/{magazine_name}/p/{post_id}/{slug}/reply/{comment_id}/edit methods: [ GET, POST ] + requirements: + post_id: \d+ + comment_id: \d+ post_comment_moderate: controller: App\Controller\Post\Comment\PostCommentModerateController defaults: { slug: -, } path: /m/{magazine_name}/p/{post_id}/{slug}/reply/{comment_id}/moderate methods: [ GET, POST ] + requirements: + post_id: \d+ + comment_id: \d+ post_comment_delete: controller: App\Controller\Post\Comment\PostCommentDeleteController::delete defaults: { slug: -, } path: /m/{magazine_name}/p/{post_id}/{slug}/reply/{comment_id}/delete methods: [ POST ] + requirements: + post_id: \d+ + comment_id: \d+ post_comment_restore: controller: App\Controller\Post\Comment\PostCommentDeleteController::restore defaults: { slug: -, } path: /m/{magazine_name}/p/{post_id}/{slug}/reply/{comment_id}/restore methods: [ POST ] + requirements: + post_id: \d+ + comment_id: \d+ post_comment_purge: controller: App\Controller\Post\Comment\PostCommentDeleteController::purge defaults: { slug: -, } path: /m/{magazine_name}/p/{post_id}/{slug}/reply/{comment_id}/purge methods: [ POST ] + requirements: + post_id: \d+ + comment_id: \d+ post_comment_change_lang: controller: App\Controller\Post\Comment\PostCommentChangeLangController defaults: { slug: - } path: /m/{magazine_name}/p/{post_id}/{slug}/comments/{comment_id}/change_lang methods: [ POST ] + requirements: + post_id: \d+ + comment_id: \d+ post_comment_change_adult: controller: App\Controller\Post\Comment\PostCommentChangeAdultController defaults: { slug: - } path: /m/{magazine_name}/p/{post_id}/{slug}/comments/{comment_id}/change_adult methods: [ POST ] + requirements: + post_id: \d+ + comment_id: \d+ post_comment_image_delete: controller: App\Controller\Post\Comment\PostCommentDeleteImageController defaults: { slug: -, } path: /m/{magazine_name}/p/{post_id}/{slug}/reply/{comment_id}/delete_image methods: [ POST ] + requirements: + post_id: \d+ + comment_id: \d+ post_comment_voters: controller: App\Controller\Post\Comment\PostCommentVotersController defaults: { slug: -, } path: /m/{magazine_name}/p/{post_id}/{slug}/reply/{comment_id}/votes methods: [ GET ] + requirements: + post_id: \d+ + comment_id: \d+ post_comment_favourites: controller: App\Controller\Post\Comment\PostCommentFavouriteController defaults: { slug: -, } path: /m/{magazine_name}/p/{post_id}/{slug}/reply/{comment_id}/favourites methods: [ GET ] + requirements: + post_id: \d+ + comment_id: \d+ post_comment_vote: controller: App\Controller\VoteController defaults: { entityClass: App\Entity\PostComment } path: /pcv/{id}/{choice} methods: [ POST ] + requirements: + id: \d+ post_comment_report: controller: App\Controller\ReportController defaults: { entityClass: App\Entity\PostComment } path: /pcr/{id} methods: [ GET, POST ] + requirements: + id: \d+ post_comment_favourite: controller: App\Controller\FavouriteController defaults: { entityClass: App\Entity\PostComment } path: /pcf/{id} methods: [ POST ] + requirements: + id: \d+ post_comment_boost: controller: App\Controller\BoostController defaults: { entityClass: App\Entity\PostComment } path: /pcb/{id} methods: [ POST ] + requirements: + id: \d+ post_pin: controller: App\Controller\Post\PostPinController defaults: { slug: - } path: /m/{magazine_name}/p/{post_id}/{slug}/pin methods: [ POST ] + requirements: + post_id: \d+ post_voters: controller: App\Controller\Post\PostVotersController defaults: { slug: -, } path: /m/{magazine_name}/p/{post_id}/{slug}/votes methods: [ GET ] + requirements: + post_id: \d+ post_favourites: controller: App\Controller\Post\PostFavouriteController defaults: { slug: -, } path: /m/{magazine_name}/p/{post_id}/{slug}/favourites methods: [ GET ] + requirements: + post_id: \d+ post_create: controller: App\Controller\Post\PostCreateController @@ -116,54 +163,72 @@ post_edit: defaults: { slug: -, } path: /m/{magazine_name}/p/{post_id}/{slug}/edit methods: [ GET, POST ] + requirements: + post_id: \d+ post_moderate: controller: App\Controller\Post\PostModerateController defaults: { slug: -, } path: /m/{magazine_name}/p/{post_id}/{slug}/moderate methods: [ GET, POST ] + requirements: + post_id: \d+ post_delete: controller: App\Controller\Post\PostDeleteController::delete defaults: { slug: -, } path: /m/{magazine_name}/p/{post_id}/{slug}/delete methods: [ POST ] + requirements: + post_id: \d+ post_restore: controller: App\Controller\Post\PostDeleteController::restore defaults: { slug: -, } path: /m/{magazine_name}/p/{post_id}/{slug}/restore methods: [ POST ] + requirements: + post_id: \d+ post_purge: controller: App\Controller\Post\PostDeleteController::purge defaults: { slug: -, } path: /m/{magazine_name}/p/{post_id}/{slug}/purge methods: [ POST ] + requirements: + post_id: \d+ post_image_delete: controller: App\Controller\Post\PostDeleteImageController defaults: { slug: -, } path: /m/{magazine_name}/p/{post_id}/{slug}/delete_image methods: [ POST ] + requirements: + post_id: \d+ post_change_magazine: controller: App\Controller\Post\PostChangeMagazineController defaults: { slug: - } path: /m/{magazine_name}/p/{post_id}/{slug}/change_magazine methods: [ POST ] + requirements: + post_id: \d+ post_change_lang: controller: App\Controller\Post\PostChangeLangController defaults: { slug: - } path: /m/{magazine_name}/p/{post_id}/{slug}/change_lang methods: [ POST ] + requirements: + post_id: \d+ post_change_adult: controller: App\Controller\Post\PostChangeAdultController defaults: { slug: - } path: /m/{magazine_name}/p/{post_id}/{slug}/change_adult methods: [ POST ] + requirements: + post_id: \d+ post_single: controller: App\Controller\Post\PostSingleController @@ -172,27 +237,36 @@ post_single: methods: [ GET ] requirements: sortBy: "%comment_sort_options%" + post_id: \d+ post_vote: controller: App\Controller\VoteController defaults: { entityClass: App\Entity\Post } path: /pv/{id}/{choice} methods: [ POST ] + requirements: + id: \d+ post_report: controller: App\Controller\ReportController defaults: { entityClass: App\Entity\Post } path: /pr/{id} methods: [ GET, POST ] + requirements: + id: \d+ post_favourite: controller: App\Controller\FavouriteController defaults: { entityClass: App\Entity\Post } path: /pf/{id} methods: [ POST ] + requirements: + id: \d+ post_boost: controller: App\Controller\BoostController defaults: { entityClass: App\Entity\Post } path: /pb/{id} methods: [ POST ] + requirements: + id: \d+