rentease-backend-new/routes/statistics.js

20 lines
1.0 KiB
JavaScript

const express = require('express');
const router = express.Router();
const statisticsController = require('../controllers/statisticsController');
const { authMiddleware } = require('../middleware/auth');
// 所有统计接口都需要认证
router.use(authMiddleware);
// 路由
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;