refactoring
This commit is contained in:
parent
2dbaead2fa
commit
6b87a84801
3
build.rs
3
build.rs
|
@ -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",
|
||||
|
|
|
@ -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 {
|
||||
|
|
36
proto/c2se/common/identity.proto
Normal file
36
proto/c2se/common/identity.proto
Normal 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;
|
||||
}
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
14
proto/models/member/member_session.proto
Normal file
14
proto/models/member/member_session.proto
Normal 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;
|
||||
}
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user