97 lines
1.6 KiB
Rust
97 lines
1.6 KiB
Rust
use super::schema::sites;
|
|
use beteran_common_rust as bcr;
|
|
|
|
///
|
|
#[derive(Eq, Hash, Identifiable, Queryable, PartialEq, PartialOrd, Debug, Clone)]
|
|
#[table_name = "sites"]
|
|
pub struct Site {
|
|
///
|
|
pub id: uuid::Uuid,
|
|
///
|
|
pub url: String,
|
|
///
|
|
pub name: Option<String>,
|
|
///
|
|
pub path: Option<String>,
|
|
///
|
|
pub show: bool,
|
|
///
|
|
pub can_use: bool,
|
|
///
|
|
pub memo: Option<String>,
|
|
///
|
|
pub expires_at: Option<i64>,
|
|
///
|
|
pub created_at: i64,
|
|
///
|
|
pub updated_at: i64,
|
|
}
|
|
|
|
///
|
|
#[derive(Insertable, Debug, Clone)]
|
|
#[table_name = "sites"]
|
|
pub struct NewSite {
|
|
///
|
|
pub url: String,
|
|
///
|
|
pub name: Option<String>,
|
|
///
|
|
pub path: Option<String>,
|
|
///
|
|
pub show: bool,
|
|
///
|
|
pub can_use: bool,
|
|
///
|
|
pub memo: Option<String>,
|
|
///
|
|
pub expires_at: Option<i64>,
|
|
}
|
|
|
|
///
|
|
#[derive(AsChangeset, Debug, Clone)]
|
|
#[table_name = "sites"]
|
|
pub struct ModifySite {
|
|
///
|
|
pub url: String,
|
|
///
|
|
pub name: Option<String>,
|
|
///
|
|
pub path: Option<String>,
|
|
///
|
|
pub show: bool,
|
|
///
|
|
pub can_use: bool,
|
|
///
|
|
pub memo: Option<String>,
|
|
///
|
|
pub expires_at: Option<i64>,
|
|
}
|
|
|
|
///
|
|
#[derive(Debug, Clone)]
|
|
pub struct FindAllSearch {
|
|
///
|
|
pub url_like: Option<String>,
|
|
///
|
|
pub name_like: Option<String>,
|
|
///
|
|
pub path_like: Option<String>,
|
|
///
|
|
pub show: Option<bool>,
|
|
///
|
|
pub can_use: Option<bool>,
|
|
///
|
|
pub memo_like: Option<String>,
|
|
}
|
|
|
|
///
|
|
#[derive(Debug, Clone)]
|
|
pub struct FindAll {
|
|
///
|
|
pub search: Option<FindAllSearch>,
|
|
///
|
|
pub pagination: Option<bcr::pagination::Pagination>,
|
|
///
|
|
pub sorts: Option<Vec<bcr::pagination::Sort>>,
|
|
}
|