diff --git a/build.rs b/build.rs index 725637b..2381388 100644 --- a/build.rs +++ b/build.rs @@ -34,6 +34,7 @@ static TARGETS: Lazy>> = Lazy::new(|| { m.insert( "models", vec![ + "./proto/models/core/network.proto", "./proto/models/member/member_class.proto", "./proto/models/member/member_level.proto", "./proto/models/member/member_site.proto", @@ -50,6 +51,8 @@ static TARGETS: Lazy>> = Lazy::new(|| { ], ); + m.insert("ss", vec!["./proto/ss/member/identity.proto"]); + m }); diff --git a/proto/c2se/backend/identity.proto b/proto/c2se/backend/identity.proto index d54d7f5..a2345bd 100644 --- a/proto/c2se/backend/identity.proto +++ b/proto/c2se/backend/identity.proto @@ -4,6 +4,15 @@ 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; @@ -15,3 +24,4 @@ message SigninResponse { optional bet.protobuf.rpc.Error error = 1; optional string token = 2; } + diff --git a/proto/c2se/core/network.proto b/proto/c2se/core/network.proto new file mode 100644 index 0000000..c6146c2 --- /dev/null +++ b/proto/c2se/core/network.proto @@ -0,0 +1 @@ +// header = bet.beteran.c2se.core.network.Client diff --git a/proto/c2se/frontend/identity.proto b/proto/c2se/frontend/identity.proto index 8c4d427..746313b 100644 --- a/proto/c2se/frontend/identity.proto +++ b/proto/c2se/frontend/identity.proto @@ -4,6 +4,15 @@ 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; diff --git a/proto/models/core/network.proto b/proto/models/core/network.proto new file mode 100644 index 0000000..7e17c58 --- /dev/null +++ b/proto/models/core/network.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package bet.beteran.core.network; + +message Client { + optional string site_url = 1; + uint64 client_id = 2; + string client_ip = 3; +} diff --git a/proto/ss/member/identity.proto b/proto/ss/member/identity.proto new file mode 100644 index 0000000..9c99677 --- /dev/null +++ b/proto/ss/member/identity.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package bet.beteran.ss.member.identity; + +import "protobuf/rpc/error.proto"; +import "models/core/network.proto"; + +// subject = bet.beteran.ss.member.identity.Captcha +message CaptchaRequest { + bet.beteran.core.network.Client client = 1; +} + +message CaptchaResponse { + optional bet.protobuf.rpc.Error error = 1; + optional string image = 2; +} + + +// 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; +} + +message SigninResponse { + optional bet.protobuf.rpc.Error error = 1; + optional string token = 2; +}