br-wechat 0.0.23

This is an wechat
Documentation
#[derive(Clone, Debug)]
pub struct Config {
    pub channel: Channel,
    pub appid: String,
    pub secret: String,
    pub access_token: String,
    pub expires_in: i64,
    /// 企业微信
    pub agent_id: String,
}
impl Default for Config {
    fn default() -> Self {
        Self {
            channel: Channel::None,
            appid: "".to_string(),
            secret: "".to_string(),
            access_token: "".to_string(),
            expires_in: 0,
            agent_id: "".to_string(),
        }
    }
}
#[derive(Clone, Debug)]
pub enum Channel {
    WeCom,
    Applet,
    Subscribe,
    Web,
    Shop,
    Open,
    None,
}

impl Channel {
    pub fn form(name: &str) -> Channel {
        match name {
            "webcom" | "企业微信" => Channel::WeCom,
            "Applet" | "小程序" => Channel::Applet,
            "Subscribe" | "公众号" => Channel::Subscribe,
            "web" | "网站" => Channel::Web,
            "Shop" | "小商店" => Channel::Shop,
            "Open" | "开放平台" => Channel::Open,
            _ => Channel::None,
        }
    }
}