娃娃机
儿童编程
抽奖接口
Method and URL Structure
Method |
MethodResource URL |
Descriptions |
Authentications Required |
PUT |
/program_face2face/lottery/prize_random/ |
YES |
|
Name |
Description |
Required |
Default |
Authorization |
Token db02586eda69b432699b2f9031e02e8f5deda8db |
YES |
|
cURL Example
curl -X PUT -H 'Authorization: Token db02586eda69b432699b2f9031e02e8f5deda8db'
http://127.0.0.1:8000/program_face2face/lottery/prize_random/
Prize Description
Name |
Description |
name |
名称 |
desc |
描述 |
prize_type |
类型 |
taken_status |
是否中奖 |
taken_token |
获奖 token |
image_url |
图片地址 |
JSON Response
{
"status": 0,
"message": "",
, "prize_list":[{
"name":"100钻石",
"desc":"100钻石",
"prize_type":2,
"taken_status":true,
"take_token":"5mfns5elsc7xiz5i",
"image_url":"http://example.com/0.png",
"order_index": 101,
},{
"name":"趣味Python编程书",
"desc":"趣味python编程书",
"prize_type":0,
"taken_status":true,
"take_token":"jom6qomqu9fk6xik",
"image_url":"http://example.com/0.png",
"order_index": 103,
},{
"name":"10Q币",
"desc":"10Q币",
"prize_type":3,
"taken_status":true,
"take_token":"7za7cjuzpxw8u3d2",
"image_url":"http://example.com/0.png",
"order_index": 102,
},{
"name":"王者荣耀英雄嬴政",
"desc":"王者荣耀英雄嬴政",
"prize_type":0,
"taken_status":true,
"take_token":"7598iwr8j5jrtodl",
"image_url":"http://example.com/0.png",
"order_index": 104,
}, {
"name":"随机",
"desc":"随机",
"prize_type":4,
"taken_status":true,
"take_token":"6mmewhuh9hy2odfr"
"image_url":"http://example.com/0.png",
"order_index": 100,
}],
}
获取奖品
Method and URL Structure
Method |
MethodResource URL |
Descriptions |
Authentications Required |
PUT |
/program_face2face/lottery/prize_take/ |
|
YES |
Name |
Description |
Required |
Default |
Authorization |
Token db02586eda69b432699b2f9031e02e8f5deda8db |
YES |
|
Request Data
{
"take_token" :"7598iwr8j5jrtodl"
}
cURL Example
curl -X PUT -H 'Authorization: Token db02586eda69b432699b2f9031e02e8f5deda8db'
--data {...} http://127.0.0.1:8000/program_face2face/lottery/prize_take/
JSON Response
{
"status": 0,
"message": "",
"taken_status":true,
"name":"150钻石",
"prize_type":2,
"take_token":"kmpl836g6o59wi2r",
"image_url":"http://example.com/0.png",
"desc":"150钻石"
}
获取奖品记录
Method and URL Structure
Method |
Resource URL |
Authorization |
GET |
/program_face2face/lottery/prize_list/ |
YES |
cURL Example
curl -X GET -H 'Authorization: Token db02586eda69b432699b2f9031e02e8f5deda8db' http://localhost/program_face2face/lottery/prize_list/
Response Data
Name |
Description |
name |
名称 |
desc |
描述 |
image_url |
图片地址 |
taken_time |
获奖时间 |
done |
完成处理 |
Response
{
"count":1,
"next":null,
"previous":null,
"results":[{
"name":"200钻石",
"desc":"200钻石",
"image_url":"https://static1.bcjiaoyu.com//cxy/app/diamond.png",
"taken_time":"2017-11-13T17:14:23.035504",
"done":true
}]
}
新抽奖接口
Method and URL Structure
Method |
MethodResource URL |
Descriptions |
Authentications Required |
PUT |
/program_face2face/lottery/prize_random/ |
YES |
|
Name |
Description |
Required |
Default |
Authorization |
Token db02586eda69b432699b2f9031e02e8f5deda8db |
YES |
|
cURL Example
curl -X PUT -H 'Authorization: Token db02586eda69b432699b2f9031e02e8f5deda8db'
http://127.0.0.1:8000/program_face2face/lottery/prize_random/
Prize Description
Name |
Description |
pool_name |
奖池 |
taken_status |
是否中奖 |
taken_token |
获奖 token |
JSON Response
{
"status": 0,
"message": "",
"prize_list":[{
"take_token":"de9iqpkd8h8ywltd",
"taken_status":true,
"pool_name":"A"
},{
"take_token":"5vs6x6aiu8kx9u4q",
"taken_status":true,
"pool_name":"B"
},{
"take_token":"q9u3ounoxm8jkx2t",
"taken_status":true,
"pool_name":"C"
},{
"take_token":"hafkzu1t2y1sf8iw",
"taken_status":true,
"pool_name":"D"
}]
}