Files
nahodka-back/src/main/java/com/krylov/refound/controller/MapController.java
2026-09-29 01:03:54 +03:00

28 lines
1021 B
Java

package com.krylov.refound.controller;
import com.krylov.refound.dto.MapMarkerDto;
import com.krylov.refound.service.MapService;
import java.util.List;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1")
public class MapController {
private final MapService mapService;
@GetMapping("/posts/map")
public List<MapMarkerDto> getMapMarkers(@RequestParam double minLat, @RequestParam double maxLat, @RequestParam double minLng, @RequestParam double maxLng, @RequestParam(required = false) String type, @RequestParam(required = false) String category) {
log.info("getMapMarkers");
return mapService.findMarkers(minLat, maxLat, minLng, maxLng, type, category);
}
}