#420 /api/ganjoor/quoted/suggestion/next
This commit is contained in:
parent
057fb1bd3e
commit
9b3eeadd69
@ -3863,6 +3863,45 @@ namespace RMuseum.Controllers
|
||||
return Ok(res.Result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// next unmoderated quoted poem
|
||||
/// </summary>
|
||||
/// <param name="skip"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Route("quoted/suggestion/next")]
|
||||
[Authorize(Policy = RMuseumSecurableItem.GanjoorEntityShortName + ":" + SecurableItem.ModifyOperationShortName)]
|
||||
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(GanjoorQuotedPoemViewModel))]
|
||||
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))]
|
||||
[ProducesResponseType((int)HttpStatusCode.NotFound)]
|
||||
public async Task<IActionResult> GetNextUnmoderatedGanjoorQuotedPoemAsync(int skip = 0)
|
||||
{
|
||||
RServiceResult<GanjoorQuotedPoemViewModel> res =
|
||||
await _ganjoorService.GetNextUnmoderatedGanjoorQuotedPoemAsync(skip);
|
||||
if (!string.IsNullOrEmpty(res.ExceptionString))
|
||||
return BadRequest(res.ExceptionString);
|
||||
|
||||
var resCount = await _ganjoorService.GetUnmoderatedGanjoorQuotedsCountAsync();
|
||||
if (!string.IsNullOrEmpty(resCount.ExceptionString))
|
||||
return BadRequest(resCount.ExceptionString);
|
||||
|
||||
// Paging Header
|
||||
HttpContext.Response.Headers.Append("paging-headers",
|
||||
JsonConvert.SerializeObject(
|
||||
new PaginationMetadata()
|
||||
{
|
||||
totalCount = resCount.Result,
|
||||
pageSize = -1,
|
||||
currentPage = -1,
|
||||
hasNextPage = false,
|
||||
hasPreviousPage = false,
|
||||
totalPages = -1
|
||||
})
|
||||
);
|
||||
|
||||
return Ok(res.Result);//might be null
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// readonly mode
|
||||
|
||||
@ -2099,6 +2099,13 @@
|
||||
<param name="quoted"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Controllers.GanjoorController.GetNextUnmoderatedGanjoorQuotedPoemAsync(System.Int32)">
|
||||
<summary>
|
||||
next unmoderated quoted poem
|
||||
</summary>
|
||||
<param name="skip"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="P:RMuseum.Controllers.GanjoorController.ReadOnlyMode">
|
||||
<summary>
|
||||
readonly mode
|
||||
@ -15911,7 +15918,7 @@
|
||||
<param name="skip"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.IGanjoorService.GetUnmoderatedGanjoorQuotedsCountPoemAsync">
|
||||
<member name="M:RMuseum.Services.IGanjoorService.GetUnmoderatedGanjoorQuotedsCountAsync">
|
||||
<summary>
|
||||
unmoderated quoted poems count
|
||||
</summary>
|
||||
@ -17908,7 +17915,7 @@
|
||||
<param name="skip"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.Implementation.GanjoorService.GetUnmoderatedGanjoorQuotedsCountPoemAsync">
|
||||
<member name="M:RMuseum.Services.Implementation.GanjoorService.GetUnmoderatedGanjoorQuotedsCountAsync">
|
||||
<summary>
|
||||
unmoderated quoted poems count
|
||||
</summary>
|
||||
|
||||
@ -1319,6 +1319,6 @@ namespace RMuseum.Services
|
||||
/// unmoderated quoted poems count
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<RServiceResult<int>> GetUnmoderatedGanjoorQuotedsCountPoemAsync();
|
||||
Task<RServiceResult<int>> GetUnmoderatedGanjoorQuotedsCountAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ namespace RMuseum.Services.Implementation
|
||||
/// unmoderated quoted poems count
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<RServiceResult<int>> GetUnmoderatedGanjoorQuotedsCountPoemAsync()
|
||||
public async Task<RServiceResult<int>> GetUnmoderatedGanjoorQuotedsCountAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user