refactoring

This commit is contained in:
병준 박 2022-07-27 06:45:53 +00:00
parent 2dbaead2fa
commit 6b87a84801
7 changed files with 93 additions and 31 deletions

View File

@ -39,12 +39,15 @@ static TARGETS: Lazy<HashMap<&str, Vec<&str>>> = Lazy::new(|| {
"./proto/models/member/member_level.proto",
"./proto/models/member/member_site.proto",
"./proto/models/member/member.proto",
"./proto/models/member/member_session.proto",
],
);
m.insert(
"c2se",
vec![
"./proto/c2se/core/network.proto",
"./proto/c2se/common/identity.proto",
"./proto/c2se/backend/identity.proto",
"./proto/c2se/backend/member.proto",
"./proto/c2se/frontend/identity.proto",

View File

@ -4,20 +4,12 @@ package bet.beteran.c2se.backend.identity;
import "protobuf/rpc/error.proto";
// subject = bet.beteran.c2se.backend.identity.Captcha
message CaptchaRequest {
}
message CaptchaResponse {
optional bet.protobuf.rpc.Error error = 1;
optional string image = 2;
}
// subject = bet.beteran.c2se.backend.identity.Signin
message SigninRequest {
string username = 1;
string password = 2;
string security_code = 3;
string token = 1;
string security_code = 2;
string username = 3;
string password = 4;
}
message SigninResponse {

View File

@ -0,0 +1,36 @@
syntax = "proto3";
package bet.beteran.c2se.common.identity;
import "protobuf/rpc/error.proto";
// subject = bet.beteran.c2se.common.identity.CheckUsernameForDuplication;
message CheckUsernameForDuplicationRequest {
string username = 1;
}
message CheckUsernameForDuplicationResponse {
optional bet.protobuf.rpc.Error error = 1;
optional bool duplicated = 2;
}
// subject = bet.beteran.c2se.common.identity.CheckNicknameForDuplication;
message CheckNicknameForDuplicationRequest {
string nickname = 1;
}
message CheckNicknameForDuplicationResponse {
optional bet.protobuf.rpc.Error error = 1;
optional bool duplicated = 2;
}
// subject = bet.beteran.c2se.common.identity.Captcha
message CaptchaRequest {
}
message CaptchaResponse {
optional bet.protobuf.rpc.Error error = 1;
optional string token = 2;
optional string image = 3;
}

View File

@ -4,20 +4,12 @@ package bet.beteran.c2se.frontend.identity;
import "protobuf/rpc/error.proto";
// subject = bet.beteran.c2se.frontend.identity.Captcha
message CaptchaRequest {
}
message CaptchaResponse {
optional bet.protobuf.rpc.Error error = 1;
optional string image = 2;
}
// subject = bet.beteran.c2se.frontend.identity.Signin
message SigninRequest {
string username = 1;
string password = 2;
string security_code = 3;
string token = 1;
string security_code = 2;
string username = 3;
string password = 4;
}
message SigninResponse {

View File

@ -3,7 +3,7 @@ syntax = "proto3";
package bet.beteran.core.network;
message Client {
optional string site_url = 1;
uint64 client_id = 2;
string client_ip = 3;
string client_ip = 1;
optional string site_url = 2;
optional string access_token = 3;
}

View File

@ -0,0 +1,14 @@
syntax = "proto3";
package bet.beteran.member;
import "models/member/member.proto";
message MemberSession {
string id = 1;
Member member = 2;
string data = 3;
uint64 last_accessed_at = 4;
uint64 expires_at = 5;
uint64 created_at = 6;
}

View File

@ -5,6 +5,29 @@ package bet.beteran.ss.member.identity;
import "protobuf/rpc/error.proto";
import "models/core/network.proto";
// subject = bet.beteran.ss.member.identity.CheckUsernameForDuplication;
message CheckUsernameForDuplicationRequest {
bet.beteran.core.network.Client client = 1;
string username = 2;
}
message CheckUsernameForDuplicationResponse {
optional bet.protobuf.rpc.Error error = 1;
optional bool duplicated = 2;
}
// subject = bet.beteran.ss.member.identity.CheckNicknameForDuplication;
message CheckNicknameForDuplicationRequest {
bet.beteran.core.network.Client client = 1;
string nickname = 2;
}
message CheckNicknameForDuplicationResponse {
optional bet.protobuf.rpc.Error error = 1;
optional bool duplicated = 2;
}
// subject = bet.beteran.ss.member.identity.Captcha
message CaptchaRequest {
bet.beteran.core.network.Client client = 1;
@ -12,16 +35,18 @@ message CaptchaRequest {
message CaptchaResponse {
optional bet.protobuf.rpc.Error error = 1;
optional string image = 2;
optional string token = 2;
optional string image = 3;
}
// subject = bet.beteran.ss.member.identity.Signin
message SigninRequest {
bet.beteran.core.network.Client client = 1;
string username = 2;
string password = 3;
string security_code = 4;
string token = 2;
string security_code = 3;
string username = 4;
string password = 5;
}
message SigninResponse {