rating panel added

This commit is contained in:
2024-10-23 02:39:15 +02:00
Unverified
parent bcd4628ba2
commit b2d1ba6dc4
22 changed files with 361 additions and 34 deletions

View File

@@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WatchIt.Common.Model.Persons;
using WatchIt.Common.Model.Rating;
using WatchIt.Common.Model.Roles;
using WatchIt.WebAPI.Services.Controllers.Persons;
@@ -145,6 +146,22 @@ public class PersonsController : ControllerBase
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<ActionResult> PostPersonCreatorRole([FromRoute]long id, [FromBody]CreatorRolePersonRequest body) => await _personsControllerService.PostPersonCreatorRole(id, body);
#endregion
#region Rating
[HttpGet("{id}/rating")]
[AllowAnonymous]
[ProducesResponseType(typeof(RatingResponse), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<ActionResult> GetPersonGlobalRating([FromRoute]long id) => await _personsControllerService.GetPersonGlobalRating(id);
[HttpGet("{id}/rating/{user_id}")]
[AllowAnonymous]
[ProducesResponseType(typeof(RatingResponse), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<ActionResult> GetPersonUserRating([FromRoute]long id, [FromRoute(Name = "user_id")]long userId) => await _personsControllerService.GetPersonUserRating(id, userId);
#endregion
#endregion