use async_trait::async_trait;
use serde::Serialize;
use crate::bean::CommonUploadParam;
use crate::error::WxErrorException;
#[async_trait]
pub trait WxService: Send + Sync {
async fn get(&self, url: &str, query_param: Option<&str>) -> Result<String, WxErrorException>;
async fn post(&self, url: &str, post_data: &str) -> Result<String, WxErrorException>;
async fn post_json<T: Serialize + Send + Sync>(
&self,
url: &str,
obj: &T,
) -> Result<String, WxErrorException>;
async fn upload(&self, url: &str, param: CommonUploadParam)
-> Result<String, WxErrorException>;
}