From b0212ea4323ee4f3167e8b6653741789ad5bff0b Mon Sep 17 00:00:00 2001 From: PARK BYUNG JUN Date: Fri, 16 Sep 2022 14:17:23 +0000 Subject: [PATCH] member_balance is added --- src/c2se/backend/member_balance.rs | 11 ++ src/c2se/backend/mod.rs | 1 + src/c2se/frontend/member_balance.rs | 7 + src/c2se/frontend/mod.rs | 1 + src/c2se/member_balance.rs | 117 ++++++++++++++++ src/c2se/mod.rs | 1 + src/models/member.rs | 12 +- src/models/member_balance.rs | 17 +++ src/models/mod.rs | 1 + src/ss/member_balance.rs | 206 ++++++++++++++++++++++++++++ src/ss/mod.rs | 1 + 11 files changed, 370 insertions(+), 5 deletions(-) create mode 100644 src/c2se/backend/member_balance.rs create mode 100644 src/c2se/frontend/member_balance.rs create mode 100644 src/c2se/member_balance.rs create mode 100644 src/models/member_balance.rs create mode 100644 src/ss/member_balance.rs diff --git a/src/c2se/backend/member_balance.rs b/src/c2se/backend/member_balance.rs new file mode 100644 index 0000000..08441dc --- /dev/null +++ b/src/c2se/backend/member_balance.rs @@ -0,0 +1,11 @@ +const SUBJECT: &str = "bet.beteran.c2se.backend.member_balance"; + +pub const SUBJECT_CREATE_MEMBER_BALANCE: &str = + const_format::concatcp!(SUBJECT, ".CreateMemberBalance"); +pub const SUBJECT_LIST_MEMBER_BALANCES: &str = + const_format::concatcp!(SUBJECT, ".ListMemberBalances"); +pub const SUBJECT_GET_MEMBER_BALANCE: &str = const_format::concatcp!(SUBJECT, ".GetMemberBalance"); +pub const SUBJECT_UPDATE_MEMBER_BALANCE: &str = + const_format::concatcp!(SUBJECT, ".UpdateMemberBalance"); +pub const SUBJECT_DELETE_MEMBER_BALANCE: &str = + const_format::concatcp!(SUBJECT, ".DeleteMemberBalance"); diff --git a/src/c2se/backend/mod.rs b/src/c2se/backend/mod.rs index b6fe34b..6b50f98 100644 --- a/src/c2se/backend/mod.rs +++ b/src/c2se/backend/mod.rs @@ -2,6 +2,7 @@ pub mod api; pub mod bank; pub mod identity; pub mod member; +pub mod member_balance; pub mod member_bank_account; pub mod member_bank_deposit; pub mod member_bank_withdraw; diff --git a/src/c2se/frontend/member_balance.rs b/src/c2se/frontend/member_balance.rs new file mode 100644 index 0000000..389a0d1 --- /dev/null +++ b/src/c2se/frontend/member_balance.rs @@ -0,0 +1,7 @@ +const SUBJECT: &str = "bet.beteran.c2se.frontend.member_balance"; + +pub const SUBJECT_CREATE_MEMBER_BALANCE: &str = + const_format::concatcp!(SUBJECT, ".CreateMemberBalance"); +pub const SUBJECT_GET_MEMBER_BALANCE: &str = const_format::concatcp!(SUBJECT, ".GetMemberBalance"); +pub const SUBJECT_UPDATE_MEMBER_BALANCE: &str = + const_format::concatcp!(SUBJECT, ".UpdateMemberBalance"); diff --git a/src/c2se/frontend/mod.rs b/src/c2se/frontend/mod.rs index e10759f..5b532c6 100644 --- a/src/c2se/frontend/mod.rs +++ b/src/c2se/frontend/mod.rs @@ -2,6 +2,7 @@ pub mod api; pub mod bank; pub mod identity; pub mod member; +pub mod member_balance; pub mod member_bank_account; pub mod member_bank_deposit; pub mod member_bank_withdraw; diff --git a/src/c2se/member_balance.rs b/src/c2se/member_balance.rs new file mode 100644 index 0000000..099d2e6 --- /dev/null +++ b/src/c2se/member_balance.rs @@ -0,0 +1,117 @@ +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateMemberBalanceRequest { + #[prost(string, tag = "1")] + pub member_id: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateMemberBalanceResponse { + #[prost(message, optional, tag = "1")] + pub error: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub result: ::core::option::Option, +} +/// Nested message and enum types in `CreateMemberBalanceResponse`. +pub mod create_member_balance_response { + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Result { + #[prost(message, optional, tag = "1")] + pub member_balance: ::core::option::Option, + } +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListMemberBalancesRequest { + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub sorts: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub search: ::core::option::Option, +} +/// Nested message and enum types in `ListMemberBalancesRequest`. +pub mod list_member_balances_request { + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Search { + #[prost(string, optional, tag = "1")] + pub member_id: ::core::option::Option<::prost::alloc::string::String>, + } +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListMemberBalancesResponse { + #[prost(message, optional, tag = "1")] + pub error: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub result: ::core::option::Option, +} +/// Nested message and enum types in `ListMemberBalancesResponse`. +pub mod list_member_balances_response { + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Result { + #[prost(uint64, tag = "1")] + pub total_count: u64, + #[prost(message, repeated, tag = "2")] + pub member_balances: ::prost::alloc::vec::Vec, + } +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetMemberBalanceRequest { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetMemberBalanceResponse { + #[prost(message, optional, tag = "1")] + pub error: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub result: ::core::option::Option, +} +/// Nested message and enum types in `GetMemberBalanceResponse`. +pub mod get_member_balance_response { + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Result { + #[prost(message, optional, tag = "1")] + pub member_balance: ::core::option::Option, + } +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateMemberBalanceRequest { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + #[prost(double, tag = "2")] + pub balance: f64, + #[prost(double, tag = "3")] + pub balance_bota: f64, + #[prost(double, tag = "4")] + pub balance_sum: f64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateMemberBalanceResponse { + #[prost(message, optional, tag = "1")] + pub error: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub result: ::core::option::Option, +} +/// Nested message and enum types in `UpdateMemberBalanceResponse`. +pub mod update_member_balance_response { + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Result { + #[prost(message, optional, tag = "1")] + pub member_balance: ::core::option::Option, + } +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteMemberBalanceRequest { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteMemberBalanceResponse { + #[prost(message, optional, tag = "1")] + pub error: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub result: ::core::option::Option, +} +/// Nested message and enum types in `DeleteMemberBalanceResponse`. +pub mod delete_member_balance_response { + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Result {} +} diff --git a/src/c2se/mod.rs b/src/c2se/mod.rs index bae0236..b11c425 100644 --- a/src/c2se/mod.rs +++ b/src/c2se/mod.rs @@ -5,6 +5,7 @@ pub mod core; pub mod frontend; pub mod identity; pub mod member; +pub mod member_balance; pub mod member_bank_account; pub mod member_bank_deposit; pub mod member_bank_withdraw; diff --git a/src/models/member.rs b/src/models/member.rs index b95e6e1..2dabd85 100644 --- a/src/models/member.rs +++ b/src/models/member.rs @@ -66,15 +66,17 @@ pub struct MemberModel { #[prost(message, optional, tag = "15")] pub member_settlement_setting: ::core::option::Option, - #[prost(string, optional, tag = "16")] + #[prost(message, optional, tag = "16")] + pub member_balance: ::core::option::Option, + #[prost(string, optional, tag = "17")] pub last_signined_ip: ::core::option::Option<::prost::alloc::string::String>, - #[prost(uint64, optional, tag = "17")] + #[prost(uint64, optional, tag = "18")] pub last_signined_at: ::core::option::Option, - #[prost(uint64, tag = "18")] - pub created_at: u64, #[prost(uint64, tag = "19")] + pub created_at: u64, + #[prost(uint64, tag = "20")] pub updated_at: u64, - #[prost(uint64, optional, tag = "20")] + #[prost(uint64, optional, tag = "21")] pub deleted_at: ::core::option::Option, } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] diff --git a/src/models/member_balance.rs b/src/models/member_balance.rs new file mode 100644 index 0000000..c87a7bd --- /dev/null +++ b/src/models/member_balance.rs @@ -0,0 +1,17 @@ +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MemberBalance { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub member_id: ::prost::alloc::string::String, + #[prost(double, tag = "3")] + pub balance: f64, + #[prost(double, tag = "4")] + pub balance_bota: f64, + #[prost(double, tag = "5")] + pub balance_sum: f64, + #[prost(uint64, tag = "6")] + pub created_at: u64, + #[prost(uint64, tag = "7")] + pub updated_at: u64, +} diff --git a/src/models/mod.rs b/src/models/mod.rs index b29d485..9264889 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -2,6 +2,7 @@ pub mod api; pub mod bank; pub mod core; pub mod member; +pub mod member_balance; pub mod member_bank_account; pub mod member_bank_deposit; pub mod member_bank_withdraw; diff --git a/src/ss/member_balance.rs b/src/ss/member_balance.rs new file mode 100644 index 0000000..d2ee186 --- /dev/null +++ b/src/ss/member_balance.rs @@ -0,0 +1,206 @@ +const SUBJECT: &str = "bet.beteran.ss.member_balance"; + +pub const SUBJECT_CREATE_MEMBER_BALANCE: &str = + const_format::concatcp!(SUBJECT, ".CreateMemberBalance"); +pub const SUBJECT_LIST_MEMBER_BALANCES: &str = + const_format::concatcp!(SUBJECT, ".ListMemberBalances"); +pub const SUBJECT_GET_MEMBER_BALANCE: &str = const_format::concatcp!(SUBJECT, ".GetMemberBalance"); +pub const SUBJECT_UPDATE_MEMBER_BALANCE: &str = + const_format::concatcp!(SUBJECT, ".UpdateMemberBalance"); +pub const SUBJECT_DELETE_MEMBER_BALANCE: &str = + const_format::concatcp!(SUBJECT, ".DeleteMemberBalance"); + +/// subject = bet.beteran.ss.member_balance.CreateMemberBalance +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateMemberBalanceRequest { + #[prost(message, optional, tag = "1")] + pub client: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub request: ::core::option::Option, +} +/// Nested message and enum types in `CreateMemberBalanceRequest`. +pub mod create_member_balance_request { + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Request { + #[prost(string, tag = "1")] + pub member_id: ::prost::alloc::string::String, + } +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateMemberBalanceResponse { + #[prost(message, optional, tag = "1")] + pub error: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub result: ::core::option::Option, +} +/// Nested message and enum types in `CreateMemberBalanceResponse`. +pub mod create_member_balance_response { + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Result { + #[prost(message, optional, tag = "1")] + pub member_balance: ::core::option::Option, + } +} +/// subject = bet.beteran.ss.member_balance.ListMemberBalances +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListMemberBalancesRequest { + #[prost(message, optional, tag = "1")] + pub client: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub request: ::core::option::Option, +} +/// Nested message and enum types in `ListMemberBalancesRequest`. +pub mod list_member_balances_request { + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Request { + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub sorts: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub search: ::core::option::Option, + } + /// Nested message and enum types in `Request`. + pub mod request { + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Search { + #[prost(string, optional, tag = "1")] + pub member_id: ::core::option::Option<::prost::alloc::string::String>, + } + } +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListMemberBalancesResponse { + #[prost(message, optional, tag = "1")] + pub error: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub result: ::core::option::Option, +} +/// Nested message and enum types in `ListMemberBalancesResponse`. +pub mod list_member_balances_response { + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Result { + #[prost(uint64, tag = "1")] + pub total_count: u64, + #[prost(message, repeated, tag = "2")] + pub member_balances: ::prost::alloc::vec::Vec, + } +} +/// subject = bet.beteran.ss.member_balance.GetMemberBalance +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetMemberBalanceRequest { + #[prost(message, optional, tag = "1")] + pub client: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub request: ::core::option::Option, +} +/// Nested message and enum types in `GetMemberBalanceRequest`. +pub mod get_member_balance_request { + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Request { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + } +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetMemberBalanceResponse { + #[prost(message, optional, tag = "1")] + pub error: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub result: ::core::option::Option, +} +/// Nested message and enum types in `GetMemberBalanceResponse`. +pub mod get_member_balance_response { + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Result { + #[prost(message, optional, tag = "1")] + pub member_balance: ::core::option::Option, + } +} +/// subject = bet.beteran.ss.member_balance.UpdateMemberBalance +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateMemberBalanceRequest { + #[prost(message, optional, tag = "1")] + pub client: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub request: ::core::option::Option, +} +/// Nested message and enum types in `UpdateMemberBalanceRequest`. +pub mod update_member_balance_request { + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Request { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + #[prost(double, tag = "2")] + pub balance: f64, + #[prost(double, tag = "3")] + pub balance_bota: f64, + #[prost(double, tag = "4")] + pub balance_sum: f64, + } +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateMemberBalanceResponse { + #[prost(message, optional, tag = "1")] + pub error: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub result: ::core::option::Option, +} +/// Nested message and enum types in `UpdateMemberBalanceResponse`. +pub mod update_member_balance_response { + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Result { + #[prost(message, optional, tag = "1")] + pub member_balance: ::core::option::Option, + } +} +/// subject = bet.beteran.ss.member_balance.DeleteMemberBalance +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteMemberBalanceRequest { + #[prost(message, optional, tag = "1")] + pub client: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub request: ::core::option::Option, +} +/// Nested message and enum types in `DeleteMemberBalanceRequest`. +pub mod delete_member_balance_request { + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Request { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + } +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DeleteMemberBalanceResponse { + #[prost(message, optional, tag = "1")] + pub error: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub result: ::core::option::Option, +} +/// Nested message and enum types in `DeleteMemberBalanceResponse`. +pub mod delete_member_balance_response { + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Result {} +} +/// subject = bet.beteran.ss_event.member_balance.AfterUpdateMemberBalance +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AfterUpdateMemberBalanceEvent { + #[prost(message, optional, tag = "1")] + pub client: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub event: ::core::option::Option, +} +/// Nested message and enum types in `AfterUpdateMemberBalanceEvent`. +pub mod after_update_member_balance_event { + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Event { + #[prost(string, tag = "1")] + pub member_id: ::prost::alloc::string::String, + #[prost(double, tag = "2")] + pub balance: f64, + #[prost(double, tag = "3")] + pub balance_bota: f64, + #[prost(double, tag = "4")] + pub balance_sum: f64, + } +} diff --git a/src/ss/mod.rs b/src/ss/mod.rs index aa6e593..b26dd42 100644 --- a/src/ss/mod.rs +++ b/src/ss/mod.rs @@ -2,6 +2,7 @@ pub mod api; pub mod bank; pub mod identity; pub mod member; +pub mod member_balance; pub mod member_bank_account; pub mod member_bank_deposit; pub mod member_bank_withdraw;