Class CountryController
- Namespace
- GastroSky.Controllers.V1
- Assembly
- GastroSky.dll
Endpoints that provides informations about the supported countries
[ApiController]
[Route("api/v1/countries")]
[Produces("application/json", new string[] { })]
public class CountryController : GastroSkyControllerBase
- Inheritance
-
CountryController
- Inherited Members
Constructors
CountryController(GastroSkyDatabaseContext, IMapper)
Endpoints that provides informations about the supported countries
public CountryController(GastroSkyDatabaseContext db, IMapper mapper)
Parameters
dbGastroSkyDatabaseContextmapperIMapper
Methods
CreateCountry(CountryCreationRequestDto)
[HttpPost]
[Authorize("ADMIN_ONLY")]
[Route("")]
[ProducesResponseType<CountryResponseDto>(200)]
public Task<IActionResult> CreateCountry(CountryCreationRequestDto dto)
Parameters
Returns
CreateRegions(string, RegionCreationRequestDto)
[HttpPost]
[Authorize("ADMIN_ONLY")]
[Route("{countryCodeISO}/regions")]
[ProducesResponseType<CountryResponseDto>(200)]
public Task<IActionResult> CreateRegions(string countryCodeISO, RegionCreationRequestDto dto)
Parameters
countryCodeISOstringdtoRegionCreationRequestDto
Returns
GetCountries()
Endpoint that returns all supported countries
[HttpGet]
[AllowAnonymous]
[Route("")]
[ProducesResponseType<CountryResponseDto>(200)]
public Task<IActionResult> GetCountries()
Returns
GetCountry(string)
Endpoint that returns info for a supported country
[HttpGet]
[AllowAnonymous]
[Route("{countryCodeISO}")]
[ProducesResponseType<CountryResponseDto>(200)]
public Task<IActionResult> GetCountry(string countryCodeISO)
Parameters
countryCodeISOstring