diff --git a/RMuseum/Controllers/ContributionStatsController.cs b/RMuseum/Controllers/ContributionStatsController.cs index c9f96620..e3ced585 100644 --- a/RMuseum/Controllers/ContributionStatsController.cs +++ b/RMuseum/Controllers/ContributionStatsController.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Caching.Memory; using Newtonsoft.Json; +using RMuseum.Models.Ganjoor.ViewModels; using RMuseum.Models.Generic.ViewModels; using RMuseum.Services; using RSecurityBackend.Models.Generic; @@ -18,6 +19,23 @@ namespace RMuseum.Controllers [Route("api/contributions")] public class ContributionStatsController : Controller { + /// + /// user contribution + /// + /// + /// + [HttpGet("{userId}")] + [AllowAnonymous] + [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(UserContributionsViewModel))] + [ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))] + public async Task GetUserContributionsAsync(Guid userId) + { + var res = await _service.GetUserContributionsAsync(userId); + if(!string.IsNullOrEmpty(res.ExceptionString)) + return BadRequest(res.ExceptionString); + return Ok(res.Result); + } + /// /// daily stats /// @@ -280,7 +298,7 @@ namespace RMuseum.Controllers /// poetpix /// /// - [HttpGet("{dataType}")] + [HttpGet("{dataType}/summary")] [AllowAnonymous] [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(SummedUpViewModel))] [ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))] diff --git a/RMuseum/RMuseum.xml b/RMuseum/RMuseum.xml index 4f54d119..6ee912c4 100644 --- a/RMuseum/RMuseum.xml +++ b/RMuseum/RMuseum.xml @@ -762,6 +762,13 @@ + + + user contribution + + + + daily stats @@ -16012,6 +16019,13 @@ contributions stats service + + + user contributions + + + + approved edits daily @@ -19153,6 +19167,13 @@ contributions stats service implementation + + + user contributions + + + + approved edits daily