115 lines
1.9 KiB
Rust
115 lines
1.9 KiB
Rust
use super::schema::api_kgon_games;
|
|
use beteran_common_rust as bcr;
|
|
|
|
///
|
|
#[derive(Eq, Hash, Identifiable, Queryable, PartialEq, Debug, Clone)]
|
|
#[table_name = "api_kgon_games"]
|
|
pub struct Game {
|
|
///
|
|
pub id: i64,
|
|
///
|
|
pub vendor_id: i64,
|
|
///
|
|
pub key: String,
|
|
///
|
|
pub names: String,
|
|
///
|
|
pub platform: String,
|
|
///
|
|
pub category: String,
|
|
///
|
|
pub game_type: String,
|
|
///
|
|
pub image: Option<String>,
|
|
///
|
|
pub created_at: i64,
|
|
///
|
|
pub updated_at: i64,
|
|
}
|
|
|
|
///
|
|
#[derive(Insertable, Debug, Clone)]
|
|
#[table_name = "api_kgon_games"]
|
|
pub struct NewGame {
|
|
///
|
|
pub id: i64,
|
|
///
|
|
pub vendor_id: i64,
|
|
///
|
|
pub key: String,
|
|
///
|
|
pub names: String,
|
|
///
|
|
pub platform: String,
|
|
///
|
|
pub category: String,
|
|
///
|
|
pub game_type: String,
|
|
///
|
|
pub image: Option<String>,
|
|
}
|
|
|
|
///
|
|
#[derive(AsChangeset, Debug, Clone)]
|
|
#[table_name = "api_kgon_games"]
|
|
pub struct ModifyGame {
|
|
///
|
|
pub key: String,
|
|
///
|
|
pub names: String,
|
|
///
|
|
pub platform: String,
|
|
///
|
|
pub category: String,
|
|
///
|
|
pub game_type: String,
|
|
///
|
|
pub image: Option<String>,
|
|
}
|
|
|
|
///
|
|
#[derive(Insertable, AsChangeset, Debug, Clone)]
|
|
#[table_name = "api_kgon_games"]
|
|
pub struct UpsertGame {
|
|
///
|
|
pub id: i64,
|
|
///
|
|
pub vendor_id: i64,
|
|
///
|
|
pub key: String,
|
|
///
|
|
pub names: String,
|
|
///
|
|
pub platform: String,
|
|
///
|
|
pub category: String,
|
|
///
|
|
pub game_type: String,
|
|
///
|
|
pub image: Option<String>,
|
|
}
|
|
|
|
///
|
|
#[derive(Debug, Clone)]
|
|
pub struct FindAllSearch {
|
|
///
|
|
pub vendor_id: Option<i64>,
|
|
///
|
|
pub key_like: Option<String>,
|
|
///
|
|
pub platform_like: Option<String>,
|
|
///
|
|
pub category_like: Option<String>,
|
|
///
|
|
pub game_type_like: Option<String>,
|
|
}
|
|
///
|
|
#[derive(Debug, Clone)]
|
|
pub struct FindAll {
|
|
pub search: Option<FindAllSearch>,
|
|
///
|
|
pub pagination: Option<bcr::models::pagination::Pagination>,
|
|
///
|
|
pub sorts: Option<Vec<bcr::models::pagination::Sort>>,
|
|
}
|