From f16bbdbc6197f78b989f7ff1f466fa16249fbb50 Mon Sep 17 00:00:00 2001 From: PARK BYUNG JUN Date: Thu, 1 Sep 2022 17:24:16 +0000 Subject: [PATCH] total_count is added --- Cargo.toml | 4 ++-- src/services/bank/service.rs | 3 ++- src/services/member/service.rs | 5 +++-- src/services/member_bank_account/service.rs | 3 ++- src/services/member_bank_deposit/service.rs | 3 ++- src/services/member_bank_withdraw/service.rs | 3 ++- src/services/member_class/service.rs | 3 ++- src/services/member_game_setting/service.rs | 3 ++- src/services/member_level/service.rs | 3 ++- src/services/member_referrer/service.rs | 3 ++- src/services/member_settlement_setting/service.rs | 3 ++- src/services/site/service.rs | 3 ++- 12 files changed, 25 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5a7a683..1e67639 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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.92-snapshot" } -beteran-common-rust = { git = "https://gitlab.loafle.net/bet/beteran-common-rust.git", tag = "v0.1.78-snapshot" } +beteran-protobuf-rust = { git = "https://gitlab.loafle.net/bet/beteran-protobuf-rust.git", tag = "v0.1.93-snapshot" } +beteran-common-rust = { git = "https://gitlab.loafle.net/bet/beteran-common-rust.git", tag = "v0.1.79-snapshot" } [build-dependencies] diff --git a/src/services/bank/service.rs b/src/services/bank/service.rs index 29311c7..00fc708 100644 --- a/src/services/bank/service.rs +++ b/src/services/bank/service.rs @@ -293,7 +293,7 @@ impl Service { ), }; - let count = self + let total_count = self .bank_repository .select_all_count(&conn, &find_all) .map_err(|e| { @@ -320,6 +320,7 @@ impl Service { bpr::ss::bank::ListBanksResponse { error: None, result: Some(bpr::ss::bank::list_banks_response::Result { + total_count: total_count as u64, banks: list .iter() .map(|d| bpr::models::bank::Bank::from(d)) diff --git a/src/services/member/service.rs b/src/services/member/service.rs index f4a3f0d..c2a3574 100644 --- a/src/services/member/service.rs +++ b/src/services/member/service.rs @@ -752,8 +752,8 @@ impl Service<'_> { search, }; - let m = self - .member_repository + let total_count = self + .member_composition .select_all_count(&conn, &find_all) .map_err(|e| { bcr::error::rpc::Error::Server(bcr::error::rpc::Server { @@ -779,6 +779,7 @@ impl Service<'_> { bpr::ss::member::ListMembersResponse { error: None, result: Some(bpr::ss::member::list_members_response::Result { + total_count: total_count as u64, members: member_list .iter() .map(bpr::models::member::MemberModel::from) diff --git a/src/services/member_bank_account/service.rs b/src/services/member_bank_account/service.rs index 1753250..444f077 100644 --- a/src/services/member_bank_account/service.rs +++ b/src/services/member_bank_account/service.rs @@ -379,7 +379,7 @@ impl Service<'_> { ), }; - let count = self + let total_count = self .member_bank_account_repository .select_all_count(&conn, &find_all) .map_err(|e| { @@ -407,6 +407,7 @@ impl Service<'_> { error: None, result: Some( bpr::ss::member_bank_account::list_member_bank_accounts_response::Result { + total_count: total_count as u64, member_bank_accounts: list .iter() .map(|d| bpr::models::member_bank_account::MemberBankAccount::from(d)) diff --git a/src/services/member_bank_deposit/service.rs b/src/services/member_bank_deposit/service.rs index 0c8695e..e48c25f 100644 --- a/src/services/member_bank_deposit/service.rs +++ b/src/services/member_bank_deposit/service.rs @@ -356,7 +356,7 @@ impl Service { ), }; - let count = self + let total_count = self .member_bank_deposit_repository .select_all_count(&conn, &find_all) .map_err(|e| { @@ -384,6 +384,7 @@ impl Service { error: None, result: Some( bpr::ss::member_bank_deposit::list_member_bank_deposits_response::Result { + total_count: total_count as u64, member_bank_deposits: list .iter() .map(bpr::models::member_bank_deposit::MemberBankDepositModel::from) diff --git a/src/services/member_bank_withdraw/service.rs b/src/services/member_bank_withdraw/service.rs index 1484f92..96c2252 100644 --- a/src/services/member_bank_withdraw/service.rs +++ b/src/services/member_bank_withdraw/service.rs @@ -359,7 +359,7 @@ impl Service { ), }; - let count = self + let total_count = self .member_bank_withdraw_repository .select_all_count(&conn, &find_all) .map_err(|e| { @@ -387,6 +387,7 @@ impl Service { error: None, result: Some( bpr::ss::member_bank_withdraw::list_member_bank_withdraws_response::Result { + total_count: total_count as u64, member_bank_withdraws: list .iter() .map(bpr::models::member_bank_withdraw::MemberBankWithdrawModel::from) diff --git a/src/services/member_class/service.rs b/src/services/member_class/service.rs index 760fa2c..41f2ade 100644 --- a/src/services/member_class/service.rs +++ b/src/services/member_class/service.rs @@ -309,7 +309,7 @@ impl Service { ), }; - let count = self + let total_count = self .member_class_repository .select_all_count(&conn, &find_all) .map_err(|e| { @@ -337,6 +337,7 @@ impl Service { error: None, result: Some( bpr::ss::member_class::list_member_classes_response::Result { + total_count: total_count as u64, member_classes: list .iter() .map(|d| bpr::models::member_class::MemberClass::from(d)) diff --git a/src/services/member_game_setting/service.rs b/src/services/member_game_setting/service.rs index af7699f..7bd3e9d 100644 --- a/src/services/member_game_setting/service.rs +++ b/src/services/member_game_setting/service.rs @@ -336,7 +336,7 @@ impl Service { ), }; - let count = self + let total_count = self .member_game_setting_repository .select_all_count(&conn, &find_all) .map_err(|e| { @@ -364,6 +364,7 @@ impl Service { error: None, result: Some( bpr::ss::member_game_setting::list_member_game_settings_response::Result { + total_count: total_count as u64, member_game_settings: list .iter() .map(|d| bpr::models::member_game_setting::MemberGameSetting::from(d)) diff --git a/src/services/member_level/service.rs b/src/services/member_level/service.rs index 768dc24..3834f1d 100644 --- a/src/services/member_level/service.rs +++ b/src/services/member_level/service.rs @@ -288,7 +288,7 @@ impl Service { ), }; - let count = self + let total_count = self .member_level_repository .select_all_count(&conn, &find_all) .map_err(|e| { @@ -315,6 +315,7 @@ impl Service { bpr::ss::member_level::ListMemberLevelsResponse { error: None, result: Some(bpr::ss::member_level::list_member_levels_response::Result { + total_count: total_count as u64, member_levels: list .iter() .map(|d| bpr::models::member_level::MemberLevel::from(d)) diff --git a/src/services/member_referrer/service.rs b/src/services/member_referrer/service.rs index 79d1fae..8c92681 100644 --- a/src/services/member_referrer/service.rs +++ b/src/services/member_referrer/service.rs @@ -500,7 +500,7 @@ impl Service { ), }; - let count = self + let total_count = self .member_referrer_repository .select_all_count(&conn, &find_all) .map_err(|e| { @@ -528,6 +528,7 @@ impl Service { error: None, result: Some( bpr::ss::member_referrer::list_member_referrers_response::Result { + total_count: total_count as u64, member_referrers: list .iter() .map(|d| bpr::models::member_referrer::MemberReferrerModel::from(d)) diff --git a/src/services/member_settlement_setting/service.rs b/src/services/member_settlement_setting/service.rs index 629cf4b..37241c6 100644 --- a/src/services/member_settlement_setting/service.rs +++ b/src/services/member_settlement_setting/service.rs @@ -353,7 +353,7 @@ impl Service { ), }; - let count = self + let total_count = self .member_settlement_setting_repository .select_all_count(&conn, &find_all) .map_err(|e| { @@ -381,6 +381,7 @@ impl Service { error: None, result: Some( bpr::ss::member_settlement_setting::list_member_settlement_settings_response::Result { + total_count: total_count as u64, member_settlement_settings: list .iter() .map(|d| bpr::models::member_settlement_setting::MemberSettlementSetting::from(d)) diff --git a/src/services/site/service.rs b/src/services/site/service.rs index 859aba0..a4a3241 100644 --- a/src/services/site/service.rs +++ b/src/services/site/service.rs @@ -175,7 +175,7 @@ impl Service { ), }; - let count = self + let total_count = self .site_repository .select_all_count(&conn, &find_all) .map_err(|e| { @@ -202,6 +202,7 @@ impl Service { bpr::ss::site::ListSitesResponse { error: None, result: Some(bpr::ss::site::list_sites_response::Result { + total_count: total_count as u64, sites: list .iter() .map(|d| bpr::models::site::Site::from(d))