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/memes/{meme_id}", tag = "user", description = "物理删除当前用户的指定 meme 条目。", params( ("meme_id" = Uuid, Path, description = "meme id") ), responses( (status = 200, description = "meme deleted", body = AppResponseData), (status = 401, description = "authentication required", body = AppResponseData) ) )] pub async fn delete_meme( State(service): State, AuthedUser(uid): AuthedUser, Path(meme_id): Path, ) -> Result, ApiError> { service.delete_meme(uid, meme_id).await?; Ok(AppResponseData::empty()) }