26 lines
882 B
Java
26 lines
882 B
Java
package SuMoC.backend.geocoding;
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
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;
|
|
import reactor.core.publisher.Mono;
|
|
|
|
@RestController
|
|
@RequestMapping("/geocoding")
|
|
public class GeocodingController {
|
|
|
|
private final GeoCodingService geoCodingService;
|
|
|
|
public GeocodingController(GeoCodingService geoCodingService) {
|
|
this.geoCodingService = geoCodingService;
|
|
}
|
|
|
|
@GetMapping("/reverse")
|
|
@Operation(description = "Returns the address at the given lat / lon.")
|
|
public Mono<AddressDTO> reverse(@RequestParam double lat, @RequestParam double lon) {
|
|
return geoCodingService.getAddress(lat, lon);
|
|
}
|
|
}
|