From d7ddfe5c460f89e97cf4401b4e787c0f5b92089e Mon Sep 17 00:00:00 2001 From: PARK BYUNG JUN Date: Thu, 1 Sep 2022 17:26:54 +0000 Subject: [PATCH] total_count is added --- Cargo.toml | 4 ++-- src/services/betting/service.rs | 3 ++- src/services/game/service.rs | 3 ++- src/services/vendor/service.rs | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 64668c9..fa8cc20 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/betting/service.rs b/src/services/betting/service.rs index cdd8029..5b5a463 100644 --- a/src/services/betting/service.rs +++ b/src/services/betting/service.rs @@ -158,7 +158,7 @@ impl Service { ), }; - let count = self + let total_count = self .betting_composition .select_all_count(&conn, &find_all) .map_err(|e| { @@ -186,6 +186,7 @@ impl Service { error: None, result: Some( bpr::ss::api::betting::list_betting_history_response::Result { + total_count: total_count as u64, betting_history: list .iter() .map(bpr::models::api::betting::BettingHistory::from) diff --git a/src/services/game/service.rs b/src/services/game/service.rs index 79d7f48..89baaf7 100644 --- a/src/services/game/service.rs +++ b/src/services/game/service.rs @@ -136,7 +136,7 @@ impl Service { ), }; - let count = self + let total_count = self .game_repository .select_all_count(&conn, &find_all) .map_err(|e| { @@ -163,6 +163,7 @@ impl Service { bpr::ss::api::game::ListGamesResponse { error: None, result: Some(bpr::ss::api::game::list_games_response::Result { + total_count: total_count as u64, games: list .iter() .map(bpr::models::api::game::Game::from) diff --git a/src/services/vendor/service.rs b/src/services/vendor/service.rs index 99288aa..6ba65b1 100644 --- a/src/services/vendor/service.rs +++ b/src/services/vendor/service.rs @@ -126,7 +126,7 @@ impl Service { ), }; - let count = self + let total_count = self .vendor_repository .select_all_count(&conn, &find_all) .map_err(|e| { @@ -153,6 +153,7 @@ impl Service { bpr::ss::api::vendor::ListVendorsResponse { error: None, result: Some(bpr::ss::api::vendor::list_vendors_response::Result { + total_count: total_count as u64, vendors: list .iter() .map(bpr::models::api::vendor::Vendor::from)