Merge origin/master into hermes/hermes-4fd30995
This commit is contained in:
27
server-rs/crates/api-server/src/modules/edutainment.rs
Normal file
27
server-rs/crates/api-server/src/modules/edutainment.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
use axum::{Router, extract::DefaultBodyLimit, middleware, routing::post};
|
||||
|
||||
use crate::{
|
||||
auth::require_bearer_auth, edutainment_baby_drawing::create_baby_love_drawing_magic,
|
||||
edutainment_baby_object::generate_baby_object_match_assets, state::AppState,
|
||||
};
|
||||
|
||||
const BABY_LOVE_DRAWING_MAGIC_BODY_LIMIT_BYTES: usize = 8 * 1024 * 1024;
|
||||
|
||||
pub fn router(state: AppState) -> Router<AppState> {
|
||||
Router::new()
|
||||
.route(
|
||||
"/api/creation/edutainment/baby-object-match/assets",
|
||||
post(generate_baby_object_match_assets).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/creation/edutainment/baby-love-drawing/magic",
|
||||
post(create_baby_love_drawing_magic)
|
||||
.layer(DefaultBodyLimit::max(
|
||||
BABY_LOVE_DRAWING_MAGIC_BODY_LIMIT_BYTES,
|
||||
))
|
||||
.route_layer(middleware::from_fn_with_state(state, require_bearer_auth)),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user