source: src/FinkiChattery/FinkiChattery.Api/Controllers/v1/StudentsController.cs@ 6738cc0

dev
Last change on this file since 6738cc0 was 6738cc0, checked in by Стојков Марко <mst@…>, 2 years ago

Added notifications

  • Property mode set to 100644
File size: 1.1 KB
Line 
1using FinkiChattery.Api.ApplicationServices.Authentication;
2using FinkiChattery.Commands.Notifications;
3using FinkiChattery.Common.Mediator.Interfaces;
4using IdentityServer4.AccessTokenValidation;
5using Microsoft.AspNetCore.Authorization;
6using Microsoft.AspNetCore.Mvc;
7using System.Threading.Tasks;
8
9namespace FinkiChattery.Api.Controllers.v1
10{
11 [ApiVersion(ApiVersions.ApiVersion1)]
12 [Route("api/v{version:apiVersion}/[controller]/")]
13 [ApiController]
14 public class StudentsController : ControllerBase
15 {
16 public StudentsController(IMediatorService mediatorService)
17 {
18 MediatorService = mediatorService;
19 }
20
21 public IMediatorService MediatorService { get; }
22
23 [HttpPost("checked-notifications")]
24 [Authorize(AuthenticationSchemes = IdentityServerAuthenticationDefaults.AuthenticationScheme, Policy = AuthenticationPolicy.Student)]
25 public async Task<IActionResult> AnswerQuestion()
26 {
27 await MediatorService.SendAsync(new StudentCheckedNotificationsCommand());
28 return Ok();
29 }
30 }
31}
Note: See TracBrowser for help on using the repository browser.