You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
forum/src/db/objects.rs

43 lines
769 B
Rust

use serde::Serialize;
use uuid::Uuid;
#[derive(Serialize, Clone)]
pub struct Site {
pub uuid: Uuid,
pub title: String,
pub base_url: String,
pub theme: String,
pub boards: Vec<Board>,
}
#[derive(Serialize, Clone)]
pub struct Board {
pub uuid: Uuid,
pub title: String,
pub description: String,
pub threads: Vec<Thread>,
}
#[derive(Serialize, Clone)]
pub struct Thread {
pub uuid: Uuid,
pub title: String,
pub posts: Vec<Post>,
}
#[derive(Serialize, Clone)]
pub struct Post {
pub uuid: Uuid,
pub contents: String,
pub author: User,
}
#[derive(Serialize, Clone)]
pub struct User {
pub uuid: Uuid,
pub email: String,
pub username: String,
pub password_hash: String,
pub is_admin: bool,
}