summaryrefslogtreecommitdiffstats
path: root/src/models/mod.rs
blob: c847ea3a7a368b79795317396d8c1f44bd26b9e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Account {
    pub id: i64,
    pub username: String,
    pub is_superuser: bool,
    pub password_change_required: bool,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Instance {
    pub id: i64,
    pub name: String,
    pub version: String,
    pub server_type: String,
    pub world_source: String,
    pub world_seed: Option<String>,
    pub level_type: String,
    pub has_modpack: bool,
    pub memory_mb: i32,
    pub difficulty: i32,
    pub gamemode: i32,
    pub max_players: i32,
    pub pvp: bool,
    pub motd: String,
    pub rcon_password: String,
    pub is_active: bool,
    pub created_at: String,
    pub updated_at: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Backup {
    pub id: i64,
    pub instance_id: i64,
    pub filename: String,
    pub created_at: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PlayerEntry {
    pub username: String,
}