Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

API - Picture - add ProducesResponseType

KrzysztofPajakac4e8c0d70d0
diff --git a/src/API/Grand.Api/Controllers/OData/PictureController.cs b/src/API/Grand.Api/Controllers/OData/PictureController.cs
index 219a7d4a8..f408460e6 100644
--- a/src/API/Grand.Api/Controllers/OData/PictureController.cs
+++ b/src/API/Grand.Api/Controllers/OData/PictureController.cs
@@ -7,6 +7,7 @@ using Grand.Business.Common.Services.Security;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.Annotations;
+using System.Net;
using System.Threading.Tasks;
namespace Grand.Api.Controllers.OData
@@ -24,6 +25,9 @@ namespace Grand.Api.Controllers.OData
[SwaggerOperation(summary: "Get entities from Picture by key", OperationId = "GetPictureById")]
[HttpGet("{key}")]
+ [ProducesResponseType((int)HttpStatusCode.Forbidden)]
+ [ProducesResponseType((int)HttpStatusCode.OK)]
+ [ProducesResponseType((int)HttpStatusCode.NotFound)]
public async Task<IActionResult> Get(string key)
{
if (!await _permissionService.Authorize(PermissionSystemName.Pictures))
@@ -38,6 +42,9 @@ namespace Grand.Api.Controllers.OData
[SwaggerOperation(summary: "Add new entity in Picture", OperationId = "InsertPicture")]
[HttpPost]
+ [ProducesResponseType((int)HttpStatusCode.Forbidden)]
+ [ProducesResponseType((int)HttpStatusCode.OK)]
+ [ProducesResponseType((int)HttpStatusCode.BadRequest)]
public async Task<IActionResult> Post([FromBody] PictureDto model)
{
if (!await _permissionService.Authorize(PermissionSystemName.Pictures))
@@ -53,6 +60,10 @@ namespace Grand.Api.Controllers.OData
[SwaggerOperation(summary: "Update entity in Picture", OperationId = "UpdatePicture")]
[HttpPut]
+ [ProducesResponseType((int)HttpStatusCode.Forbidden)]
+ [ProducesResponseType((int)HttpStatusCode.OK)]
+ [ProducesResponseType((int)HttpStatusCode.BadRequest)]
+ [ProducesResponseType((int)HttpStatusCode.NotFound)]
public async Task<IActionResult> Put([FromBody] PictureDto model)
{
if (!await _permissionService.Authorize(PermissionSystemName.Categories))
@@ -74,6 +85,9 @@ namespace Grand.Api.Controllers.OData
[SwaggerOperation(summary: "Delete entity in Picture", OperationId = "DeletePicture")]
[HttpDelete]
+ [ProducesResponseType((int)HttpStatusCode.Forbidden)]
+ [ProducesResponseType((int)HttpStatusCode.OK)]
+ [ProducesResponseType((int)HttpStatusCode.NotFound)]
public async Task<IActionResult> Delete(string key)
{
if (!await _permissionService.Authorize(PermissionSystemName.Pictures))