-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbadge.proto
51 lines (43 loc) · 1.15 KB
/
badge.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
syntax = "proto3";
package badge;
import "google/protobuf/timestamp.proto";
import "template.proto";
// 用户 “扫福” 结果
enum ScanResult {
// 没有识别到校徽
NoBadge = 0;
// 当日领福卡次数已达到限制
ReachLimit = 1;
// 没有抽中
NoCard = 2;
// 抽中了
WinCard = 3;
}
// 用户 “扫福” 记录
message ScanRecord {
// 用户 ID
// int32 uid = 1;
// “扫福” 结果类型
ScanResult _type = 2;
// 抽到的卡类型。暂且考虑到扩展性,使用 int 类型表示
optional int32 card = 3;
// 触发的时间
google.protobuf.Timestamp ts = 4;
}
// 用户卡片
message Card {
// 卡片类型
int32 card_type = 1;
// 抽卡时间
google.protobuf.Timestamp ts = 2;
}
message CardListResponse {
repeated Card card_list = 1;
}
service BadgeService {
// 获取用户所抽到的所有卡片
rpc GetUserCardStorage(template.EmptyRequest) returns (CardListResponse);
// 记录用户分享事件
// 该方法用于增加用户抽卡次数(2022春节)
rpc AppendShareLog(template.EmptyRequest) returns (template.Empty);
}