-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathauth.proto
47 lines (39 loc) · 1.45 KB
/
auth.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
syntax = "proto3";
package douyin.auth;
option go_package = "douyin/auth";
message LoginRequest {
string username = 1; // 登录用户名
string password = 2; // 登录密码
}
message LoginResponse {
uint32 status_code = 1 [json_name = "status_code"]; // 状态码,0-成功,其他值-失败
string status_msg = 2 [json_name = "status_msg"]; // 返回状态描述
uint32 user_id = 3 [json_name = "user_id"]; // 用户id
string token = 4; // 用户鉴权token
}
message RegisterRequest {
string username = 1; // 注册用户名,最长32个字符
string password = 2; // 密码,最长32个字符
}
message RegisterResponse {
uint32 status_code = 1 [json_name = "status_code"]; // 状态码,0-成功,其他值-失败
string status_msg = 2 [json_name = "status_msg"]; // 返回状态描述
uint32 user_id = 3 [json_name = "user_id"]; // 用户id
string token = 4; // 用户鉴权token
}
message AuthenticateRequest {
string token = 1; // 用户鉴权token
}
message AuthenticateResponse {
uint32 status_code = 1 [json_name = "status_code"]; // 状态码,0-成功,其他值-失败
string status_msg = 2 [json_name = "status_msg"]; // 返回状态描述
uint32 user_id = 3 [json_name = "user_id"]; // 用户id
}
service AuthService {
rpc Authenticate (AuthenticateRequest) returns (AuthenticateResponse) {
}
rpc Register (RegisterRequest) returns (RegisterResponse) {
}
rpc Login (LoginRequest) returns (LoginResponse) {
}
}