273 lines
7.5 KiB
JavaScript
273 lines
7.5 KiB
JavaScript
/**
|
|
* @swagger
|
|
* tags:
|
|
* name: Orders
|
|
* description: 订单管理API
|
|
*/
|
|
|
|
/**
|
|
* @swagger
|
|
* /api/orders:
|
|
* get:
|
|
* summary: 获取订单列表
|
|
* tags: [Orders]
|
|
* security:
|
|
* - bearerAuth: []
|
|
* parameters:
|
|
* - in: query
|
|
* name: page
|
|
* schema:
|
|
* type: integer
|
|
* default: 1
|
|
* description: 页码
|
|
* - in: query
|
|
* name: limit
|
|
* schema:
|
|
* type: integer
|
|
* default: 10
|
|
* description: 每页数量
|
|
* - in: query
|
|
* name: search
|
|
* schema:
|
|
* type: string
|
|
* description: 搜索关键词
|
|
* - in: query
|
|
* name: orderNumber
|
|
* schema:
|
|
* type: string
|
|
* description: 订单号
|
|
* - in: query
|
|
* name: username
|
|
* schema:
|
|
* type: string
|
|
* description: 用户名
|
|
* - in: query
|
|
* name: status
|
|
* schema:
|
|
* type: string
|
|
* description: 订单状态
|
|
* - in: query
|
|
* name: startDate
|
|
* schema:
|
|
* type: string
|
|
* format: date
|
|
* description: 开始日期
|
|
* - in: query
|
|
* name: endDate
|
|
* schema:
|
|
* type: string
|
|
* format: date
|
|
* description: 结束日期
|
|
* responses:
|
|
* 200:
|
|
* description: 成功获取订单列表
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* type: object
|
|
* properties:
|
|
* success:
|
|
* type: boolean
|
|
* data:
|
|
* type: object
|
|
* properties:
|
|
* orders:
|
|
* type: array
|
|
* items:
|
|
* $ref: '#/components/schemas/Order'
|
|
* pagination:
|
|
* type: object
|
|
* properties:
|
|
* page:
|
|
* type: integer
|
|
* limit:
|
|
* type: integer
|
|
* total:
|
|
* type: integer
|
|
* pages:
|
|
* type: integer
|
|
* 401:
|
|
* description: 未授权
|
|
* 500:
|
|
* description: 服务器错误
|
|
*/
|
|
|
|
/**
|
|
* @swagger
|
|
* /api/orders/confirm:
|
|
* post:
|
|
* summary: 确认下单
|
|
* tags: [Orders]
|
|
* security:
|
|
* - bearerAuth: []
|
|
* requestBody:
|
|
* required: true
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* type: object
|
|
* required:
|
|
* - pre_order_id
|
|
* - address
|
|
* properties:
|
|
* pre_order_id:
|
|
* type: integer
|
|
* description: 预订单ID
|
|
* address:
|
|
* type: object
|
|
* properties:
|
|
* recipient_name:
|
|
* type: string
|
|
* description: 收货人姓名
|
|
* phone:
|
|
* type: string
|
|
* description: 收货人电话
|
|
* province:
|
|
* type: string
|
|
* description: 省份
|
|
* city:
|
|
* type: string
|
|
* description: 城市
|
|
* district:
|
|
* type: string
|
|
* description: 区县
|
|
* detail_address:
|
|
* type: string
|
|
* description: 详细地址
|
|
* responses:
|
|
* 200:
|
|
* description: 确认下单成功
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* type: object
|
|
* properties:
|
|
* success:
|
|
* type: boolean
|
|
* message:
|
|
* type: string
|
|
* data:
|
|
* type: object
|
|
* properties:
|
|
* order_id:
|
|
* type: integer
|
|
* order_no:
|
|
* type: string
|
|
* 400:
|
|
* description: 请求参数错误
|
|
* 401:
|
|
* description: 未授权
|
|
* 404:
|
|
* description: 预订单不存在
|
|
* 500:
|
|
* description: 服务器错误
|
|
*/
|
|
|
|
/**
|
|
* @swagger
|
|
* /api/orders/pre-order/{id}:
|
|
* get:
|
|
* summary: 获取预订单详情
|
|
* tags: [Orders]
|
|
* security:
|
|
* - bearerAuth: []
|
|
* parameters:
|
|
* - in: path
|
|
* name: id
|
|
* required: true
|
|
* schema:
|
|
* type: integer
|
|
* description: 预订单ID
|
|
* responses:
|
|
* 200:
|
|
* description: 获取预订单详情成功
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* type: object
|
|
* properties:
|
|
* success:
|
|
* type: boolean
|
|
* data:
|
|
* type: object
|
|
* properties:
|
|
* id:
|
|
* type: integer
|
|
* order_no:
|
|
* type: string
|
|
* total_amount:
|
|
* type: integer
|
|
* total_points:
|
|
* type: integer
|
|
* total_rongdou:
|
|
* type: integer
|
|
* status:
|
|
* type: string
|
|
* created_at:
|
|
* type: string
|
|
* items:
|
|
* type: array
|
|
* items:
|
|
* type: object
|
|
* properties:
|
|
* id:
|
|
* type: integer
|
|
* product_id:
|
|
* type: integer
|
|
* product_name:
|
|
* type: string
|
|
* quantity:
|
|
* type: integer
|
|
* price:
|
|
* type: integer
|
|
* points_price:
|
|
* type: integer
|
|
* rongdou_price:
|
|
* type: integer
|
|
* spec_info:
|
|
* type: object
|
|
* 401:
|
|
* description: 未授权
|
|
* 404:
|
|
* description: 预订单不存在
|
|
* 500:
|
|
* description: 服务器错误
|
|
*/
|
|
|
|
/**
|
|
* @swagger
|
|
* /api/orders/{id}:
|
|
* get:
|
|
* summary: 获取单个订单详情
|
|
* tags: [Orders]
|
|
* security:
|
|
* - bearerAuth: []
|
|
* parameters:
|
|
* - in: path
|
|
* name: id
|
|
* required: true
|
|
* schema:
|
|
* type: integer
|
|
* description: 订单ID
|
|
* responses:
|
|
* 200:
|
|
* description: 成功获取订单详情
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* type: object
|
|
* properties:
|
|
* success:
|
|
* type: boolean
|
|
* data:
|
|
* type: object
|
|
* properties:
|
|
* order:
|
|
* $ref: '#/components/schemas/Order'
|
|
* 401:
|
|
* description: 未授权
|
|
* 404:
|
|
* description: 订单不存在
|
|
* 500:
|
|
* description: 服务器错误
|
|
*/ |