28 lines
No EOL
1 KiB
C#
28 lines
No EOL
1 KiB
C#
using DrinkRateAPI.ApiModels.ProductTable;
|
|
using DrinkRateAPI.AuthorizationPolicies;
|
|
using DrinkRateAPI.Services;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace DrinkRateAPI.Controllers;
|
|
|
|
[ApiController]
|
|
[Route("productCompanyTableCouple")]
|
|
public class ProductCompanyTableCoupleController : ControllerBase
|
|
{
|
|
private ProductCompanyTableCoupleService _productCompanyTableCoupleService;
|
|
|
|
public ProductCompanyTableCoupleController(ProductCompanyTableCoupleService productCompanyTableCoupleService)
|
|
{
|
|
_productCompanyTableCoupleService = productCompanyTableCoupleService;
|
|
}
|
|
|
|
[HttpPost]
|
|
[Authorize(Policy = PolicyConstants.AdminOnly)]
|
|
[Produces("application/json")]
|
|
public async Task<ProductCompanyTableCouplePostResponse> PostProductCompanyTableCouple(
|
|
[FromBody] ProductCompanyTableCouplePost productCompanyTableCouple)
|
|
{
|
|
return await _productCompanyTableCoupleService.PostProductCompanyTableCoupleAsync(productCompanyTableCouple);
|
|
}
|
|
} |