#413 poem sections by format api

This commit is contained in:
Hamid Reza Mohammadi 2023-12-06 21:32:11 +03:30
parent bba5980051
commit 6da3d5ec76
2 changed files with 33 additions and 0 deletions

View File

@ -2430,6 +2430,30 @@ namespace RMuseum.Controllers
return Ok(pagedResult.Result.Items);
}
/// <summary>
/// Get Poem sections based on poem format
/// </summary>
/// <param name="paging"></param>
/// <param name="format"></param>
/// <param name="poetId"></param>
/// <returns></returns>
[HttpGet]
[Route("sections/tagged/format")]
[AllowAnonymous]
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<GanjoorPoemCompleteViewModel>))]
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))]
public async Task<IActionResult> GetPoemSectionsByPoemFormat([FromQuery] PagingParameterModel paging, GanjoorPoemFormat format, int poetId = 0)
{
var pagedResult = await _ganjoorService.GetPoemSectionsByPoemFormat(paging, format, poetId == 0 ? (int?)null : poetId);
if (!string.IsNullOrEmpty(pagedResult.ExceptionString))
return BadRequest(pagedResult.ExceptionString);
// Paging Header
HttpContext.Response.Headers.Append("paging-headers", JsonConvert.SerializeObject(pagedResult.Result.PagingMeta));
return Ok(pagedResult.Result.Items);
}
/// <summary>
/// search
/// </summary>

View File

@ -1614,6 +1614,15 @@
<param name="poetId">0 means all poets</param>
<returns></returns>
</member>
<member name="M:RMuseum.Controllers.GanjoorController.GetPoemSectionsByPoemFormat(RSecurityBackend.Models.Generic.PagingParameterModel,RMuseum.Models.Ganjoor.GanjoorPoemFormat,System.Int32)">
<summary>
Get Poem sections based on poem format
</summary>
<param name="paging"></param>
<param name="format"></param>
<param name="poetId"></param>
<returns></returns>
</member>
<member name="M:RMuseum.Controllers.GanjoorController.Search(RSecurityBackend.Models.Generic.PagingParameterModel,System.String,System.Int32,System.Int32)">
<summary>
search