use crate::ids::UserId;
use crate::wire::finger::{WireUserBag, WireUserIP};
#[derive(Clone, Debug)]
pub struct UserIp {
pub latest_login_ip: String,
pub user_id: UserId,
}
impl From<WireUserIP> for UserIp {
fn from(wire: WireUserIP) -> Self {
Self {
latest_login_ip: wire.latest_login_ip,
user_id: wire.user_id.into(),
}
}
}
#[derive(Clone, Debug)]
pub struct UserBag {
pub checkin1day: u32,
pub checkin2days: u32,
pub patch_checkin_card: u32,
pub metal_ticket: u32,
}
impl From<WireUserBag> for UserBag {
fn from(wire: WireUserBag) -> Self {
Self {
checkin1day: wire.checkin1day,
checkin2days: wire.checkin2days,
patch_checkin_card: wire.patch_checkin_card,
metal_ticket: wire.metal_ticket,
}
}
}
#[derive(Clone, Copy, Debug)]
pub enum BagItem {
Checkin1day,
Checkin2days,
PatchCheckinCard,
MetalTicket,
}
impl BagItem {
pub fn as_str(&self) -> &'static str {
match self {
Self::Checkin1day => "checkin1day",
Self::Checkin2days => "checkin2days",
Self::PatchCheckinCard => "patchCheckinCard",
Self::MetalTicket => "metalTicket",
}
}
}
#[derive(Clone, Debug)]
pub struct MetalGift {
pub attr: String,
pub name: String,
pub description: String,
pub data: String,
}