diff --git a/build.rs b/build.rs index 035daaa..8f6577f 100644 --- a/build.rs +++ b/build.rs @@ -24,10 +24,8 @@ static TARGETS: Lazy>> = Lazy::new(|| { m.insert( "protobuf", vec![ - "./proto/protobuf/rpc/error.proto", - "./proto/protobuf/pagination/pagination.proto", - "./proto/protobuf/pagination/search.proto", - "./proto/protobuf/pagination/sort.proto", + "./proto/protobuf/rpc.proto", + "./proto/protobuf/pagination.proto", ], ); @@ -35,31 +33,46 @@ static TARGETS: Lazy>> = Lazy::new(|| { "models", vec![ "./proto/models/core/network.proto", - "./proto/models/domain/site.proto", - "./proto/models/rbac/resource.proto", - "./proto/models/rbac/resource_action.proto", - "./proto/models/rbac/role.proto", - "./proto/models/member/member_class.proto", - "./proto/models/member/member_level.proto", - "./proto/models/member/member.proto", - "./proto/models/member/member_session.proto", - "./proto/models/account/bank.proto", + "./proto/models/bank.proto", + "./proto/models/member_bank_account.proto", + "./proto/models/member_bank_deposit.proto", + "./proto/models/member_bank_withdraw.proto", + "./proto/models/member_class.proto", + "./proto/models/member_level.proto", + "./proto/models/member_permission.proto", + "./proto/models/member_role.proto", + "./proto/models/member_session.proto", + "./proto/models/member.proto", + "./proto/models/resource_action.proto", + "./proto/models/resource.proto", + "./proto/models/role.proto", + "./proto/models/site.proto", ], ); m.insert( "c2se", vec![ + "./proto/c2se/bank.proto", + "./proto/c2se/identity.proto", + "./proto/c2se/member_bank_account.proto", + "./proto/c2se/member_bank_deposit.proto", + "./proto/c2se/member_bank_withdraw.proto", + "./proto/c2se/member_class.proto", + "./proto/c2se/member_level.proto", + "./proto/c2se/member.proto", + "./proto/c2se/site.proto", "./proto/c2se/core/network.proto", - "./proto/c2se/common/identity.proto", - "./proto/c2se/common/bank.proto", - "./proto/c2se/backend/site.proto", - "./proto/c2se/backend/account.proto", + "./proto/c2se/backend/bank.proto", "./proto/c2se/backend/identity.proto", + "./proto/c2se/backend/member_bank_account.proto", + "./proto/c2se/backend/member_bank_deposit.proto", + "./proto/c2se/backend/member_bank_withdraw.proto", "./proto/c2se/backend/member_class.proto", "./proto/c2se/backend/member_level.proto", "./proto/c2se/backend/member.proto", - "./proto/c2se/frontend/account.proto", + "./proto/c2se/backend/site.proto", + "./proto/c2se/frontend/bank.proto", "./proto/c2se/frontend/identity.proto", ], ); @@ -67,12 +80,15 @@ static TARGETS: Lazy>> = Lazy::new(|| { m.insert( "ss", vec![ - "./proto/ss/domain/site.proto", - "./proto/ss/member/identity.proto", - "./proto/ss/member/member.proto", - "./proto/ss/member/member_class.proto", - "./proto/ss/member/member_level.proto", - "./proto/ss/account/bank.proto", + "./proto/ss/bank.proto", + "./proto/ss/identity.proto", + "./proto/ss/member_bank_account.proto", + "./proto/ss/member_bank_deposit.proto", + "./proto/ss/member_bank_withdraw.proto", + "./proto/ss/member_class.proto", + "./proto/ss/member_level.proto", + "./proto/ss/member.proto", + "./proto/ss/site.proto", ], ); diff --git a/proto/c2se/backend/account.proto b/proto/c2se/backend/bank.proto similarity index 65% rename from proto/c2se/backend/account.proto rename to proto/c2se/backend/bank.proto index 047a485..9fc593d 100644 --- a/proto/c2se/backend/account.proto +++ b/proto/c2se/backend/bank.proto @@ -1,4 +1,9 @@ -// subject = bet.beteran.c2se.backend.bank.ListBanks +syntax = "proto3"; + +package bet.beteran.c2se.backend.bank; + // subject = bet.beteran.c2se.backend.bank.CreateBank +// subject = bet.beteran.c2se.backend.bank.ListBanks +// subject = bet.beteran.c2se.backend.bank.GetBank // subject = bet.beteran.c2se.backend.bank.UpdateBank // subject = bet.beteran.c2se.backend.bank.DeleteBank diff --git a/proto/c2se/backend/identity.proto b/proto/c2se/backend/identity.proto index 0765455..9c8103d 100644 --- a/proto/c2se/backend/identity.proto +++ b/proto/c2se/backend/identity.proto @@ -2,21 +2,8 @@ syntax = "proto3"; package bet.beteran.c2se.backend.identity; -import "protobuf/rpc/error.proto"; +// subject = bet.beteran.c2se.backend.identity.CheckUsernameForDuplication +// subject = bet.beteran.c2se.backend.identity.CheckNicknameForDuplication +// subject = bet.beteran.c2se.backend.identity.Captcha // subject = bet.beteran.c2se.backend.identity.Signin -message SigninRequest { - string security_code_hash = 1; - string security_code = 2; - string username = 3; - string password = 4; -} - -message SigninResponse { - message Result { - string access_token = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - diff --git a/proto/c2se/backend/member.proto b/proto/c2se/backend/member.proto index 4d52dc3..89b9f0f 100644 --- a/proto/c2se/backend/member.proto +++ b/proto/c2se/backend/member.proto @@ -2,114 +2,10 @@ syntax = "proto3"; package bet.beteran.c2se.backend.member; -import "protobuf/rpc/error.proto"; -import "protobuf/pagination/pagination.proto"; -import "protobuf/pagination/search.proto"; -import "protobuf/pagination/sort.proto"; - -import "models/member/member.proto"; - // subject = bet.beteran.c2se.backend.member.CreateMember -message CreateMemberRequest { - string site_id = 1; - string member_class_id = 2; - string member_level_id = 3; - optional string referrer_member_username = 4; - string username = 5; - string password = 6; - string nickname = 7; - optional string mobile_phone_number = 8; - bet.beteran.member.MemberState state = 9; -} - -message CreateMemberResponse { - message Result { - bet.beteran.member.MemberModel member = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - // subject = bet.beteran.c2se.backend.member.ListMembers -message ListMembersRequest { - optional bet.protobuf.pagination.Pagination pagination = 1; - repeated bet.protobuf.pagination.Search searches = 2; - repeated bet.protobuf.pagination.Sort sorts = 3; - optional string site_id = 4; - optional string member_class_id = 5; - optional string member_level_id = 6; - optional string referrer_member_id = 7; - optional string username_like = 8; - optional string nickname_like = 9; - optional string mobile_phone_number_like = 10; - optional string last_signined_ip = 11; - optional bet.beteran.member.MemberState state = 12; - optional uint64 deleted_at = 13; -} - -message ListMembersResponse { - message Result { - repeated bet.beteran.member.MemberModel members = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - - - // subject = bet.beteran.c2se.backend.member.GetMember -message GetMemberRequest { - string id = 1; -} - -message GetMemberResponse { - message Result { - bet.beteran.member.MemberModel member = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - // subject = bet.beteran.c2se.backend.member.GetMemberByUsername -message GetMemberByUsernameRequest { - string username = 1; -} - -message GetMemberByUsernameResponse { - message Result { - bet.beteran.member.MemberModel member = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - // subject = bet.beteran.c2se.backend.member.UpdateMember -message UpdateMemberRequest { - string id = 1; - optional string site_id = 2; - optional string member_level_id = 3; - optional string password = 4; - optional string mobile_phone_number = 5; - optional bet.beteran.member.MemberState state = 6; -} - -message UpdateMemberResponse { - message Result { - bet.beteran.member.MemberModel member = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - // subject = bet.beteran.c2se.backend.member.DeleteMember -message DeleteMemberRequest { - string id = 1; -} - -message DeleteMemberResponse { - message Result { - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} diff --git a/proto/c2se/backend/member_bank_account.proto b/proto/c2se/backend/member_bank_account.proto new file mode 100644 index 0000000..5865d23 --- /dev/null +++ b/proto/c2se/backend/member_bank_account.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package bet.beteran.c2se.backend.member_bank_account; + +// subject = bet.beteran.c2se.backend.member_bank_account.CreateMemberBankAccount +// subject = bet.beteran.c2se.backend.member_bank_account.ListMemberBankAccounts +// subject = bet.beteran.c2se.backend.member_bank_account.GetMemberBankAccount +// subject = bet.beteran.c2se.backend.member_bank_account.UpdateMemberBankAccount +// subject = bet.beteran.c2se.backend.member_bank_account.DeleteMemberBankAccount diff --git a/proto/c2se/backend/member_bank_deposit.proto b/proto/c2se/backend/member_bank_deposit.proto new file mode 100644 index 0000000..9c21bc5 --- /dev/null +++ b/proto/c2se/backend/member_bank_deposit.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + +package bet.beteran.c2se.backend.member_bank_deposit; + +// subject = bet.beteran.c2se.backend.member_bank_deposit.CreateMemberBankDeposit +// subject = bet.beteran.c2se.backend.member_bank_deposit.ListMemberBankDeposits +// subject = bet.beteran.c2se.backend.member_bank_deposit.GetMemberBankDeposit +// subject = bet.beteran.c2se.backend.member_bank_deposit.UpdateMemberBankDeposit +// subject = bet.beteran.c2se.backend.member_bank_deposit.UpdateMemberBankDepositForState +// subject = bet.beteran.c2se.backend.member_bank_deposit.DeleteMemberBankDeposit diff --git a/proto/c2se/backend/member_bank_withdraw.proto b/proto/c2se/backend/member_bank_withdraw.proto new file mode 100644 index 0000000..d9fd435 --- /dev/null +++ b/proto/c2se/backend/member_bank_withdraw.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + +package bet.beteran.c2se.backend.member_bank_withdraw; + +// subject = bet.beteran.c2se.backend.member_bank_withdraw.CreateMemberBankWithdraw +// subject = bet.beteran.c2se.backend.member_bank_withdraw.ListMemberBankWithdraws +// subject = bet.beteran.c2se.backend.member_bank_withdraw.GetMemberBankWithdraw +// subject = bet.beteran.c2se.backend.member_bank_withdraw.UpdateMemberBankWithdraw +// subject = bet.beteran.c2se.backend.member_bank_withdraw.UpdateMemberBankWithdrawForState +// subject = bet.beteran.c2se.backend.member_bank_withdraw.DeleteMemberBankWithdraw diff --git a/proto/c2se/backend/member_class.proto b/proto/c2se/backend/member_class.proto index 9e54c8e..42d989d 100644 --- a/proto/c2se/backend/member_class.proto +++ b/proto/c2se/backend/member_class.proto @@ -2,82 +2,9 @@ syntax = "proto3"; package bet.beteran.c2se.backend.member_class; -import "protobuf/rpc/error.proto"; -import "protobuf/pagination/pagination.proto"; -import "protobuf/pagination/search.proto"; -import "protobuf/pagination/sort.proto"; - -import "models/member/member_class.proto"; - // subject = bet.beteran.c2se.backend.member_class.CreateMemberClass -message CreateMemberClassRequest { - optional string parent_id = 1; - string name = 2; -} - -message CreateMemberClassResponse { - message Result { - bet.beteran.member.MemberClass member_class = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - // subject = bet.beteran.c2se.backend.member_class.ListMemberClasses -message ListMemberClassesRequest { - optional bet.protobuf.pagination.Pagination pagination = 1; - repeated bet.protobuf.pagination.Search searches = 2; - repeated bet.protobuf.pagination.Sort sorts = 3; - optional string name_like = 4; -} - -message ListMemberClassesResponse { - message Result { - repeated bet.beteran.member.MemberClass member_classes = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - - - // subject = bet.beteran.c2se.backend.member_class.GetMemberClass -message GetMemberClassRequest { - string id = 1; -} - -message GetMemberClassResponse { - message Result { - bet.beteran.member.MemberClass member_class = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - // subject = bet.beteran.c2se.backend.member_class.UpdateMemberClass -message UpdateMemberClassRequest { - string id = 1; - optional string parent_id = 2; - string name = 3; -} - -message UpdateMemberClassResponse { - message Result { - bet.beteran.member.MemberClass member_class = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - // subject = bet.beteran.c2se.backend.member_class.DeleteMemberClass -message DeleteMemberClassRequest { - string id = 1; -} - -message DeleteMemberClassResponse { - message Result { - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} diff --git a/proto/c2se/backend/member_level.proto b/proto/c2se/backend/member_level.proto index d5de7cd..51561ef 100644 --- a/proto/c2se/backend/member_level.proto +++ b/proto/c2se/backend/member_level.proto @@ -2,82 +2,9 @@ syntax = "proto3"; package bet.beteran.c2se.backend.member_level; -import "protobuf/rpc/error.proto"; -import "protobuf/pagination/pagination.proto"; -import "protobuf/pagination/search.proto"; -import "protobuf/pagination/sort.proto"; - -import "models/member/member_level.proto"; - // subject = bet.beteran.c2se.backend.member_level.CreateMemberLevel -message CreateMemberLevelRequest { - string name = 1; - uint32 sort_order = 2; -} - -message CreateMemberLevelResponse { - message Result { - bet.beteran.member.MemberLevel member_level = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - // subject = bet.beteran.c2se.backend.member_level.ListMemberLevels -message ListMemberLevelsRequest { - optional bet.protobuf.pagination.Pagination pagination = 1; - repeated bet.protobuf.pagination.Search searches = 2; - repeated bet.protobuf.pagination.Sort sorts = 3; - optional string name_like = 4; -} - -message ListMemberLevelsResponse { - message Result { - repeated bet.beteran.member.MemberLevel member_levels = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - - - // subject = bet.beteran.c2se.backend.member_level.GetMemberLevel -message GetMemberLevelRequest { - string id = 1; -} - -message GetMemberLevelResponse { - message Result { - bet.beteran.member.MemberLevel member_level = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - // subject = bet.beteran.c2se.backend.member_level.UpdateMemberLevel -message UpdateMemberLevelRequest { - string id = 1; - string name = 2; - uint32 sort_order = 3; -} - -message UpdateMemberLevelResponse { - message Result { - bet.beteran.member.MemberLevel member_level = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - // subject = bet.beteran.c2se.backend.member_level.DeleteMemberLevel -message DeleteMemberLevelRequest { - string id = 1; -} - -message DeleteMemberLevelResponse { - message Result { - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} diff --git a/proto/c2se/backend/site.proto b/proto/c2se/backend/site.proto index d8cbbe2..95ecef8 100644 --- a/proto/c2se/backend/site.proto +++ b/proto/c2se/backend/site.proto @@ -2,81 +2,8 @@ syntax = "proto3"; package bet.beteran.c2se.backend.site; -import "protobuf/rpc/error.proto"; -import "protobuf/pagination/pagination.proto"; -import "protobuf/pagination/search.proto"; -import "protobuf/pagination/sort.proto"; -import "models/domain/site.proto"; - -// subject = bet.beteran.c2se.backend.site.ListSites -message ListSitesRequest { - optional bet.protobuf.pagination.Pagination pagination = 1; - repeated bet.protobuf.pagination.Search searches = 2; - repeated bet.protobuf.pagination.Sort sorts = 3; - optional string url_like = 4; - optional string name_like = 5; - optional string path_like = 6; - optional bool show = 7; - optional bool can_use = 8; - optional string memo_like = 9; -} - -message ListSitesResponse { - message Result { - repeated bet.beteran.domain.Site sites = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - // subject = bet.beteran.c2se.backend.site.CreateSite -message CreateSiteRequest { - string url = 1; - optional string name = 2; - optional string path = 3; - bool show = 4; - bool can_use = 5; - optional string memo = 6; - optional uint64 expires_at = 7; -} - -message CreateSiteResponse { - message Result { - bet.beteran.domain.Site site = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - +// subject = bet.beteran.c2se.backend.site.ListSites +// subject = bet.beteran.c2se.backend.site.GetSite // subject = bet.beteran.c2se.backend.site.UpdateSite -message UpdateSiteRequest { - string id = 1; - string url = 2; - optional string name = 3; - optional string path = 4; - bool show = 5; - bool can_use = 6; - optional string memo = 7; - optional uint64 expires_at = 8; -} - -message UpdateSiteResponse { - message Result { - bet.beteran.domain.Site site = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - - // subject = bet.beteran.c2se.backend.site.DeleteSite -message DeleteSiteRequest { - string id = 1; -} - -message DeleteSiteResponse { - message Result { - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} diff --git a/proto/c2se/bank.proto b/proto/c2se/bank.proto new file mode 100644 index 0000000..3150d61 --- /dev/null +++ b/proto/c2se/bank.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; + +package bet.beteran.c2se.bank; + +import "protobuf/rpc.proto"; +import "protobuf/pagination.proto"; +import "models/bank.proto"; + +message CreateBankRequest { + string name = 1; + uint32 sort_order = 2; + bool show = 3; + bool can_use = 4; + optional string memo = 5; +} + +message CreateBankResponse { + message Result { + bet.beteran.bank.Bank bank = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message ListBanksRequest { + message Search { + optional string name_like = 1; + optional bool show = 2; + optional bool can_use = 3; + optional string memo_like = 4; + } + optional bet.protobuf.pagination.Pagination pagination = 1; + repeated bet.protobuf.pagination.Sort sorts = 2; + optional Search search = 3; +} + +message ListBanksResponse { + message Result { + repeated bet.beteran.bank.Bank banks = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message GetBankRequest { + string id = 1; +} + +message GetBankResponse { + message Result { + bet.beteran.bank.Bank bank = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message UpdateBankRequest { + string id = 1; + string name = 2; + uint32 sort_order = 3; + bool show = 4; + bool can_use = 5; + optional string memo = 6; +} + +message UpdateBankResponse { + message Result { + bet.beteran.bank.Bank bank = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message DeleteBankRequest { + string id = 1; +} + +message DeleteBankResponse { + message Result { + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} diff --git a/proto/c2se/common/bank.proto b/proto/c2se/common/bank.proto deleted file mode 100644 index 9c1c462..0000000 --- a/proto/c2se/common/bank.proto +++ /dev/null @@ -1,77 +0,0 @@ -syntax = "proto3"; - -package bet.beteran.c2se.common.bank; - -import "protobuf/rpc/error.proto"; -import "protobuf/pagination/pagination.proto"; -import "protobuf/pagination/search.proto"; -import "protobuf/pagination/sort.proto"; -import "models/account/bank.proto"; - -// subject = bet.beteran.c2se.common.bank.CreateBank -message CreateBankRequest { - string name = 1; - bool show = 2; - bool can_use = 3; - optional string memo = 4; - optional uint64 expires_at = 5; -} - -message CreateBankResponse { - message Result { - bet.beteran.account.Bank bank = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - - -// subject = bet.beteran.c2se.common.bank.ListBanks -message ListBanksRequest { - optional bet.protobuf.pagination.Pagination pagination = 1; - repeated bet.protobuf.pagination.Search searches = 2; - repeated bet.protobuf.pagination.Sort sorts = 3; - optional string name_like = 4; - optional bool show = 5; - optional bool can_use = 6; - optional string memo_like = 7; -} - -message ListBanksResponse { - message Result { - repeated bet.beteran.account.Bank banks = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - - -// subject = bet.beteran.c2se.common.bank.UpdateBank -message UpdateBankRequest { - string id = 1; - string name = 2; - bool show = 3; - bool can_use = 4; - optional string memo = 5; -} - -message UpdateBankResponse { - message Result { - bet.beteran.account.Bank bank = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - - -// subject = bet.beteran.c2se.common.bank.DeleteBank -message DeleteBankRequest { - string id = 1; -} - -message DeleteBankResponse { - message Result { - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} diff --git a/proto/c2se/frontend/account.proto b/proto/c2se/frontend/account.proto deleted file mode 100644 index 73c001b..0000000 --- a/proto/c2se/frontend/account.proto +++ /dev/null @@ -1 +0,0 @@ -// subject = bet.beteran.c2se.frontend.bank.ListBanks diff --git a/proto/c2se/frontend/bank.proto b/proto/c2se/frontend/bank.proto new file mode 100644 index 0000000..d1ebe53 --- /dev/null +++ b/proto/c2se/frontend/bank.proto @@ -0,0 +1,5 @@ +syntax = "proto3"; + +package bet.beteran.c2se.frontend.bank; + +// subject = bet.beteran.c2se.frontend.bank.ListBanks diff --git a/proto/c2se/frontend/identity.proto b/proto/c2se/frontend/identity.proto index d938a34..e46ab40 100644 --- a/proto/c2se/frontend/identity.proto +++ b/proto/c2se/frontend/identity.proto @@ -2,20 +2,8 @@ syntax = "proto3"; package bet.beteran.c2se.frontend.identity; -import "protobuf/rpc/error.proto"; +// subject = bet.beteran.c2se.frontend.identity.CheckUsernameForDuplication +// subject = bet.beteran.c2se.frontend.identity.CheckNicknameForDuplication +// subject = bet.beteran.c2se.frontend.identity.Captcha // subject = bet.beteran.c2se.frontend.identity.Signin -message SigninRequest { - string security_code_hash = 1; - string security_code = 2; - string username = 3; - string password = 4; -} - -message SigninResponse { - message Result { - string access_token = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} diff --git a/proto/c2se/common/identity.proto b/proto/c2se/identity.proto similarity index 67% rename from proto/c2se/common/identity.proto rename to proto/c2se/identity.proto index df66c5c..e703c77 100644 --- a/proto/c2se/common/identity.proto +++ b/proto/c2se/identity.proto @@ -1,10 +1,9 @@ syntax = "proto3"; -package bet.beteran.c2se.common.identity; +package bet.beteran.c2se.identity; -import "protobuf/rpc/error.proto"; +import "protobuf/rpc.proto"; -// subject = bet.beteran.c2se.common.identity.CheckUsernameForDuplication; message CheckUsernameForDuplicationRequest { string username = 1; } @@ -17,7 +16,6 @@ message CheckUsernameForDuplicationResponse { optional Result result = 2; } -// subject = bet.beteran.c2se.common.identity.CheckNicknameForDuplication; message CheckNicknameForDuplicationRequest { string nickname = 1; } @@ -31,7 +29,6 @@ message CheckNicknameForDuplicationResponse { } -// subject = bet.beteran.c2se.common.identity.Captcha message CaptchaRequest { } @@ -43,3 +40,18 @@ message CaptchaResponse { optional bet.protobuf.rpc.Error error = 1; optional Result result = 2; } + +message SigninRequest { + string security_code_hash = 1; + string security_code = 2; + string username = 3; + string password = 4; +} + +message SigninResponse { + message Result { + string access_token = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} diff --git a/proto/c2se/member.proto b/proto/c2se/member.proto new file mode 100644 index 0000000..77de21a --- /dev/null +++ b/proto/c2se/member.proto @@ -0,0 +1,119 @@ +syntax = "proto3"; + +package bet.beteran.c2se.member; + +import "protobuf/rpc.proto"; +import "protobuf/pagination.proto"; + +import "models/member.proto"; + +message CreateMemberRequest { + string site_id = 1; + string member_class_id = 2; + string member_level_id = 3; + optional string referrer_member_username = 4; + string username = 5; + string password = 6; + string nickname = 7; + optional string mobile_phone_number = 8; + bet.beteran.member.MemberState state = 9; +} + +message CreateMemberResponse { + message Result { + bet.beteran.member.MemberModel member = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message ListMembersRequest { + message Search { + optional string site_id = 1; + optional string member_class_id = 2; + optional string member_level_id = 3; + optional string referrer_member_id = 4; + optional string username_like = 5; + optional string nickname_like = 6; + optional string mobile_phone_number_like = 7; + optional string last_signined_ip = 8; + optional bet.beteran.member.MemberState state = 9; + optional uint64 deleted_at = 10; + } + optional bet.protobuf.pagination.Pagination pagination = 1; + repeated bet.protobuf.pagination.Sort sorts = 2; + optional Search search = 3; +} + +message ListMembersResponse { + message Result { + repeated bet.beteran.member.MemberModel members = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message GetMemberRequest { + string id = 1; +} + +message GetMemberResponse { + message Result { + bet.beteran.member.MemberModel member = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message GetMemberByUsernameRequest { + string username = 1; +} + +message GetMemberByUsernameResponse { + message Result { + bet.beteran.member.MemberModel member = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message UpdateMemberRequest { + string id = 1; + optional string site_id = 2; + optional string member_level_id = 3; + optional string password = 4; + optional string mobile_phone_number = 5; +} + +message UpdateMemberResponse { + message Result { + bet.beteran.member.MemberModel member = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message UpdateMemberForStateRequest { + string id = 1; + bet.beteran.member.MemberState state = 2; +} + +message UpdateMemberForStateResponse { + message Result { + bet.beteran.member.MemberModel member = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + + +message DeleteMemberRequest { + string id = 1; +} + +message DeleteMemberResponse { + message Result { + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} diff --git a/proto/c2se/member_bank_account.proto b/proto/c2se/member_bank_account.proto new file mode 100644 index 0000000..4eef957 --- /dev/null +++ b/proto/c2se/member_bank_account.proto @@ -0,0 +1,85 @@ +syntax = "proto3"; + +package bet.beteran.c2se.member_bank_account; + +import "protobuf/rpc.proto"; +import "protobuf/pagination.proto"; + +import "models/member_bank_account.proto"; + +message CreateMemberBankAccountRequest { + string member_id = 1; + string bank_id = 2; + string name = 3; + string account_number = 4; + optional string memo = 5; +} + +message CreateMemberBankAccountResponse { + message Result { + bet.beteran.member_bank_account.MemberBankAccount member_bank_account = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message ListMemberBankAccountsRequest { + message Search { + optional string member_id = 1; + optional string bank_id = 2; + optional string name_like = 3; + optional string account_number_like = 4; + optional string memo_like = 5; + } + optional bet.protobuf.pagination.Pagination pagination = 1; + repeated bet.protobuf.pagination.Sort sorts = 2; + optional Search search = 3; +} + +message ListMemberBankAccountsResponse { + message Result { + repeated bet.beteran.member_bank_account.MemberBankAccount member_bank_accounts = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message GetMemberBankAccountRequest { + string id = 1; +} + +message GetMemberBankAccountResponse { + message Result { + bet.beteran.member_bank_account.MemberBankAccount member_bank_account = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message UpdateMemberBankAccountRequest { + string id = 1; + string bank_id = 2; + string name = 3; + string account_number = 4; + optional string memo = 5; + +} + +message UpdateMemberBankAccountResponse { + message Result { + bet.beteran.member_bank_account.MemberBankAccount member_bank_account = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message DeleteMemberBankAccountRequest { + string id = 1; +} + +message DeleteMemberBankAccountResponse { + message Result { + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} diff --git a/proto/c2se/member_bank_deposit.proto b/proto/c2se/member_bank_deposit.proto new file mode 100644 index 0000000..6b51838 --- /dev/null +++ b/proto/c2se/member_bank_deposit.proto @@ -0,0 +1,95 @@ +syntax = "proto3"; + +package bet.beteran.c2se.member_bank_deposit; + +import "protobuf/rpc.proto"; +import "protobuf/pagination.proto"; + +import "models/member_bank_deposit.proto"; + +message CreateMemberBankDepositRequest { + string name = 1; + uint32 amount = 2; + optional string memo = 3; +} + +message CreateMemberBankDepositResponse { + message Result { + bet.beteran.member_bank_deposit.MemberBankDeposit member_bank_deposit = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message ListMemberBankDepositsRequest { + message Search { + optional string member_id = 1; + optional string name_like = 2; + optional string amount = 3; + optional string memo_like = 4; + optional string state = 5; + } + optional bet.protobuf.pagination.Pagination pagination = 1; + repeated bet.protobuf.pagination.Sort sorts = 2; + optional Search search = 3; +} + +message ListMemberBankDepositsResponse { + message Result { + repeated bet.beteran.member_bank_deposit.MemberBankDeposit member_bank_deposits = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message GetMemberBankDepositRequest { + string id = 1; +} + +message GetMemberBankDepositResponse { + message Result { + bet.beteran.member_bank_deposit.MemberBankDeposit member_bank_deposit = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message UpdateMemberBankDepositRequest { + string id = 1; + string name = 3; + uint32 amount = 5; + optional string memo = 7; +} + +message UpdateMemberBankDepositResponse { + message Result { + bet.beteran.member_bank_deposit.MemberBankDeposit member_bank_deposit = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + + +message UpdateMemberBankDepositForStateRequest { + string id = 1; + bet.beteran.member_bank_deposit.MemberBankDepositState state = 2; +} + +message UpdateMemberBankDepositForStateResponse { + message Result { + bet.beteran.member_bank_deposit.MemberBankDeposit member_bank_deposit = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message DeleteMemberBankDepositRequest { + string id = 1; +} + +message DeleteMemberBankDepositResponse { + message Result { + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} diff --git a/proto/c2se/member_bank_withdraw.proto b/proto/c2se/member_bank_withdraw.proto new file mode 100644 index 0000000..1dbef93 --- /dev/null +++ b/proto/c2se/member_bank_withdraw.proto @@ -0,0 +1,102 @@ +syntax = "proto3"; + +package bet.beteran.c2se.member_bank_withdraw; + +import "protobuf/rpc.proto"; +import "protobuf/pagination.proto"; + +import "models/member_bank_withdraw.proto"; + +message CreateMemberBankWithdrawRequest { + string bank_name = 1; + string name = 2; + string account_number = 3; + uint32 amount = 4; + string password = 5; + optional string memo = 6; +} + +message CreateMemberBankWithdrawResponse { + message Result { + bet.beteran.member_bank_withdraw.MemberBankWithdraw member_bank_withdraw = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message ListMemberBankWithdrawsRequest { + message Search { + optional string member_id = 1; + optional string bank_name_like = 2; + optional string name_like = 3; + optional string account_number_like = 4; + optional string amount = 5; + optional string memo_like = 6; + optional string state = 7; + } + optional bet.protobuf.pagination.Pagination pagination = 1; + repeated bet.protobuf.pagination.Sort sorts = 2; + optional Search search = 3; +} + +message ListMemberBankWithdrawsResponse { + message Result { + repeated bet.beteran.member_bank_withdraw.MemberBankWithdraw member_bank_withdraws = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message GetMemberBankWithdrawRequest { + string id = 1; +} + +message GetMemberBankWithdrawResponse { + message Result { + bet.beteran.member_bank_withdraw.MemberBankWithdraw member_bank_withdraw = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message UpdateMemberBankWithdrawRequest { + string id = 1; + string bank_name = 2; + string name = 3; + string account_number = 4; + uint32 amount = 5; + string password = 6; + optional string memo = 7; +} + +message UpdateMemberBankWithdrawResponse { + message Result { + bet.beteran.member_bank_withdraw.MemberBankWithdraw member_bank_withdraw = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message UpdateMemberBankWithdrawForStateRequest { + string id = 1; + bet.beteran.member_bank_withdraw.MemberBankWithdrawState state = 2; +} + +message UpdateMemberBankWithdrawForStateResponse { + message Result { + bet.beteran.member_bank_withdraw.MemberBankWithdraw member_bank_withdraw = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message DeleteMemberBankWithdrawRequest { + string id = 1; +} + +message DeleteMemberBankWithdrawResponse { + message Result { + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} diff --git a/proto/c2se/member_class.proto b/proto/c2se/member_class.proto new file mode 100644 index 0000000..420f267 --- /dev/null +++ b/proto/c2se/member_class.proto @@ -0,0 +1,74 @@ +syntax = "proto3"; + +package bet.beteran.c2se.member_class; + +import "protobuf/rpc.proto"; +import "protobuf/pagination.proto"; +import "models/member_class.proto"; + +message CreateMemberClassRequest { + optional string parent_id = 1; + string name = 2; +} + +message CreateMemberClassResponse { + message Result { + bet.beteran.member_class.MemberClass member_class = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message ListMemberClassesRequest { + message Search { + optional string name_like = 4; + } + optional bet.protobuf.pagination.Pagination pagination = 1; + repeated bet.protobuf.pagination.Sort sorts = 2; + optional Search search = 3; +} + +message ListMemberClassesResponse { + message Result { + repeated bet.beteran.member_class.MemberClass member_classes = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message GetMemberClassRequest { + string id = 1; +} + +message GetMemberClassResponse { + message Result { + bet.beteran.member_class.MemberClass member_class = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message UpdateMemberClassRequest { + string id = 1; + optional string parent_id = 2; + string name = 3; +} + +message UpdateMemberClassResponse { + message Result { + bet.beteran.member_class.MemberClass member_class = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message DeleteMemberClassRequest { + string id = 1; +} + +message DeleteMemberClassResponse { + message Result { + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} diff --git a/proto/c2se/member_level.proto b/proto/c2se/member_level.proto new file mode 100644 index 0000000..a53e6a4 --- /dev/null +++ b/proto/c2se/member_level.proto @@ -0,0 +1,74 @@ +syntax = "proto3"; + +package bet.beteran.c2se.member_level; + +import "protobuf/rpc.proto"; +import "protobuf/pagination.proto"; +import "models/member_level.proto"; + +message CreateMemberLevelRequest { + string name = 1; + uint32 sort_order = 2; +} + +message CreateMemberLevelResponse { + message Result { + bet.beteran.member_level.MemberLevel member_level = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message ListMemberLevelsRequest { + message Search { + optional string name_like = 1; + } + optional bet.protobuf.pagination.Pagination pagination = 1; + repeated bet.protobuf.pagination.Sort sorts = 2; + optional Search search = 3; +} + +message ListMemberLevelsResponse { + message Result { + repeated bet.beteran.member_level.MemberLevel member_levels = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message GetMemberLevelRequest { + string id = 1; +} + +message GetMemberLevelResponse { + message Result { + bet.beteran.member_level.MemberLevel member_level = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message UpdateMemberLevelRequest { + string id = 1; + string name = 2; + uint32 sort_order = 3; +} + +message UpdateMemberLevelResponse { + message Result { + bet.beteran.member_level.MemberLevel member_level = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message DeleteMemberLevelRequest { + string id = 1; +} + +message DeleteMemberLevelResponse { + message Result { + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} diff --git a/proto/c2se/site.proto b/proto/c2se/site.proto new file mode 100644 index 0000000..db452e3 --- /dev/null +++ b/proto/c2se/site.proto @@ -0,0 +1,89 @@ +syntax = "proto3"; + +package bet.beteran.c2se.site; + +import "protobuf/rpc.proto"; +import "protobuf/pagination.proto"; +import "models/site.proto"; + +message CreateSiteRequest { + string url = 1; + optional string name = 2; + optional string path = 3; + bool show = 4; + bool can_use = 5; + optional string memo = 6; + optional uint64 expires_at = 7; +} + +message CreateSiteResponse { + message Result { + bet.beteran.site.Site site = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message ListSitesRequest { + message Search { + optional string url_like = 1; + optional string name_like = 2; + optional string path_like = 3; + optional bool show = 4; + optional bool can_use = 5; + optional string memo_like = 6; + } + optional bet.protobuf.pagination.Pagination pagination = 1; + repeated bet.protobuf.pagination.Sort sorts = 2; + optional Search search = 3; +} + +message ListSitesResponse { + message Result { + repeated bet.beteran.site.Site sites = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message GetSiteRequest { + string id = 1; +} + +message GetSiteResponse { + message Result { + bet.beteran.site.Site site = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message UpdateSiteRequest { + string id = 1; + string url = 2; + optional string name = 3; + optional string path = 4; + bool show = 5; + bool can_use = 6; + optional string memo = 7; + optional uint64 expires_at = 8; +} + +message UpdateSiteResponse { + message Result { + bet.beteran.site.Site site = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +message DeleteSiteRequest { + string id = 1; +} + +message DeleteSiteResponse { + message Result { + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} diff --git a/proto/models/account/bank.proto b/proto/models/account/bank.proto deleted file mode 100644 index b0c378a..0000000 --- a/proto/models/account/bank.proto +++ /dev/null @@ -1,13 +0,0 @@ -syntax = "proto3"; - -package bet.beteran.account; - -message Bank { - string id = 1; - string name = 2; - bool show = 3; - bool can_use = 4; - optional string memo = 5; - uint64 created_at = 6; - uint64 updated_at = 7; -} diff --git a/proto/models/bank.proto b/proto/models/bank.proto new file mode 100644 index 0000000..45d5fbb --- /dev/null +++ b/proto/models/bank.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +package bet.beteran.bank; + +message Bank { + string id = 1; + string name = 2; + bool sort_order = 3; + bool show = 4; + bool can_use = 5; + optional string memo = 6; + uint64 created_at = 7; + uint64 updated_at = 8; +} diff --git a/proto/models/member/member.proto b/proto/models/member.proto similarity index 82% rename from proto/models/member/member.proto rename to proto/models/member.proto index 12e978c..d4d73de 100644 --- a/proto/models/member/member.proto +++ b/proto/models/member.proto @@ -2,10 +2,10 @@ syntax = "proto3"; package bet.beteran.member; -import "models/domain/site.proto"; +import "models/site.proto"; -import "models/member/member_class.proto"; -import "models/member/member_level.proto"; +import "models/member_class.proto"; +import "models/member_level.proto"; enum MemberState { @@ -39,9 +39,9 @@ message Member { message MemberModel { string id = 1; - bet.beteran.domain.Site site = 2; - MemberClass member_class = 3; - MemberLevel member_level = 4; + bet.beteran.site.Site site = 2; + bet.beteran.member_class.MemberClass member_class = 3; + bet.beteran.member_level.MemberLevel member_level = 4; optional Member referrer_member = 5; uint64 referred_count = 6; string username = 7; diff --git a/proto/models/member/member_permission.proto b/proto/models/member/member_permission.proto deleted file mode 100644 index e69de29..0000000 diff --git a/proto/models/member/member_role.proto b/proto/models/member/member_role.proto deleted file mode 100644 index e69de29..0000000 diff --git a/proto/models/member_bank_account.proto b/proto/models/member_bank_account.proto new file mode 100644 index 0000000..2139e09 --- /dev/null +++ b/proto/models/member_bank_account.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +package bet.beteran.member_bank_account; + +message MemberBankAccount { + string id = 1; + string member_id = 2; + string bank_id = 3; + string name = 4; + string account_number = 5; + optional string memo = 6; + uint64 created_at = 7; + uint64 updated_at = 8; +} diff --git a/proto/models/member_bank_deposit.proto b/proto/models/member_bank_deposit.proto new file mode 100644 index 0000000..73a9c35 --- /dev/null +++ b/proto/models/member_bank_deposit.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +package bet.beteran.member_bank_deposit; + +enum MemberBankDepositState { + NONE = 0; + APPLICATION = 1; + COMPLETE = 2; +} + +message MemberBankDeposit { + string id = 1; + string member_id = 2; + string name = 3; + uint32 amount = 4; + optional string memo = 5; + MemberBankDepositState state = 6; + uint64 state_changed_at = 7; + uint64 created_at = 8; + uint64 updated_at = 9; +} diff --git a/proto/models/member_bank_withdraw.proto b/proto/models/member_bank_withdraw.proto new file mode 100644 index 0000000..3cf5da5 --- /dev/null +++ b/proto/models/member_bank_withdraw.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package bet.beteran.member_bank_withdraw; + +enum MemberBankWithdrawState { + NONE = 0; + APPLICATION = 1; + COMPLETE = 2; +} + +message MemberBankWithdraw { + string id = 1; + string member_id = 2; + string bank_name = 3; + string name = 4; + string account_number = 5; + uint32 amount = 6; + string password = 7; + optional string memo = 8; + MemberBankWithdrawState state = 9; + uint64 state_changed_at = 10; + uint64 created_at = 11; + uint64 updated_at = 12; +} diff --git a/proto/models/member/member_class.proto b/proto/models/member_class.proto similarity index 82% rename from proto/models/member/member_class.proto rename to proto/models/member_class.proto index 8c8b302..6a65d9f 100644 --- a/proto/models/member/member_class.proto +++ b/proto/models/member_class.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package bet.beteran.member; +package bet.beteran.member_class; message MemberClass { string id = 1; diff --git a/proto/models/member/member_level.proto b/proto/models/member_level.proto similarity index 82% rename from proto/models/member/member_level.proto rename to proto/models/member_level.proto index 1b43eef..d8e758f 100644 --- a/proto/models/member/member_level.proto +++ b/proto/models/member_level.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package bet.beteran.member; +package bet.beteran.member_level; message MemberLevel { string id = 1; diff --git a/proto/models/member_permission.proto b/proto/models/member_permission.proto new file mode 100644 index 0000000..e38a758 --- /dev/null +++ b/proto/models/member_permission.proto @@ -0,0 +1,3 @@ +syntax = "proto3"; + +package bet.beteran.member_permission; \ No newline at end of file diff --git a/proto/models/member_role.proto b/proto/models/member_role.proto new file mode 100644 index 0000000..72aca2c --- /dev/null +++ b/proto/models/member_role.proto @@ -0,0 +1,3 @@ +syntax = "proto3"; + +package bet.beteran.member_role; \ No newline at end of file diff --git a/proto/models/member/member_session.proto b/proto/models/member_session.proto similarity index 60% rename from proto/models/member/member_session.proto rename to proto/models/member_session.proto index bd073fe..75596a6 100644 --- a/proto/models/member/member_session.proto +++ b/proto/models/member_session.proto @@ -1,12 +1,12 @@ syntax = "proto3"; -package bet.beteran.member; +package bet.beteran.member_session; -import "models/member/member.proto"; +import "models/member.proto"; message MemberSession { string id = 1; - Member member = 2; + bet.beteran.member.Member member = 2; string data = 3; uint64 last_accessed_at = 4; uint64 expires_at = 5; diff --git a/proto/models/rbac/resource.proto b/proto/models/resource.proto similarity index 87% rename from proto/models/rbac/resource.proto rename to proto/models/resource.proto index b502b1a..97a41ab 100644 --- a/proto/models/rbac/resource.proto +++ b/proto/models/resource.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package bet.beteran.rbac; +package bet.beteran.resource; message Resource { string id = 1; diff --git a/proto/models/rbac/resource_action.proto b/proto/models/resource_action.proto similarity index 63% rename from proto/models/rbac/resource_action.proto rename to proto/models/resource_action.proto index d4ce175..a5e2b36 100644 --- a/proto/models/rbac/resource_action.proto +++ b/proto/models/resource_action.proto @@ -1,12 +1,12 @@ syntax = "proto3"; -package bet.beteran.rbac; +package bet.beteran.resource_action; -import "models/rbac/resource.proto"; +import "models/resource.proto"; message ResourceAction { string id = 1; - Resource resource = 2; + bet.beteran.resource.Resource resource = 2; string name = 3; string key = 4; string description = 5; diff --git a/proto/models/rbac/role.proto b/proto/models/role.proto similarity index 88% rename from proto/models/rbac/role.proto rename to proto/models/role.proto index 076cca4..108c75f 100644 --- a/proto/models/rbac/role.proto +++ b/proto/models/role.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package bet.beteran.rbac; +package bet.beteran.role; message Role { string id = 1; diff --git a/proto/models/domain/site.proto b/proto/models/site.proto similarity index 90% rename from proto/models/domain/site.proto rename to proto/models/site.proto index b6eb78b..2217704 100644 --- a/proto/models/domain/site.proto +++ b/proto/models/site.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package bet.beteran.domain; +package bet.beteran.site; message Site { string id = 1; diff --git a/proto/protobuf/pagination/pagination.proto b/proto/protobuf/pagination.proto similarity index 81% rename from proto/protobuf/pagination/pagination.proto rename to proto/protobuf/pagination.proto index d754d5c..4fe85be 100644 --- a/proto/protobuf/pagination/pagination.proto +++ b/proto/protobuf/pagination.proto @@ -14,3 +14,13 @@ message Pagination { optional uint32 page = 1; optional uint32 page_size = 2; } + +enum SortOrder { + ASC = 0; + DESC = 1; +} + +message Sort { + string by = 1; + SortOrder order = 2; +} diff --git a/proto/protobuf/pagination/search.proto b/proto/protobuf/pagination/search.proto deleted file mode 100644 index 9586edb..0000000 --- a/proto/protobuf/pagination/search.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; - -package bet.protobuf.pagination; - -option csharp_namespace = "Bet.Protobuf.Pagination"; -option cc_enable_arenas = true; -option java_package = "com.bet.protobuf.pagination"; -option java_outer_classname = "PaginationProto"; -option java_multiple_files = true; -option objc_class_prefix = "BetPagination"; -option go_package = "bet.com/protobuf/pagination"; - -message Search { - string key = 1; - string value = 2; -} diff --git a/proto/protobuf/pagination/sort.proto b/proto/protobuf/pagination/sort.proto deleted file mode 100644 index 7d5b6eb..0000000 --- a/proto/protobuf/pagination/sort.proto +++ /dev/null @@ -1,21 +0,0 @@ -syntax = "proto3"; - -package bet.protobuf.pagination; - -option csharp_namespace = "Bet.Protobuf.Pagination"; -option cc_enable_arenas = true; -option java_package = "com.bet.protobuf.pagination"; -option java_outer_classname = "PaginationProto"; -option java_multiple_files = true; -option objc_class_prefix = "BetPagination"; -option go_package = "bet.com/protobuf/pagination"; - -enum SortOrder { - ASC = 0; - DESC = 1; -} - -message Sort { - string by = 1; - SortOrder order = 2; -} diff --git a/proto/protobuf/rpc/error.proto b/proto/protobuf/rpc.proto similarity index 100% rename from proto/protobuf/rpc/error.proto rename to proto/protobuf/rpc.proto diff --git a/proto/ss/.gitkeep b/proto/ss/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/proto/ss/account/bank.proto b/proto/ss/account/bank.proto deleted file mode 100644 index a355b74..0000000 --- a/proto/ss/account/bank.proto +++ /dev/null @@ -1,79 +0,0 @@ -syntax = "proto3"; - -package bet.beteran.ss.account.bank; - -import "protobuf/rpc/error.proto"; -import "protobuf/pagination/pagination.proto"; -import "protobuf/pagination/search.proto"; -import "protobuf/pagination/sort.proto"; -import "models/core/network.proto"; -import "models/account/bank.proto"; - -// subject = bet.beteran.ss.account.bank.ListBanks; -message ListBanksRequest { - bet.beteran.core.network.Client client = 1; - optional bet.protobuf.pagination.Pagination pagination = 2; - repeated bet.protobuf.pagination.Search searches = 3; - repeated bet.protobuf.pagination.Sort sorts = 4; - optional string name_like = 5; - optional bool show = 6; - optional bool can_use = 7; - optional string memo_like = 8; -} - -message ListBanksResponse { - message Result { - repeated bet.beteran.account.Bank banks = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - -// subject = bet.beteran.ss.account.bank.CreateBank; -message CreateBankRequest { - bet.beteran.core.network.Client client = 1; - string name = 2; - bool show = 3; - bool can_use = 4; - optional string memo = 5; -} - -message CreateBankResponse { - message Result { - bet.beteran.account.Bank bank = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - -// subject = bet.beteran.ss.account.bank.UpdateBank -message UpdateBankRequest { - bet.beteran.core.network.Client client = 1; - string id = 2; - string name = 3; - bool show = 4; - bool can_use = 5; - optional string memo = 6; -} - -message UpdateBankResponse { - message Result { - bet.beteran.account.Bank bank = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - - -// subject = bet.beteran.ss.account.bank.DeleteBank -message DeleteBankRequest { - bet.beteran.core.network.Client client = 1; - string id = 2; -} - -message DeleteBankResponse { - message Result { - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} diff --git a/proto/ss/bank.proto b/proto/ss/bank.proto new file mode 100644 index 0000000..cd9a3e6 --- /dev/null +++ b/proto/ss/bank.proto @@ -0,0 +1,113 @@ +syntax = "proto3"; + +package bet.beteran.ss.bank; + +import "models/core/network.proto"; +import "protobuf/rpc.proto"; +import "protobuf/pagination.proto"; +import "models/bank.proto"; + +// subject = bet.beteran.ss.bank.CreateBank; +message CreateBankRequest { + message Request { + string name = 1; + uint32 sort_order = 2; + bool show = 3; + bool can_use = 4; + optional string memo = 5; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message CreateBankResponse { + message Result { + bet.beteran.bank.Bank bank = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + + +// subject = bet.beteran.ss.bank.ListBanks; +message ListBanksRequest { + message Request { + message Search { + optional string name_like = 1; + optional bool show = 2; + optional bool can_use = 3; + optional string memo_like = 4; + } + 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 ListBanksResponse { + message Result { + repeated bet.beteran.bank.Bank banks = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + + +// subject = bet.beteran.ss.bank.GetBank +message GetBankRequest { + message Request { + string id = 1; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message GetBankResponse { + message Result { + bet.beteran.bank.Bank bank = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + + +// subject = bet.beteran.ss.bank.UpdateBank +message UpdateBankRequest { + message Request { + string id = 1; + string name = 2; + uint32 sort_order = 3; + bool show = 4; + bool can_use = 5; + optional string memo = 6; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message UpdateBankResponse { + message Result { + bet.beteran.bank.Bank bank = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + + +// subject = bet.beteran.ss.bank.DeleteBank +message DeleteBankRequest { + message Request { + string id = 1; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message DeleteBankResponse { + message Result { + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} diff --git a/proto/ss/domain/site.proto b/proto/ss/domain/site.proto deleted file mode 100644 index 2cc9494..0000000 --- a/proto/ss/domain/site.proto +++ /dev/null @@ -1,87 +0,0 @@ -syntax = "proto3"; - -package bet.beteran.ss.domain.site; - -import "protobuf/rpc/error.proto"; -import "protobuf/pagination/pagination.proto"; -import "protobuf/pagination/search.proto"; -import "protobuf/pagination/sort.proto"; -import "models/core/network.proto"; -import "models/domain/site.proto"; - -// subject = bet.beteran.ss.domain.site.ListSites; -message ListSitesRequest { - bet.beteran.core.network.Client client = 1; - optional bet.protobuf.pagination.Pagination pagination = 2; - repeated bet.protobuf.pagination.Search searches = 3; - repeated bet.protobuf.pagination.Sort sorts = 4; - optional string url_like = 5; - optional string name_like = 6; - optional string path_like = 7; - optional bool show = 8; - optional bool can_use = 9; - optional string memo_like = 10; -} - -message ListSitesResponse { - message Result { - repeated bet.beteran.domain.Site sites = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - -// subject = bet.beteran.ss.domain.site.CreateSite; -message CreateSiteRequest { - bet.beteran.core.network.Client client = 1; - string url = 2; - optional string name = 3; - optional string path = 4; - bool show = 5; - bool can_use = 6; - optional string memo = 7; - optional uint64 expires_at = 8; -} - -message CreateSiteResponse { - message Result { - bet.beteran.domain.Site site = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - -// subject = bet.beteran.ss.domain.site.UpdateSite -message UpdateSiteRequest { - bet.beteran.core.network.Client client = 1; - string id = 2; - string url = 3; - optional string name = 4; - optional string path = 5; - bool show = 6; - bool can_use = 7; - optional string memo = 8; - optional uint64 expires_at = 9; -} - -message UpdateSiteResponse { - message Result { - bet.beteran.domain.Site site = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - - -// subject = bet.beteran.ss.domain.site.DeleteSite -message DeleteSiteRequest { - bet.beteran.core.network.Client client = 1; - string id = 2; -} - -message DeleteSiteResponse { - message Result { - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} diff --git a/proto/ss/member/identity.proto b/proto/ss/identity.proto similarity index 58% rename from proto/ss/member/identity.proto rename to proto/ss/identity.proto index 7c18ac1..4388844 100644 --- a/proto/ss/member/identity.proto +++ b/proto/ss/identity.proto @@ -1,16 +1,19 @@ syntax = "proto3"; -package bet.beteran.ss.member.identity; +package bet.beteran.ss.identity; -import "protobuf/rpc/error.proto"; import "models/core/network.proto"; -import "models/member/member.proto"; +import "protobuf/rpc.proto"; +import "models/member.proto"; -// subject = bet.beteran.ss.member.identity.CheckUsernameForDuplication; +// subject = bet.beteran.ss.identity.CheckUsernameForDuplication; message CheckUsernameForDuplicationRequest { + message Request { + string username = 1; + } bet.beteran.core.network.Client client = 1; - string username = 2; + Request request = 2; } message CheckUsernameForDuplicationResponse { @@ -21,10 +24,13 @@ message CheckUsernameForDuplicationResponse { optional Result result = 2; } -// subject = bet.beteran.ss.member.identity.CheckNicknameForDuplication; +// subject = bet.beteran.ss.identity.CheckNicknameForDuplication; message CheckNicknameForDuplicationRequest { + message Request { + string nickname = 1; + } bet.beteran.core.network.Client client = 1; - string nickname = 2; + Request request = 2; } message CheckNicknameForDuplicationResponse { @@ -35,9 +41,12 @@ message CheckNicknameForDuplicationResponse { optional Result result = 2; } -// subject = bet.beteran.ss.member.identity.Captcha +// subject = bet.beteran.ss.identity.Captcha message CaptchaRequest { + message Request { + } bet.beteran.core.network.Client client = 1; + Request request = 2; } message CaptchaResponse { @@ -50,13 +59,16 @@ message CaptchaResponse { } -// subject = bet.beteran.ss.member.identity.Signin +// subject = bet.beteran.ss.identity.Signin message SigninRequest { + message Request { + string security_code_hash = 1; + string security_code = 2; + string username = 3; + string password = 4; + } bet.beteran.core.network.Client client = 1; - string security_code_hash = 2; - string security_code = 3; - string username = 4; - string password = 5; + Request request = 2; } message SigninResponse { @@ -67,8 +79,11 @@ message SigninResponse { optional Result result = 2; } -// subject = bet.beteran.ss.event.member.identity.AfterSignin +// subject = bet.beteran.ss_event.identity.AfterSignin message AfterSigninEvent { + message Event { + bet.beteran.member.Member member = 1; + } bet.beteran.core.network.Client client = 1; - bet.beteran.member.Member member = 2; + Event event = 2; } diff --git a/proto/ss/member.proto b/proto/ss/member.proto new file mode 100644 index 0000000..c4e9a73 --- /dev/null +++ b/proto/ss/member.proto @@ -0,0 +1,154 @@ +syntax = "proto3"; + +package bet.beteran.ss.member; + +import "protobuf/rpc.proto"; +import "protobuf/pagination.proto"; +import "models/core/network.proto"; + +import "models/member.proto"; + +// subject = bet.beteran.ss.member.CreateMember +message CreateMemberRequest { + message Request { + string site_id = 1; + string member_class_id = 2; + string member_level_id = 3; + optional string referrer_member_username = 4; + string username = 5; + string password = 6; + string nickname = 7; + optional string mobile_phone_number = 8; + bet.beteran.member.MemberState state = 9; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message CreateMemberResponse { + message Result { + bet.beteran.member.MemberModel member = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member.ListMembers +message ListMembersRequest { + message Request { + message Search { + optional string site_id = 1; + optional string member_class_id = 2; + optional string member_level_id = 3; + optional string referrer_member_id = 4; + optional string username_like = 5; + optional string nickname_like = 6; + optional string mobile_phone_number_like = 7; + optional string last_signined_ip = 8; + optional bet.beteran.member.MemberState state = 9; + optional uint64 deleted_at = 10; + } + 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 ListMembersResponse { + message Result { + repeated bet.beteran.member.MemberModel members = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member.GetMember +message GetMemberRequest { + message Request { + string id = 1; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message GetMemberResponse { + message Result { + bet.beteran.member.MemberModel member = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member.GetMemberByUsername +message GetMemberByUsernameRequest { + message Request { + string username = 1; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message GetMemberByUsernameResponse { + message Result { + bet.beteran.member.MemberModel member = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member.UpdateMember +message UpdateMemberRequest { + message Request { + string id = 1; + optional string site_id = 2; + optional string member_level_id = 3; + optional string password = 4; + optional string mobile_phone_number = 5; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message UpdateMemberResponse { + message Result { + bet.beteran.member.MemberModel member = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member.UpdateMemberForState +message UpdateMemberForStateRequest { + message Request { + string id = 1; + bet.beteran.member.MemberState state = 2; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message UpdateMemberForStateResponse { + message Result { + bet.beteran.member.MemberModel member = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member.DeleteMember +message DeleteMemberRequest { + message Request { + string id = 1; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message DeleteMemberResponse { + message Result { + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} diff --git a/proto/ss/member/member.proto b/proto/ss/member/member.proto deleted file mode 100644 index 62c66ad..0000000 --- a/proto/ss/member/member.proto +++ /dev/null @@ -1,120 +0,0 @@ -syntax = "proto3"; - -package bet.beteran.ss.member; - -import "protobuf/rpc/error.proto"; -import "models/core/network.proto"; -import "protobuf/pagination/pagination.proto"; -import "protobuf/pagination/search.proto"; -import "protobuf/pagination/sort.proto"; - -import "models/member/member.proto"; - -// subject = bet.beteran.ss.member.CreateMember -message CreateMemberRequest { - bet.beteran.core.network.Client client = 1; - string site_id = 2; - string member_class_id = 3; - string member_level_id = 4; - optional string referrer_member_username = 5; - string username = 6; - string password = 7; - string nickname = 8; - optional string mobile_phone_number = 9; - bet.beteran.member.MemberState state = 10; -} - -message CreateMemberResponse { - message Result { - bet.beteran.member.MemberModel member = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - -// subject = bet.beteran.ss.member.ListMembers -message ListMembersRequest { - bet.beteran.core.network.Client client = 1; - optional bet.protobuf.pagination.Pagination pagination = 2; - repeated bet.protobuf.pagination.Search searches = 3; - repeated bet.protobuf.pagination.Sort sorts = 4; - optional string site_id = 5; - optional string member_class_id = 6; - optional string member_level_id = 7; - optional string referrer_member_id = 8; - optional string username_like = 9; - optional string nickname_like = 10; - optional string mobile_phone_number_like = 11; - optional string last_signined_ip = 12; - optional bet.beteran.member.MemberState state = 13; - optional uint64 deleted_at = 14; -} - -message ListMembersResponse { - message Result { - repeated bet.beteran.member.MemberModel members = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - -// subject = bet.beteran.ss.member.GetMember -message GetMemberRequest { - bet.beteran.core.network.Client client = 1; - string id = 2; -} - -message GetMemberResponse { - message Result { - bet.beteran.member.MemberModel member = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - -// subject = bet.beteran.ss.member.GetMemberByUsername -message GetMemberByUsernameRequest { - bet.beteran.core.network.Client client = 1; - string username = 2; -} - -message GetMemberByUsernameResponse { - message Result { - bet.beteran.member.MemberModel member = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - - -// subject = bet.beteran.ss.member.UpdateMember -message UpdateMemberRequest { - bet.beteran.core.network.Client client = 1; - string id = 2; - optional string site_id = 3; - optional string member_level_id = 4; - optional string password = 5; - optional string mobile_phone_number = 6; - optional bet.beteran.member.MemberState state = 7; -} - -message UpdateMemberResponse { - message Result { - bet.beteran.member.MemberModel member = 1; - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} - -// subject = bet.beteran.ss.member.DeleteMember -message DeleteMemberRequest { - bet.beteran.core.network.Client client = 1; - string id = 2; -} - -message DeleteMemberResponse { - message Result { - } - optional bet.protobuf.rpc.Error error = 1; - optional Result result = 2; -} diff --git a/proto/ss/member_bank_account.proto b/proto/ss/member_bank_account.proto new file mode 100644 index 0000000..28abcdd --- /dev/null +++ b/proto/ss/member_bank_account.proto @@ -0,0 +1,110 @@ +syntax = "proto3"; + +package bet.beteran.ss.member_bank_account; + +import "models/core/network.proto"; +import "protobuf/rpc.proto"; +import "protobuf/pagination.proto"; +import "models/member_bank_account.proto"; + +// subject = bet.beteran.ss.member_bank_account.CreateMemberBankAccount +message CreateMemberBankAccountRequest { + message Request { + string member_id = 1; + string bank_id = 2; + string name = 3; + string account_number = 4; + optional string memo = 5; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message CreateMemberBankAccountResponse { + message Result { + bet.beteran.member_bank_account.MemberBankAccount member_bank_account = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member_bank_account.ListMemberBankAccounts +message ListMemberBankAccountsRequest { + message Request { + message Search { + optional string member_id = 1; + optional string bank_id = 2; + optional string name_like = 3; + optional string account_number_like = 4; + optional string memo_like = 5; + } + 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 ListMemberBankAccountsResponse { + message Result { + repeated bet.beteran.member_bank_account.MemberBankAccount member_bank_accounts = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member_bank_account.GetMemberBankAccount +message GetMemberBankAccountRequest { + message Request { + string id = 1; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message GetMemberBankAccountResponse { + message Result { + bet.beteran.member_bank_account.MemberBankAccount member_bank_account = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member_bank_account.UpdateMemberBankAccount +message UpdateMemberBankAccountRequest { + message Request { + string id = 1; + string bank_id = 2; + string name = 3; + string account_number = 4; + optional string memo = 5; + + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message UpdateMemberBankAccountResponse { + message Result { + bet.beteran.member_bank_account.MemberBankAccount member_bank_account = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member_bank_account.DeleteMemberBankAccount +message DeleteMemberBankAccountRequest { + message Request { + string id = 1; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message DeleteMemberBankAccountResponse { + message Result { + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} diff --git a/proto/ss/member_bank_deposit.proto b/proto/ss/member_bank_deposit.proto new file mode 100644 index 0000000..bde0073 --- /dev/null +++ b/proto/ss/member_bank_deposit.proto @@ -0,0 +1,124 @@ +syntax = "proto3"; + +package bet.beteran.ss.member_bank_deposit; + +import "models/core/network.proto"; +import "protobuf/rpc.proto"; +import "protobuf/pagination.proto"; +import "models/member_bank_deposit.proto"; + +// subject = bet.beteran.ss.member_bank_deposit.CreateMemberBankDeposit +message CreateMemberBankDepositRequest { + message Request { + string name = 1; + uint32 amount = 2; + optional string memo = 3; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message CreateMemberBankDepositResponse { + message Result { + bet.beteran.member_bank_deposit.MemberBankDeposit member_bank_deposit = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member_bank_deposit.ListMemberBankDeposits +message ListMemberBankDepositsRequest { + message Request { + message Search { + optional string member_id = 1; + optional string name_like = 2; + optional string amount = 3; + optional string memo_like = 4; + optional string state = 5; + } + 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 ListMemberBankDepositsResponse { + message Result { + repeated bet.beteran.member_bank_deposit.MemberBankDeposit member_bank_deposits = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member_bank_deposit.GetMemberBankDeposit +message GetMemberBankDepositRequest { + message Request { + string id = 1; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message GetMemberBankDepositResponse { + message Result { + bet.beteran.member_bank_deposit.MemberBankDeposit member_bank_deposit = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member_bank_deposit.UpdateMemberBankDeposit +message UpdateMemberBankDepositRequest { + message Request { + string id = 1; + string name = 3; + uint32 amount = 5; + optional string memo = 7; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message UpdateMemberBankDepositResponse { + message Result { + bet.beteran.member_bank_deposit.MemberBankDeposit member_bank_deposit = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member_bank_deposit.UpdateMemberBankDepositForState +message UpdateMemberBankDepositForStateRequest { + message Request { + string id = 1; + bet.beteran.member_bank_deposit.MemberBankDepositState state = 2; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message UpdateMemberBankDepositForStateResponse { + message Result { + bet.beteran.member_bank_deposit.MemberBankDeposit member_bank_deposit = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member_bank_deposit.DeleteMemberBankDeposit +message DeleteMemberBankDepositRequest { + message Request { + string id = 1; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message DeleteMemberBankDepositResponse { + message Result { + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} diff --git a/proto/ss/member_bank_withdraw.proto b/proto/ss/member_bank_withdraw.proto new file mode 100644 index 0000000..24b1d87 --- /dev/null +++ b/proto/ss/member_bank_withdraw.proto @@ -0,0 +1,132 @@ +syntax = "proto3"; + +package bet.beteran.ss.member_bank_withdraw; + +import "models/core/network.proto"; +import "protobuf/rpc.proto"; +import "protobuf/pagination.proto"; +import "models/member_bank_withdraw.proto"; + +// subject = bet.beteran.ss.member_bank_withdraw.CreateMemberBankWithdraw +message CreateMemberBankWithdrawRequest { + message Request { + string bank_name = 1; + string name = 2; + string account_number = 3; + uint32 amount = 4; + string password = 5; + optional string memo = 6; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message CreateMemberBankWithdrawResponse { + message Result { + bet.beteran.member_bank_withdraw.MemberBankWithdraw member_bank_withdraw = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member_bank_withdraw.ListMemberBankWithdraws +message ListMemberBankWithdrawsRequest { + message Request { + message Search { + optional string member_id = 1; + optional string bank_name_like = 2; + optional string name_like = 3; + optional string account_number_like = 4; + optional string amount = 5; + optional string memo_like = 6; + optional string state = 7; + } + 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 ListMemberBankWithdrawsResponse { + message Result { + repeated bet.beteran.member_bank_withdraw.MemberBankWithdraw member_bank_withdraws = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member_bank_withdraw.GetMemberBankWithdraw +message GetMemberBankWithdrawRequest { + message Request { + string id = 1; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message GetMemberBankWithdrawResponse { + message Result { + bet.beteran.member_bank_withdraw.MemberBankWithdraw member_bank_withdraw = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member_bank_withdraw.UpdateMemberBankWithdraw +message UpdateMemberBankWithdrawRequest { + message Request { + string id = 1; + string bank_name = 2; + string name = 3; + string account_number = 4; + uint32 amount = 5; + string password = 6; + optional string memo = 7; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message UpdateMemberBankWithdrawResponse { + message Result { + bet.beteran.member_bank_withdraw.MemberBankWithdraw member_bank_withdraw = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member_bank_withdraw.UpdateMemberBankWithdrawForState +message UpdateMemberBankWithdrawForStateRequest { + message Request { + string id = 1; + bet.beteran.member_bank_withdraw.MemberBankWithdrawState state = 2; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message UpdateMemberBankWithdrawForStateResponse { + message Result { + bet.beteran.member_bank_withdraw.MemberBankWithdraw member_bank_withdraw = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.member_bank_withdraw.DeleteMemberBankWithdraw +message DeleteMemberBankWithdrawRequest { + message Request { + string id = 1; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message DeleteMemberBankWithdrawResponse { + message Result { + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} diff --git a/proto/ss/member/member_class.proto b/proto/ss/member_class.proto similarity index 60% rename from proto/ss/member/member_class.proto rename to proto/ss/member_class.proto index 9f350b2..4999240 100644 --- a/proto/ss/member/member_class.proto +++ b/proto/ss/member_class.proto @@ -2,24 +2,24 @@ syntax = "proto3"; package bet.beteran.ss.member_class; -import "protobuf/rpc/error.proto"; -import "protobuf/pagination/pagination.proto"; -import "protobuf/pagination/search.proto"; -import "protobuf/pagination/sort.proto"; import "models/core/network.proto"; - -import "models/member/member_class.proto"; +import "protobuf/rpc.proto"; +import "protobuf/pagination.proto"; +import "models/member_class.proto"; // subject = bet.beteran.ss.member_class.CreateMemberClass message CreateMemberClassRequest { + message Request { + optional string parent_id = 1; + string name = 2; + } bet.beteran.core.network.Client client = 1; - optional string parent_id = 2; - string name = 3; + Request request = 2; } message CreateMemberClassResponse { message Result { - bet.beteran.member.MemberClass member_class = 1; + bet.beteran.member_class.MemberClass member_class = 1; } optional bet.protobuf.rpc.Error error = 1; optional Result result = 2; @@ -27,32 +27,40 @@ message CreateMemberClassResponse { // subject = bet.beteran.ss.member_class.ListMemberClasses message ListMemberClassesRequest { + message Request { + message Search { + optional string name_like = 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; - optional bet.protobuf.pagination.Pagination pagination = 2; - repeated bet.protobuf.pagination.Search searches = 3; - repeated bet.protobuf.pagination.Sort sorts = 4; - optional string name_like = 5; + Request request = 2; } message ListMemberClassesResponse { message Result { - repeated bet.beteran.member.MemberClass member_classes = 1; + repeated bet.beteran.member_class.MemberClass member_classes = 1; } optional bet.protobuf.rpc.Error error = 1; optional Result result = 2; } - // subject = bet.beteran.ss.member_class.GetMemberClass message GetMemberClassRequest { + message Request { + string id = 1; + } bet.beteran.core.network.Client client = 1; - string id = 2; + Request request = 2; } message GetMemberClassResponse { message Result { - bet.beteran.member.MemberClass member_class = 1; + bet.beteran.member_class.MemberClass member_class = 1; } optional bet.protobuf.rpc.Error error = 1; optional Result result = 2; @@ -60,15 +68,18 @@ message GetMemberClassResponse { // subject = bet.beteran.ss.member_class.UpdateMemberClass message UpdateMemberClassRequest { + message Request { + string id = 1; + optional string parent_id = 2; + string name = 3; + } bet.beteran.core.network.Client client = 1; - string id = 2; - optional string parent_id = 3; - string name = 4; + Request request = 2; } message UpdateMemberClassResponse { message Result { - bet.beteran.member.MemberClass member_class = 1; + bet.beteran.member_class.MemberClass member_class = 1; } optional bet.protobuf.rpc.Error error = 1; optional Result result = 2; @@ -76,8 +87,11 @@ message UpdateMemberClassResponse { // subject = bet.beteran.ss.member_class.DeleteMemberClass message DeleteMemberClassRequest { + message Request { + string id = 1; + } bet.beteran.core.network.Client client = 1; - string id = 2; + Request request = 2; } message DeleteMemberClassResponse { diff --git a/proto/ss/member/member_level.proto b/proto/ss/member_level.proto similarity index 60% rename from proto/ss/member/member_level.proto rename to proto/ss/member_level.proto index cc6c35c..a0c34df 100644 --- a/proto/ss/member/member_level.proto +++ b/proto/ss/member_level.proto @@ -2,25 +2,24 @@ syntax = "proto3"; package bet.beteran.ss.member_level; -import "protobuf/rpc/error.proto"; -import "protobuf/pagination/pagination.proto"; -import "protobuf/pagination/search.proto"; -import "protobuf/pagination/sort.proto"; import "models/core/network.proto"; - -import "models/member/member_level.proto"; - +import "protobuf/rpc.proto"; +import "protobuf/pagination.proto"; +import "models/member_level.proto"; // subject = bet.beteran.ss.member_level.CreateMemberLevel message CreateMemberLevelRequest { + message Request { + string name = 1; + uint32 sort_order = 2; + } bet.beteran.core.network.Client client = 1; - string name = 2; - uint32 sort_order = 3; + Request request = 2; } message CreateMemberLevelResponse { message Result { - bet.beteran.member.MemberLevel member_level = 1; + bet.beteran.member_level.MemberLevel member_level = 1; } optional bet.protobuf.rpc.Error error = 1; optional Result result = 2; @@ -28,32 +27,38 @@ message CreateMemberLevelResponse { // subject = bet.beteran.ss.member_level.ListMemberLevels message ListMemberLevelsRequest { + message Request { + message Search { + optional string name_like = 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; - optional bet.protobuf.pagination.Pagination pagination = 2; - repeated bet.protobuf.pagination.Search searches = 3; - repeated bet.protobuf.pagination.Sort sorts = 4; - optional string name_like = 5; + Request request = 2; } message ListMemberLevelsResponse { message Result { - repeated bet.beteran.member.MemberLevel member_levels = 1; + repeated bet.beteran.member_level.MemberLevel member_levels = 1; } optional bet.protobuf.rpc.Error error = 1; optional Result result = 2; } - - // subject = bet.beteran.ss.member_level.GetMemberLevel message GetMemberLevelRequest { + message Request { + string id = 1; + } bet.beteran.core.network.Client client = 1; - string id = 2; + Request request = 2; } message GetMemberLevelResponse { message Result { - bet.beteran.member.MemberLevel member_level = 1; + bet.beteran.member_level.MemberLevel member_level = 1; } optional bet.protobuf.rpc.Error error = 1; optional Result result = 2; @@ -61,15 +66,18 @@ message GetMemberLevelResponse { // subject = bet.beteran.ss.member_level.UpdateMemberLevel message UpdateMemberLevelRequest { + message Request { + string id = 1; + string name = 2; + uint32 sort_order = 3; + } bet.beteran.core.network.Client client = 1; - string id = 2; - string name = 3; - uint32 sort_order = 4; + Request request = 2; } message UpdateMemberLevelResponse { message Result { - bet.beteran.member.MemberLevel member_level = 1; + bet.beteran.member_level.MemberLevel member_level = 1; } optional bet.protobuf.rpc.Error error = 1; optional Result result = 2; @@ -77,8 +85,11 @@ message UpdateMemberLevelResponse { // subject = bet.beteran.ss.member_level.DeleteMemberLevel message DeleteMemberLevelRequest { + message Request { + string id = 1; + } bet.beteran.core.network.Client client = 1; - string id = 2; + Request request = 2; } message DeleteMemberLevelResponse { diff --git a/proto/ss/site.proto b/proto/ss/site.proto new file mode 100644 index 0000000..52eef26 --- /dev/null +++ b/proto/ss/site.proto @@ -0,0 +1,117 @@ +syntax = "proto3"; + +package bet.beteran.ss.site; + +import "models/core/network.proto"; +import "protobuf/rpc.proto"; +import "protobuf/pagination.proto"; +import "models/site.proto"; + +// subject = bet.beteran.ss.site.CreateSite; +message CreateSiteRequest { + message Request { + string url = 1; + optional string name = 2; + optional string path = 3; + bool show = 4; + bool can_use = 5; + optional string memo = 6; + optional uint64 expires_at = 7; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message CreateSiteResponse { + message Result { + bet.beteran.site.Site site = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.site.ListSites; +message ListSitesRequest { + message Request { + message Search { + optional string url_like = 1; + optional string name_like = 2; + optional string path_like = 3; + optional bool show = 4; + optional bool can_use = 5; + optional string memo_like = 6; + } + 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 ListSitesResponse { + message Result { + repeated bet.beteran.site.Site sites = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.site.GetSite +message GetSiteRequest { + message Request { + string id = 1; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message GetSiteResponse { + message Result { + bet.beteran.site.Site site = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + +// subject = bet.beteran.ss.site.UpdateSite +message UpdateSiteRequest { + message Request { + string id = 1; + string url = 2; + optional string name = 3; + optional string path = 4; + bool show = 5; + bool can_use = 6; + optional string memo = 7; + optional uint64 expires_at = 8; + + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message UpdateSiteResponse { + message Result { + bet.beteran.site.Site site = 1; + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +} + + +// subject = bet.beteran.ss.site.DeleteSite +message DeleteSiteRequest { + message Request { + string id = 1; + } + bet.beteran.core.network.Client client = 1; + Request request = 2; +} + +message DeleteSiteResponse { + message Result { + } + optional bet.protobuf.rpc.Error error = 1; + optional Result result = 2; +}