1
 2
 3
 4
 5
 6
 7
 8
 9
10
macro_rules! define_api {
    ($name:ident, $url:expr, $req:ty, $resp:ty) => {
        pub async fn $name<R: Into<$req>>(&self, data: R) -> Result<$resp, crate::error::Error> {
            self.inner.request(
                &format!("https://console.tim.qq.com{}", $url),
                &data.into()
            ).await
        }
    };
}