use actix_web::{HttpResponse, web}; use crate::api::response::{ApiErrorResponse, ApiResponse}; use crate::error::AppError; use crate::service::AppService; use crate::session::Session; /// Mark all notifications as read #[utoipa::path( put, path = "/api/v1/notifications/read-all", tag = "Notifications", operation_id = "notificationMarkAllAsRead", responses( (status = 200, description = "All notifications marked as read", body = ApiResponse), (status = 401, description = "Authentication required or session expired", body = ApiErrorResponse), (status = 500, description = "Internal server error", body = ApiErrorResponse), ), security( ("session_cookie" = []) ) )] pub async fn mark_all_as_read( service: web::Data, session: Session, ) -> Result { let result = service.notify.mark_all_as_read(&session).await?; Ok(HttpResponse::Ok().json(ApiResponse::new(result))) }