refactor: rename associated type to Response
This commit is contained in:
@@ -50,7 +50,7 @@ pub enum APIMethod {
|
|||||||
pub trait APIExt {
|
pub trait APIExt {
|
||||||
const METHOD: APIMethod;
|
const METHOD: APIMethod;
|
||||||
type Payload: Serialize + Send + 'static;
|
type Payload: Serialize + Send + 'static;
|
||||||
type Output: for<'de> Deserialize<'de>;
|
type Response: for<'de> Deserialize<'de>;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[crabtime::function]
|
#[crabtime::function]
|
||||||
@@ -63,7 +63,7 @@ fn api_implement(api_names: Vec<String>) {
|
|||||||
impl APIExt for {{api_name}} {
|
impl APIExt for {{api_name}} {
|
||||||
const METHOD: APIMethod = APIMethod::{{api_name}};
|
const METHOD: APIMethod = APIMethod::{{api_name}};
|
||||||
type Payload = crate::title::model::{{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;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ pub trait MaiVersionExt: MaiVersion {
|
|||||||
client: &AsyncClient,
|
client: &AsyncClient,
|
||||||
data: M::Payload,
|
data: M::Payload,
|
||||||
agent_extra: impl Display + Send + 'static,
|
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)
|
Self::request(client, M::METHOD, agent_extra, data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user