捐款和捐款记录
金色童年
捐款
Method and URL Structure
Method |
Resource URL |
Descrtipion |
POST |
/market/donation/ |
|
Request Data
Name |
Description |
Required |
Default |
amount |
金额 |
YES |
|
order_type |
类型 |
YES |
|
Request
{
"amount":"33.0",
"order_type": "donation",
}
cURL Example
curl -X POST -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
-H 'Content-Type: Application/json' --data '{....}' http://localhost/market/donation/
Response
{
"pk":19,
"amount":"42.00",
"created":"2016-10-31T19:03:38.727343"
}
捐款记录
Method and URL Structure
Method |
Resource URL |
GET |
/market/donation/logs/ |
Request Paramaters
No Applicatated
cURL Example
curl -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\ http://localhost/market/donation/logs/
Response
{
"count":3,
"next":null,
"previous":null,
"results":[{
"pk":3,
"amount":"99.90",
"created":"2016-11-01T12:15:03.042222",
"extra":"donation"
},..]
}
捐款总记录
Method and URL Structure
Method |
Resource URL |
GET |
/market/donation/statistics/ |
Request Paramaters
No Applicatated
cURL Example
curl -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\ http://localhost/market/donation/statistics/
Response
{
"amount_sum":"1999.99",
"user_count": 999,
}