Class LocationController
- Namespace
- GastroSky.Controllers.V1
- Assembly
- GastroSky.dll
Endpoints that provides information about the cities and regions for a given nation.
[ApiController]
[Route("api/v1/locations")]
[Produces("application/json", new string[] { })]
public class LocationController : GastroSkyControllerBase
- Inheritance
-
LocationController
- Inherited Members
Constructors
LocationController(GastroSkyDatabaseContext, IMapper)
Endpoints that provides information about the cities and regions for a given nation.
public LocationController(GastroSkyDatabaseContext db, IMapper mapper)
Parameters
dbGastroSkyDatabaseContextmapperIMapper
Methods
CreateLocations(LocationCreationRequestDto)
[HttpPost]
[Authorize("ADMIN_ONLY")]
[Route("")]
[ProducesResponseType<LocationResponseDto>(200)]
public Task<IActionResult> CreateLocations(LocationCreationRequestDto dto)
Parameters
Returns
GetCitiesForCountry(string, string?, PaginationFilter?)
Endpoint that returns all cities for a given nation
[HttpGet]
[AllowAnonymous]
[Route("{countryCodeISO}")]
[ProducesResponseType<LocationResponseDto>(200)]
public Task<IActionResult> GetCitiesForCountry(string countryCodeISO, string? text, PaginationFilter? paginationFilter = null)
Parameters
countryCodeISOstringtextstringpaginationFilterPaginationFilter
Returns
GetCitiesForCountryAndRegion(string, string, PaginationFilter?)
Endpoint that returns all cities for a given nation
[HttpGet]
[AllowAnonymous]
[Route("{countryCodeISO}/{regionCode}")]
[ProducesResponseType<LocationResponseDto>(200)]
public Task<IActionResult> GetCitiesForCountryAndRegion(string countryCodeISO, string regionCode, PaginationFilter? paginationFilter = null)
Parameters
countryCodeISOstringregionCodestringpaginationFilterPaginationFilter