roles rating endpoints added
This commit is contained in:
@@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using WatchIt.Common.Model.Rating;
|
||||
using WatchIt.Common.Model.Roles;
|
||||
using WatchIt.WebAPI.Services.Controllers.Roles;
|
||||
|
||||
@@ -56,6 +57,32 @@ public class RolesController : ControllerBase
|
||||
[ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)]
|
||||
public async Task<ActionResult> DeleteActorRole([FromRoute]Guid id) => await _rolesControllerService.DeleteActorRole(id);
|
||||
|
||||
[HttpGet("actor/{id}/rating")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(typeof(RatingResponse), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<ActionResult> GetActorRoleRating([FromRoute] Guid id) => await _rolesControllerService.GetActorRoleRating(id);
|
||||
|
||||
[HttpGet("actor/{id}/rating/{user_id}")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(typeof(short), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<ActionResult> GetActorRoleRatingByUser([FromRoute] Guid id, [FromRoute(Name = "user_id")]long userId) => await _rolesControllerService.GetActorRoleRatingByUser(id, userId);
|
||||
|
||||
[HttpPut("actor/{id}/rating")]
|
||||
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<ActionResult> PutActorRoleRating([FromRoute] Guid id, [FromBody] RatingRequest data) => await _rolesControllerService.PutActorRoleRating(id, data);
|
||||
|
||||
[HttpDelete("actor/{id}/rating")]
|
||||
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
|
||||
public async Task<ActionResult> DeleteActorRoleRating([FromRoute] Guid id) => await _rolesControllerService.DeleteActorRoleRating(id);
|
||||
|
||||
[HttpGet("actor/type")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(typeof(IEnumerable<RoleTypeResponse>), StatusCodes.Status200OK)]
|
||||
@@ -107,6 +134,32 @@ public class RolesController : ControllerBase
|
||||
[ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)]
|
||||
public async Task<ActionResult> DeleteCreatorRole([FromRoute]Guid id) => await _rolesControllerService.DeleteCreatorRole(id);
|
||||
|
||||
[HttpGet("creator/{id}/rating")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(typeof(RatingResponse), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<ActionResult> GetCreatorRoleRating([FromRoute] Guid id) => await _rolesControllerService.GetCreatorRoleRating(id);
|
||||
|
||||
[HttpGet("creator/{id}/rating/{user_id}")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(typeof(short), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<ActionResult> GetCreatorRoleRatingByUser([FromRoute] Guid id, [FromRoute(Name = "user_id")] long userId) => await _rolesControllerService.GetCreatorRoleRatingByUser(id, userId);
|
||||
|
||||
[HttpPut("creator/{id}/rating")]
|
||||
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<ActionResult> PutCreatorRoleRating([FromRoute] Guid id, [FromBody] RatingRequest data) => await _rolesControllerService.PutCreatorRoleRating(id, data);
|
||||
|
||||
[HttpDelete("creator/{id}/rating")]
|
||||
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
|
||||
public async Task<ActionResult> DeleteCreatorRoleRating([FromRoute] Guid id) => await _rolesControllerService.DeleteCreatorRoleRating(id);
|
||||
|
||||
[HttpGet("creator/type")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(typeof(IEnumerable<RoleTypeResponse>), StatusCodes.Status200OK)]
|
||||
|
||||
Reference in New Issue
Block a user