forked from cloudwego/hertz-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser.thrift
32 lines (26 loc) · 973 Bytes
/
user.thrift
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
namespace go user
namespace py user
namespace java user
struct BaseResp {
1: i64 code
2: string message
}
struct RegisterRequest {
1: string username (api.form="username", api.vd="(len($) > 0 && len($) < 128); msg:'Illegal format'")
2: string password (api.form="password", api.vd="(len($) > 0 && len($) < 128); msg:'Illegal format'")
3: string email (api.form="email", api.vd="(len($) > 0 && len($) < 128) && email($); msg:'Illegal format'")
}
struct RegisterResponse {
1: BaseResp baseresp
}
struct LoginRequest {
1: string username (api.form="username", api.vd="(len($) > 0 && len($) < 30); msg:'Illegal format'")
2: string password (api.form="password", api.vd="(len($) > 0 && len($) < 30); msg:'Illegal format'")
}
struct LoginResponse {
1: BaseResp baseresp
}
service UserService {
RegisterResponse register(1: RegisterRequest req) (api.post="/register")
LoginResponse login(1: LoginRequest req) (api.post="/login")
}