adding filterUserId to comments api

This commit is contained in:
Hamid Reza Mohammadi 2021-03-23 20:03:15 +04:30
parent 4ad27a10ea
commit ba4e744305
2 changed files with 5 additions and 3 deletions

View File

@ -496,6 +496,7 @@ namespace RMuseum.Controllers
/// get recent comments
/// </summary>
/// <param name="paging"></param>
/// <param name="filterUserId"></param>
/// <returns></returns>
[HttpGet]
[Route("comments")]
@ -503,9 +504,9 @@ namespace RMuseum.Controllers
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<GanjoorCommentFullViewModel>))]
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))]
public async Task<IActionResult> GetRecentComments([FromQuery] PagingParameterModel paging)
public async Task<IActionResult> GetRecentComments([FromQuery] PagingParameterModel paging, Guid? filterUserId = null)
{
var comments = await _ganjoorService.GetRecentComments(paging, Guid.Empty, true);
var comments = await _ganjoorService.GetRecentComments(paging, filterUserId == null ? Guid.Empty : (Guid)filterUserId, true);
if (!string.IsNullOrEmpty(comments.ExceptionString))
{
return BadRequest(comments.ExceptionString);

View File

@ -765,11 +765,12 @@
</summary>
<returns></returns>
</member>
<member name="M:RMuseum.Controllers.GanjoorController.GetRecentComments(RSecurityBackend.Models.Generic.PagingParameterModel)">
<member name="M:RMuseum.Controllers.GanjoorController.GetRecentComments(RSecurityBackend.Models.Generic.PagingParameterModel,System.Nullable{System.Guid})">
<summary>
get recent comments
</summary>
<param name="paging"></param>
<param name="filterUserId"></param>
<returns></returns>
</member>
<member name="M:RMuseum.Controllers.GanjoorController.GetMyRecentComments(RSecurityBackend.Models.Generic.PagingParameterModel)">