[关闭]
@fuyb1986 2017-02-19T11:54:37.000000Z 字数 1076 阅读 618

捐款和捐款记录

金色童年

捐款

Method and URL Structure

Method Resource URL Descrtipion
POST /market/donation/

Request Data

Name Description Required Default
amount 金额 YES
order_type 类型 YES

Request

  1. {
  2. "amount":"33.0",
  3. "order_type": "donation",
  4. }

cURL Example

  1. curl -X POST -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
  2. -H 'Content-Type: Application/json' --data '{....}' http://localhost/market/donation/

Response

  1. {
  2. "pk":19,
  3. "amount":"42.00",
  4. "created":"2016-10-31T19:03:38.727343"
  5. }

捐款记录

Method and URL Structure

Method Resource URL
GET /market/donation/logs/

Request Paramaters

No Applicatated

cURL Example

  1. curl -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\ http://localhost/market/donation/logs/

Response

  1. {
  2. "count":3,
  3. "next":null,
  4. "previous":null,
  5. "results":[{
  6. "pk":3,
  7. "amount":"99.90",
  8. "created":"2016-11-01T12:15:03.042222",
  9. "extra":"donation"
  10. },..]
  11. }

捐款总记录

Method and URL Structure

Method Resource URL
GET /market/donation/statistics/

Request Paramaters

No Applicatated

cURL Example

  1. curl -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\ http://localhost/market/donation/statistics/

Response

  1. {
  2. "amount_sum":"1999.99",
  3. "user_count": 999,
  4. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注