refactor(api): split Axum handlers into handler/service/repo modules

Keep the REST contract; move domain logic out of route files so checkout, fulfillment, and identity can be reused across customer, shop, and admin surfaces.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Chengdong Zhang
2026-09-18 14:59:36 +08:00
co-authored by Cursor
parent e457339847
commit 5e866d08f4
68 changed files with 3796 additions and 2304 deletions
+4 -5
View File
@@ -1,11 +1,10 @@
pub mod auth;
pub mod cart;
pub mod config;
pub mod error;
pub mod http;
pub mod models;
pub mod money;
pub mod pagination;
pub mod routes;
pub mod modules;
pub mod seed;
pub mod state;
@@ -16,8 +15,8 @@ use crate::state::AppState;
pub fn build_router(state: AppState) -> Router {
Router::new()
.route("/api/health", get(routes::health::health))
.nest("/api", routes::api_router(state.clone()))
.route("/api/health", get(modules::health::health))
.nest("/api", modules::api_router())
.layer(TraceLayer::new_for_http())
.layer(CorsLayer::permissive())
.with_state(state)