diff --git a/src/modules/rest/api/account.rs b/src/modules/rest/api/account.rs index 2ff1dc6..655c917 100644 --- a/src/modules/rest/api/account.rs +++ b/src/modules/rest/api/account.rs @@ -31,8 +31,7 @@ use crate::modules::rest::response::DataPage; use crate::modules::rest::ApiResult; use crate::modules::token::{AccessToken, AccountInfo}; use crate::raise_error; -use poem::web::Path; -use poem_openapi::param::Query; +use poem_openapi::param::{Path, Query}; use poem_openapi::payload::Json; use poem_openapi::OpenApi; diff --git a/src/modules/rest/api/auto_config.rs b/src/modules/rest/api/auto_config.rs index 299c703..4d3a145 100644 --- a/src/modules/rest/api/auto_config.rs +++ b/src/modules/rest/api/auto_config.rs @@ -23,7 +23,7 @@ use crate::modules::error::code::ErrorCode; use crate::modules::rest::api::ApiTags; use crate::modules::rest::ApiResult; use crate::raise_error; -use poem::web::Path; +use poem_openapi::param::Path; use poem_openapi::payload::Json; use poem_openapi::OpenApi; diff --git a/src/modules/rest/api/mailbox.rs b/src/modules/rest/api/mailbox.rs index 155ec95..c2b39eb 100644 --- a/src/modules/rest/api/mailbox.rs +++ b/src/modules/rest/api/mailbox.rs @@ -22,8 +22,7 @@ use crate::modules::common::auth::ClientContext; use crate::modules::mailbox::list::get_account_mailboxes; use crate::modules::rest::api::ApiTags; use crate::modules::rest::ApiResult; -use poem::web::Path; -use poem_openapi::param::Query; +use poem_openapi::param::{Path, Query}; use poem_openapi::payload::Json; use poem_openapi::OpenApi; diff --git a/src/modules/rest/api/message.rs b/src/modules/rest/api/message.rs index 41ff759..456da2d 100644 --- a/src/modules/rest/api/message.rs +++ b/src/modules/rest/api/message.rs @@ -32,9 +32,8 @@ use crate::modules::rest::response::DataPage; use crate::modules::rest::ApiResult; use crate::modules::rest::ErrorCode; use crate::raise_error; -use poem::web::Path; use poem::Body; -use poem_openapi::param::Query; +use poem_openapi::param::{Path, Query}; use poem_openapi::payload::{Attachment, AttachmentType, Json}; use poem_openapi::OpenApi; use std::collections::HashMap; @@ -134,7 +133,9 @@ impl MessageApi { )] async fn fetch_message_content( &self, + /// The ID of the account. account_id: Path, + /// The ID of the message to fetch. message_id: Query, context: ClientContext, ) -> ApiResult> { @@ -151,7 +152,9 @@ impl MessageApi { )] async fn download_message( &self, + /// The ID of the account. account_id: Path, + /// The ID of the message to download. message_id: Query, context: ClientContext, ) -> ApiResult> { @@ -175,8 +178,11 @@ impl MessageApi { )] async fn download_attachment( &self, + /// The ID of the account. account_id: Path, + /// The ID of the message containing the attachment. message_id: Query, + /// The filename of the attachment to download. name: Query, context: ClientContext, ) -> ApiResult> { diff --git a/src/modules/rest/api/oauth2.rs b/src/modules/rest/api/oauth2.rs index 2606cfa..b8df0f6 100644 --- a/src/modules/rest/api/oauth2.rs +++ b/src/modules/rest/api/oauth2.rs @@ -26,8 +26,7 @@ use crate::modules::rest::api::ApiTags; use crate::modules::rest::response::DataPage; use crate::modules::rest::ApiResult; use crate::raise_error; -use poem::web::Path; -use poem_openapi::param::Query; +use poem_openapi::param::{Path, Query}; use poem_openapi::payload::{Json, PlainText}; use poem_openapi::OpenApi; diff --git a/web/src/api/mailbox/envelope/api.ts b/web/src/api/mailbox/envelope/api.ts index f30bf60..1ab399f 100644 --- a/web/src/api/mailbox/envelope/api.ts +++ b/web/src/api/mailbox/envelope/api.ts @@ -48,7 +48,7 @@ export const get_thread_messages = async (accountId: number, thread_id: number, } export const download_attachment = async (accountId: number, id: number, attachmentFileName: string) => { - const response = await axiosInstance.get(`/api/v1/download-attachment/${accountId}?id=${id}&name=${attachmentFileName}`, { responseType: 'blob' }); + const response = await axiosInstance.get(`/api/v1/download-attachment/${accountId}?message_id=${id}&name=${attachmentFileName}`, { responseType: 'blob' }); const blob = new Blob([response.data]); saveAs(blob, attachmentFileName); }; @@ -83,7 +83,7 @@ export const getContent = (messageContent: MessageContentResponse): string | nul }; export const load_message = async (accountId: number, id: number) => { - const response = await axiosInstance.get(`/api/v1/message-content/${accountId}?id=${id}`); + const response = await axiosInstance.get(`/api/v1/message-content/${accountId}?message_id=${id}`); return response.data; }; @@ -93,7 +93,7 @@ export const delete_messages = async (payload: Record) => { }; export const download_message = async (accountId: number, id: number) => { - const response = await axiosInstance.get(`/api/v1/download-message/${accountId}?id=${id}`, { responseType: 'blob' }); + const response = await axiosInstance.get(`/api/v1/download-message/${accountId}?message_id=${id}`, { responseType: 'blob' }); const blob = new Blob([response.data]); saveAs(blob, `${id}.eml`); }; \ No newline at end of file