package com.deb.qbe.controller; ............... @RestController @RequestMapping("/customer") @Log4j2 public class CustomerController { @Autowired private CustomerService customerService; @GetMapping("/list") public ResponseEntity> getAllStates() { log.info("Request received to get all availavble customers"); return ResponseEntity.ok(customerService.getAll()); } @GetMapping("/firstname") public ResponseEntity> getAllCustomersFirstNameEndsWith(@RequestParam(name = "endsWith") String endsWith) { log.info("Request received to get all customers first name ends with {}", endsWith); return ResponseEntity.ok(customerService.findByFirstNameEnding(endsWith)); } @GetMapping("/lastname") public ResponseEntity> getAllCustomersLastNameEndsWith(@RequestParam(name = "endsWith") String endsWith) { log.info("Request received to get all customers last name endswith {}", endsWith); return ResponseEntity.ok(customerService.findByLastNameEnding(endsWith)); } @GetMapping("/balance") public ResponseEntity> getAllCustomersLastNameEndsWith(@RequestParam(name = "balance") Long balance) { log.info("Request received to get all customers whose wallet balance is {}", balance); return ResponseEntity.ok(customerService.findByWalletBalanceEquals(balance)); } @GetMapping("/{firstName}") public ResponseEntity> getCustomerByName(@PathVariable String firstName) { log.info("Request received to get all customer by name {}", firstName); return ResponseEntity.ok(customerService.findByFirstName(firstName)); } }