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 | |
---|
1 | using FinkiChattery.Api.ApplicationServices.Authentication;
|
---|
2 | using FinkiChattery.Commands.Notifications;
|
---|
3 | using FinkiChattery.Common.Mediator.Interfaces;
|
---|
4 | using IdentityServer4.AccessTokenValidation;
|
---|
5 | using Microsoft.AspNetCore.Authorization;
|
---|
6 | using Microsoft.AspNetCore.Mvc;
|
---|
7 | using System.Threading.Tasks;
|
---|
8 |
|
---|
9 | namespace 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.