refactor: rename redis-cache feature to cache
- Simplified feature name from 'redis-cache' to 'cache' - Updated Cargo.toml feature definitions - Updated state.rs cfg attributes - More concise naming
This commit is contained in:
parent
b1193afda2
commit
415c7cce77
4 changed files with 76 additions and 18 deletions
12
Cargo.toml
12
Cargo.toml
|
|
@ -44,7 +44,7 @@ features = ["database"]
|
|||
|
||||
[features]
|
||||
# ===== DEFAULT FEATURE SET =====
|
||||
default = ["console", "chat", "automation", "tasks", "drive", "llm", "redis-cache", "progress-bars", "directory"]
|
||||
default = ["console", "chat", "automation", "tasks", "drive", "llm", "cache", "progress-bars", "directory"]
|
||||
|
||||
# ===== UI FEATURES =====
|
||||
console = ["dep:crossterm", "dep:ratatui", "monitoring"]
|
||||
|
|
@ -76,7 +76,7 @@ weba = []
|
|||
timeseries = []
|
||||
|
||||
# ===== OPTIONAL INFRASTRUCTURE =====
|
||||
redis-cache = ["dep:redis"]
|
||||
cache = ["dep:redis"]
|
||||
monitoring = ["dep:sysinfo"]
|
||||
automation = ["dep:rhai"]
|
||||
grpc = ["dep:tonic"]
|
||||
|
|
@ -89,11 +89,11 @@ full = [
|
|||
"email", "whatsapp", "instagram", "msteams",
|
||||
"chat", "drive", "tasks", "calendar", "meet", "mail",
|
||||
"compliance", "attendance", "directory", "weba",
|
||||
"redis-cache", "monitoring", "automation", "grpc", "progress-bars"
|
||||
"cache", "monitoring", "automation", "grpc", "progress-bars"
|
||||
]
|
||||
|
||||
communications = ["email", "whatsapp", "instagram", "msteams", "chat", "redis-cache"]
|
||||
productivity = ["chat", "drive", "tasks", "calendar", "meet", "mail", "redis-cache"]
|
||||
communications = ["email", "whatsapp", "instagram", "msteams", "chat", "cache"]
|
||||
productivity = ["chat", "drive", "tasks", "calendar", "meet", "mail", "cache"]
|
||||
enterprise = ["compliance", "attendance", "directory", "llm", "vectordb", "monitoring", "timeseries"]
|
||||
minimal = ["chat"]
|
||||
lightweight = ["chat", "drive", "tasks"]
|
||||
|
|
@ -204,7 +204,7 @@ rust_xlsxwriter = "0.79"
|
|||
# Error handling
|
||||
thiserror = "2.0"
|
||||
|
||||
# Caching/Sessions (redis-cache feature)
|
||||
# Caching/Sessions (cache feature)
|
||||
redis = { version = "0.27", features = ["tokio-comp"], optional = true }
|
||||
|
||||
# System Monitoring (monitoring feature)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
use anyhow::{anyhow, Result};
|
||||
use aws_sdk_s3::primitives::ByteStream;
|
||||
use aws_sdk_s3::Client;
|
||||
use chrono::TimeZone;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::path::PathBuf;
|
||||
use tokio::fs;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,69 @@
|
|||
//! REST API Module
|
||||
//! Attendance Module
|
||||
//!
|
||||
//! Provides HTTP endpoints for cloud-based functionality.
|
||||
//! Supports web, desktop, and mobile clients.
|
||||
//! Provides attendance tracking and human handoff queue functionality.
|
||||
//!
|
||||
//! Note: Local operations require native access and are handled separately:
|
||||
//! - Screen capture: Tauri commands (desktop) or WebRTC (web/mobile)
|
||||
//! - File sync: Tauri commands with local rclone process (desktop only)
|
||||
//! ## Features
|
||||
//!
|
||||
//! - **Queue System**: Human handoff for conversations that need human attention
|
||||
//! - **Keyword Services**: Check-in/out, break/resume tracking via keywords
|
||||
//! - **Drive Integration**: S3 storage for attendance records
|
||||
//!
|
||||
//! ## Usage
|
||||
//!
|
||||
//! Enable with the `attendance` feature flag in Cargo.toml:
|
||||
//! ```toml
|
||||
//! [features]
|
||||
//! default = ["attendance"]
|
||||
//! ```
|
||||
|
||||
// pub mod drive;
|
||||
// pub mod keyword_services;
|
||||
pub mod drive;
|
||||
pub mod keyword_services;
|
||||
pub mod queue;
|
||||
|
||||
// Re-export main types for convenience
|
||||
pub use drive::{AttendanceDriveConfig, AttendanceDriveService, RecordMetadata, SyncResult};
|
||||
pub use keyword_services::{
|
||||
AttendanceCommand, AttendanceRecord, AttendanceResponse, AttendanceService, KeywordConfig,
|
||||
KeywordParser, ParsedCommand,
|
||||
};
|
||||
pub use queue::{
|
||||
AssignRequest, AttendantStats, AttendantStatus, QueueFilters, QueueItem, QueueStatus,
|
||||
TransferRequest,
|
||||
};
|
||||
|
||||
use crate::shared::state::AppState;
|
||||
use axum::{
|
||||
routing::{get, post},
|
||||
Router,
|
||||
};
|
||||
use std::sync::Arc;
|
||||
|
||||
/// Configure attendance routes
|
||||
pub fn configure_attendance_routes() -> Router<Arc<AppState>> {
|
||||
Router::new()
|
||||
// Queue management endpoints
|
||||
.route("/api/attendance/queue", get(queue::list_queue))
|
||||
.route("/api/attendance/attendants", get(queue::list_attendants))
|
||||
.route("/api/attendance/assign", post(queue::assign_conversation))
|
||||
.route(
|
||||
"/api/attendance/transfer",
|
||||
post(queue::transfer_conversation),
|
||||
)
|
||||
.route(
|
||||
"/api/attendance/resolve/:session_id",
|
||||
post(queue::resolve_conversation),
|
||||
)
|
||||
.route("/api/attendance/insights", get(queue::get_insights))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_module_exports() {
|
||||
// Test that types are properly exported
|
||||
let _config = KeywordConfig::default();
|
||||
let _parser = KeywordParser::new();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ use crate::shared::utils::DbPool;
|
|||
use crate::tasks::{TaskEngine, TaskScheduler};
|
||||
#[cfg(feature = "drive")]
|
||||
use aws_sdk_s3::Client as S3Client;
|
||||
#[cfg(feature = "redis-cache")]
|
||||
#[cfg(feature = "cache")]
|
||||
use redis::Client as RedisClient;
|
||||
use std::any::{Any, TypeId};
|
||||
use std::collections::HashMap;
|
||||
|
|
@ -85,7 +85,7 @@ pub struct AppState {
|
|||
#[cfg(feature = "drive")]
|
||||
pub drive: Option<S3Client>,
|
||||
pub s3_client: Option<S3Client>,
|
||||
#[cfg(feature = "redis-cache")]
|
||||
#[cfg(feature = "cache")]
|
||||
pub cache: Option<Arc<RedisClient>>,
|
||||
pub bucket_name: String,
|
||||
pub config: Option<AppConfig>,
|
||||
|
|
@ -117,7 +117,7 @@ impl Clone for AppState {
|
|||
config: self.config.clone(),
|
||||
conn: self.conn.clone(),
|
||||
database_url: self.database_url.clone(),
|
||||
#[cfg(feature = "redis-cache")]
|
||||
#[cfg(feature = "cache")]
|
||||
cache: self.cache.clone(),
|
||||
session_manager: Arc::clone(&self.session_manager),
|
||||
metrics_collector: self.metrics_collector.clone(),
|
||||
|
|
@ -146,7 +146,7 @@ impl std::fmt::Debug for AppState {
|
|||
|
||||
debug.field("s3_client", &self.s3_client.is_some());
|
||||
|
||||
#[cfg(feature = "redis-cache")]
|
||||
#[cfg(feature = "cache")]
|
||||
debug.field("cache", &self.cache.is_some());
|
||||
|
||||
debug
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue