-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomment-service.proto
More file actions
81 lines (65 loc) · 1.67 KB
/
Copy pathcomment-service.proto
File metadata and controls
81 lines (65 loc) · 1.67 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
syntax = "proto3";
package comment;
option go_package = "gen/comment-service/pb;pb";
import "google/protobuf/empty.proto";
import "google/api/annotations.proto";
import "models.proto";
service CommentService {
rpc CheckHealth(google.protobuf.Empty) returns (google.protobuf.Empty);
rpc ListComments(ListCommentsRequest) returns (ListCommentsResponse) {
option (google.api.http) = {
get: "/comments"
};
}
rpc CreateComment(CreateCommentRequest) returns (CreateCommentResponse) {
option (google.api.http) = {
post: "/comments"
body: "*"
};
}
rpc GetComment(GetCommentRequest) returns (models.Comment) {
option (google.api.http) = {
get: "/comments/{id}"
};
}
rpc UpdateComment(UpdateCommentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
patch: "/comments/{id}"
body: "*"
};
}
rpc DeleteComment(DeleteCommentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/comments/{id}"
};
}
}
message ListCommentsRequest {
optional string thread_id = 1;
optional int32 offset = 2;
optional int32 limit = 3;
optional string sort_by = 4;
}
message ListCommentsResponse {
repeated models.Comment comments = 1;
}
message CreateCommentRequest {
string content = 1;
string parent_id = 2;
models.CommentParentType parent_type = 3;
}
message CreateCommentResponse {
string id = 1;
}
message GetCommentRequest {
string id = 1;
}
message UpdateCommentRequest {
string id = 1;
optional string content = 2;
optional int32 vote_offset = 3;
optional int32 num_comments_offset = 4;
}
message DeleteCommentRequest {
string id = 1;
}