| | | 1 | | namespace Syki.Back.Features.Teacher.CreateLessonAttendance; |
| | | 2 | | |
| | | 3 | | [ApiController, AuthTeacher] |
| | | 4 | | [EnableRateLimiting("Medium")] |
| | 206 | 5 | | public class CreateLessonAttendanceController(CreateLessonAttendanceService service) : ControllerBase |
| | | 6 | | { |
| | | 7 | | /// <summary> |
| | | 8 | | /// Realizar chamada |
| | | 9 | | /// </summary> |
| | | 10 | | /// <remarks> |
| | | 11 | | /// Realiza a chamada da aula informada. |
| | | 12 | | /// </remarks> |
| | | 13 | | [HttpPut("teacher/lessons/{id}/attendance")] |
| | | 14 | | [SwaggerResponseExample(200, typeof(ResponseExamples))] |
| | | 15 | | [SwaggerResponseExample(400, typeof(ErrorsExamples))] |
| | | 16 | | public async Task<IActionResult> Create([FromRoute] Guid id, [FromBody] CreateLessonAttendanceIn data) |
| | | 17 | | { |
| | 206 | 18 | | var result = await service.Create(User.Id, id, data); |
| | 206 | 19 | | return result.Match<IActionResult>(Ok, BadRequest); |
| | 206 | 20 | | } |
| | | 21 | | } |
| | | 22 | | |
| | | 23 | | internal class RequestExamples : ExamplesProvider<CreateLessonAttendanceIn>; |
| | | 24 | | internal class ResponseExamples : ExamplesProvider<SuccessOut>; |
| | | 25 | | internal class ErrorsExamples : ErrorExamplesProvider< |
| | | 26 | | LessonNotFound, |
| | | 27 | | ClassNotFound, |
| | | 28 | | InvalidStudentsList>; |