/
relation.proto
67 lines (53 loc) · 1.75 KB
/
relation.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
syntax = "proto3";
package api.relation.v1;
//import "tagger/tagger.proto";
import "validate/validate.proto";
option go_package = "community_gw/api/relation/v1;v1";
// 好友关系服务
service RelationService {
// 关注
rpc Follow (FollowRequest) returns (FollowReply) {}
// 取消关注
rpc Unfollow (UnfollowRequest) returns (UnfollowReply) {}
// 关注列表
rpc ListFollowing (ListFollowingRequest) returns (ListFollowingReply) {}
// 粉丝列表
rpc ListFollower (ListFollowerRequest) returns (ListFollowerReply) {}
// 批量获取关注关系,a和b,c,d的关注状态
rpc BatchGetRelation (BatchGetRelationRequest) returns (BatchGetRelationReply) {}
}
message FollowRequest {
uint64 userId = 1 [(validate.rules).uint64.gte = 1];
uint64 followedUid = 2 [(validate.rules).uint64.gte = 1];
}
message FollowReply {}
message UnfollowRequest {
uint64 userId = 1 [(validate.rules).uint64.gte = 1];
uint64 followedUid = 2 [(validate.rules).uint64.gte = 1];
}
message UnfollowReply {}
message ListFollowingRequest {
uint64 userId = 1 [(validate.rules).uint64.gte = 1];
int32 page = 2 [(validate.rules).int32.gte = 0];
int32 limit = 3 [(validate.rules).int32.gte = 1];
}
message ListFollowingReply {
repeated uint64 followedUids = 1;
int64 total = 2;
}
message ListFollowerRequest {
uint64 userId = 1 [(validate.rules).uint64.gte = 1];
int32 page = 2 [(validate.rules).int32.gte = 0];
int32 limit = 3 [(validate.rules).int32.gte = 1];
}
message ListFollowerReply {
repeated uint64 followerUids = 1;
int64 total = 2;
}
message BatchGetRelationRequest {
uint64 userId = 1 [(validate.rules).uint64.gte = 1];
repeated uint64 uids = 2 [(validate.rules).repeated.min_items = 1];
}
message BatchGetRelationReply {
map<uint64, int32> result = 1;
}