Class HomeController
java.lang.Object
com.medilabo.solutions.front.controller.HomeController
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
HomeController
public HomeController()
-
-
Method Details
-
home
@GetMapping("/home") @Cacheable("patient") public String home(org.springframework.ui.Model model, @RequestParam(defaultValue="0") int page, @RequestParam(defaultValue="4") int size, @RequestParam(defaultValue="id") String sortBy, @RequestParam(defaultValue="asc") String sortDir) Handles GET requests to the "/home" endpoint and displays a paginated list of patients. This method retrieves patients from the gateway service with pagination and sorting support, then adds the necessary attributes to the model for rendering in the "home" view.- Parameters:
model
- the Spring MVC model object used to pass data to the viewpage
- the page number to retrieve (0-based, defaults to 0)size
- the number of patients per page (defaults to 2)sortBy
- the field to sort by (defaults to "id")sortDir
- the sort direction, either "asc" or "desc" (defaults to "asc")- Returns:
- the name of the view template ("home") to render
- Throws:
Exception
- if an error occurs while retrieving patients from the gateway service
-