move DingTalkType to mod msg

This commit is contained in:
2020-04-25 23:30:36 +08:00
parent 109c85379b
commit 5b5a23ab0b
2 changed files with 14 additions and 12 deletions

View File

@@ -14,6 +14,7 @@ mod msg;
use msg::*; use msg::*;
pub use msg:: { pub use msg:: {
DingTalkType,
DingTalkMessage, DingTalkMessage,
DingTalkMessageType, DingTalkMessageType,
DingTalkMessageActionCardHideAvatar, DingTalkMessageActionCardHideAvatar,
@@ -30,18 +31,6 @@ const APPLICATION_JSON_UTF8: &str = "application/json; charset=utf-8";
const DEFAULT_DINGTALK_ROBOT_URL: &str = "https://oapi.dingtalk.com/robot/send"; const DEFAULT_DINGTALK_ROBOT_URL: &str = "https://oapi.dingtalk.com/robot/send";
const DEFAULT_WECHAT_WORK_ROBOT_URL: &str = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send"; const DEFAULT_WECHAT_WORK_ROBOT_URL: &str = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send";
/// Send Dingtalk or WeChatWork message
#[derive(Clone, Copy, Debug)]
pub enum DingTalkType {
DingTalk,
WeChatWork,
}
impl Default for DingTalkType {
fn default() -> Self { DingTalkType::DingTalk }
}
/// `DingTalk` is a simple SDK for DingTalk webhook robot /// `DingTalk` is a simple SDK for DingTalk webhook robot
/// ///

View File

@@ -1,6 +1,19 @@
use serde::{Serialize, Deserialize}; use serde::{Serialize, Deserialize};
/// Send Dingtalk or WeChatWork message
#[derive(Clone, Copy, Debug)]
pub enum DingTalkType {
DingTalk,
WeChatWork,
}
impl Default for DingTalkType {
fn default() -> Self { DingTalkType::DingTalk }
}
/// DingTalk message type /// DingTalk message type
/// * Text - text message /// * Text - text message
/// * Markdown - markdown message /// * Markdown - markdown message