package io.github.js0ny.ilp_coursework.controller;

import io.github.js0ny.ilp_coursework.data.external.RestrictedArea;
import io.github.js0ny.ilp_coursework.data.external.ServicePoint;
import io.github.js0ny.ilp_coursework.service.DroneInfoService;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/v1")
public class MapMetaController {

    private final DroneInfoService droneInfoService;

    public MapMetaController(DroneInfoService droneInfoService) {
        this.droneInfoService = droneInfoService;
    }

    @GetMapping("/restrictedAreas")
    public List<RestrictedArea> getRestrictedAreas() {
        return droneInfoService.fetchRestrictedAreas();
    }

    @GetMapping("/servicePoints")
    public List<ServicePoint> getServicePoints() {
        return droneInfoService.fetchServicePoints();
    }
}
