Commit 8c6dec4572d3c2835209d5f44e6ef7d772af48d0
0 parents
first commit
Showing
6 changed files
with
90 additions
and
0 deletions
Show diff stats
1 | +++ a/.gitignore | ... | ... |
1 | +++ a/account.proto | |
... | ... | @@ -0,0 +1,34 @@ |
1 | +syntax = "proto3"; | |
2 | +option go_package = "./pb;pb"; | |
3 | + | |
4 | +package account; | |
5 | +import "public.proto"; | |
6 | + | |
7 | +message ServiceInfo { | |
8 | + string id = 1; | |
9 | + string name = 2; | |
10 | + string address = 3; | |
11 | +} | |
12 | + | |
13 | +message AccountInfo{ | |
14 | + string phone = 2; | |
15 | + string password = 3; | |
16 | + int64 uid = 4; | |
17 | + string device = 5; | |
18 | +} | |
19 | + | |
20 | +message CreateTokenRsp { | |
21 | + string token = 1; | |
22 | + ServiceInfo game_service = 2; | |
23 | +} | |
24 | + | |
25 | +message Register { | |
26 | + string phone = 1; | |
27 | + string password = 2; | |
28 | + int32 code = 3; | |
29 | +} | |
30 | + | |
31 | +service Account{ | |
32 | + rpc RegisterHandler(Register) returns (public.PubRsp) {} | |
33 | + rpc CreateTokenHandler(AccountInfo) returns (CreateTokenRsp) {} | |
34 | +} | |
0 | 35 | \ No newline at end of file | ... | ... |
1 | +++ a/game.proto | |
... | ... | @@ -0,0 +1,28 @@ |
1 | +syntax = "proto3"; | |
2 | +option go_package = "./pb;pb"; | |
3 | + | |
4 | +package game; | |
5 | +import "public.proto"; | |
6 | + | |
7 | +message Role{ | |
8 | + string id = 1; | |
9 | + int32 level = 3; | |
10 | + int64 login_time = 4; | |
11 | + string device = 5; | |
12 | + int64 uid = 6; | |
13 | +} | |
14 | + | |
15 | +message Token { | |
16 | + string token = 1; | |
17 | +} | |
18 | + | |
19 | +message RoleRsp { | |
20 | + public.PubRsp rsp = 1; | |
21 | + Role role = 2; | |
22 | +} | |
23 | + | |
24 | +service Game{ | |
25 | + rpc HeartBeatHandler(Token) returns (public.PubRsp) {} | |
26 | + rpc LoginHandler(Token) returns (RoleRsp) {} | |
27 | + rpc CreateRoleHandler(Token) returns (RoleRsp) {} | |
28 | +} | |
0 | 29 | \ No newline at end of file | ... | ... |