Added charging station router
ADD
src/server/rest/v1/router/api/ChargingStationRouter.ts
+import express, { NextFunction, Request, Response } from 'express';
+
+import ChargingStationService from '../../service/ChargingStationService';
+import RouterUtils from '../RouterUtils';
+import { ServerAction } from '../../../../../types/Server';
+import sanitize from 'mongo-sanitize';
+
+export default class ChargingStationRouter {
+ private router: express.Router;
+
+ public constructor() {
+ this.router = express.Router();
+ }
+
+ public buildRoutes(): express.Router {
+ this.buildRouteChargingStations();
+ return this.router;
+ }
+
+ protected buildRouteChargingStations(): void {
+ this.router.get(`/${ServerAction.REST_CHARGING_STATIONS}`, async (req: Request, res: Response, next: NextFunction) => {
+ await RouterUtils.handleServerAction(ChargingStationService.handleGetChargingStations.bind(this), ServerAction.REST_CHARGING_STATIONS, req, res, next);
+ });
+ }
+}

MODIFY
src/types/Server.ts
src/types/Server.ts
@@ -395,6 +395,8 @@ export enum ServerAction {
REST_END_USER_LICENSE_AGREEMENT_CHECK = 'eula/check',
REST_MAIL_CHECK = 'mail/check',
REST_MAIL_RESEND = 'mail/resend',
+
+ REST_CHARGING_STATIONS = 'chargingstations',
REST_PING = 'ping',
REST_TENANTS = 'tenants'
}

Added charging station router