活动竞赛
编程王者
获取活动列表
Method and URL Structure
Method |
Resource URL |
Authorization |
GET |
/api/calculate_game/contest/activity/ |
YES |
Requeset Paramters
Name |
Description |
Required |
Default |
day |
活动日期 |
NO |
|
cURL Example
curl -X GET -H 'Authorization: token 95b7b4d8fff5d76c9d3d2954fe5c7d456c110a8c' -H 'Content-Type: application/json' http://localhost/api/calculate_game/contest/activity/?day=2018-09-10
Response Data
Name |
Description |
pk |
id |
start_time |
开始时间 |
end_time |
结束时间 |
numser |
活动号 |
grade_index |
科目索引 |
Response
{
u'count': 1,
u'previous': None,
u'next': None,
u'results': [{
u'pk': 4,
u'start_time': u'2018-09-06T10:27:30.204725Z',
u'grade_index': 13,
u'number': u'7r15roj3r3jdmwcy',
u'end_time': u'2018-09-04T13:27:30.200829Z'
}]
}
开始竞赛
Method and URL Structure
Method |
Resource URL |
Authorization |
POST |
/api/calculate_game/contest/contestroom/create/ |
YES |
Requeset Paramters
Name |
Description |
Required |
Default |
activity_number |
活动号 |
YES |
NO |
Request Data
{
"activity_number": "12345678910"
}
cURL Example
curl -X POST -H 'Authorization: token 95b7b4d8fff5d76c9d3d2954fe5c7d456c110a8c' -H 'Content-Type: application/json' --data '{...}' http://localhost/api/calculate_game/contest/activity/?day=2018-09-10
Response Data
Name |
Description |
pk |
id |
create_owner |
创建者 |
create_profile |
创建者用户信息 |
inviter_owner |
对战者 |
inviter_profile |
对战者用户信息 |
questions |
问题列表 |
Response
{
"pk":29223,
"create_owner":"oTYE24wV9PQdVBnbKyQPpZWh5qrs",
"create_profile":{
"pk":2645,
"owner":"oTYE24wV9PQdVBnbKyQPpZWh5qrs",
"nickname":"...",
"avatar_url":"https://wx.qlogo.cn/mmopen/vi_32/QbDVtZYQYAhpEzL5Xo45ZZYiaMuibSEYO4BQTKpATAbPsic4QhndDlt7b8qj0U6All3VLCibm4GRqu9DK99m3L3WJQ/132",
"sex":"M",
"sex_display":"男",
"country":"Wallis and Futuna",
"province":"",
"city":"",
"grade":{
"images":"",
"pk":8,
"name":"脑筋急转弯"
},
"point_rank":{
"next_name":"励志白银",
"current_name":"英勇黄铜",
"current_point_rank_point":1214,
"current_point_rank":726,
"current_all_point":1200,
"current_point":1214,
"next_all_point":1250}
},
"invite_owner":"oTYE24xY_qf8fDo96XZ9uYXCxz4Q",
"invite_profile":{
"pk":2410,
"owner":"oTYE24xY_qf8fDo96XZ9uYXCxz4Q",
"nickname":"明",
"avatar_url":"https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJibIicicvIxrJS4llckjUOHuPAIgyaEs1QJOykOeiaRibrhibUDBpicJT4zEdgvClVek85Z5gTiabZic1Jic4Q/132",
"sex":"M",
"sex_display":"男",
"country":"China",
"province":"Jiangxi",
"city":"Jiujiang",
"grade":{
"images":"",
"pk":1,
"name":"一年级"
},
"point_rank":{
"next_name":"励志白银",
"current_name":"英勇黄铜",
"current_point_rank_point":1241,
"current_point_rank":539,
"current_all_point":1200,
"current_point":1241,
"next_all_point":1250
}
},
"gold":0,
"questions":"[132L, 133L, 130L, 29L, 31L]",
"contest_types":"activity",
"winer_owner":"",
"winer_gold":0,
"winer_point":0,
"create_score":0,
"invite_score":0,
"create_combo":0,
"invite_combo":0,
"contest_status":"unfinish",
"created":"2018-09-04T10:36:28.662276Z"
}
获取竞赛结果
Method and URL Structure
Method |
Resource URL |
Authorization |
PUT |
/api/calculate_game/contest/contestroom/result/${pk}/ |
YES |
cURL Example
curl -X PUT -H 'Authorization: token 95b7b4d8fff5d76c9d3d2954fe5c7d456c110a8c' -H 'Content-Type: application/json' http://localhost/api/calculate_game/contest/contestrooom/result/111/
Response Data
Name |
Description |
pk |
id |
winer_owner |
胜者 |
reward_amount |
奖学金 |
diamond_amount |
红钻 |
Response
{
"pk":29223,
"gold":0,
"questions":"[132L, 133L, 130L, 29L, 31L]",
"contest_types":"activity",
"winer_owner":"create_owner",
"winer_gold":0,
"winer_point":0,
"create_score":0,
"invite_score":0,
"create_combo":0,
"invite_combo":0,
"contest_status":"finish",
"created":"2018-09-04T10:36:28.662276Z"
"reward_amount": 33.3,
"diamond_amount": 0,
}
获取奖励
用活动号获取
Method and URL Structure
Method |
Resource URL |
Authorization |
PUT |
/api/calculate_game/contest/activity/take-reward/${num}/ |
YES |
Requeset Paramters
Name |
Description |
Required |
Default |
username |
手机号 |
YES |
NO |
Request Data
{
"mobile": "18012345678"
}