-
Notifications
You must be signed in to change notification settings - Fork 55
/
account.proto
34 lines (29 loc) · 979 Bytes
/
account.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
syntax = "proto3";
package stack.rpc.api.console.account;
import "github.com/stack-labs/stack-rpc/api/proto/api.proto";
import "github.com/envoyproxy/protoc-gen-validate/validate/validate.proto";
import "srv/account.proto";
service Account {
// rpc模式handler
// 可以在proto中定义validate,https://github.com/envoyproxy/protoc-gen-validate
rpc Login (LoginRequest) returns (Response) {
}
// api模式handler
rpc Logout (go.api.Request) returns (go.api.Response) {
}
rpc Info (go.api.Request) returns (go.api.Response) {
}
}
message LoginRequest {
string username = 1 [(validate.rules).string = {
min_bytes: 4, max_bytes: 32
}];
string password = 2 [(validate.rules).string = {
min_bytes: 6, max_bytes: 20
}];
}
message Response {
int64 code = 1;
string detail = 2;
stack.rpc.srv.account.LoginResponse data = 3;
}