gitdataai/libs/api/route.rs
ZhenYi 14f6e1e500 feat(core): initialize project with access control and AI integration
- Add gitignore and prettier configuration files for project scaffolding
- Implement room access control service with project member verification
- Create user access key management with CRUD operations and activity logging
- Add accordion UI component for frontend expandable sections
- Implement room AI configuration with list, upsert, and delete operations
- Add AI event types for agent join/leave/status change tracking
- Create streaming AI processing services for mode and react patterns
- Build room AI service with model detection and idempotency handling
- Integrate chat service orchestration for AI message processing
- Add typing indicators and stream cancellation for AI interactions
- Implement mention parsing and context extraction for AI agents
2026-05-03 06:04:31 +08:00

31 lines
1.2 KiB
Rust

use actix_web::web;
pub fn init_routes(cfg: &mut web::ServiceConfig) {
cfg.service(
web::scope("/ws")
.route("", web::get().to(transport::handler::ws::ws_handler))
.route(
"/ai-stream/{room_id}/{message_id}",
web::get().to(transport::handler::sse::ws_ai_stream),
),
);
cfg.service(
web::scope("/api")
.configure(crate::auth::init_auth_routes)
.configure(crate::git::init_git_routes)
.configure(crate::git::init_git_toplevel_routes)
.configure(crate::issue::init_issue_routes)
.configure(crate::project::init_project_routes)
.configure(crate::user::init_user_routes)
.configure(crate::pull_request::init_pull_request_routes)
.configure(crate::agent::init_agent_routes)
.configure(crate::workspace::init_workspace_routes)
.configure(crate::search::init_search_routes)
.configure(crate::room::init_room_routes),
);
// SPA fallback — must be registered last so /api/* takes precedence
// cfg.route("/{path:.*}", web::get().to(crate::dist::serve_frontend));
}