diff --git a/account.proto b/account.proto index 6a5174c..330cada 100644 --- a/account.proto +++ b/account.proto @@ -2,7 +2,6 @@ syntax = "proto3"; option go_package = "./pb;pb"; package account; -import "public.proto"; message ServiceInfo { string id = 1; @@ -10,17 +9,17 @@ message ServiceInfo { string address = 3; } -message AccountInfo{ +message Account{ string phone = 2; // @inject_tag: index:"unique" pri:"1" string password = 3; string uid = 4; - string device = 5; } message CreateTokenRsp { - public.PubRsp rsp = 1; - string token = 2; - repeated ServiceInfo game_service = 3; + int64 code = 1; + string uid = 2; + string token = 3; + repeated ServiceInfo game_service = 4; } message Register { @@ -29,7 +28,11 @@ message Register { int32 code = 3; } -service Account{ - rpc RegisterHandler(Register) returns (public.PubRsp) {} - rpc CreateTokenHandler(AccountInfo) returns (CreateTokenRsp) {} +message RegisterRsp{ + int64 code = 1; +} + +service Login{ + rpc RegisterHandler(Register) returns (RegisterRsp) {} + rpc CreateTokenHandler(Account) returns (CreateTokenRsp) {} } \ No newline at end of file diff --git a/game.proto b/game.proto index 773fc70..1dc6245 100644 --- a/game.proto +++ b/game.proto @@ -2,7 +2,7 @@ syntax = "proto3"; option go_package = "./pb;pb"; package game; -import "public.proto"; +import "google/protobuf/empty.proto"; message Hero { int64 id = 1; // @inject_tag: index:"unique" pri:"1" @@ -51,16 +51,25 @@ message Token { string token = 1; } +message HeartRsp { + int64 code = 1; +} + message RoleRsp { - public.PubRsp rsp = 1; + int64 code = 1; Role role = 2; map hero = 3; Team team = 4; repeated Equipment equips = 5; } +message LoginReq { + string uid = 1; + string device = 2; +} + service Game{ - rpc HeartBeatHandler(Token) returns (public.PubRsp) {} - rpc LoginHandler(Token) returns (RoleRsp) {} - rpc CreateRoleHandler(Token) returns (RoleRsp) {} + rpc HeartBeatHandler(google.protobuf.Empty) returns (HeartRsp) {} + rpc LoginHandler(LoginReq) returns (RoleRsp) {} + rpc CreateRoleHandler(LoginReq) returns (RoleRsp) {} } \ No newline at end of file diff --git a/public.proto b/public.proto deleted file mode 100644 index f78af68..0000000 --- a/public.proto +++ /dev/null @@ -1,13 +0,0 @@ -syntax = "proto3"; -package public; - -option go_package = "./pb;pb"; - -message PubRsp { - int32 code = 1; - string msg = 2; -} - -message GenerateToken { - string phone = 1; -} \ No newline at end of file -- libgit2 0.21.2