- 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
187 lines
6.4 KiB
Rust
187 lines
6.4 KiB
Rust
pub mod ai;
|
|
pub mod category;
|
|
pub mod draft_and_history;
|
|
pub mod member;
|
|
pub mod message;
|
|
pub mod notification;
|
|
pub mod pin;
|
|
pub mod reaction;
|
|
pub mod room;
|
|
pub mod thread;
|
|
pub mod upload;
|
|
pub mod ws;
|
|
pub mod ws_handler;
|
|
pub mod ws_types;
|
|
pub mod ws_universal;
|
|
|
|
use actix_web::web;
|
|
|
|
pub fn init_room_routes(cfg: &mut web::ServiceConfig) {
|
|
cfg.service(
|
|
web::scope("")
|
|
.route(
|
|
"/project_room/{project_name}/rooms",
|
|
web::get().to(room::room_list),
|
|
)
|
|
.route(
|
|
"/project_room/{project_name}/rooms",
|
|
web::post().to(room::room_create),
|
|
)
|
|
.route(
|
|
"/project_room/{project_name}/room-categories",
|
|
web::get().to(category::category_list),
|
|
)
|
|
.route(
|
|
"/project_room/{project_name}/room-categories",
|
|
web::post().to(category::category_create),
|
|
)
|
|
.route("/rooms/{room_id}", web::get().to(room::room_get))
|
|
.route("/rooms/{room_id}", web::patch().to(room::room_update))
|
|
.route("/rooms/{room_id}", web::delete().to(room::room_delete))
|
|
.route(
|
|
"/rooms/{room_id}/messages",
|
|
web::get().to(message::message_list),
|
|
)
|
|
.route(
|
|
"/rooms/{room_id}/messages",
|
|
web::post().to(message::message_create),
|
|
)
|
|
.route(
|
|
"/rooms/{room_id}/messages/{message_id}",
|
|
web::patch().to(message::message_update),
|
|
)
|
|
.route(
|
|
"/rooms/{room_id}/messages/{message_id}",
|
|
web::get().to(message::message_get),
|
|
)
|
|
.route(
|
|
"/rooms/{room_id}/messages/{message_id}/revoke",
|
|
web::post().to(message::message_revoke),
|
|
)
|
|
// room pins
|
|
.route("/rooms/{room_id}/pins", web::get().to(pin::pin_list))
|
|
.route(
|
|
"/rooms/{room_id}/messages/{message_id}/pin",
|
|
web::post().to(pin::pin_add),
|
|
)
|
|
.route(
|
|
"/rooms/{room_id}/messages/{message_id}/pin",
|
|
web::delete().to(pin::pin_remove),
|
|
)
|
|
// room threads
|
|
.route(
|
|
"/rooms/{room_id}/threads",
|
|
web::get().to(thread::thread_list),
|
|
)
|
|
.route(
|
|
"/rooms/{room_id}/threads",
|
|
web::post().to(thread::thread_create),
|
|
)
|
|
.route(
|
|
"/rooms/{room_id}/threads/{thread_id}/messages",
|
|
web::get().to(thread::thread_messages),
|
|
)
|
|
// room participants
|
|
.route(
|
|
"/rooms/{room_id}/participants",
|
|
web::get().to(member::participant_list),
|
|
)
|
|
// room access (private rooms)
|
|
.route(
|
|
"/rooms/{room_id}/access",
|
|
web::post().to(member::access_grant),
|
|
)
|
|
.route(
|
|
"/rooms/{room_id}/access/{user_id}",
|
|
web::delete().to(member::access_revoke),
|
|
)
|
|
// room user state
|
|
.route(
|
|
"/rooms/{room_id}/state/read-seq",
|
|
web::patch().to(member::state_set_read_seq),
|
|
)
|
|
.route(
|
|
"/rooms/{room_id}/state/dnd",
|
|
web::patch().to(member::state_update_dnd),
|
|
)
|
|
// room reactions
|
|
.route(
|
|
"/rooms/{room_id}/messages/{message_id}/reactions",
|
|
web::post().to(reaction::reaction_add),
|
|
)
|
|
.route(
|
|
"/rooms/{room_id}/messages/{message_id}/reactions/{emoji}",
|
|
web::delete().to(reaction::reaction_remove),
|
|
)
|
|
.route(
|
|
"/rooms/{room_id}/messages/{message_id}/reactions",
|
|
web::get().to(reaction::reaction_get),
|
|
)
|
|
// batch reactions
|
|
.route(
|
|
"/rooms/{room_id}/messages/reactions/batch",
|
|
web::get().to(reaction::reaction_batch),
|
|
)
|
|
// message search
|
|
.route(
|
|
"/rooms/{room_id}/messages/search",
|
|
web::get().to(reaction::message_search),
|
|
)
|
|
// message edit history
|
|
.route(
|
|
"/rooms/{room_id}/messages/{message_id}/edit-history",
|
|
web::get().to(draft_and_history::message_edit_history),
|
|
)
|
|
// mention notifications
|
|
.route(
|
|
"/me/mentions",
|
|
web::get().to(draft_and_history::mention_list),
|
|
)
|
|
.route(
|
|
"/me/mentions/read-all",
|
|
web::post().to(draft_and_history::mention_read_all),
|
|
)
|
|
// room AI
|
|
.route("/rooms/{room_id}/ai", web::get().to(ai::ai_list))
|
|
.route("/rooms/{room_id}/ai", web::put().to(ai::ai_upsert))
|
|
.route(
|
|
"/rooms/{room_id}/ai/{model_id}",
|
|
web::delete().to(ai::ai_delete),
|
|
)
|
|
// room category management
|
|
.route(
|
|
"/room-categories/{category_id}",
|
|
web::patch().to(category::category_update),
|
|
)
|
|
.route(
|
|
"/room-categories/{category_id}",
|
|
web::delete().to(category::category_delete),
|
|
)
|
|
.route(
|
|
"/me/notifications",
|
|
web::get().to(notification::notification_list),
|
|
)
|
|
.route(
|
|
"/me/notifications/{notification_id}/read",
|
|
web::post().to(notification::notification_mark_read),
|
|
)
|
|
.route(
|
|
"/me/notifications/read-all",
|
|
web::post().to(notification::notification_mark_all_read),
|
|
)
|
|
.route(
|
|
"/me/notifications/{notification_id}/archive",
|
|
web::post().to(notification::notification_archive),
|
|
)
|
|
// file upload
|
|
.route(
|
|
"/rooms/{room_id}/upload",
|
|
web::post().to(upload::upload),
|
|
)
|
|
.route(
|
|
"/rooms/{room_id}/attachments/{attachment_id}",
|
|
web::get().to(upload::get_attachment),
|
|
),
|
|
);
|
|
}
|