This introduces the new CountryController to handle various country-related operations in our API. The controller provides endpoints for searching, retrieving, and counting countries.
Key features:
Base path: "api/country"
Access restricted to ADMINISTRATOR and SUPER_ADMINISTRATOR roles
Endpoints implemented:
Search countries: GET ""
Get country by ID: GET /id/{id}
Get country by code: GET /code/{code}
Count all countries: GET /count-all
Get country code by title: GET /title/{title}
Implementation details:
Uses Spring's @RestController and @GetMapping annotations for RESTful API design
Integrates with CountryService for business logic
Implements proper error handling, including a custom CountryNotFoundException
Utilizes @PathVariable for clear parameter passing in URL paths
Please review this implementation and provide any feedback for improvement. Thanks
This introduces the new CountryController to handle various country-related operations in our API. The controller provides endpoints for searching, retrieving, and counting countries. Key features:
Base path: "api/country" Access restricted to ADMINISTRATOR and SUPER_ADMINISTRATOR roles Endpoints implemented: Search countries: GET "" Get country by ID: GET /id/{id} Get country by code: GET /code/{code} Count all countries: GET /count-all Get country code by title: GET /title/{title}
Implementation details:
Uses Spring's @RestController and @GetMapping annotations for RESTful API design Integrates with CountryService for business logic Implements proper error handling, including a custom CountryNotFoundException Utilizes @PathVariable for clear parameter passing in URL paths
Please review this implementation and provide any feedback for improvement. Thanks