refactor: rename associated type to Response

This commit is contained in:
mokurin000
2025-07-31 21:50:13 +08:00
parent b0b8cea00e
commit 8dfc834d15
2 changed files with 3 additions and 3 deletions

View File

@@ -50,7 +50,7 @@ pub enum APIMethod {
pub trait APIExt {
const METHOD: APIMethod;
type Payload: Serialize + Send + 'static;
type Output: for<'de> Deserialize<'de>;
type Response: for<'de> Deserialize<'de>;
}
#[crabtime::function]
@@ -63,7 +63,7 @@ fn api_implement(api_names: Vec<String>) {
impl APIExt for {{api_name}} {
const METHOD: APIMethod = APIMethod::{{api_name}};
type Payload = crate::title::model::{{api_name}};
type Output = crate::title::model::{{api_name}}Resp;
type Response = crate::title::model::{{api_name}}Resp;
}
);
}

View File

@@ -112,7 +112,7 @@ pub trait MaiVersionExt: MaiVersion {
client: &AsyncClient,
data: M::Payload,
agent_extra: impl Display + Send + 'static,
) -> impl Future<Output = Result<M::Output, ApiError>> {
) -> impl Future<Output = Result<M::Response, ApiError>> {
Self::request(client, M::METHOD, agent_extra, data)
}
}