// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ // ┃ Copyright: (c) 2023, Mike 'PhiSyX' S. (https://github.com/PhiSyX) ┃ // ┃ SPDX-License-Identifier: MPL-2.0 ┃ // ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃ // ┃ ┃ // ┃ This Source Code Form is subject to the terms of the Mozilla Public ┃ // ┃ License, v. 2.0. If a copy of the MPL was not distributed with this ┃ // ┃ file, You can obtain one at https://mozilla.org/MPL/2.0/. ┃ // ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ use lexa_framework::routing; use crate::auth_site::applications::ApplicationState; use crate::auth_site::controllers::UnprotectedController; // --------- // // Structure // // --------- // pub struct UnprotectedRouter; // ----------- // // Énumération // // ----------- // lexa_framework::routes! { pub enum UnprotectedRouteId<'r> { #[route(url = "/unprotected1")] Unprotected1, #[route(url = "/unprotected2")] Unprotected2, } } // -------------- // // Implémentation // -> Interface // -------------- // impl lexa_framework::ApplicationRouter for UnprotectedRouter { type State = ApplicationState; fn routes() -> routing::RouteCollection { Self::router_collection() .add( routing::Router::path(UnprotectedRouteId::Unprotected1) .get(UnprotectedController::unprotected1), ) .add( routing::Router::path(UnprotectedRouteId::Unprotected2) .get(UnprotectedController::unprotected2), ) } }