Add missing API endpoints for UI suite screens
- src/meet/mod.rs: Add UI-compatible endpoints: - /api/meet/rooms (list_rooms_ui) - /api/meet/recent (recent_meetings) - /api/meet/participants (all_participants) - /api/meet/scheduled (scheduled_meetings) - src/drive/mod.rs: Add UI-compatible endpoint: - /api/drive/list (list_drive_files_ui) - src/calendar/mod.rs: Add UI-compatible endpoints (from previous session): - /api/calendar/list (list_calendars) - /api/calendar/upcoming (upcoming_events) All endpoints return stub JSON responses for UI compatibility.
This commit is contained in:
parent
88d629e310
commit
c986539fad
3 changed files with 80 additions and 0 deletions
|
|
@ -249,6 +249,32 @@ pub async fn list_events(
|
|||
Json(vec![])
|
||||
}
|
||||
|
||||
/// List calendars
|
||||
pub async fn list_calendars(
|
||||
State(_state): State<Arc<AppState>>,
|
||||
) -> Json<serde_json::Value> {
|
||||
Json(serde_json::json!({
|
||||
"calendars": [
|
||||
{
|
||||
"id": "default",
|
||||
"name": "My Calendar",
|
||||
"color": "#3b82f6",
|
||||
"visible": true
|
||||
}
|
||||
]
|
||||
}))
|
||||
}
|
||||
|
||||
/// Get upcoming events
|
||||
pub async fn upcoming_events(
|
||||
State(_state): State<Arc<AppState>>,
|
||||
) -> Json<serde_json::Value> {
|
||||
Json(serde_json::json!({
|
||||
"events": [],
|
||||
"message": "No upcoming events"
|
||||
}))
|
||||
}
|
||||
|
||||
pub async fn get_event(
|
||||
State(_state): State<Arc<AppState>>,
|
||||
Path(_id): Path<Uuid>,
|
||||
|
|
@ -309,6 +335,9 @@ pub fn router(state: Arc<AppState>) -> Router {
|
|||
)
|
||||
.route("/api/calendar/export.ics", get(export_ical))
|
||||
.route("/api/calendar/import", post(import_ical))
|
||||
// UI-compatible endpoints
|
||||
.route("/api/calendar/list", get(list_calendars))
|
||||
.route("/api/calendar/upcoming", get(upcoming_events))
|
||||
.with_state(state)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -202,6 +202,8 @@ pub fn configure() -> Router<Arc<AppState>> {
|
|||
Router::new()
|
||||
// Basic file operations
|
||||
.route("/files/list", get(list_files))
|
||||
// UI-compatible endpoint
|
||||
.route("/api/drive/list", get(list_drive_files_ui))
|
||||
.route("/files/read", post(read_file))
|
||||
.route("/files/write", post(write_file))
|
||||
.route("/files/save", post(write_file))
|
||||
|
|
@ -1157,3 +1159,13 @@ pub async fn restore_version(
|
|||
new_version_id,
|
||||
}))
|
||||
}
|
||||
|
||||
// ===== UI-Compatible Endpoints =====
|
||||
|
||||
/// GET /api/drive/list - List files for UI display
|
||||
pub async fn list_drive_files_ui(State(_state): State<Arc<AppState>>) -> Json<serde_json::Value> {
|
||||
Json(serde_json::json!({
|
||||
"files": [],
|
||||
"message": "No files available"
|
||||
}))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,11 @@ pub fn configure() -> Router<Arc<AppState>> {
|
|||
.route(ApiUrls::VOICE_STOP, post(voice_stop))
|
||||
.route(ApiUrls::MEET_CREATE, post(create_meeting))
|
||||
.route(ApiUrls::MEET_ROOMS, get(list_rooms))
|
||||
// UI-compatible endpoints
|
||||
.route("/api/meet/rooms", get(list_rooms_ui))
|
||||
.route("/api/meet/recent", get(recent_meetings))
|
||||
.route("/api/meet/participants", get(all_participants))
|
||||
.route("/api/meet/scheduled", get(scheduled_meetings))
|
||||
.route(
|
||||
ApiUrls::MEET_ROOM_BY_ID.replace(":id", "{room_id}"),
|
||||
get(get_room),
|
||||
|
|
@ -400,3 +405,37 @@ async fn handle_meeting_socket(_socket: axum::extract::ws::WebSocket, _state: Ar
|
|||
// Handle WebSocket messages for real-time meeting communication
|
||||
// This would integrate with WebRTC signaling
|
||||
}
|
||||
|
||||
// ===== UI-Compatible Endpoints =====
|
||||
|
||||
/// List rooms for UI display
|
||||
pub async fn list_rooms_ui(State(_state): State<Arc<AppState>>) -> Json<serde_json::Value> {
|
||||
Json(serde_json::json!({
|
||||
"rooms": [],
|
||||
"message": "No active meeting rooms"
|
||||
}))
|
||||
}
|
||||
|
||||
/// Get recent meetings
|
||||
pub async fn recent_meetings(State(_state): State<Arc<AppState>>) -> Json<serde_json::Value> {
|
||||
Json(serde_json::json!({
|
||||
"meetings": [],
|
||||
"message": "No recent meetings"
|
||||
}))
|
||||
}
|
||||
|
||||
/// Get all participants across meetings
|
||||
pub async fn all_participants(State(_state): State<Arc<AppState>>) -> Json<serde_json::Value> {
|
||||
Json(serde_json::json!({
|
||||
"participants": [],
|
||||
"message": "No participants"
|
||||
}))
|
||||
}
|
||||
|
||||
/// Get scheduled meetings
|
||||
pub async fn scheduled_meetings(State(_state): State<Arc<AppState>>) -> Json<serde_json::Value> {
|
||||
Json(serde_json::json!({
|
||||
"meetings": [],
|
||||
"message": "No scheduled meetings"
|
||||
}))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue