forked from jackluo2012/datacenter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
questions.api
77 lines (69 loc) · 1.52 KB
/
questions.api
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
// 问答 抽奖 开始
@server(
group: questions
)
service datacenter-api {
@doc(
summary: "获取活动的信息"
)
@handler activitiesInfo
get /questions/activities/info (Actid) returns (ActivityResp)
@doc(
summary: "获取奖品信息"
)
@handler awardInfo
get /questions/award/info (Actid) returns (ActivityResp)
@handler awardList
get /questions/award/list (Actid) returns (ActivityResp)
}
type AnswerReq struct {
ActivityId int64 `json:"actid"`
Answers string `json:"answers"`
Score string `json:"score"`
}
type QuestionsAwardReq struct {
ActivityId int64 `json:"actid"`
AnswerId int64 `json:"answerid"`
}
type AnswerResp struct {
Answers string `json:"answers"`
Score string `json:"score"`
}
type AwardConvertReq struct {
UserName string `json:"username"`
Phone string `json:"phone"`
LotteryId int64 `json:"lotteryid"`
}
@server(
jwt: Auth
group: questions
middleware: Usercheck
)
service datacenter-api {
@doc(
summary: "获取题目"
)
@handler lists
get /questions/lists (VoteReq) returns (AnswerResp)
@doc(
summary: "提交答案"
)
@handler change
post /questions/change (AnswerReq) returns (VoteResp)
@doc(
summary: "获取分数"
)
@handler grade
get /questions/grade (VoteReq) returns (VoteResp)
@doc(
summary: "开始转盘"
)
@handler turntable
post /questions/lottery/turntable (EnrollReq) returns (EnrollResp)
@doc(
summary: "填写中奖信息人"
)
@handler lottery
post /questions/lottery/convert (AwardConvertReq) returns (EnrollResp)
}
// 问答 抽奖 结束