com.mx.path.model.mdx.web.controller.LocationsController Maven / Gradle / Ivy
The newest version!
package com.mx.path.model.mdx.web.controller;
import com.mx.path.gateway.accessor.AccessorResponse;
import com.mx.path.model.mdx.model.MdxList;
import com.mx.path.model.mdx.model.location.Location;
import com.mx.path.model.mdx.model.location.LocationSearch;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value = "{clientId}", produces = BaseController.MDX_MEDIA)
public class LocationsController extends BaseController {
@RequestMapping(value = "/locations", method = RequestMethod.GET)
public final ResponseEntity> searchLocations(LocationSearch locationSearch) {
AccessorResponse> response = gateway().locations().search(locationSearch);
return new ResponseEntity<>(response.getResult().wrapped(), createMultiMapForResponse(response.getHeaders()), HttpStatus.OK);
}
@RequestMapping(value = "/locations/{locationId}", method = RequestMethod.GET)
public final ResponseEntity getLocation(@PathVariable("locationId") String locationId) {
AccessorResponse response = gateway().locations().get(locationId);
return new ResponseEntity<>(response.getResult().wrapped(), createMultiMapForResponse(response.getHeaders()), HttpStatus.OK);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy