February 2019
Intermediate to advanced
442 pages
11h 46m
English
Let's define the RESTful API controller for the country resource. The following is the template for the controller:
@RestController@RequestMapping("/api/countries")@Slf4jpublic class CountryAPIController { @Autowired CountryDAO countryDao; @Autowired WorldBankApiClient worldBankApiClient; @GetMapping public ResponseEntity<?> getCountries( @RequestParam(name="search", required = false) String searchTerm, @RequestParam(name="continent", required = false) String continent, @RequestParam(name="region", required = false) String region, @RequestParam(name="pageNo", required = false) Integer pageNo ){ //logic to fetch contries from CountryDAO return ResponseEntity.ok(); } @PostMapping(value ...