use ::session::AuthedUser; use api::http::{Path, State}; use api::rest::{AppResponseData, NoData}; use uuid::Uuid; use crate::errors::ApiError; use crate::services::service::UserService; #[utoipa::path( delete, path = "/me/messages/saved/{message_id}", tag = "user", description = "删除当前用户对指定消息的全部收藏记录。", params( ("message_id" = Uuid, Path, description = "message id") ), responses( (status = 200, description = "unsave message", body = AppResponseData), (status = 401, description = "authentication required", body = AppResponseData) ) )] pub async fn unsave_message( State(service): State, AuthedUser(uid): AuthedUser, Path(message_id): Path, ) -> Result, ApiError> { service.unsave_message(uid, message_id).await?; Ok(AppResponseData::empty()) }