diff --git a/prts-server/src/models/account/mod.rs b/prts-server/src/models/account/mod.rs index ad8a830..007235a 100644 --- a/prts-server/src/models/account/mod.rs +++ b/prts-server/src/models/account/mod.rs @@ -14,6 +14,7 @@ pub mod skin; pub mod social; pub mod status; pub mod sync; +pub mod theme; pub use sync::*; diff --git a/prts-server/src/models/account/theme.rs b/prts-server/src/models/account/theme.rs new file mode 100644 index 0000000..64a24d2 --- /dev/null +++ b/prts-server/src/models/account/theme.rs @@ -0,0 +1,36 @@ +use std::collections::HashMap; + +use serde::{Deserialize, Serialize}; + +use crate::utils::time::time; + +#[derive(Deserialize, Serialize, Default)] +pub struct HomeTheme { + selected: String, + themes: HashMap, +} + +impl HomeTheme { + pub fn new() -> Self { + Self::default() + } + + pub fn select_theme(&mut self, id: String) { + self.selected = id + } + + pub fn set_theme(&mut self, id: String) { + self.themes.insert(id, Theme::default()); + } +} + +#[derive(Deserialize, Serialize)] +pub struct Theme { + unlock: u64, +} + +impl Default for Theme { + fn default() -> Self { + Self { unlock: time() } + } +}