/** * @swagger * tags: * name: Matching * description: 匹配订单相关接口 */ /** * @swagger * /api/matching/my-orders: * get: * summary: 获取用户的匹配订单列表 * tags: [Matching] * security: * - bearerAuth: [] * parameters: * - in: query * name: page * schema: * type: integer * default: 1 * description: 页码 * - in: query * name: limit * schema: * type: integer * default: 10 * description: 每页数量 * responses: * 200: * description: 成功获取匹配订单列表 * content: * application/json: * schema: * type: object * properties: * success: * type: boolean * data: * type: array * items: * $ref: '#/components/schemas/MatchingOrder' * 401: * description: 未授权 * 500: * description: 服务器错误 */ /** * @swagger * components: * schemas: * MatchingOrder: * type: object * properties: * id: * type: integer * description: 匹配订单ID * initiator_id: * type: integer * description: 发起人ID * matching_type: * type: string * enum: [small, large] * description: 匹配类型(小额或大额) * amount: * type: number * description: 匹配总金额 * status: * type: string * enum: [pending, matching, completed, failed] * description: 订单状态 * created_at: * type: string * format: date-time * description: 创建时间 * Allocation: * type: object * properties: * id: * type: integer * description: 分配ID * from_user_id: * type: integer * description: 发送方用户ID * to_user_id: * type: integer * description: 接收方用户ID * amount: * type: number * description: 分配金额 * cycle_number: * type: integer * description: 轮次编号 * status: * type: string * enum: [pending, confirmed, rejected, cancelled] * description: 分配状态 * created_at: * type: string * format: date-time * description: 创建时间 */ /** * @swagger * /api/matching/create: * post: * summary: 创建匹配订单 * tags: [Matching] * security: * - bearerAuth: [] * requestBody: * required: true * content: * application/json: * schema: * type: object * properties: * matchingType: * type: string * enum: [small, large] * default: small * description: 匹配类型(小额或大额) * customAmount: * type: number * description: 大额匹配时的自定义金额(5000-50000之间) * responses: * 200: * description: 匹配订单创建成功 * content: * application/json: * schema: * type: object * properties: * success: * type: boolean * message: * type: string * data: * type: object * properties: * matchingOrderId: * type: integer * amounts: * type: array * items: * type: number * matchingType: * type: string * totalAmount: * type: number * 400: * description: 参数错误或用户未满足匹配条件 * 401: * description: 未授权 * 404: * description: 用户不存在 * 500: * description: 服务器错误 */