Table of Contents

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

db GastroSkyDatabaseContext
mapper IMapper

Methods

CreateLocations(LocationCreationRequestDto)

[HttpPost]
[Authorize("ADMIN_ONLY")]
[Route("")]
[ProducesResponseType<LocationResponseDto>(200)]
public Task<IActionResult> CreateLocations(LocationCreationRequestDto dto)

Parameters

dto LocationCreationRequestDto

Returns

Task<IActionResult>

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

countryCodeISO string
text string
paginationFilter PaginationFilter

Returns

Task<IActionResult>

IActionResult

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

countryCodeISO string
regionCode string
paginationFilter PaginationFilter

Returns

Task<IActionResult>

IActionResult