diff --git a/build.rs b/build.rs index 7a80c1a..0894778 100644 --- a/build.rs +++ b/build.rs @@ -34,6 +34,7 @@ static TARGETS: Lazy>> = Lazy::new(|| { vec![ "./proto/models/core/network.proto", "./proto/models/bank.proto", + "./proto/models/member_balance.proto", "./proto/models/member_bank_account.proto", "./proto/models/member_bank_deposit.proto", "./proto/models/member_bank_withdraw.proto", @@ -61,6 +62,7 @@ static TARGETS: Lazy>> = Lazy::new(|| { vec![ "./proto/c2se/bank.proto", "./proto/c2se/identity.proto", + "./proto/c2se/member_balance.proto", "./proto/c2se/member_bank_account.proto", "./proto/c2se/member_bank_deposit.proto", "./proto/c2se/member_bank_withdraw.proto", @@ -77,6 +79,7 @@ static TARGETS: Lazy>> = Lazy::new(|| { "./proto/c2se/api/betting.proto", "./proto/c2se/backend/bank.proto", "./proto/c2se/backend/identity.proto", + "./proto/c2se/backend/member_balance.proto", "./proto/c2se/backend/member_bank_account.proto", "./proto/c2se/backend/member_bank_deposit.proto", "./proto/c2se/backend/member_bank_withdraw.proto", @@ -92,6 +95,7 @@ static TARGETS: Lazy>> = Lazy::new(|| { "./proto/c2se/backend/api/betting.proto", "./proto/c2se/frontend/bank.proto", "./proto/c2se/frontend/identity.proto", + "./proto/c2se/frontend/member_balance.proto", "./proto/c2se/frontend/member_bank_account.proto", "./proto/c2se/frontend/member_bank_deposit.proto", "./proto/c2se/frontend/member_bank_withdraw.proto", @@ -107,6 +111,7 @@ static TARGETS: Lazy>> = Lazy::new(|| { vec![ "./proto/ss/bank.proto", "./proto/ss/identity.proto", + "./proto/ss/member_balance.proto", "./proto/ss/member_bank_account.proto", "./proto/ss/member_bank_deposit.proto", "./proto/ss/member_bank_withdraw.proto", diff --git a/proto/c2se/backend/member_balance.proto b/proto/c2se/backend/member_balance.proto new file mode 100644 index 0000000..0de87cc --- /dev/null +++ b/proto/c2se/backend/member_balance.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package bet.beteran.c2se.backend.member_balance; + +// subject = bet.beteran.c2se.backend.member_balance.CreateMemberBalance +// subject = bet.beteran.c2se.backend.member_balance.ListMemberBalances +// subject = bet.beteran.c2se.backend.member_balance.GetMemberBalance +// subject = bet.beteran.c2se.backend.member_balance.UpdateMemberBalance +// subject = bet.beteran.c2se.backend.member_balance.DeleteMemberBalance diff --git a/proto/c2se/frontend/member_balance.proto b/proto/c2se/frontend/member_balance.proto new file mode 100644 index 0000000..9fd1679 --- /dev/null +++ b/proto/c2se/frontend/member_balance.proto @@ -0,0 +1,7 @@ +syntax = "proto3"; + +package bet.beteran.c2se.frontend.member_balance; + +// subject = bet.beteran.c2se.frontend.member_balance.CreateMemberBalance +// subject = bet.beteran.c2se.frontend.member_balance.GetMemberBalance +// subject = bet.beteran.c2se.frontend.member_balance.UpdateMemberBalance diff --git a/proto/c2se/member_balance.proto b/proto/c2se/member_balance.proto new file mode 100644 index 0000000..a180ca4 --- /dev/null +++ b/proto/c2se/member_balance.proto @@ -0,0 +1,77 @@ +syntax = "proto3"; + +package bet.beteran.c2se.member_balance; + +import "protobuf/rpc.proto"; +import "protobuf/pagination.proto"; + +import "models/member_balance.proto"; + +message CreateMemberBalanceRequest { + string member_id = 1; +} + +message CreateMemberBalanceResponse { + message Result { + bet.beteran.member_balance.MemberBalance member_balance = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message ListMemberBalancesRequest { + message Search { + optional string member_id = 1; + } + optional bet.protobuf.pagination.Pagination pagination = 1; + repeated bet.protobuf.pagination.Sort sorts = 2; + optional Search search = 3; +} + +message ListMemberBalancesResponse { + message Result { + uint64 total_count = 1; + repeated bet.beteran.member_balance.MemberBalance member_balances = 2; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message GetMemberBalanceRequest { + string id = 1; +} + +message GetMemberBalanceResponse { + message Result { + bet.beteran.member_balance.MemberBalance member_balance = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message UpdateMemberBalanceRequest { + string id = 1; + double balance = 2; + double balance_bota = 3; + double balance_sum = 4; +} + +message UpdateMemberBalanceResponse { + message Result { + bet.beteran.member_balance.MemberBalance member_balance = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + + +message DeleteMemberBalanceRequest { + string id = 1; +} + +message DeleteMemberBalanceResponse { + message Result { + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} diff --git a/proto/models/member.proto b/proto/models/member.proto index 016122e..b4282e4 100644 --- a/proto/models/member.proto +++ b/proto/models/member.proto @@ -9,6 +9,7 @@ import "models/member_class.proto"; import "models/member_level.proto"; import "models/member_game_setting.proto"; import "models/member_settlement_setting.proto"; +import "models/member_balance.proto"; enum MemberState { @@ -48,17 +49,19 @@ message MemberModel { optional bet.beteran.member_bank_account.MemberBankAccountModel bank_account = 5; optional MemberModel parent_member = 6; uint64 child_member_count = 7; - string username = 8; - string nickname = 9; - optional string mobile_phone_number = 10; - MemberState state = 11; - optional uint64 state_changed_at = 12; - optional bet.beteran.member_game_setting.MemberGameSetting member_game_setting = 13; - optional bet.beteran.member_settlement_setting.MemberSettlementSetting member_settlement_setting = 14; - optional string last_signined_ip = 15; - optional uint64 last_signined_at = 16; - uint64 created_at = 17; - uint64 updated_at = 18; - optional uint64 deleted_at = 19; + repeated uint64 children_count = 8; + string username = 9; + string nickname = 10; + optional string mobile_phone_number = 11; + MemberState state = 12; + optional uint64 state_changed_at = 13; + optional bet.beteran.member_game_setting.MemberGameSetting member_game_setting = 14; + optional bet.beteran.member_settlement_setting.MemberSettlementSetting member_settlement_setting = 15; + optional bet.beteran.member_balance.MemberBalance member_balance = 16; + optional string last_signined_ip = 17; + optional uint64 last_signined_at = 18; + uint64 created_at = 19; + uint64 updated_at = 20; + optional uint64 deleted_at = 21; } diff --git a/proto/models/member_balance.proto b/proto/models/member_balance.proto new file mode 100644 index 0000000..68a0eb7 --- /dev/null +++ b/proto/models/member_balance.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package bet.beteran.member_balance; + +message MemberBalance { + string id = 1; + string member_id = 2; + double balance = 3; + double balance_bota = 4; + double balance_sum = 5; + uint64 created_at = 6; + uint64 updated_at = 7; +} diff --git a/proto/ss/member_balance.proto b/proto/ss/member_balance.proto new file mode 100644 index 0000000..de2de8d --- /dev/null +++ b/proto/ss/member_balance.proto @@ -0,0 +1,115 @@ +syntax = "proto3"; + +package bet.beteran.ss.member_balance; + +import "models/core/network.proto"; +import "protobuf/rpc.proto"; +import "protobuf/pagination.proto"; +import "models/member_balance.proto"; + +// subject = bet.beteran.ss.member_balance.CreateMemberBalance +message CreateMemberBalanceRequest { + message Request { + string member_id = 1; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message CreateMemberBalanceResponse { + message Result { + bet.beteran.member_balance.MemberBalance member_balance = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member_balance.ListMemberBalances +message ListMemberBalancesRequest { + message Request { + message Search { + optional string member_id = 1; + } + optional bet.protobuf.pagination.Pagination pagination = 1; + repeated bet.protobuf.pagination.Sort sorts = 2; + optional Search search = 3; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message ListMemberBalancesResponse { + message Result { + uint64 total_count = 1; + repeated bet.beteran.member_balance.MemberBalance member_balances = 2; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member_balance.GetMemberBalance +message GetMemberBalanceRequest { + message Request { + string id = 1; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message GetMemberBalanceResponse { + message Result { + bet.beteran.member_balance.MemberBalance member_balance = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member_balance.UpdateMemberBalance +message UpdateMemberBalanceRequest { + message Request { + string id = 1; + double balance = 2; + double balance_bota = 3; + double balance_sum = 4; + + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message UpdateMemberBalanceResponse { + message Result { + bet.beteran.member_balance.MemberBalance member_balance = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + + +// subject = bet.beteran.ss.member_balance.DeleteMemberBalance +message DeleteMemberBalanceRequest { + message Request { + string id = 1; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message DeleteMemberBalanceResponse { + message Result { + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss_event.member_balance.AfterUpdateMemberBalance +message AfterUpdateMemberBalanceEvent { + message Event { + string member_id = 1; + double balance = 2; + double balance_bota = 3; + double balance_sum = 4; + } + bet.beteran.core.network.Client client = 1; + Event event = 2; +}