protocol is changed

This commit is contained in:
병준 박 2022-08-19 06:14:52 +00:00
parent 41c81e63aa
commit d4216f56f6
14 changed files with 314 additions and 11 deletions

View File

@ -13,7 +13,7 @@
// Use this environment variable if you need to bind mount your local source code into a new container. // Use this environment variable if you need to bind mount your local source code into a new container.
"remoteEnv": { "remoteEnv": {
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}", "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}",
"PROTOBUF_VERSION": "21.5" "PROTOBUF_VERSION": "3.20.1"
}, },
// Configure tool-specific properties. // Configure tool-specific properties.
"customizations": { "customizations": {

View File

@ -11,8 +11,8 @@ path = "./src/lib.rs"
[dependencies] [dependencies]
prost = "0.10" prost = "0"
[build-dependencies] [build-dependencies]
prost-build = "0.10"
once_cell = "1" once_cell = "1"
prost-build = "0"

View File

@ -42,12 +42,14 @@ static TARGETS: Lazy<HashMap<&str, Vec<&str>>> = Lazy::new(|| {
"./proto/models/member_permission.proto", "./proto/models/member_permission.proto",
"./proto/models/member_role.proto", "./proto/models/member_role.proto",
"./proto/models/member_session.proto", "./proto/models/member_session.proto",
"./proto/models/member_referrer.proto",
"./proto/models/member.proto", "./proto/models/member.proto",
"./proto/models/resource_action.proto", "./proto/models/resource_action.proto",
"./proto/models/resource.proto", "./proto/models/resource.proto",
"./proto/models/role.proto", "./proto/models/role.proto",
"./proto/models/site.proto", "./proto/models/site.proto",
"./proto/models/api/vendor.proto", "./proto/models/api/vendor.proto",
"./proto/models/api/game.proto",
], ],
); );
@ -61,10 +63,12 @@ static TARGETS: Lazy<HashMap<&str, Vec<&str>>> = Lazy::new(|| {
"./proto/c2se/member_bank_withdraw.proto", "./proto/c2se/member_bank_withdraw.proto",
"./proto/c2se/member_class.proto", "./proto/c2se/member_class.proto",
"./proto/c2se/member_level.proto", "./proto/c2se/member_level.proto",
"./proto/c2se/member_referrer.proto",
"./proto/c2se/member.proto", "./proto/c2se/member.proto",
"./proto/c2se/site.proto", "./proto/c2se/site.proto",
"./proto/c2se/core/network.proto", "./proto/c2se/core/network.proto",
"./proto/c2se/api/vendor.proto", "./proto/c2se/api/vendor.proto",
"./proto/c2se/api/game.proto",
"./proto/c2se/backend/bank.proto", "./proto/c2se/backend/bank.proto",
"./proto/c2se/backend/identity.proto", "./proto/c2se/backend/identity.proto",
"./proto/c2se/backend/member_bank_account.proto", "./proto/c2se/backend/member_bank_account.proto",
@ -72,9 +76,11 @@ static TARGETS: Lazy<HashMap<&str, Vec<&str>>> = Lazy::new(|| {
"./proto/c2se/backend/member_bank_withdraw.proto", "./proto/c2se/backend/member_bank_withdraw.proto",
"./proto/c2se/backend/member_class.proto", "./proto/c2se/backend/member_class.proto",
"./proto/c2se/backend/member_level.proto", "./proto/c2se/backend/member_level.proto",
"./proto/c2se/backend/member_referrer.proto",
"./proto/c2se/backend/member.proto", "./proto/c2se/backend/member.proto",
"./proto/c2se/backend/site.proto", "./proto/c2se/backend/site.proto",
"./proto/c2se/backend/api/vendor.proto", "./proto/c2se/backend/api/vendor.proto",
"./proto/c2se/backend/api/game.proto",
"./proto/c2se/frontend/bank.proto", "./proto/c2se/frontend/bank.proto",
"./proto/c2se/frontend/identity.proto", "./proto/c2se/frontend/identity.proto",
], ],
@ -90,9 +96,11 @@ static TARGETS: Lazy<HashMap<&str, Vec<&str>>> = Lazy::new(|| {
"./proto/ss/member_bank_withdraw.proto", "./proto/ss/member_bank_withdraw.proto",
"./proto/ss/member_class.proto", "./proto/ss/member_class.proto",
"./proto/ss/member_level.proto", "./proto/ss/member_level.proto",
"./proto/ss/member_referrer.proto",
"./proto/ss/member.proto", "./proto/ss/member.proto",
"./proto/ss/site.proto", "./proto/ss/site.proto",
"./proto/ss/api/vendor.proto", "./proto/ss/api/vendor.proto",
"./proto/ss/api/game.proto",
], ],
); );

30
proto/c2se/api/game.proto Normal file
View File

