My problem is quite simple example has two methods. One returns an Account and another a Customer object.
I have about 10 other different requests that should be made for a WebApp page.
Is it correct to make 10 different requests on the WebApp or just create 1 with everything that I need?
If so, what is the correct way to do this? Do I need to create a custom object that holds all the other objects that I need in the page and then return it or is there a better way?
What is the correct approach?
@GetMapping("/customer")
public Customer getCustomer(@RequestParam String customerNumber) {
return customer.getCustomer(customerNumber);
}
@GetMapping("/account")
public Account getAccountFromCustomer(@RequestParam String customerNumber, @RequestParam String accountNumber) {
return account.getAccountFromCustomer(customerNumber, accountNumber);
}