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:
@@ -29,7 +29,7 @@ pub struct CreateIdentityResponse {
|
||||
pub quality_avg: Option<f64>,
|
||||
}
|
||||
|
||||
pub fn identity_routes() -> Router<crate::api::server::AppState> {
|
||||
pub fn identity_routes() -> Router<crate::api::types::AppState> {
|
||||
Router::new()
|
||||
.route("/api/v1/identities", get(list_identities))
|
||||
.route("/api/v1/identity", post(create_identity))
|
||||
@@ -39,7 +39,7 @@ pub fn identity_routes() -> Router<crate::api::server::AppState> {
|
||||
/// Register a Global Identity from face.json with multi-angle reference vectors.
|
||||
/// Calls select_face_reference_vectors_v2.py for automatic reference selection.
|
||||
async fn create_identity(
|
||||
State(_state): State<crate::api::server::AppState>,
|
||||
State(_state): State<crate::api::types::AppState>,
|
||||
Json(req): Json<CreateIdentityRequest>,
|
||||
) -> Result<Json<CreateIdentityResponse>, (StatusCode, String)> {
|
||||
let schema = req.schema.unwrap_or("dev".to_string());
|
||||
@@ -147,7 +147,7 @@ async fn create_identity(
|
||||
|
||||
/// List all global identities
|
||||
async fn list_identities(
|
||||
State(_state): State<crate::api::server::AppState>,
|
||||
State(_state): State<crate::api::types::AppState>,
|
||||
Query(query): Query<ListIdentitiesQuery>,
|
||||
) -> Result<Json<IdentityListResponse>, (StatusCode, String)> {
|
||||
let db = match PostgresDb::init().await {
|
||||
|
||||
Reference in New Issue
Block a user