接口标识:

  1. 用户注册接口:/register
  2. 用户登录接口:/login
  3. 餐厅列表接口:/restaurants
  4. 菜单列表接口:/menu
  5. 下单接口:/order
  6. 订单查询接口:/orders
  7. 订单取消接口:/cancel_order

接口图: 用户注册接口: 请求方式:POST 请求参数:

  • username: string,必填,用户名
  • password: string,必填,密码
  • email: string,必填,邮箱
  • phone: string,必填,电话号码 返回结果:
  • 成功:{"code": 200, "msg": "注册成功"}
  • 失败:{"code": 400, "msg": "注册失败"}

用户登录接口: 请求方式:POST 请求参数:

  • username: string,必填,用户名
  • password: string,必填,密码 返回结果:
  • 成功:{"code": 200, "msg": "登录成功", "token": "xxxxx"}
  • 失败:{"code": 400, "msg": "登录失败"}

餐厅列表接口: 请求方式:GET 请求参数:无 返回结果:

  • 成功:{"code": 200, "msg": "获取餐厅列表成功", "data": [{"id": 1, "name": "餐厅1"}, {"id": 2, "name": "餐厅2"}]}
  • 失败:{"code": 400, "msg": "获取餐厅列表失败"}

菜单列表接口: 请求方式:GET 请求参数:

  • restaurant_id: int,必填,餐厅id 返回结果:
  • 成功:{"code": 200, "msg": "获取菜单列表成功", "data": [{"id": 1, "name": "菜品1", "price": 10.0}, {"id": 2, "name": "菜品2", "price": 20.0}]}
  • 失败:{"code": 400, "msg": "获取菜单列表失败"}

下单接口: 请求方式:POST 请求参数:

  • restaurant_id: int,必填,餐厅id
  • menu_id: int,必填,菜品id
  • quantity: int,必填,数量
  • token: string,必填,用户token 返回结果:
  • 成功:{"code": 200, "msg": "下单成功"}
  • 失败:{"code": 400, "msg": "下单失败"}

订单查询接口: 请求方式:GET 请求参数:

  • token: string,必填,用户token 返回结果:
  • 成功:{"code": 200, "msg": "获取订单列表成功", "data": [{"id": 1, "restaurant": "餐厅1", "menu": "菜品1", "quantity": 2, "total_price": 20.0, "status": "待处理"}]}
  • 失败:{"code": 400, "msg": "获取订单列表失败"}

订单取消接口: 请求方式:POST 请求参数:

  • order_id: int,必填,订单id
  • token: string,必填,用户token 返回结果:
  • 成功:{"code": 200, "msg": "取消订单成功"}
  • 失败:{"code": 400, "msg": "取消订单失败"
网上订餐系统接口标识和接口图

原文地址: https://www.cveoy.top/t/topic/cOg0 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录