docs: #275 api/poetspecs/unpublished/next GET API

This commit is contained in:
Hamid Reza Mohammadi 2022-01-30 19:01:33 +03:30
parent 02b678bfb4
commit 5a543b4340

View File

@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using RMuseum.Models.Auth.Memory;
using RMuseum.Models.Ganjoor.ViewModels;
using RMuseum.Services;
using System.Net;
@ -28,6 +29,27 @@ namespace RMuseum.Controllers
return Ok(res.Result);
}
/// <summary>
/// return the next unpublished suggested line for poets
/// </summary>
/// <param name="skip"></param>
/// <returns></returns>
[HttpGet("unpublished/next")]
[Authorize(Policy = RMuseumSecurableItem.GanjoorEntityShortName + ":" + RMuseumSecurableItem.ModeratePoetPhotos)]
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(GanjoorPoetSuggestedSpecLineViewModel))]
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))]
[ProducesResponseType((int)HttpStatusCode.NotFound)]
public async Task<IActionResult> GetNextUnmoderatedPoetSuggestedSpecLineAsync(int skip)
{
var res = await _ganjoorService.GetNextUnmoderatedPoetSuggestedSpecLineAsync(skip);
if (!string.IsNullOrEmpty(res.ExceptionString))
return BadRequest(res.ExceptionString);
if (res.Result == null)
return NotFound();
return Ok(res.Result);
}
/// <summary>