[关闭]
@gzm1997 2018-06-08T13:26:16.000000Z 字数 1166 阅读 809

ooad api文档

系统分析与设计


获取一样的菜的详情

http://149.28.53.135/api/order/{id}

例如

http://149.28.53.135/api/product/1

返回值

  1. {
  2. "id": 1,
  3. "name": "pork",
  4. "picture": "https://demo.pork.png",
  5. "price": 53,
  6. "description": "this is a pork",
  7. "rating": 0.8,
  8. "amount": 100,
  9. "likes": 0,
  10. "tag_id": 1,
  11. "sales_permonth": 136
  12. }

获取所有菜详情

http://149.28.53.135/api/products

返回值

  1. {
  2. "result": [
  3. {
  4. "id": 1,
  5. "name": "pork",
  6. "picture": "https://demo.pork.png",
  7. "price": 53,
  8. "description": "this is a pork",
  9. "rating": 0.8,
  10. "amount": 100,
  11. "likes": 0,
  12. "tag_id": 1,
  13. "sales_permonth": 136
  14. },
  15. {
  16. "id": 2,
  17. "name": "fish",
  18. "picture": "https://demo.fish.png",
  19. "price": 32,
  20. "description": "this is a fish",
  21. "rating": 0.4,
  22. "amount": 10,
  23. "likes": 0,
  24. "tag_id": 1,
  25. "sales_permonth": 323
  26. }
  27. ]
  28. }

获取订单详情

http://149.28.53.135/api/order/{id}
例如

http://149.28.53.135/api/order/1

返回值

  1. {
  2. "isPaid": true,
  3. "id": 1,
  4. "reserve_datetime": "2018-06-08 04:58:51",
  5. "pay_datetime": "None",
  6. "table_num": 12,
  7. "food_list": [
  8. {
  9. "id": 2,
  10. "name": "fish",
  11. "count": 2,
  12. "price": 32
  13. },
  14. {
  15. "id": 1,
  16. "name": "pork",
  17. "count": 13,
  18. "price": 53
  19. }
  20. ],
  21. "total": 34
  22. }

生成一个订单

表单形如

  1. table:5
  2. list:[{'id': '1', 'name': 'pork', 'count': 123, 'price': 20}, {'id': '2', 'name': 'fish', 'count': 321, 'price': 23}]

返回值 返回值的reservation_id即为新生成的订单单号

  1. {
  2. "reservation_id": 3
  3. }

使用postman进行测试生成订单api
image_1cfetng8i12bb1i6a1ro775d1ogop.png-56.2kB

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注