data type of money is changed
This commit is contained in:
parent
bcf0c819ad
commit
605daab740
|
@ -36,7 +36,7 @@ tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
|
|||
tokio-cron-scheduler = { version = "0" }
|
||||
uuid = { version = "0", features = ["serde", "v4", "v5"] }
|
||||
|
||||
beteran-protobuf-rust = { git = "https://gitlab.loafle.net/bet/beteran-protobuf-rust.git", tag = "v0.1.83-snapshot" }
|
||||
beteran-common-rust = { git = "https://gitlab.loafle.net/bet/beteran-common-rust.git", tag = "v0.1.69-snapshot" }
|
||||
beteran-protobuf-rust = { git = "https://gitlab.loafle.net/bet/beteran-protobuf-rust.git", tag = "v0.1.84-snapshot" }
|
||||
beteran-common-rust = { git = "https://gitlab.loafle.net/bet/beteran-common-rust.git", tag = "v0.1.70-snapshot" }
|
||||
|
||||
[build-dependencies]
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
CREATE TABLE IF NOT EXISTS api_kgon_members (
|
||||
id BIGINT NOT NULL,
|
||||
balance BIGINT NOT NULL DEFAULT 0,
|
||||
balance_bota BIGINT NOT NULL DEFAULT 0,
|
||||
balance_sum BIGINT NOT NULL DEFAULT 0,
|
||||
companies BIGINT NOT NULL DEFAULT 0,
|
||||
balance DOUBLE PRECISION NOT NULL DEFAULT 0.00,
|
||||
balance_bota DOUBLE PRECISION NOT NULL DEFAULT 0.00,
|
||||
balance_sum DOUBLE PRECISION NOT NULL DEFAULT 0.00,
|
||||
companies TEXT,
|
||||
oriental_play CHAR(1) NOT NULL DEFAULT 'n',
|
||||
member_id UUID NOT NULL,
|
||||
created_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
CREATE TABLE IF NOT EXISTS api_kgon_balances (
|
||||
id SERIAL PRIMARY KEY,
|
||||
balance BIGINT NOT NULL DEFAULT 0,
|
||||
balance_bota BIGINT NOT NULL DEFAULT 0,
|
||||
balance DOUBLE PRECISION NOT NULL DEFAULT 0.00,
|
||||
balance_bota DOUBLE PRECISION NOT NULL DEFAULT 0.00,
|
||||
created_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000),
|
||||
updated_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000)
|
||||
);
|
||||
|
|
|
@ -2,8 +2,8 @@ CREATE TABLE IF NOT EXISTS api_kgon_vendors (
|
|||
id BIGINT NOT NULL,
|
||||
company_id BIGINT NOT NULL,
|
||||
vendor_id BIGINT NOT NULL,
|
||||
max_bet_casino BIGINT NOT NULL,
|
||||
max_bet_slot BIGINT NOT NULL,
|
||||
max_bet_casino DOUBLE PRECISION NOT NULL DEFAULT 0.00,
|
||||
max_bet_slot DOUBLE PRECISION NOT NULL DEFAULT 0.00,
|
||||
is_enable CHAR(1) NOT NULL,
|
||||
bet_count BIGINT NOT NULL,
|
||||
key TEXT NOT NULL,
|
||||
|
|
|
@ -144,7 +144,7 @@ impl Api {
|
|||
|
||||
let user_id = r.user_id.unwrap_or(0);
|
||||
let url = r.url.unwrap_or("".to_string());
|
||||
let balance = r.balance.unwrap_or(0);
|
||||
let balance = r.balance.unwrap_or(0.00);
|
||||
|
||||
Ok(models::GetGameUrlResponse {
|
||||
user_id,
|
||||
|
|
|
@ -36,7 +36,7 @@ pub struct GetGameUrlRequest {
|
|||
pub nickname: String,
|
||||
pub site_username: String,
|
||||
pub group_key: Option<String>,
|
||||
pub amount: i64,
|
||||
pub amount: f64,
|
||||
pub request_key: Option<String>,
|
||||
}
|
||||
|
||||
|
@ -47,12 +47,12 @@ pub struct _GetGameUrlResponse {
|
|||
#[serde(rename = "userId")]
|
||||
pub user_id: Option<i64>,
|
||||
pub url: Option<String>,
|
||||
pub balance: Option<i64>,
|
||||
pub balance: Option<f64>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct GetGameUrlResponse {
|
||||
pub user_id: i64,
|
||||
pub url: String,
|
||||
pub balance: i64,
|
||||
pub balance: f64,
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@ pub struct ListMembersRequest {
|
|||
pub struct Member {
|
||||
pub id: i64,
|
||||
pub username: String,
|
||||
pub cash: i64,
|
||||
pub cash_bota: i64,
|
||||
pub cash: f64,
|
||||
pub cash_bota: f64,
|
||||
pub nickname: String,
|
||||
pub site_username: String,
|
||||
pub group_key: Option<String>,
|
||||
|
|
|
@ -66,10 +66,10 @@ impl Api {
|
|||
});
|
||||
}
|
||||
|
||||
let balance = r.balance.unwrap_or(0);
|
||||
let balance_bota = r.balance_bota.unwrap_or(0);
|
||||
let balance_sum = r.balance_sum.unwrap_or(0);
|
||||
let companies = r.companies.unwrap_or(0);
|
||||
let balance = r.balance.unwrap_or(0.00);
|
||||
let balance_bota = r.balance_bota.unwrap_or(0.00);
|
||||
let balance_sum = r.balance_sum.unwrap_or(0.00);
|
||||
let companies = r.companies.unwrap_or("".to_string());
|
||||
|
||||
Ok(models::GetBalanceForUserResponse {
|
||||
balance,
|
||||
|
@ -127,8 +127,8 @@ impl Api {
|
|||
});
|
||||
}
|
||||
|
||||
let balance = r.balance.unwrap_or(0);
|
||||
let balance_bota = r.balance_bota.unwrap_or(0);
|
||||
let balance = r.balance.unwrap_or(0.00);
|
||||
let balance_bota = r.balance_bota.unwrap_or(0.00);
|
||||
|
||||
Ok(models::GetBalanceForPartnerResponse {
|
||||
balance,
|
||||
|
@ -196,7 +196,7 @@ impl Api {
|
|||
});
|
||||
}
|
||||
|
||||
let balance = r.balance.unwrap_or(0);
|
||||
let balance = r.balance.unwrap_or(0.00);
|
||||
|
||||
Ok(models::CreateDepositResponse { balance })
|
||||
}
|
||||
|
@ -257,10 +257,10 @@ impl Api {
|
|||
});
|
||||
}
|
||||
|
||||
let balance = r.balance.unwrap_or(0);
|
||||
let balance_cash = r.balance_cash.unwrap_or(0);
|
||||
let balance_cash_bota = r.balance_cash_bota.unwrap_or(0);
|
||||
let amount = r.amount.unwrap_or(0);
|
||||
let balance = r.balance.unwrap_or(0.00);
|
||||
let balance_cash = r.balance_cash.unwrap_or(0.00);
|
||||
let balance_cash_bota = r.balance_cash_bota.unwrap_or(0.00);
|
||||
let amount = r.amount.unwrap_or(0.00);
|
||||
|
||||
Ok(models::CreateWithdrawResponse {
|
||||
balance,
|
||||
|
|
|
@ -8,22 +8,22 @@ pub struct GetBalanceForUserRequest {
|
|||
pub struct _GetBalanceForUserResponse {
|
||||
pub code: i64,
|
||||
pub msg: Option<String>,
|
||||
pub balance: Option<i64>,
|
||||
pub balance: Option<f64>,
|
||||
#[serde(rename = "balanceBota")]
|
||||
pub balance_bota: Option<i64>,
|
||||
pub balance_bota: Option<f64>,
|
||||
#[serde(rename = "balanceSum")]
|
||||
pub balance_sum: Option<i64>,
|
||||
pub companies: Option<i64>,
|
||||
pub balance_sum: Option<f64>,
|
||||
pub companies: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct GetBalanceForUserResponse {
|
||||
pub balance: i64,
|
||||
pub balance: f64,
|
||||
#[serde(rename = "balanceBota")]
|
||||
pub balance_bota: i64,
|
||||
pub balance_bota: f64,
|
||||
#[serde(rename = "balanceSum")]
|
||||
pub balance_sum: i64,
|
||||
pub companies: i64,
|
||||
pub balance_sum: f64,
|
||||
pub companies: String,
|
||||
}
|
||||
|
||||
pub struct GetBalanceForPartnerRequest {}
|
||||
|
@ -32,22 +32,22 @@ pub struct GetBalanceForPartnerRequest {}
|
|||
pub struct _GetBalanceForPartnerResponse {
|
||||
pub code: i64,
|
||||
pub msg: Option<String>,
|
||||
pub balance: Option<i64>,
|
||||
pub balance: Option<f64>,
|
||||
#[serde(rename = "balanceBota")]
|
||||
pub balance_bota: Option<i64>,
|
||||
pub balance_bota: Option<f64>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct GetBalanceForPartnerResponse {
|
||||
pub balance: i64,
|
||||
pub balance: f64,
|
||||
#[serde(rename = "balanceBota")]
|
||||
pub balance_bota: i64,
|
||||
pub balance_bota: f64,
|
||||
}
|
||||
|
||||
pub struct CreateDepositRequest {
|
||||
pub username: String,
|
||||
pub cash_type: Option<String>,
|
||||
pub amount: i64,
|
||||
pub amount: f64,
|
||||
pub request_key: Option<String>,
|
||||
}
|
||||
|
||||
|
@ -55,12 +55,12 @@ pub struct CreateDepositRequest {
|
|||
pub struct _CreateDepositResponse {
|
||||
pub code: i64,
|
||||
pub msg: Option<String>,
|
||||
pub balance: Option<i64>,
|
||||
pub balance: Option<f64>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct CreateDepositResponse {
|
||||
pub balance: i64,
|
||||
pub balance: f64,
|
||||
}
|
||||
|
||||
pub struct CreateWithdrawRequest {
|
||||
|
@ -72,16 +72,16 @@ pub struct CreateWithdrawRequest {
|
|||
pub struct _CreateWithdrawResponse {
|
||||
pub code: i64,
|
||||
pub msg: Option<String>,
|
||||
pub balance: Option<i64>,
|
||||
pub balance_cash: Option<i64>,
|
||||
pub balance_cash_bota: Option<i64>,
|
||||
pub amount: Option<i64>,
|
||||
pub balance: Option<f64>,
|
||||
pub balance_cash: Option<f64>,
|
||||
pub balance_cash_bota: Option<f64>,
|
||||
pub amount: Option<f64>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct CreateWithdrawResponse {
|
||||
pub balance: i64,
|
||||
pub balance_cash: i64,
|
||||
pub balance_cash_bota: i64,
|
||||
pub amount: i64,
|
||||
pub balance: f64,
|
||||
pub balance_cash: f64,
|
||||
pub balance_cash_bota: f64,
|
||||
pub amount: f64,
|
||||
}
|
||||
|
|
4
src/api/vendor/models.rs
vendored
4
src/api/vendor/models.rs
vendored
|
@ -5,8 +5,8 @@ pub struct Vendor {
|
|||
pub id: i64,
|
||||
pub company_id: i64,
|
||||
pub vendor_id: i64,
|
||||
pub max_bet_casino: i64,
|
||||
pub max_bet_slot: i64,
|
||||
pub max_bet_casino: f64,
|
||||
pub max_bet_slot: f64,
|
||||
pub is_enable: String,
|
||||
pub bet_count: i64,
|
||||
pub key: String,
|
||||
|
|
|
@ -6,13 +6,13 @@ pub struct MemberModel {
|
|||
///
|
||||
pub id: i64,
|
||||
///
|
||||
pub balance: i64,
|
||||
pub balance: f64,
|
||||
///
|
||||
pub balance_bota: i64,
|
||||
pub balance_bota: f64,
|
||||
///
|
||||
pub balance_sum: i64,
|
||||
pub balance_sum: f64,
|
||||
///
|
||||
pub companies: i64,
|
||||
pub companies: String,
|
||||
///
|
||||
pub oriental_play: String,
|
||||
///
|
||||
|
|
|
@ -171,7 +171,7 @@ impl EventHandler {
|
|||
self.member_account_api.create_deposit(api::member_account::models::CreateDepositRequest{
|
||||
username: member.username.clone(),
|
||||
cash_type: None,
|
||||
amount: member_bank_deposit.amount as i64,
|
||||
amount: member_bank_deposit.amount,
|
||||
request_key: None,
|
||||
}).await
|
||||
.map_err(|e| {
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
use super::schema::api_kgon_balances;
|
||||
|
||||
///
|
||||
#[derive(Eq, Hash, Identifiable, Queryable, PartialEq, Debug, Clone)]
|
||||
#[derive(Identifiable, Queryable, PartialEq, Debug, Clone)]
|
||||
#[table_name = "api_kgon_balances"]
|
||||
pub struct Balance {
|
||||
///
|
||||
pub id: i32,
|
||||
///
|
||||
pub balance: i64,
|
||||
pub balance: f64,
|
||||
///
|
||||
pub balance_bota: i64,
|
||||
pub balance_bota: f64,
|
||||
///
|
||||
pub created_at: i64,
|
||||
///
|
||||
|
@ -21,9 +21,9 @@ pub struct Balance {
|
|||
#[table_name = "api_kgon_balances"]
|
||||
pub struct NewBalance {
|
||||
///
|
||||
pub balance: i64,
|
||||
pub balance: f64,
|
||||
///
|
||||
pub balance_bota: i64,
|
||||
pub balance_bota: f64,
|
||||
}
|
||||
|
||||
///
|
||||
|
@ -31,7 +31,7 @@ pub struct NewBalance {
|
|||
#[table_name = "api_kgon_balances"]
|
||||
pub struct ModifyBalance {
|
||||
///
|
||||
pub balance: i64,
|
||||
pub balance: f64,
|
||||
///
|
||||
pub balance_bota: i64,
|
||||
pub balance_bota: f64,
|
||||
}
|
||||
|
|
|
@ -7,9 +7,9 @@ table! {
|
|||
///
|
||||
id -> Integer,
|
||||
///
|
||||
balance -> BigInt,
|
||||
balance -> Double,
|
||||
///
|
||||
balance_bota -> BigInt,
|
||||
balance_bota -> Double,
|
||||
///
|
||||
created_at -> BigInt,
|
||||
///
|
||||
|
|
|
@ -2,19 +2,19 @@ use super::schema::api_kgon_members;
|
|||
use beteran_common_rust as bcr;
|
||||
|
||||
///
|
||||
#[derive(Eq, Hash, Identifiable, Queryable, PartialEq, Debug, Clone)]
|
||||
#[derive(Identifiable, Queryable, PartialEq, Debug, Clone)]
|
||||
#[table_name = "api_kgon_members"]
|
||||
pub struct Member {
|
||||
///
|
||||
pub id: i64,
|
||||
///
|
||||
pub balance: i64,
|
||||
pub balance: f64,
|
||||
///
|
||||
pub balance_bota: i64,
|
||||
pub balance_bota: f64,
|
||||
///
|
||||
pub balance_sum: i64,
|
||||
pub balance_sum: f64,
|
||||
///
|
||||
pub companies: i64,
|
||||
pub companies: String,
|
||||
///
|
||||
pub oriental_play: String,
|
||||
///
|
||||
|
@ -40,9 +40,9 @@ pub struct NewMember {
|
|||
#[table_name = "api_kgon_members"]
|
||||
pub struct ModifyMember {
|
||||
///
|
||||
pub balance: i64,
|
||||
pub balance: f64,
|
||||
///
|
||||
pub balance_bota: i64,
|
||||
pub balance_bota: f64,
|
||||
///
|
||||
pub oriental_play: String,
|
||||
}
|
||||
|
@ -52,13 +52,13 @@ pub struct ModifyMember {
|
|||
#[table_name = "api_kgon_members"]
|
||||
pub struct ModifyMemberForBalance {
|
||||
///
|
||||
pub balance: i64,
|
||||
pub balance: f64,
|
||||
///
|
||||
pub balance_bota: i64,
|
||||
pub balance_bota: f64,
|
||||
///
|
||||
pub balance_sum: i64,
|
||||
pub balance_sum: f64,
|
||||
///
|
||||
pub companies: i64,
|
||||
pub companies: String,
|
||||
}
|
||||
|
||||
///
|
||||
|
|
|
@ -7,13 +7,13 @@ table! {
|
|||
///
|
||||
id -> BigInt,
|
||||
///
|
||||
balance -> BigInt,
|
||||
balance -> Double,
|
||||
///
|
||||
balance_bota -> BigInt,
|
||||
balance_bota -> Double,
|
||||
///
|
||||
balance_sum -> BigInt,
|
||||
balance_sum -> Double,
|
||||
///
|
||||
companies -> BigInt,
|
||||
companies -> Text,
|
||||
///
|
||||
oriental_play -> Text,
|
||||
///
|
||||
|
|
18
src/repositories/vendor/models.rs
vendored
18
src/repositories/vendor/models.rs
vendored
|
@ -2,7 +2,7 @@ use super::schema::api_kgon_vendors;
|
|||
use beteran_common_rust as bcr;
|
||||
|
||||
///
|
||||
#[derive(Eq, Hash, Identifiable, Queryable, PartialEq, Debug, Clone)]
|
||||
#[derive(Identifiable, Queryable, PartialEq, Debug, Clone)]
|
||||
#[table_name = "api_kgon_vendors"]
|
||||
pub struct Vendor {
|
||||
///
|
||||
|
@ -18,9 +18,9 @@ pub struct Vendor {
|
|||
///
|
||||
pub category: String,
|
||||
///
|
||||
pub max_bet_casino: i64,
|
||||
pub max_bet_casino: f64,
|
||||
///
|
||||
pub max_bet_slot: i64,
|
||||
pub max_bet_slot: f64,
|
||||
///
|
||||
pub is_enable: String,
|
||||
///
|
||||
|
@ -48,9 +48,9 @@ pub struct NewVendor {
|
|||
///
|
||||
pub category: String,
|
||||
///
|
||||
pub max_bet_casino: i64,
|
||||
pub max_bet_casino: f64,
|
||||
///
|
||||
pub max_bet_slot: i64,
|
||||
pub max_bet_slot: f64,
|
||||
///
|
||||
pub is_enable: String,
|
||||
///
|
||||
|
@ -72,9 +72,9 @@ pub struct ModifyVendor {
|
|||
///
|
||||
pub category: String,
|
||||
///
|
||||
pub max_bet_casino: i64,
|
||||
pub max_bet_casino: f64,
|
||||
///
|
||||
pub max_bet_slot: i64,
|
||||
pub max_bet_slot: f64,
|
||||
///
|
||||
pub is_enable: String,
|
||||
///
|
||||
|
@ -98,9 +98,9 @@ pub struct UpsertVendor {
|
|||
///
|
||||
pub category: String,
|
||||
///
|
||||
pub max_bet_casino: i64,
|
||||
pub max_bet_casino: f64,
|
||||
///
|
||||
pub max_bet_slot: i64,
|
||||
pub max_bet_slot: f64,
|
||||
///
|
||||
pub is_enable: String,
|
||||
///
|
||||
|
|
4
src/repositories/vendor/schema.rs
vendored
4
src/repositories/vendor/schema.rs
vendored
|
@ -17,9 +17,9 @@ table! {
|
|||
///
|
||||
category -> Text,
|
||||
///
|
||||
max_bet_casino -> BigInt,
|
||||
max_bet_casino -> Double,
|
||||
///
|
||||
max_bet_slot -> BigInt,
|
||||
max_bet_slot -> Double,
|
||||
///
|
||||
is_enable -> Text,
|
||||
///
|
||||
|
|
|
@ -302,7 +302,7 @@ impl Service {
|
|||
|
||||
Some(bpr::ss::api::game::get_game_url_response::Result {
|
||||
user_id: res.user_id as u64,
|
||||
balance: res.balance as u64,
|
||||
balance: res.balance,
|
||||
url: res.url,
|
||||
})
|
||||
}
|
||||
|
|
4
src/services/vendor/models.rs
vendored
4
src/services/vendor/models.rs
vendored
|
@ -10,8 +10,8 @@ impl From<&repositories::vendor::models::Vendor> for bpr::models::api::vendor::V
|
|||
vendor_id: d.vendor_id as u64,
|
||||
key: d.key.clone(),
|
||||
category: d.category.clone(),
|
||||
max_bet_casino: d.max_bet_casino as u64,
|
||||
max_bet_slot: d.max_bet_slot as u64,
|
||||
max_bet_casino: d.max_bet_casino,
|
||||
max_bet_slot: d.max_bet_slot,
|
||||
is_enable: d.is_enable.clone(),
|
||||
bet_count: d.bet_count as u64,
|
||||
created_at: d.created_at as u64,
|
||||
|
|
Loading…
Reference in New Issue
Block a user