use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum FeedCardStatus {
#[serde(rename = "active")]
Active,
#[serde(rename = "inactive")]
Inactive,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum UserIdType {
#[serde(rename = "user_id")]
UserId,
#[serde(rename = "union_id")]
UnionId,
#[serde(rename = "open_id")]
OpenId,
}
impl UserIdType {
pub fn as_str(&self) -> &'static str {
match self {
UserIdType::UserId => "user_id",
UserIdType::UnionId => "union_id",
UserIdType::OpenId => "open_id",
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FeedCard {
pub card_id: String,
pub title: Option<String>,
pub content: Option<String>,
pub status: Option<FeedCardStatus>,
pub create_time: Option<String>,
pub update_time: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ButtonInfo {
pub button_id: String,
pub text: String,
pub button_type: Option<String>,
pub action: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TimelyNotification {
pub notification_type: String,
pub message: String,
pub target_users: Vec<String>,
}