added searchMap methods
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user