use ::session::AuthedUser; use api::http::{Path, State}; use api::rest::{AppResponseData, NoData}; use uuid::Uuid; use crate::AuthService; use crate::errors::ApiError; #[utoipa::path( delete, path = "/me/notifications/{notification_id}", tag = "notifications", description = "删除当前用户名下的指定通知记录。", params( ("notification_id" = Uuid, Path, description = "notification id") ), responses( (status = 200, description = "notification deleted", body = AppResponseData), (status = 401, description = "authentication required", body = AppResponseData) ) )] pub async fn delete_notification( State(service): State, AuthedUser(uid): AuthedUser, Path(notification_id): Path, ) -> Result, ApiError> { service .delete_notification(uid, notification_id) .await .map_err(ApiError::from)?; Ok(AppResponseData::empty()) }