I need to modify the request parameters in the GET URL "http://localhost:8081/qeats/v1/restaurants?latitude=87.97864&longitude=20.82345" while sending it to spring boot controller such that the latitude and longitude values are only precise up to the single decimal place. e.g "http://localhost:8081/qeats/v1/restaurants?latitude=87.9&longitude=20.8"
@GetMapping(RESTAURANTS_API)
public ResponseEntity<GetRestaurantsResponse> getRestaurants(
@RequestParam Double latitude,
@RequestParam Double longitude, GetRestaurantsRequest getRestaurantsRequest) {
log.info("getRestaurants called with {}", getRestaurantsRequest);
GetRestaurantsResponse getRestaurantsResponse;
if (getRestaurantsRequest.getLatitude() != null && getRestaurantsRequest.getLongitude() != null
&& getRestaurantsRequest.getLatitude() >= -90
&& getRestaurantsRequest.getLatitude() <= 90
&& getRestaurantsRequest.getLongitude() >= -180
&& getRestaurantsRequest.getLongitude() <= 180) {
getRestaurantsResponse = restaurantService.findAllRestaurantsCloseBy(
getRestaurantsRequest, LocalTime.now());
log.info("getRestaurants returned {}", getRestaurantsResponse);
return ResponseEntity.ok().body(getRestaurantsResponse);
} else {
return ResponseEntity.badRequest().body(null);
}