Skip to main content

jx3_api/
enums.rs

1use crate::model::free::ServerCheck;
2use serde::{Deserialize, Serialize};
3
4pub enum CelebClub {
5    /// 云从社
6    Ycs,
7    /// 楚天社
8    Cts,
9    /// 披风会
10    Pfh,
11}
12
13impl CelebClub {
14    pub fn from_str(s: &str) -> Option<CelebClub> {
15        match s {
16            "云从社" => Some(CelebClub::Ycs),
17            "楚天社" => Some(CelebClub::Cts),
18            "披风会" => Some(CelebClub::Pfh),
19            _ => None,
20        }
21    }
22
23    pub fn to_str(&self) -> &'static str {
24        match self {
25            CelebClub::Ycs => "云从社",
26            CelebClub::Cts => "楚天社",
27            CelebClub::Pfh => "披风会",
28        }
29    }
30}
31
32#[derive(Debug, Serialize, Deserialize, Clone)]
33#[serde(untagged)]
34pub enum ServerCheckEnums {
35    Object(ServerCheck),
36    Array(Vec<ServerCheck>),
37}