-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtodo.proto
68 lines (56 loc) · 1.23 KB
/
todo.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
syntax = "proto3";
package todo.v1;
import "google/type/datetime.proto";
/*
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";
*/
// HTTP annotations
import "google/api/annotations.proto";
service todoService {
rpc GetUser(GetUserRequest) returns (GetUserResponse) {
option (google.api.http) = {
get: "/v1/user/{id}"
};
}
rpc ListTaskUsers(ListTaskUsersRequest) returns (ListTaskUsersResponse) {
option (google.api.http) = {
get: "/v1/task/{id}/users"
};
}
}
message User {
uint32 id = 1;
string name = 2;
string email = 3;
// google.type.DateTime created_at = 3;
}
message Task {
uint32 id = 1;
string description = 3;
// google.type.DateTime created_at = 3;
// google.type.DateTime started_at = 4;
// google.type.DateTime finished_at = 5;
}
message GetUserRequest {
uint32 id = 1;
string email = 2;
}
message GetUserResponse {
User user = 1;
}
message SearchTaskRequest {
string name = 1;
}
message SearchTaskResponse {
repeated Task tasks = 1;
}
message ListTaskUsersRequest {
uint32 id = 1;
}
message ListTaskUsersResponse {
Task task = 1;
repeated User users = 2;
}