diff --git a/migrations/202208051000_api_kgon_synchronization/up.sql b/migrations/202208051000_api_kgon_synchronization/up.sql index 91e87c5..ee53c7b 100644 --- a/migrations/202208051000_api_kgon_synchronization/up.sql +++ b/migrations/202208051000_api_kgon_synchronization/up.sql @@ -1,7 +1,7 @@ CREATE TABLE IF NOT EXISTS api_kgon_synchronizations ( id SERIAL PRIMARY KEY, item TEXT NOT NULL, - last_code INTEGER NOT NULL, + last_code BIGINT NOT NULL, synchronized_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000) ); diff --git a/migrations/202208051010_api_kgon_synchronization_history/up.sql b/migrations/202208051010_api_kgon_synchronization_history/up.sql index 85212a9..f1c7d99 100644 --- a/migrations/202208051010_api_kgon_synchronization_history/up.sql +++ b/migrations/202208051010_api_kgon_synchronization_history/up.sql @@ -3,7 +3,7 @@ CREATE TABLE IF NOT EXISTS api_kgon_synchronization_history ( item TEXT NOT NULL, start_at BIGINT NOT NULL, complete_at BIGINT NOT NULL, - code INTEGER NOT NULL, + code BIGINT NOT NULL, message TEXT, created_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000) ); diff --git a/migrations/202208051200_api_kgon_member/up.sql b/migrations/202208051200_api_kgon_member/up.sql index a62a6dc..35fe26c 100644 --- a/migrations/202208051200_api_kgon_member/up.sql +++ b/migrations/202208051200_api_kgon_member/up.sql @@ -1,9 +1,9 @@ CREATE TABLE IF NOT EXISTS api_kgon_members ( - id INTEGER NOT NULL, - balance INTEGER NOT NULL DEFAULT 0, - balance_bota INTEGER NOT NULL DEFAULT 0, - balance_sum INTEGER NOT NULL DEFAULT 0, - companies INTEGER NOT NULL DEFAULT 0, + 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, oriental_play BOOLEAN NOT NULL DEFAULT FALSE, member_id UUID NOT NULL, created_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000), diff --git a/migrations/202208051400_api_kgon_balance/up.sql b/migrations/202208051400_api_kgon_balance/up.sql index a656525..14fa1d3 100644 --- a/migrations/202208051400_api_kgon_balance/up.sql +++ b/migrations/202208051400_api_kgon_balance/up.sql @@ -1,7 +1,7 @@ CREATE TABLE IF NOT EXISTS api_kgon_balances ( id SERIAL PRIMARY KEY, - balance INTEGER NOT NULL DEFAULT 0, - balance_bota INTEGER NOT NULL DEFAULT 0, + balance BIGINT NOT NULL DEFAULT 0, + balance_bota BIGINT NOT NULL DEFAULT 0, created_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000), updated_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000) ); diff --git a/migrations/202208061200_api_kgon_vendor/up.sql b/migrations/202208061200_api_kgon_vendor/up.sql index 317d0f9..4be6ecd 100644 --- a/migrations/202208061200_api_kgon_vendor/up.sql +++ b/migrations/202208061200_api_kgon_vendor/up.sql @@ -1,11 +1,11 @@ CREATE TABLE IF NOT EXISTS api_kgon_vendors ( - id INTEGER NOT NULL, - company_id INTEGER NOT NULL, - vendor_id INTEGER NOT NULL, - max_bet_casino INTEGER NOT NULL, - max_bet_slot INTEGER NOT NULL, + 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, is_enable CHAR(1) NOT NULL, - bet_count INTEGER NOT NULL, + bet_count BIGINT NOT NULL, key TEXT NOT NULL, name TEXT NOT NULL, category TEXT NOT NULL, diff --git a/migrations/202208061300_api_kgon_game/up.sql b/migrations/202208061300_api_kgon_game/up.sql index 27dfd26..57aa603 100644 --- a/migrations/202208061300_api_kgon_game/up.sql +++ b/migrations/202208061300_api_kgon_game/up.sql @@ -1,6 +1,6 @@ CREATE TABLE IF NOT EXISTS api_kgon_games ( - id INTEGER NOT NULL, - vendor_id INTEGER NOT NULL, + id BIGINT NOT NULL, + vendor_id BIGINT NOT NULL, key TEXT NOT NULL, names TEXT NOT NULL, platform TEXT NOT NULL, diff --git a/src/api/betting/models.rs b/src/api/betting/models.rs index 529e9b9..0320047 100644 --- a/src/api/betting/models.rs +++ b/src/api/betting/models.rs @@ -1,7 +1,7 @@ use serde::{Deserialize, Serialize}; pub struct Error { - pub code: i32, + pub code: i64, pub msg: Option, } @@ -11,12 +11,12 @@ pub struct FindTransactionsRequest { pub edate: Option, pub group_key: Option, pub username: Option, - pub limit: i32, + pub limit: i64, } #[derive(Serialize, Deserialize, Debug)] pub struct FindTransactionsResponse { - pub code: i32, + pub code: i64, pub msg: Option, pub transactions: Vec, } @@ -27,7 +27,7 @@ pub struct FindPragmaticHistoryRequest { #[derive(Serialize, Deserialize, Debug)] pub struct FindPragmaticHistoryResponse { - pub code: i32, + pub code: i64, pub msg: Option, pub url: Option, } @@ -38,7 +38,7 @@ pub struct FindEvolutionTransactionDetailRequest { #[derive(Serialize, Deserialize, Debug)] pub struct FindEvolutionTransactionDetailResponse { - pub code: i32, + pub code: i64, pub msg: Option, pub transactions: Vec, } @@ -51,7 +51,7 @@ pub struct FindStatisticRequest { #[derive(Serialize, Deserialize, Debug)] pub struct FindStatisticResponse { - pub code: i32, + pub code: i64, pub msg: Option, pub data: Option, } diff --git a/src/api/core/models.rs b/src/api/core/models.rs index 88344c1..e1ece92 100644 --- a/src/api/core/models.rs +++ b/src/api/core/models.rs @@ -1,5 +1,5 @@ #[derive(Debug)] pub struct Error { - pub code: i32, + pub code: i64, pub msg: Option, } diff --git a/src/api/game/models.rs b/src/api/game/models.rs index 9a5e4f7..74a9125 100644 --- a/src/api/game/models.rs +++ b/src/api/game/models.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; #[derive(Serialize, Deserialize, Debug)] pub struct Game { - pub id: i32, + pub id: i64, pub key: String, pub names: HashMap, pub platform: String, @@ -19,7 +19,7 @@ pub struct ListGamesRequest { #[derive(Serialize, Deserialize, Debug)] pub struct _ListGamesResponse { - pub code: i32, + pub code: i64, pub msg: Option, pub games: Vec, } @@ -36,23 +36,23 @@ pub struct PlayRequest { pub nickname: String, pub site_username: String, pub group_key: Option, - pub amount: i32, + pub amount: i64, pub request_key: Option, } #[derive(Serialize, Deserialize, Debug)] pub struct _PlayResponse { - pub code: i32, + pub code: i64, pub msg: Option, #[serde(rename = "userId")] pub user_id: String, pub url: String, - pub balance: i32, + pub balance: i64, } #[derive(Debug)] pub struct PlayResponse { pub user_id: String, pub url: String, - pub balance: i32, + pub balance: i64, } diff --git a/src/api/member/models.rs b/src/api/member/models.rs index ad42968..5deb137 100644 --- a/src/api/member/models.rs +++ b/src/api/member/models.rs @@ -7,10 +7,10 @@ pub struct ListMembersRequest { #[derive(Serialize, Deserialize, Debug)] pub struct Member { - pub id: i32, + pub id: i64, pub username: String, - pub cash: i32, - pub cash_bota: i32, + pub cash: i64, + pub cash_bota: i64, pub nickname: String, pub site_username: String, pub group_key: Option, @@ -19,7 +19,7 @@ pub struct Member { #[derive(Serialize, Deserialize, Debug)] pub struct _ListMembersResponse { - pub code: i32, + pub code: i64, pub msg: Option, pub users: Vec, } @@ -39,7 +39,7 @@ pub struct SaveMemberRequest { #[derive(Serialize, Deserialize, Debug)] pub struct SaveMemberResponse { - pub code: i32, + pub code: i64, pub msg: Option, - pub id: Option, + pub id: Option, } diff --git a/src/api/member_account/models.rs b/src/api/member_account/models.rs index 7e388d4..bd2fadc 100644 --- a/src/api/member_account/models.rs +++ b/src/api/member_account/models.rs @@ -6,50 +6,50 @@ pub struct GetBalanceForUserRequest { #[derive(Serialize, Deserialize, Debug)] pub struct _GetBalanceForUserResponse { - pub code: i32, + pub code: i64, pub msg: Option, - pub balance: i32, - pub balance_bota: i32, - pub balance_sum: i32, - pub companies: i32, + pub balance: i64, + pub balance_bota: i64, + pub balance_sum: i64, + pub companies: i64, } #[derive(Serialize, Deserialize, Debug)] pub struct GetBalanceForUserResponse { - pub balance: i32, - pub balance_bota: i32, - pub balance_sum: i32, - pub companies: i32, + pub balance: i64, + pub balance_bota: i64, + pub balance_sum: i64, + pub companies: i64, } pub struct GetBalanceForPartnerRequest {} #[derive(Serialize, Deserialize, Debug)] pub struct _GetBalanceForPartnerResponse { - pub code: i32, + pub code: i64, pub msg: Option, - pub balance: i32, - pub balance_bota: i32, + pub balance: i64, + pub balance_bota: i64, } #[derive(Serialize, Deserialize, Debug)] pub struct GetBalanceForPartnerResponse { - pub balance: i32, - pub balance_bota: i32, + pub balance: i64, + pub balance_bota: i64, } pub struct SaveDepositRequest { pub username: String, pub cash_type: Option, - pub amount: i32, + pub amount: i64, pub request_key: Option, } #[derive(Serialize, Deserialize, Debug)] pub struct SaveDepositResponse { - pub code: i32, + pub code: i64, pub msg: Option, - pub balance: i32, + pub balance: i64, } pub struct SaveWithdrawRequest { @@ -59,10 +59,10 @@ pub struct SaveWithdrawRequest { #[derive(Serialize, Deserialize, Debug)] pub struct SaveWithdrawResponse { - pub code: i32, + pub code: i64, pub msg: Option, - pub balance: i32, - pub balance_cash: i32, - pub balance_cash_bota: i32, - pub amount: i32, + pub balance: i64, + pub balance_cash: i64, + pub balance_cash_bota: i64, + pub amount: i64, } diff --git a/src/api/vendor/models.rs b/src/api/vendor/models.rs index 8ddedb1..bc918eb 100644 --- a/src/api/vendor/models.rs +++ b/src/api/vendor/models.rs @@ -2,13 +2,13 @@ use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug)] pub struct Vendor { - pub id: i32, - pub company_id: i32, - pub vendor_id: i32, - pub max_bet_casino: i32, - pub max_bet_slot: i32, + pub id: i64, + pub company_id: i64, + pub vendor_id: i64, + pub max_bet_casino: i64, + pub max_bet_slot: i64, pub is_enable: String, - pub bet_count: i32, + pub bet_count: i64, pub key: String, pub name: String, pub category: String, @@ -18,7 +18,7 @@ pub struct ListVendorsRequest {} #[derive(Serialize, Deserialize, Debug)] pub struct _ListVendorsResponse { - pub code: i32, + pub code: i64, pub msg: Option, pub vendors: Vec, } diff --git a/src/main.rs b/src/main.rs index ef5e94f..2f9bde1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -87,30 +87,30 @@ async fn main() -> Result<(), Box> { let mut sched = tokio_cron_scheduler::JobScheduler::new().await?; - let member_scheduler = schedulers::member::scheduler::Scheduler::get_instance( - pool.clone(), - sched.clone(), - api_config.clone(), - )?; - member_scheduler.queue().await?; - let balance_scheduler = schedulers::balance::scheduler::Scheduler::get_instance( - pool.clone(), - sched.clone(), - api_config.clone(), - )?; - balance_scheduler.queue().await?; + // let member_scheduler = schedulers::member::scheduler::Scheduler::get_instance( + // pool.clone(), + // sched.clone(), + // api_config.clone(), + // )?; + // member_scheduler.queue().await?; + // let balance_scheduler = schedulers::balance::scheduler::Scheduler::get_instance( + // pool.clone(), + // sched.clone(), + // api_config.clone(), + // )?; + // balance_scheduler.queue().await?; let vendor_scheduler = schedulers::vendor::scheduler::Scheduler::get_instance( pool.clone(), sched.clone(), api_config.clone(), )?; vendor_scheduler.queue().await?; - let game_scheduler = schedulers::game::scheduler::Scheduler::get_instance( - pool.clone(), - sched.clone(), - api_config.clone(), - )?; - game_scheduler.queue().await?; + // let game_scheduler = schedulers::game::scheduler::Scheduler::get_instance( + // pool.clone(), + // sched.clone(), + // api_config.clone(), + // )?; + // game_scheduler.queue().await?; let _h_scheduler = sched.start().await?; diff --git a/src/repositories/balance/models.rs b/src/repositories/balance/models.rs index e42c4ea..312095f 100644 --- a/src/repositories/balance/models.rs +++ b/src/repositories/balance/models.rs @@ -7,9 +7,9 @@ pub struct Balance { /// pub id: i32, /// - pub balance: i32, + pub balance: i64, /// - pub balance_bota: i32, + pub balance_bota: i64, /// pub created_at: i64, /// @@ -21,9 +21,9 @@ pub struct Balance { #[table_name = "api_kgon_balances"] pub struct NewBalance { /// - pub balance: i32, + pub balance: i64, /// - pub balance_bota: i32, + pub balance_bota: i64, } /// @@ -31,7 +31,7 @@ pub struct NewBalance { #[table_name = "api_kgon_balances"] pub struct ModifyBalance { /// - pub balance: i32, + pub balance: i64, /// - pub balance_bota: i32, + pub balance_bota: i64, } diff --git a/src/repositories/balance/schema.rs b/src/repositories/balance/schema.rs index e82b352..7c3226a 100644 --- a/src/repositories/balance/schema.rs +++ b/src/repositories/balance/schema.rs @@ -7,9 +7,9 @@ table! { /// id -> Integer, /// - balance -> Integer, + balance -> BigInt, /// - balance_bota -> Integer, + balance_bota -> BigInt, /// created_at -> BigInt, /// diff --git a/src/repositories/game/models.rs b/src/repositories/game/models.rs index d22796c..a762de6 100644 --- a/src/repositories/game/models.rs +++ b/src/repositories/game/models.rs @@ -6,9 +6,9 @@ use beteran_common_rust as bcr; #[table_name = "api_kgon_games"] pub struct Game { /// - pub id: i32, + pub id: i64, /// - pub vendor_id: i32, + pub vendor_id: i64, /// pub key: String, /// @@ -32,9 +32,9 @@ pub struct Game { #[table_name = "api_kgon_games"] pub struct NewGame { /// - pub id: i32, + pub id: i64, /// - pub vendor_id: i32, + pub vendor_id: i64, /// pub key: String, /// @@ -72,9 +72,9 @@ pub struct ModifyGame { #[table_name = "api_kgon_games"] pub struct UpsertGame { /// - pub id: i32, + pub id: i64, /// - pub vendor_id: i32, + pub vendor_id: i64, /// pub key: String, /// @@ -93,7 +93,7 @@ pub struct UpsertGame { #[derive(Debug, Clone)] pub struct FindAllSearch { /// - pub vendor_id: Option, + pub vendor_id: Option, /// pub key_like: Option, /// diff --git a/src/repositories/game/repository.rs b/src/repositories/game/repository.rs index f074756..2c48769 100644 --- a/src/repositories/game/repository.rs +++ b/src/repositories/game/repository.rs @@ -70,7 +70,7 @@ impl Repository { pub fn select( &self, conn: &diesel::PgConnection, - id: i32, + id: i64, ) -> Result, Error> { match api_kgon_games::table.find(id).first::(conn) { Ok(m) => Ok(Some(m)), @@ -206,7 +206,7 @@ impl Repository { pub fn update( &self, conn: &diesel::PgConnection, - id: i32, + id: i64, modify: &models::ModifyGame, ) -> Result { use api_kgon_games::dsl; @@ -218,7 +218,7 @@ impl Repository { } /// - pub fn delete(&self, conn: &diesel::PgConnection, id: i32) -> Result { + pub fn delete(&self, conn: &diesel::PgConnection, id: i64) -> Result { use api_kgon_games::dsl; diesel::delete(api_kgon_games::table.filter(dsl::id.eq(id))) diff --git a/src/repositories/game/schema.rs b/src/repositories/game/schema.rs index 682e676..4d5a2e0 100644 --- a/src/repositories/game/schema.rs +++ b/src/repositories/game/schema.rs @@ -5,9 +5,9 @@ table! { /// api_kgon_games(id) { /// - id -> Integer, + id -> BigInt, /// - vendor_id -> Integer, + vendor_id -> BigInt, /// key -> Text, /// diff --git a/src/repositories/member/models.rs b/src/repositories/member/models.rs index aa12ad9..947bdd9 100644 --- a/src/repositories/member/models.rs +++ b/src/repositories/member/models.rs @@ -6,15 +6,15 @@ use beteran_common_rust as bcr; #[table_name = "api_kgon_members"] pub struct Member { /// - pub id: i32, + pub id: i64, /// - pub balance: i32, + pub balance: i64, /// - pub balance_bota: i32, + pub balance_bota: i64, /// - pub balance_sum: i32, + pub balance_sum: i64, /// - pub companies: i32, + pub companies: i64, /// pub oriental_play: String, /// @@ -30,15 +30,15 @@ pub struct Member { #[table_name = "api_kgon_members"] pub struct NewMember { /// - pub id: i32, + pub id: i64, /// - pub balance: i32, + pub balance: i64, /// - pub balance_bota: i32, + pub balance_bota: i64, /// - pub balance_sum: i32, + pub balance_sum: i64, /// - pub companies: i32, + pub companies: i64, /// pub oriental_play: String, /// @@ -50,9 +50,9 @@ pub struct NewMember { #[table_name = "api_kgon_members"] pub struct ModifyMember { /// - pub balance: i32, + pub balance: i64, /// - pub balance_bota: i32, + pub balance_bota: i64, /// pub oriental_play: String, } @@ -62,13 +62,13 @@ pub struct ModifyMember { #[table_name = "api_kgon_members"] pub struct ModifyMemberForBalance { /// - pub balance: i32, + pub balance: i64, /// - pub balance_bota: i32, + pub balance_bota: i64, /// - pub balance_sum: i32, + pub balance_sum: i64, /// - pub companies: i32, + pub companies: i64, } /// diff --git a/src/repositories/member/repository.rs b/src/repositories/member/repository.rs index d51d3c3..1898d6e 100644 --- a/src/repositories/member/repository.rs +++ b/src/repositories/member/repository.rs @@ -43,7 +43,7 @@ impl Repository { pub fn select( &self, conn: &diesel::PgConnection, - id: i32, + id: i64, ) -> Result, Error> { match api_kgon_members::table .find(id) @@ -178,7 +178,7 @@ impl Repository { pub fn update( &self, conn: &diesel::PgConnection, - id: i32, + id: i64, modify: &models::ModifyMember, ) -> Result { use api_kgon_members::dsl; @@ -193,7 +193,7 @@ impl Repository { pub fn update_balance( &self, conn: &diesel::PgConnection, - id: i32, + id: i64, modify: &models::ModifyMemberForBalance, ) -> Result { use api_kgon_members::dsl; @@ -205,7 +205,7 @@ impl Repository { } /// - pub fn delete(&self, conn: &diesel::PgConnection, id: i32) -> Result { + pub fn delete(&self, conn: &diesel::PgConnection, id: i64) -> Result { use api_kgon_members::dsl; diesel::delete(api_kgon_members::table.filter(dsl::id.eq(id))) diff --git a/src/repositories/member/schema.rs b/src/repositories/member/schema.rs index eea1ac5..dafaa84 100644 --- a/src/repositories/member/schema.rs +++ b/src/repositories/member/schema.rs @@ -5,15 +5,15 @@ table! { /// api_kgon_members(id) { /// - id -> Integer, + id -> BigInt, /// - balance -> Integer, + balance -> BigInt, /// - balance_bota -> Integer, + balance_bota -> BigInt, /// - balance_sum -> Integer, + balance_sum -> BigInt, /// - companies -> Integer, + companies -> BigInt, /// oriental_play -> Text, /// diff --git a/src/repositories/synchronization_history/models.rs b/src/repositories/synchronization_history/models.rs index d15ea79..5730800 100644 --- a/src/repositories/synchronization_history/models.rs +++ b/src/repositories/synchronization_history/models.rs @@ -14,7 +14,7 @@ pub struct SynchronizationHistory { /// pub complete_at: i64, /// - pub code: i32, + pub code: i64, /// pub message: Option, /// @@ -32,7 +32,7 @@ pub struct NewSynchronizationHistory { /// pub complete_at: i64, /// - pub code: i32, + pub code: i64, /// pub message: Option, } @@ -43,7 +43,7 @@ pub struct FindAllSearch { /// pub item: Option, /// - pub code: Option, + pub code: Option, } /// #[derive(Debug, Clone)] diff --git a/src/repositories/synchronization_history/schema.rs b/src/repositories/synchronization_history/schema.rs index 0852daf..5be09b3 100644 --- a/src/repositories/synchronization_history/schema.rs +++ b/src/repositories/synchronization_history/schema.rs @@ -13,7 +13,7 @@ table! { /// complete_at -> BigInt, /// - code -> Integer, + code -> BigInt, /// message -> Nullable, /// diff --git a/src/repositories/vendor/models.rs b/src/repositories/vendor/models.rs index 08f3d0e..f8ddb60 100644 --- a/src/repositories/vendor/models.rs +++ b/src/repositories/vendor/models.rs @@ -6,11 +6,11 @@ use beteran_common_rust as bcr; #[table_name = "api_kgon_vendors"] pub struct Vendor { /// - pub id: i32, + pub id: i64, /// - pub company_id: i32, + pub company_id: i64, /// - pub vendor_id: i32, + pub vendor_id: i64, /// pub key: String, /// @@ -18,13 +18,13 @@ pub struct Vendor { /// pub category: String, /// - pub max_bet_casino: i32, + pub max_bet_casino: i64, /// - pub max_bet_slot: i32, + pub max_bet_slot: i64, /// pub is_enable: String, /// - pub bet_count: i32, + pub bet_count: i64, /// pub created_at: i64, /// @@ -36,11 +36,11 @@ pub struct Vendor { #[table_name = "api_kgon_vendors"] pub struct NewVendor { /// - pub id: i32, + pub id: i64, /// - pub company_id: i32, + pub company_id: i64, /// - pub vendor_id: i32, + pub vendor_id: i64, /// pub key: String, /// @@ -48,13 +48,13 @@ pub struct NewVendor { /// pub category: String, /// - pub max_bet_casino: i32, + pub max_bet_casino: i64, /// - pub max_bet_slot: i32, + pub max_bet_slot: i64, /// pub is_enable: String, /// - pub bet_count: i32, + pub bet_count: i64, } /// @@ -62,9 +62,9 @@ pub struct NewVendor { #[table_name = "api_kgon_vendors"] pub struct ModifyVendor { /// - pub company_id: i32, + pub company_id: i64, /// - pub vendor_id: i32, + pub vendor_id: i64, /// pub key: String, /// @@ -72,13 +72,13 @@ pub struct ModifyVendor { /// pub category: String, /// - pub max_bet_casino: i32, + pub max_bet_casino: i64, /// - pub max_bet_slot: i32, + pub max_bet_slot: i64, /// pub is_enable: String, /// - pub bet_count: i32, + pub bet_count: i64, } /// @@ -86,11 +86,11 @@ pub struct ModifyVendor { #[table_name = "api_kgon_vendors"] pub struct UpsertVendor { /// - pub id: i32, + pub id: i64, /// - pub company_id: i32, + pub company_id: i64, /// - pub vendor_id: i32, + pub vendor_id: i64, /// pub key: String, /// @@ -98,22 +98,22 @@ pub struct UpsertVendor { /// pub category: String, /// - pub max_bet_casino: i32, + pub max_bet_casino: i64, /// - pub max_bet_slot: i32, + pub max_bet_slot: i64, /// pub is_enable: String, /// - pub bet_count: i32, + pub bet_count: i64, } /// #[derive(Debug, Clone)] pub struct FindAllSearch { /// - pub company_id: Option, + pub company_id: Option, /// - pub vendor_id: Option, + pub vendor_id: Option, /// pub key_like: Option, /// diff --git a/src/repositories/vendor/repository.rs b/src/repositories/vendor/repository.rs index 157b2dc..bbc70f1 100644 --- a/src/repositories/vendor/repository.rs +++ b/src/repositories/vendor/repository.rs @@ -72,7 +72,7 @@ impl Repository { pub fn select( &self, conn: &diesel::PgConnection, - id: i32, + id: i64, ) -> Result, Error> { match api_kgon_vendors::table .find(id) @@ -241,7 +241,7 @@ impl Repository { pub fn update( &self, conn: &diesel::PgConnection, - id: i32, + id: i64, modify: &models::ModifyVendor, ) -> Result { use api_kgon_vendors::dsl; @@ -253,7 +253,7 @@ impl Repository { } /// - pub fn delete(&self, conn: &diesel::PgConnection, id: i32) -> Result { + pub fn delete(&self, conn: &diesel::PgConnection, id: i64) -> Result { use api_kgon_vendors::dsl; diesel::delete(api_kgon_vendors::table.filter(dsl::id.eq(id))) diff --git a/src/repositories/vendor/schema.rs b/src/repositories/vendor/schema.rs index f834a52..1da6328 100644 --- a/src/repositories/vendor/schema.rs +++ b/src/repositories/vendor/schema.rs @@ -5,11 +5,11 @@ table! { /// api_kgon_vendors(id) { /// - id -> Integer, + id -> BigInt, /// - company_id -> Integer, + company_id -> BigInt, /// - vendor_id -> Integer, + vendor_id -> BigInt, /// key -> Text, /// @@ -17,13 +17,13 @@ table! { /// category -> Text, /// - max_bet_casino -> Integer, + max_bet_casino -> BigInt, /// - max_bet_slot -> Integer, + max_bet_slot -> BigInt, /// is_enable -> Text, /// - bet_count -> Integer, + bet_count -> BigInt, /// created_at -> BigInt, /// diff --git a/src/schedulers/balance/scheduler.rs b/src/schedulers/balance/scheduler.rs index 346d11d..9d78432 100644 --- a/src/schedulers/balance/scheduler.rs +++ b/src/schedulers/balance/scheduler.rs @@ -68,7 +68,7 @@ impl Scheduler { &'static self, item: String, start_at: i64, - code: i32, + code: i64, message: Option, ) -> Result<(), Box> { let conn = self.pool.get().expect("conn"); diff --git a/src/schedulers/game/scheduler.rs b/src/schedulers/game/scheduler.rs index 79c8f18..44445d8 100644 --- a/src/schedulers/game/scheduler.rs +++ b/src/schedulers/game/scheduler.rs @@ -65,7 +65,7 @@ impl Scheduler { &'static self, item: String, start_at: i64, - code: i32, + code: i64, message: Option, ) -> Result<(), Box> { let complete_at = (chrono::Utc::now()).timestamp(); diff --git a/src/schedulers/member/scheduler.rs b/src/schedulers/member/scheduler.rs index 2e94154..02e2f37 100644 --- a/src/schedulers/member/scheduler.rs +++ b/src/schedulers/member/scheduler.rs @@ -63,7 +63,7 @@ impl Scheduler { &'static self, item: String, start_at: i64, - code: i32, + code: i64, message: Option, ) -> Result<(), Box> { let conn = self.pool.get().expect("conn"); diff --git a/src/schedulers/vendor/scheduler.rs b/src/schedulers/vendor/scheduler.rs index c8af2bb..13cda79 100644 --- a/src/schedulers/vendor/scheduler.rs +++ b/src/schedulers/vendor/scheduler.rs @@ -63,7 +63,7 @@ impl Scheduler { &'static self, item: String, start_at: i64, - code: i32, + code: i64, message: Option, ) -> Result<(), Box> { let complete_at = (chrono::Utc::now()).timestamp(); diff --git a/src/services/game/service.rs b/src/services/game/service.rs index fc06f9a..4816011 100644 --- a/src/services/game/service.rs +++ b/src/services/game/service.rs @@ -105,8 +105,8 @@ impl Service { search: match request.search { Some(s) => Some(repositories::vendor::models::FindAllSearch { name_like: s.name_like, - company_id: s.company_id.map(|d| d as i32), - vendor_id: s.vendor_id.map(|d| d as i32), + company_id: s.company_id.map(|d| d as i64), + vendor_id: s.vendor_id.map(|d| d as i64), key_like: s.key_like, category_like: s.category_like, is_enable: s.is_enable,