22 lines
681 B
JavaScript
22 lines
681 B
JavaScript
|
|
const express = require('express');
|
||
|
|
const router = express.Router();
|
||
|
|
const billPaymentController = require('../controllers/billPaymentController');
|
||
|
|
const { authMiddleware } = require('../middleware/auth');
|
||
|
|
|
||
|
|
// 所有路由都需要认证
|
||
|
|
router.use(authMiddleware);
|
||
|
|
|
||
|
|
// 获取账单的所有支付流水
|
||
|
|
router.get('/bill/:billId', billPaymentController.getPaymentsByBillId);
|
||
|
|
|
||
|
|
// 创建支付流水(收款)
|
||
|
|
router.post('/bill/:billId', billPaymentController.createPayment);
|
||
|
|
|
||
|
|
// 删除支付流水
|
||
|
|
router.delete('/:id', billPaymentController.deletePayment);
|
||
|
|
|
||
|
|
// 获取支付统计
|
||
|
|
router.get('/statistics', billPaymentController.getPaymentStatistics);
|
||
|
|
|
||
|
|
module.exports = router;
|