Table of Contents

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

db GastroSkyDatabaseContext
mapper IMapper

Methods

CreateCountry(CountryCreationRequestDto)

[HttpPost]
[Authorize("ADMIN_ONLY")]
[Route("")]
[ProducesResponseType<CountryResponseDto>(200)]
public Task<IActionResult> CreateCountry(CountryCreationRequestDto dto)

Parameters

dto CountryCreationRequestDto

Returns

Task<IActionResult>

CreateRegions(string, RegionCreationRequestDto)

[HttpPost]
[Authorize("ADMIN_ONLY")]
[Route("{countryCodeISO}/regions")]
[ProducesResponseType<CountryResponseDto>(200)]
public Task<IActionResult> CreateRegions(string countryCodeISO, RegionCreationRequestDto dto)

Parameters

countryCodeISO string
dto RegionCreationRequestDto

Returns

Task<IActionResult>

GetCountries()

Endpoint that returns all supported countries

[HttpGet]
[AllowAnonymous]
[Route("")]
[ProducesResponseType<CountryResponseDto>(200)]
public Task<IActionResult> GetCountries()

Returns

Task<IActionResult>

IActionResult

GetCountry(string)

Endpoint that returns info for a supported country

[HttpGet]
[AllowAnonymous]
[Route("{countryCodeISO}")]
[ProducesResponseType<CountryResponseDto>(200)]
public Task<IActionResult> GetCountry(string countryCodeISO)

Parameters

countryCodeISO string

Returns

Task<IActionResult>

IActionResult