167 lines
3.7 KiB
Rust
167 lines
3.7 KiB
Rust
use beteran_common_rust as bcr;
|
|
use diesel::deserialize::QueryableByName;
|
|
|
|
///
|
|
#[derive(PartialEq, Debug, Clone)]
|
|
pub struct BettingHistoryModel {
|
|
///
|
|
pub id: String,
|
|
///
|
|
pub vendor_id: i64,
|
|
///
|
|
pub vendor_name: String,
|
|
///
|
|
pub game_id: i64,
|
|
///
|
|
pub game_name: String,
|
|
///
|
|
pub game_category: String,
|
|
///
|
|
pub game_type: String,
|
|
///
|
|
pub currency: String,
|
|
///
|
|
pub cash: f64,
|
|
///
|
|
pub before_cash: f64,
|
|
///
|
|
pub after_cash: f64,
|
|
///
|
|
pub group_key: Option<String>,
|
|
///
|
|
pub detail: Option<String>,
|
|
///
|
|
pub is_bonus: bool,
|
|
///
|
|
pub is_promo: bool,
|
|
///
|
|
pub is_jackpot: bool,
|
|
///
|
|
pub site_username: String,
|
|
///
|
|
pub key: String,
|
|
///
|
|
pub ref_id: String,
|
|
///
|
|
pub o_ref_id: String,
|
|
///
|
|
pub betting_type: String,
|
|
///
|
|
pub category: String,
|
|
///
|
|
pub created_at: i64,
|
|
///
|
|
pub utc_created_at: i64,
|
|
}
|
|
|
|
impl QueryableByName<diesel::pg::Pg> for BettingHistoryModel {
|
|
fn build<R: diesel::row::NamedRow<diesel::pg::Pg>>(row: &R) -> diesel::deserialize::Result<Self> {
|
|
Ok(BettingHistoryModel {
|
|
id: row.get("akbh_id")?,
|
|
vendor_id: row.get("akbh_vendor_id")?,
|
|
vendor_name: row.get("akbh_vendor_name")?,
|
|
game_id: row.get("akbh_game_id")?,
|
|
game_name: row.get("akbh_game_name")?,
|
|
game_category: row.get("akbh_game_category")?,
|
|
game_type: row.get("akbh_game_type")?,
|
|
currency: row.get("akbh_currency")?,
|
|
cash: row.get("akbh_cash")?,
|
|
before_cash: row.get("akbh_before_cash")?,
|
|
after_cash: row.get("akbh_after_cash")?,
|
|
group_key: row.get("akbh_group_key")?,
|
|
detail: row.get("akbh_detail")?,
|
|
is_bonus: row.get("akbh_is_bonus")?,
|
|
is_promo: row.get("akbh_is_promo")?,
|
|
is_jackpot: row.get("akbh_is_jackpot")?,
|
|
site_username: row.get("akbh_site_username")?,
|
|
key: row.get("akbh_key")?,
|
|
ref_id: row.get("akbh_ref_id")?,
|
|
o_ref_id: row.get("akbh_o_ref_id")?,
|
|
betting_type: row.get("akbh_betting_type")?,
|
|
category: row.get("akbh_category")?,
|
|
created_at: row.get("akbh_created_at")?,
|
|
utc_created_at: row.get("akbh_utc_created_at")?,
|
|
})
|
|
}
|
|
}
|
|
|
|
///
|
|
#[derive(Debug, Clone)]
|
|
pub struct FindAllSearch {
|
|
///
|
|
pub member_id: Option<String>,
|
|
///
|
|
pub vendor_id: Option<i64>,
|
|
///
|
|
pub vendor_ids: Vec<i64>,
|
|
///
|
|
pub vendor_name: Option<String>,
|
|
///
|
|
pub vendor_name_like: Option<String>,
|
|
///
|
|
pub game_id: Option<i64>,
|
|
///
|
|
pub game_ids: Vec<i64>,
|
|
///
|
|
pub game_name: Option<String>,
|
|
///
|
|
pub game_name_like: Option<String>,
|
|
///
|
|
pub game_category: Option<String>,
|
|
///
|
|
pub game_category_like: Option<String>,
|
|
///
|
|
pub game_type: Option<String>,
|
|
///
|
|
pub game_type_like: Option<String>,
|
|
///
|
|
pub currency: Option<String>,
|
|
///
|
|
pub currency_like: Option<String>,
|
|
///
|
|
pub key: Option<String>,
|
|
///
|
|
pub key_like: Option<String>,
|
|
///
|
|
pub ref_id: Option<String>,
|
|
///
|
|
pub ref_id_like: Option<String>,
|
|
///
|
|
pub o_ref_id: Option<String>,
|
|
///
|
|
pub o_ref_id_like: Option<String>,
|
|
///
|
|
pub group_key: Option<String>,
|
|
///
|
|
pub group_key_like: Option<String>,
|
|
///
|
|
pub is_bonus: Option<bool>,
|
|
///
|
|
pub is_promo: Option<bool>,
|
|
///
|
|
pub is_jackpot: Option<bool>,
|
|
///
|
|
pub site_username: Option<String>,
|
|
///
|
|
pub site_username_like: Option<String>,
|
|
///
|
|
pub betting_type: Option<String>,
|
|
///
|
|
pub betting_type_like: Option<String>,
|
|
///
|
|
pub category: Option<String>,
|
|
///
|
|
pub category_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>>,
|
|
}
|
|
|
|
/////////////////////////////// temparary definitions ///////////////////////////////////////////
|