-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.thrift
48 lines (38 loc) · 796 Bytes
/
api.thrift
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
namespace java com.myodov.sample_thrift_app.api
// exception SomeException { ... }
// service SomeService { ... }
enum Weapon {
Sword = 1
Bow = 2
}
struct WarriorInfo {
1: optional Weapon weapon
2: required i64 arrowsNumber
}
enum Spell {
Fireball = 1
Thunderbolt = 2
}
struct MageInfo {
1: required set<Spell> spellbook
2: required i64 mana
}
union ClassSpecificInfo {
1: WarriorInfo warrior
2: MageInfo mage
}
struct Hero {
1: required string name
2: required i64 hp
3: required i64 xp
4: ClassSpecificInfo classSpecificInfo
}
struct SomeInfo {
1: required i64 first
2: required i64 second
3: required set<i64> sss
4: required set<Spell> mmm
}
service CalculatorService {
i32 multiply(1:i32 n1, 2:i32 n2),
}