sylvia_iot_data/routes/v1/network_dldata/
mod.rs1use axum::{Router, routing};
2
3use super::super::{State, middleware::AuthService};
4
5mod api;
6mod request;
7mod response;
8
9pub fn new_service(scope_path: &str, state: &State) -> Router {
10 let auth_uri = format!("{}/api/v1/auth/tokeninfo", state.auth_base.as_str());
11 Router::new().nest(
12 scope_path,
13 Router::new()
14 .route(
15 "/count",
16 routing::get(api::get_count).layer(AuthService::new(auth_uri.clone())),
17 )
18 .route(
19 "/list",
20 routing::get(api::get_list).layer(AuthService::new(auth_uri.clone())),
21 )
22 .with_state(state.clone()),
23 )
24}