refactor: modularize server.rs into separate route modules

- Extract scan.rs, files.rs, types.rs, processing.rs, visual_chunk_search.rs
- Move AppState and AppConfig to types.rs
- Each module exposes pub fn xxx_routes() -> Router<AppState>
- server.rs reduced from 5005 to 118 lines (orchestrator only)
- All stubs filled with real implementations from git history
- Verify: cargo check, clippy, tests all pass
This commit is contained in:
M5Max128
2026-05-21 16:38:49 +08:00
parent 80812128e2
commit 3a33d00449
22 changed files with 3315 additions and 4962 deletions
+2 -2
View File
@@ -51,7 +51,7 @@ pub struct SmartSearchResponse {
// --- API Handler ---
pub async fn smart_search(
State(state): State<crate::api::server::AppState>,
State(state): State<crate::api::types::AppState>,
Json(req): Json<SmartSearchRequest>,
) -> Result<Json<SmartSearchResponse>, (StatusCode, Json<serde_json::Value>)> {
let db = &state.db;
@@ -126,6 +126,6 @@ pub async fn smart_search(
// --- Router Setup ---
pub fn search_routes() -> Router<crate::api::server::AppState> {
pub fn search_routes() -> Router<crate::api::types::AppState> {
Router::new().route("/api/v1/search/smart", post(smart_search))
}