fleencorp / fleen-feen

Fleen Feen connects you with the world
GNU General Public License v3.0
0 stars 1 forks source link

Add Country endpoints for CountryService #31 #32

Closed Banji0x closed 2 weeks ago

Banji0x commented 2 weeks ago

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