rentease-backend-new/routes/statistics.js

20 lines
1.0 KiB
JavaScript
Raw Normal View History

2026-04-20 06:43:09 +00:00
const express = require('express');
const router = express.Router();
const statisticsController = require('../controllers/statisticsController');
2026-05-09 09:01:41 +00:00
const { authMiddleware } = require('../middleware/auth');
// 所有统计接口都需要认证
router.use(authMiddleware);
2026-04-20 06:43:09 +00:00
// 路由
router.get('/rent', statisticsController.getRentStatistics);
router.get('/room-status', statisticsController.getRoomStatusStatistics);
router.get('/dashboard', statisticsController.getDashboardStatistics);
router.get('/apartment-room-status', statisticsController.getApartmentRoomStatusStatistics);
router.get('/empty-rooms-by-apartment', statisticsController.getEmptyRoomsByApartment);
router.get('/rented-rooms-by-apartment', statisticsController.getRentedRoomsByApartment);
router.get('/soon-expire-rooms-by-apartment', statisticsController.getSoonExpireRoomsByApartment);
router.get('/expired-rooms-by-apartment', statisticsController.getExpiredRoomsByApartment);
router.get('/tenant-rental-stats', statisticsController.getTenantRentalStats);
module.exports = router;