2026-03-20 11:48:58 -07:00
|
|
|
import { IMaintenanceWindowController } from "@/controllers/maintenanceWindowController.js";
|
2025-04-20 11:29:53 -07:00
|
|
|
import { Router } from "express";
|
2025-10-20 14:22:20 +08:00
|
|
|
|
2025-04-20 11:29:53 -07:00
|
|
|
class MaintenanceWindowRoutes {
|
2026-01-21 10:36:03 -08:00
|
|
|
private router: Router;
|
2026-03-20 11:48:58 -07:00
|
|
|
private mwController: IMaintenanceWindowController;
|
2026-01-21 10:36:03 -08:00
|
|
|
|
2026-03-20 11:48:58 -07:00
|
|
|
constructor(maintenanceWindowController: IMaintenanceWindowController) {
|
2025-04-20 11:29:53 -07:00
|
|
|
this.router = Router();
|
2025-07-21 09:55:49 -07:00
|
|
|
this.mwController = maintenanceWindowController;
|
2025-04-20 11:29:53 -07:00
|
|
|
this.initRoutes();
|
|
|
|
|
}
|
|
|
|
|
initRoutes() {
|
2025-07-21 09:55:49 -07:00
|
|
|
this.router.post("/", this.mwController.createMaintenanceWindows);
|
|
|
|
|
this.router.get("/team/", this.mwController.getMaintenanceWindowsByTeamId);
|
2025-04-20 11:29:53 -07:00
|
|
|
|
2025-07-21 12:27:53 -07:00
|
|
|
this.router.get("/monitor/:monitorId", this.mwController.getMaintenanceWindowsByMonitorId);
|
2025-04-20 11:29:53 -07:00
|
|
|
|
2025-07-21 09:55:49 -07:00
|
|
|
this.router.get("/:id", this.mwController.getMaintenanceWindowById);
|
2026-02-04 19:30:41 +00:00
|
|
|
this.router.patch("/:id", this.mwController.editMaintenanceWindow);
|
2025-07-21 12:27:53 -07:00
|
|
|
this.router.delete("/:id", this.mwController.deleteMaintenanceWindow);
|
2025-04-20 11:29:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getRouter() {
|
|
|
|
|
return this.router;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default MaintenanceWindowRoutes;
|