Class ProductController
- Namespace
- GastroSky.Controllers.V1
- Assembly
- GastroSky.dll
[ApiController]
[Authorize]
[Route("api/v1/products")]
[Produces("application/json", new string[] { })]
public class ProductController : GastroSkyControllerBase
- Inheritance
-
ProductController
- Inherited Members
-
Constructors
ProductController(GastroSkyDatabaseContext, IMapper, ILogger<ProductController>)
public ProductController(GastroSkyDatabaseContext db, IMapper mapper, ILogger<ProductController> logger)
Parameters
db GastroSkyDatabaseContext
mapper IMapper
logger ILogger<ProductController>
Methods
ArchiveProduct(string, long?)
[HttpPut]
[Route("archive/{sku}")]
[ProducesResponseType(200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
[Authorize(Policy = "https://api.gastrosky.ch/identity/claims/resources/products:R")]
[Authorize(Policy = "https://api.gastrosky.ch/identity/claims/resources/products:W")]
public Task<IActionResult> ArchiveProduct(string sku, long? archivalTimestampUTC = null)
Parameters
sku string
archivalTimestampUTC long?
Returns
- Task<IActionResult>
CreateProduct(ProductCreationRequestDto)
[HttpPost]
[Route("")]
[ProducesResponseType(201)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
[Authorize(Policy = "https://api.gastrosky.ch/identity/claims/resources/products:W")]
public Task<IActionResult> CreateProduct(ProductCreationRequestDto dto)
Parameters
dto ProductCreationRequestDto
Returns
- Task<IActionResult>
GetArchivedProduct(string)
[HttpGet]
[Route("archive/{sku}")]
[ProducesResponseType(200)]
[ProducesResponseType(400)]
[ProducesResponseType(404)]
[Authorize(Policy = "https://api.gastrosky.ch/identity/claims/resources/products:R")]
public Task<IActionResult> GetArchivedProduct(string sku)
Parameters
sku string
Returns
- Task<IActionResult>
[HttpGet]
[Route("archive")]
[ProducesResponseType(200)]
[Authorize(Policy = "https://api.gastrosky.ch/identity/claims/resources/products:R")]
public Task<IActionResult> GetArchivedProducts(PaginationFilter? paginationFilter = null, SortingOrder? sortingOrder = null)
Parameters
paginationFilter PaginationFilter
sortingOrder SortingOrder?
Returns
- Task<IActionResult>
GetAvailableBoosters()
[HttpGet]
[AllowAnonymous]
[Route("available-boosters")]
[ProducesResponseType(200)]
public Task<IActionResult> GetAvailableBoosters()
Returns
- Task<IActionResult>
GetAvailablePremiumUpgrades()
[HttpGet]
[AllowAnonymous]
[Route("available-premium-upgrades")]
[ProducesResponseType(200)]
public Task<IActionResult> GetAvailablePremiumUpgrades()
Returns
- Task<IActionResult>
GetAvailableSubscriptions()
[HttpGet]
[AllowAnonymous]
[Route("available-subscriptions")]
[ProducesResponseType(200)]
public Task<IActionResult> GetAvailableSubscriptions()
Returns
- Task<IActionResult>
GetAvailableTranslations()
[HttpGet]
[AllowAnonymous]
[Route("available-translations")]
[ProducesResponseType(200)]
public Task<IActionResult> GetAvailableTranslations()
Returns
- Task<IActionResult>
GetBoosterProducts()
[HttpGet]
[Route("boosters")]
[ProducesResponseType(200)]
public Task<IActionResult> GetBoosterProducts()
Returns
- Task<IActionResult>
GetDeeplProduct()
[HttpGet]
[Route("deepl")]
[ProducesResponseType(200)]
public Task<IActionResult> GetDeeplProduct()
Returns
- Task<IActionResult>
GetPremiumUpgradeProducts()
[HttpGet]
[Route("premium-upgrades")]
[ProducesResponseType(200)]
public Task<IActionResult> GetPremiumUpgradeProducts()
Returns
- Task<IActionResult>
GetProduct(string)
[HttpGet]
[Route("{sku}")]
[ProducesResponseType(200)]
[ProducesResponseType(400)]
[ProducesResponseType(404)]
public Task<IActionResult> GetProduct(string sku)
Parameters
sku string
Returns
- Task<IActionResult>
[HttpGet]
[Route("")]
[ProducesResponseType(200)]
public Task<IActionResult> GetProducts(PaginationFilter? paginationFilter = null, SortingOrder? sortingOrder = null)
Parameters
paginationFilter PaginationFilter
sortingOrder SortingOrder?
Returns
- Task<IActionResult>
GetSubscriptionProducts()
[HttpGet]
[Route("subscriptions")]
[ProducesResponseType(200)]
public Task<IActionResult> GetSubscriptionProducts()
Returns
- Task<IActionResult>
GetTranslationProducts()
[HttpGet]
[Route("translations")]
[ProducesResponseType(200)]
public Task<IActionResult> GetTranslationProducts()
Returns
- Task<IActionResult>
UnarchiveProduct(string)
[HttpPut]
[Route("unarchive/{sku}")]
[ProducesResponseType(200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
[Authorize(Policy = "https://api.gastrosky.ch/identity/claims/resources/products:R")]
[Authorize(Policy = "https://api.gastrosky.ch/identity/claims/resources/products:W")]
public Task<IActionResult> UnarchiveProduct(string sku)
Parameters
sku string
Returns
- Task<IActionResult>