[关闭]
@fuyb1986 2018-04-16T07:16:16.000000Z 字数 1893 阅读 573

娃娃机

program_girl


新抽奖接口

Method and URL Structure

Method MethodResource URL Descriptions Authentications Required
PUT /program_girl/lottery/prize_random/ YES

Request Header

Name Description Required Default
Authorization Token db02586eda69b432699b2f9031e02e8f5deda8db YES

cURL Example

  1. curl -X PUT -H 'Authorization: Token db02586eda69b432699b2f9031e02e8f5deda8db'
  2. http://127.0.0.1:8000/program_girl/lottery/prize_random/

Prize Description

Name Description
pool_name 奖池
taken_status 是否中奖
taken_token 获奖 token

JSON Response

  1. {
  2. "status": 0,
  3. "message": "",
  4. "prize_list":[{
  5. "take_token":"de9iqpkd8h8ywltd",
  6. "taken_status":true,
  7. "pool_name":"A"
  8. },{
  9. "take_token":"5vs6x6aiu8kx9u4q",
  10. "taken_status":true,
  11. "pool_name":"B"
  12. },{
  13. "take_token":"q9u3ounoxm8jkx2t",
  14. "taken_status":true,
  15. "pool_name":"C"
  16. },{
  17. "take_token":"hafkzu1t2y1sf8iw",
  18. "taken_status":true,
  19. "pool_name":"D"
  20. }]
  21. }

获取奖品

Method and URL Structure

Method MethodResource URL Descriptions Authentications Required
PUT /program_girl/lottery/prize_take/ YES

Request Header

Name Description Required Default
Authorization Token db02586eda69b432699b2f9031e02e8f5deda8db YES

Request Data

  1. {
  2. "take_token" :"7598iwr8j5jrtodl"
  3. }

cURL Example

  1. curl -X PUT -H 'Authorization: Token db02586eda69b432699b2f9031e02e8f5deda8db'
  2. --data {...} http://127.0.0.1:8000/program_girl/lottery/prize_take/

JSON Response

  1. {
  2. "status": 0,
  3. "message": "",
  4. "taken_status":true,
  5. "name":"150钻石",
  6. "prize_type":2,
  7. "take_token":"kmpl836g6o59wi2r",
  8. "image_url":"http://example.com/0.png",
  9. "desc":"150钻石"
  10. }

获取奖品记录

Method and URL Structure

Method Resource URL Authorization
GET /program_girl/lottery/prize_list/ YES

cURL Example

  1. curl -X GET -H 'Authorization: Token db02586eda69b432699b2f9031e02e8f5deda8db' http://localhost/program_girl/lottery/prize_list/

Response Data

Name Description
name 名称
desc 描述
image_url 图片地址
taken_time 获奖时间
done 完成处理

Response

  1. {
  2. "count":1,
  3. "next":null,
  4. "previous":null,
  5. "results":[{
  6. "name":"200钻石",
  7. "desc":"200钻石",
  8. "image_url":"https://static1.bcjiaoyu.com//cxy/app/diamond.png",
  9. "taken_time":"2017-11-13T17:14:23.035504",
  10. "done":true
  11. }]
  12. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注