[关闭]
@JackieQu 2018-06-12T17:06:38.000000Z 字数 1504 阅读 293

商品信息

好热闹TeaShop


商品列表

Method and Url Structure

Method Resource URL
GET /market/products/

cURL Example

  1. curl -X POST -H 'Authorization: Token 7dccb47cbeb6a283013708ed983712fc6488aa74'
  2. http://127.0.0.1:8000/market/products/

JSON Response

  1. {
  2. "count": 2,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 2,
  8. "name": "冰红茶",
  9. "content": "冰力十足",
  10. "image": "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2077117511,2743730327&fm=200&gp=0.jpg",
  11. "price": "5.00",
  12. "offer_price": "3.00",
  13. "isoffer": false,
  14. "bought": 0
  15. },
  16. {
  17. "pk": 1,
  18. "name": "青梅绿茶",
  19. "content": "绿茶配青梅还是头一回",
  20. "image": "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1031155128,3611764703&fm=27&gp=0.jpg",
  21. "price": "6.00",
  22. "offer_price": "4.00",
  23. "isoffer": false,
  24. "bought": 0
  25. }
  26. ]
  27. }

查看商品详情

Method and Url Structure

Method Resource URL
GET /market/product/&{pk}

Request and Parameters

Name Description Required Default
pk 商品 pk YES

Request

  1. 2

cURL Example

  1. curl -X POST -H 'Authorization: Token 7dccb47cbeb6a283013708ed983712fc6488aa74'
  2. http://127.0.0.1:8000/market/product/2/

JSON Response

  1. {
  2. "pk": 2,
  3. "name": "冰红茶",
  4. "content": "冰力十足",
  5. "image": "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2077117511,2743730327&fm=200&gp=0.jpg",
  6. "price": "5.00",
  7. "offer_price": "3.00",
  8. "isoffer": false,
  9. "bought": 0
  10. }

查看商品评价

Method and Url Structure

Method Resource URL
GET /market/product/evaluations/&{pk}

Request and Parameters

Name Description Required Default
pk pk YES

Request

  1. 2

cURL Example

  1. curl -X POST -H 'Authorization: Token 7dccb47cbeb6a283013708ed983712fc6488aa74'
  2. http://127.0.0.1:8000/market/product/evaluations/2/

JSON Response

  1. {
  2. "count": 0,
  3. "next": null,
  4. "previous": null,
  5. "results": []
  6. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注