-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththread-service.proto
More file actions
83 lines (67 loc) · 1.68 KB
/
Copy paththread-service.proto
File metadata and controls
83 lines (67 loc) · 1.68 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
syntax = "proto3";
package thread;
option go_package = "gen/thread-service/pb;pb";
import "google/protobuf/empty.proto";
import "google/api/annotations.proto";
import "models.proto";
service ThreadService {
rpc CheckHealth(google.protobuf.Empty) returns (google.protobuf.Empty);
rpc ListThreads (ListThreadsRequest) returns (ListThreadsResponse) {
option (google.api.http) = {
get: "/threads"
};
}
rpc CreateThread (CreateThreadRequest) returns (CreateThreadResponse) {
option (google.api.http) = {
post: "/threads"
body: "*"
};
}
rpc GetThread (GetThreadRequest) returns (models.Thread) {
option (google.api.http) = {
get: "/threads/{id}"
};
}
rpc UpdateThread (UpdateThreadRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
patch: "/threads/{id}"
body: "*"
};
}
rpc DeleteThread (DeleteThreadRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/threads/{id}"
};
}
}
message ListThreadsRequest {
optional string community_id = 1;
optional string title = 2;
optional int32 offset = 3;
optional int32 limit = 4;
optional string sort_by = 5;
}
message ListThreadsResponse {
repeated models.Thread threads = 1;
}
message CreateThreadRequest {
string community_id = 1;
string title = 2;
string content = 3;
}
message CreateThreadResponse {
string id = 1;
}
message GetThreadRequest {
string id = 1;
}
message UpdateThreadRequest {
string id = 1;
optional string title = 2;
optional string content = 3;
optional int32 vote_offset = 4;
optional int32 num_comments_offset = 5;
}
message DeleteThreadRequest {
string id = 1;
}