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:
@@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::core::db::PostgresDb;
|
||||
|
||||
pub fn trace_agent_routes() -> Router<crate::api::server::AppState> {
|
||||
pub fn trace_agent_routes() -> Router<crate::api::types::AppState> {
|
||||
Router::new()
|
||||
.route("/api/v1/file/:file_uuid/traces", post(list_traces_sorted))
|
||||
.route(
|
||||
@@ -55,7 +55,7 @@ struct TracesResponse {
|
||||
}
|
||||
|
||||
async fn list_traces_sorted(
|
||||
State(state): State<crate::api::server::AppState>,
|
||||
State(state): State<crate::api::types::AppState>,
|
||||
Path(file_uuid): Path<String>,
|
||||
Json(req): Json<TracesRequest>,
|
||||
) -> Result<Json<TracesResponse>, (StatusCode, String)> {
|
||||
@@ -202,7 +202,7 @@ fn lerp_i32(a: Option<i32>, b: Option<i32>, t: f64) -> Option<i32> {
|
||||
}
|
||||
|
||||
async fn list_trace_faces(
|
||||
State(state): State<crate::api::server::AppState>,
|
||||
State(state): State<crate::api::types::AppState>,
|
||||
Path((file_uuid, trace_id)): Path<(String, i32)>,
|
||||
Query(q): Query<TraceFacesQuery>,
|
||||
) -> Result<Json<TraceFacesResponse>, (StatusCode, String)> {
|
||||
|
||||
Reference in New Issue
Block a user