const express = require("express") const transportService = require("../../../../services/transportService") const router = express.Router({ mergeParams: true }) router.get("/:stationId", async (req, res) => { const { stationId } = req.params const station = await transportService.getStationByIdx({ stationId }) return res.status(200).json(station) }) router.get("/:stationId/lines", async (req, res) => { const { stationId } = req.params const lines = await transportService.getStationLines(stationId) return res.status(200).json(lines) }) router.get("/all", async (req, res) => { const stations = await transportService.getAllStations() return res.status(200).json(stations) }) router.get("/:radiusKm/:latitude/:longitude", async (req, res) => { const { radiusKm, latitude, longitude } = req.params const station = await transportService.getStationsByDistance({ latitude, longitude, radiusKm }) return res.status(200).json(station) }) router.get("/accessible/:radiusKm/:latitude/:longitude", async (req, res) => { const { radiusKm, latitude, longitude } = req.params const station = await transportService.getAccessibleStations({ latitude, longitude, radiusKm }) return res.status(200).json(station) }) module.exports = router