273 lines
7.6 KiB
JavaScript
273 lines
7.6 KiB
JavaScript
/**
|
|
* @swagger
|
|
* tags:
|
|
* name: 佣金管理
|
|
* description: 佣金记录管理相关接口
|
|
*/
|
|
|
|
/**
|
|
* @swagger
|
|
* /commissions:
|
|
* get:
|
|
* summary: 获取佣金记录列表
|
|
* tags: [佣金管理]
|
|
* 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: status
|
|
* schema:
|
|
* type: string
|
|
* enum: [pending, paid, cancelled]
|
|
* description: 佣金状态
|
|
* - in: query
|
|
* name: commission_type
|
|
* schema:
|
|
* type: string
|
|
* description: 佣金类型
|
|
* - in: query
|
|
* name: start_date
|
|
* schema:
|
|
* type: string
|
|
* format: date
|
|
* description: 开始日期
|
|
* - in: query
|
|
* name: end_date
|
|
* schema:
|
|
* type: string
|
|
* format: date
|
|
* description: 结束日期
|
|
* - in: query
|
|
* name: min_amount
|
|
* schema:
|
|
* type: number
|
|
* description: 最小金额
|
|
* - in: query
|
|
* name: max_amount
|
|
* schema:
|
|
* type: number
|
|
* description: 最大金额
|
|
* - in: query
|
|
* name: sort_by
|
|
* schema:
|
|
* type: string
|
|
* default: created_at
|
|
* description: 排序字段
|
|
* - in: query
|
|
* name: sort_order
|
|
* schema:
|
|
* type: string
|
|
* enum: [asc, desc]
|
|
* default: desc
|
|
* description: 排序方向
|
|
* responses:
|
|
* 200:
|
|
* description: 获取成功
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* type: object
|
|
* properties:
|
|
* success:
|
|
* type: boolean
|
|
* example: true
|
|
* data:
|
|
* type: object
|
|
* properties:
|
|
* commissions:
|
|
* type: array
|
|
* items:
|
|
* $ref: '#/components/schemas/Commission'
|
|
* total:
|
|
* type: integer
|
|
* description: 总记录数
|
|
* page:
|
|
* type: integer
|
|
* description: 当前页码
|
|
* limit:
|
|
* type: integer
|
|
* description: 每页数量
|
|
* totalPages:
|
|
* type: integer
|
|
* description: 总页数
|
|
* stats:
|
|
* type: object
|
|
* properties:
|
|
* totalAmount:
|
|
* type: number
|
|
* format: decimal
|
|
* description: 总佣金金额
|
|
* pendingAmount:
|
|
* type: number
|
|
* format: decimal
|
|
* description: 待发放金额
|
|
* paidAmount:
|
|
* type: number
|
|
* format: decimal
|
|
* description: 已发放金额
|
|
* 401:
|
|
* description: 未授权
|
|
* 500:
|
|
* description: 服务器错误
|
|
*/
|
|
|
|
/**
|
|
* @swagger
|
|
* /commissions/{id}:
|
|
* get:
|
|
* summary: 获取单个佣金记录详情
|
|
* tags: [佣金管理]
|
|
* 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
|
|
* example: true
|
|
* data:
|
|
* $ref: '#/components/schemas/Commission'
|
|
* 401:
|
|
* description: 未授权
|
|
* 404:
|
|
* description: 佣金记录不存在
|
|
* 500:
|
|
* description: 服务器错误
|
|
*/
|
|
|
|
/**
|
|
* @swagger
|
|
* /commissions/{id}/request-payment:
|
|
* post:
|
|
* summary: 申请单个佣金发放
|
|
* tags: [佣金管理]
|
|
* 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
|
|
* example: true
|
|
* message:
|
|
* type: string
|
|
* example: "佣金发放申请已提交"
|
|
* 400:
|
|
* description: 申请失败
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* type: object
|
|
* properties:
|
|
* success:
|
|
* type: boolean
|
|
* example: false
|
|
* message:
|
|
* type: string
|
|
* example: "该佣金记录不可申请发放"
|
|
* 401:
|
|
* description: 未授权
|
|
* 404:
|
|
* description: 佣金记录不存在
|
|
* 500:
|
|
* description: 服务器错误
|
|
*/
|
|
|
|
/**
|
|
* @swagger
|
|
* /commissions/batch-request-payment:
|
|
* post:
|
|
* summary: 批量申请佣金发放
|
|
* tags: [佣金管理]
|
|
* security:
|
|
* - bearerAuth: []
|
|
* requestBody:
|
|
* required: true
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* type: object
|
|
* required:
|
|
* - commission_ids
|
|
* properties:
|
|
* commission_ids:
|
|
* type: array
|
|
* items:
|
|
* type: integer
|
|
* description: 佣金记录ID数组
|
|
* responses:
|
|
* 200:
|
|
* description: 批量申请成功
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* type: object
|
|
* properties:
|
|
* success:
|
|
* type: boolean
|
|
* example: true
|
|
* data:
|
|
* type: object
|
|
* properties:
|
|
* successCount:
|
|
* type: integer
|
|
* description: 成功申请数量
|
|
* failedCount:
|
|
* type: integer
|
|
* description: 失败申请数量
|
|
* failedIds:
|
|
* type: array
|
|
* items:
|
|
* type: integer
|
|
* description: 失败的佣金记录ID
|
|
* message:
|
|
* type: string
|
|
* example: "批量申请完成"
|
|
* 400:
|
|
* description: 参数错误
|
|
* 401:
|
|
* description: 未授权
|
|
* 500:
|
|
* description: 服务器错误
|
|
*/ |