This commit is contained in:
Hamid Reza Mohammadi 2025-03-27 15:40:26 +03:30
parent 2554128f4d
commit 3231816aed
2 changed files with 33 additions and 3 deletions

View File

@ -28,6 +28,7 @@ namespace RMuseum.Controllers
/// cat/corrections
/// suggestedsongs
/// quoteds
/// comments
/// </param>
/// <param name="paging"></param>
/// <param name="userId"></param>
@ -83,8 +84,16 @@ namespace RMuseum.Controllers
pagedResult = res.Result;
}
break;
case "comments":
{
var res = await _service.GetApprovedCommentsGroupedByDateAsync(paging, userId);
if (!string.IsNullOrEmpty(res.ExceptionString))
return BadRequest(res.ExceptionString);
pagedResult = res.Result;
}
break;
default:
return BadRequest("invalid value for the paramater: dataType");
return BadRequest($"Invalid value for the paramater: dataType = {dataType}");
}
}
// Paging Header
@ -103,6 +112,7 @@ namespace RMuseum.Controllers
/// cat/corrections
/// suggestedsongs
/// quoteds
/// comments
/// </param>
/// <param name="paging"></param>
/// <param name="day"></param>
@ -159,8 +169,16 @@ namespace RMuseum.Controllers
pagedResult = res.Result;
}
break;
case "comments":
{
var res = await _service.GetApprovedCommentsGroupedByUserAsync(paging, day, userId);
if (!string.IsNullOrEmpty(res.ExceptionString))
return BadRequest(res.ExceptionString);
pagedResult = res.Result;
}
break;
default:
return BadRequest("invalid value for the paramater: dataType");
return BadRequest($"Invalid value for the paramater: dataType = {dataType}");
}
}
@ -180,6 +198,7 @@ namespace RMuseum.Controllers
/// cat/corrections
/// suggestedsongs
/// quoteds
/// comments
/// </param>
/// <returns></returns>
[HttpGet("{dataType}")]
@ -232,8 +251,16 @@ namespace RMuseum.Controllers
result = res.Result;
}
break;
case "comments":
{
var res = await _service.GetApprovedCommentsSummedUpStatsAsync();
if (!string.IsNullOrEmpty(res.ExceptionString))
return BadRequest(res.ExceptionString);
result = res.Result;
}
break;
default:
return BadRequest("invalid value for the paramater: dataType");
return BadRequest($"Invalid value for the paramater: dataType = {dataType}");
}
}

View File

@ -773,6 +773,7 @@
cat/corrections
suggestedsongs
quoteds
comments
</param>
<param name="paging"></param>
<param name="userId"></param>
@ -789,6 +790,7 @@
cat/corrections
suggestedsongs
quoteds
comments
</param>
<param name="paging"></param>
<param name="day"></param>
@ -806,6 +808,7 @@
cat/corrections
suggestedsongs
quoteds
comments
</param>
<returns></returns>
</member>