Last active
April 16, 2020 17:56
-
-
Save Raouf25/ee35ead9d6ecfaee5e8074d338a6837b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Transactional | |
@GetMapping(value = "", produces = MediaType.APPLICATION_JSON_VALUE) | |
@ResponseStatus(HttpStatus.OK) | |
public ResponseEntity<List<Car>> get( | |
@And({ | |
@Spec(path = "manufacturer", params = "manufacturer", spec = Like.class), | |
@Spec(path = "model", params = "model", spec = Like.class), | |
@Spec(path = "country", params = "country", spec = In.class), | |
@Spec(path = "type", params = "type", spec = Like.class), | |
@Spec(path = "createDate", params = "createDate", spec = Equal.class), | |
@Spec(path = "createDate", params = {"createDateGt", "createDateLt"}, spec = Between.class) | |
}) Specification<Car> spec, | |
Sort sort, | |
@RequestHeader HttpHeaders headers) { | |
final PagingResponse response = carService.get(spec, headers, sort); | |
return new ResponseEntity<>(response.getElements(), returnHttpHeaders(response), HttpStatus.OK); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment