add: layouts types

This commit is contained in:
trisua 2025-07-02 17:08:40 -04:00
parent 0634819278
commit c83d0a9fc0
5 changed files with 399 additions and 0 deletions

View file

@ -1,5 +1,7 @@
use std::collections::HashMap;
use crate::model::layouts::CustomizablePage;
use super::{
oauth::AuthGrant,
permissions::{FinePermission, SecondaryPermission},
@ -61,6 +63,11 @@ pub struct User {
/// Users collect achievements through little actions across the site.
#[serde(default)]
pub achievements: Vec<Achievement>,
/// The ID of each layout the user is using.
///
/// Only applies if the user is a supporter.
#[serde(default)]
pub layouts: HashMap<CustomizablePage, usize>,
}
pub type UserConnections =
@ -319,6 +326,7 @@ impl User {
invite_code: 0,
secondary_permissions: SecondaryPermission::DEFAULT,
achievements: Vec::new(),
layouts: HashMap::new(),
}
}