@ -0,0 +1,30 @@
syntax = "proto3";
package bet.beteran.c2se.api.game;
import "protobuf/rpc.proto";
import "protobuf/pagination.proto";
import "models/core/network.proto";
import "models/api/game.proto";
message ListGamesRequest {
message Search {
optional uint64 vendor_id = 1;
optional string key_like = 2;
optional string platform_like = 3;
optional string category_like = 4;
optional string game_type_like = 5;
}
optional bet.protobuf.pagination.Pagination pagination = 1;
repeated bet.protobuf.pagination.Sort sorts = 2;
optional Search search = 3;
}
message ListGamesResponse {
message Result {
repeated bet.beteran.api.game.Game games = 1;
}
optional bet.protobuf.rpc.Error error = 1;
optional Result result = 2;
}

View File

@ -0,0 +1,5 @@
syntax = "proto3";
package bet.beteran.c2se.backend.api.game;
// subject = bet.beteran.c2se.backend.api.game.ListGames

View File

@ -0,0 +1,9 @@
syntax = "proto3";
package bet.beteran.c2se.backend.member_referrer;
// subject = bet.beteran.c2se.backend.member_referrer.CreateMemberReferrer
// subject = bet.beteran.c2se.backend.member_referrer.ListMemberReferrers
// subject = bet.beteran.c2se.backend.member_referrer.GetMemberReferrer
// subject = bet.beteran.c2se.backend.member_referrer.UpdateMemberReferrer
// subject = bet.beteran.c2se.backend.member_referrer.DeleteMemberReferrer

View File

