-
Notifications
You must be signed in to change notification settings - Fork 0
/
actions.proto
74 lines (62 loc) · 1.83 KB
/
actions.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
69
70
71
72
73
74
syntax = "proto3";
import "commons.proto";
option java_multiple_files = true;
option java_package = "com.kotlang.social";
option java_outer_classname = "PostActionsInternal";
option go_package = "github.com/Kotlang/socialGo/generated";
package social;
service actions {
rpc React(ReactRequest) returns (SocialStatusResponse) {}
rpc UnReact(ReactRequest) returns (SocialStatusResponse) {}
rpc Bookmark(IdRequest) returns (SocialStatusResponse) {}
rpc Comment(CommentRequest) returns (CommentProto);
rpc DeleteComment(IdRequest) returns (SocialStatusResponse);
rpc FetchComments (CommentFetchRequest) returns (CommentsFetchResponse);
rpc FetchCommentById (IdRequest) returns (CommentProto);
}
//enlist types of entities that can be reacted/commented on
enum EntityTypes {
POST = 0;
EVENT = 1;
COMMENT = 2;
}
message ReactRequest {
string entityId = 1;
string reaction = 2;
EntityTypes reactionOn = 3;
}
message IdRequest {
string id = 1;
}
message CommentRequest {
string parentId = 1;
string content = 2;
EntityTypes commentOn = 3;
repeated MediaUrl mediaUrls = 4;
repeated WebPreview webPreviews = 5;
}
message CommentProto {
string commentId = 1;
string content = 2;
string userId = 3;
int64 createdOn = 4;
map<string, int64> numReacts = 5;
int32 numComments = 6;
repeated string userReactions = 7;
repeated MediaUrl mediaUrls = 8;
repeated WebPreview webPreviews = 9;
string parentId = 10;
SocialProfile authorInfo = 11;
}
message CommentFetchRequest {
string parentId = 1;
//optianl, IF want to fetch comments created by specific user
string userId = 2;
int32 pageNumber = 3;
int32 pageSize = 4;
}
message CommentsFetchResponse {
repeated CommentProto comments = 1;
int32 pageNumber = 2;
int32 pageSize = 3;
}