25 lines
812 B
Java
25 lines
812 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 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;
|
|
|
|
@RestController
|
|
@RequiredArgsConstructor
|
|
@RequestMapping("/api/v1")
|
|
public class MapController {
|
|
|
|
private final MapService mapService;
|
|
|
|
@GetMapping("/posts/map")
|
|
public List<MapMarkerDto> getMapMarkers(@RequestParam(required = false) String type, @RequestParam(required = false) String category) {
|
|
return mapService.findAllWithCoordinates(type, category);
|
|
}
|
|
|
|
}
|