@ -38,7 +38,7 @@ message ListMembersRequest {
optional string site_id = 1; optional string site_id = 1;
optional string member_class_id = 2; optional string member_class_id = 2;
optional string member_level_id = 3; optional string member_level_id = 3;
optional string referrer_member_id = 4; optional string parent_member_id = 4;
optional string username_like = 5; optional string username_like = 5;
optional string nickname_like = 6; optional string nickname_like = 6;
optional string mobile_phone_number_like = 7; optional string mobile_phone_number_like = 7;

View File

@ -0,0 +1,75 @@
syntax = "proto3";
package bet.beteran.c2se.member_referrer;
import "protobuf/rpc.proto";
import "protobuf/pagination.proto";
import "models/member_referrer.proto";
message CreateMemberReferrerRequest {
string member_id = 1;
}
message CreateMemberReferrerResponse {
message Result {
bet.beteran.member_referrer.MemberReferrer member_referrer = 1;
}
optional bet.protobuf.rpc.Error error = 1;
optional Result result = 2;
}
message ListMemberReferrersRequest {
message Search {
optional string member_id = 1;
optional bool can_use = 2;
optional string memo_like = 3;
}
optional bet.protobuf.pagination.Pagination pagination = 1;
repeated bet.protobuf.pagination.Sort sorts = 2;
optional Search search = 3;
}
message ListMemberReferrersResponse {
message Result {
repeated bet.beteran.member_referrer.MemberReferrerModel member_referrers = 1;
}
optional bet.protobuf.rpc.Error error = 1;
optional Result result = 2;
}
message GetMemberReferrerRequest {
string id = 1;
}
message GetMemberReferrerResponse {
message Result {
bet.beteran.member_referrer.MemberReferrerModel member_referrer = 1;
}
optional bet.protobuf.rpc.Error error = 1;
optional Result result = 2;
}
message UpdateMemberReferrerRequest {
string id = 1;
bool can_use = 2;
optional string memo = 3;
}
message UpdateMemberReferrerResponse {
message Result {
bet.beteran.member_referrer.MemberReferrerModel member_referrer = 1;
}
optional bet.protobuf.rpc.Error error = 1;
optional Result result = 2;
}
message DeleteMemberReferrerRequest {
string id = 1;
}
message DeleteMemberReferrerResponse {
message Result {
}
optional bet.protobuf.rpc.Error error = 1;
optional Result result = 2;
}

View File

@ -0,0 +1,16 @@
syntax = "proto3";
package bet.beteran.api.game;
message Game {
uint64 id = 1;
uint64 vendor_id = 2;
string key = 3;
string names = 4;
string platform = 5;
string category = 6;
string game_type = 7;
optional string image = 8;
uint64 created_at = 9;
uint64 updated_at = 10;
}

View File

@ -24,8 +24,8 @@ message Member {
string site_id = 2; string site_id = 2;
string member_class_id = 3; string member_class_id = 3;
string member_level_id = 4; string member_level_id = 4;
optional string referrer_member_id = 5; optional string parent_member_id = 5;
uint64 referred_count = 6; uint64 child_member_count = 6;
string username = 7; string username = 7;
string nickname = 8; string nickname = 8;
optional string mobile_phone_number = 9; optional string mobile_phone_number = 9;
@ -44,8 +44,8 @@ message MemberModel {
bet.beteran.member_class.MemberClass member_class = 3; bet.beteran.member_class.MemberClass member_class = 3;
bet.beteran.member_level.MemberLevel member_level = 4; bet.beteran.member_level.MemberLevel member_level = 4;
optional bet.beteran.member_bank_account.MemberBankAccountModel bank_account = 5; optional bet.beteran.member_bank_account.MemberBankAccountModel bank_account = 5;
optional Member referrer_member = 6; optional Member parent_member = 6;
uint64 referred_count = 7; uint64 child_member_count = 7;
string username = 8; string username = 8;
string nickname = 9; string nickname = 9;
optional string mobile_phone_number = 10; optional string mobile_phone_number = 10;

View File

@ -0,0 +1,23 @@
syntax = "proto3";
package bet.beteran.member_referrer;
import "models/member.proto";
message MemberReferrer {
string id = 1;
string member_id = 2;
bool can_use = 3;
optional string memo = 4;
uint64 created_at = 5;
uint64 updated_at = 6;
}
message MemberReferrerModel {
string id = 1;
bet.beteran.member.Member member = 2;
bool can_use = 3;
optional string memo = 4;
uint64 created_at = 5;
uint64 updated_at = 6;
}

36
proto/ss/api/game.proto Normal file
View File

@ -0,0 +1,36 @@
syntax = "proto3";
package bet.beteran.ss.api.game;
import "protobuf/rpc.proto";
import "protobuf/pagination.proto";
import "models/core/network.proto";
import "models/api/game.proto";
// subject = bet.beteran.ss.api.game.ListGames
message ListGamesRequest {
message Request {
message Search {
optional uint64 vendor_id = 1;
optional string key_like = 2;
optional string platform_like = 3;
optional string category_like = 4;
optional string game_type_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 ListGamesResponse {
message Result {
repeated bet.beteran.api.game.Game games = 1;
}
optional bet.protobuf.rpc.Error error = 1;
optional Result result = 2;
}

View File

@ -2,10 +2,9 @@ syntax = "proto3";
package bet.beteran.ss.member; package bet.beteran.ss.member;
import "models/core/network.proto";
import "protobuf/rpc.proto"; import "protobuf/rpc.proto";
import "protobuf/pagination.proto"; import "protobuf/pagination.proto";
import "models/core/network.proto";
import "models/member.proto"; import "models/member.proto";
// subject = bet.beteran.ss.member.CreateMember // subject = bet.beteran.ss.member.CreateMember
@ -46,7 +45,7 @@ message ListMembersRequest {
optional string site_id = 1; optional string site_id = 1;
optional string member_class_id = 2; optional string member_class_id = 2;
optional string member_level_id = 3; optional string member_level_id = 3;
optional string referrer_member_id = 4; optional string parent_member_id = 4;
optional string username_like = 5; optional string username_like = 5;
optional string nickname_like = 6; optional string nickname_like = 6;
optional string mobile_phone_number_like = 7; optional string mobile_phone_number_like = 7;

View File

@ -0,0 +1,102 @@
syntax = "proto3";
package bet.beteran.ss.member_referrer;
import "models/core/network.proto";
import "protobuf/rpc.proto";
import "protobuf/pagination.proto";
import "models/member_referrer.proto";
// subject = bet.beteran.ss.member_referrer.CreateMemberReferrer
message CreateMemberReferrerRequest {
message Request {
string member_id = 1;
}
bet.beteran.core.network.Client client = 1;
Request request = 2;
}
message CreateMemberReferrerResponse {
message Result {
bet.beteran.member_referrer.MemberReferrer member_referrer = 1;
}
optional bet.protobuf.rpc.Error error = 1;
optional Result result = 2;
}
// subject = bet.beteran.ss.member_referrer.ListMemberReferrers
message ListMemberReferrersRequest {
message Request {
message Search {
optional string member_id = 1;
optional bool can_use = 2;
optional string memo_like = 3;
}
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 ListMemberReferrersResponse {
message Result {
repeated bet.beteran.member_referrer.MemberReferrerModel member_referrers = 1;
}
optional bet.protobuf.rpc.Error error = 1;
optional Result result = 2;
}
// subject = bet.beteran.ss.member_referrer.GetMemberReferrer
message GetMemberReferrerRequest {
message Request {
string id = 1;
}
bet.beteran.core.network.Client client = 1;
Request request = 2;
}
message GetMemberReferrerResponse {
message Result {
bet.beteran.member_referrer.MemberReferrerModel member_referrer = 1;
}
optional bet.protobuf.rpc.Error error = 1;
optional Result result = 2;
}
// subject = bet.beteran.ss.member_referrer.UpdateMemberReferrer
message UpdateMemberReferrerRequest {
message Request {
string id = 1;
bool can_use = 2;
optional string memo = 3;
}
bet.beteran.core.network.Client client = 1;
Request request = 2;
}
message UpdateMemberReferrerResponse {
message Result {
bet.beteran.member_referrer.MemberReferrerModel member_referrer = 1;
}
optional bet.protobuf.rpc.Error error = 1;
optional Result result = 2;
}
// subject = bet.beteran.ss.member_referrer.DeleteMemberReferrer
message DeleteMemberReferrerRequest {
message Request {
string id = 1;
}
bet.beteran.core.network.Client client = 1;
Request request = 2;
}
message DeleteMemberReferrerResponse {
message Result {
}
optional bet.protobuf.rpc.Error error = 1;
optional Result result = 2;
}