| | | 1 | | namespace Syki.Back.Features.Academic.AssignDisciplinesToTeacher; |
| | | 2 | | |
| | | 3 | | [ApiController, AuthAcademic] |
| | | 4 | | [EnableRateLimiting("Medium")] |
| | 208 | 5 | | public class AssignDisciplinesToTeacherController(AssignDisciplinesToTeacherService service) : ControllerBase |
| | | 6 | | { |
| | | 7 | | /// <summary> |
| | | 8 | | /// Vincular disciplinas |
| | | 9 | | /// </summary> |
| | | 10 | | /// <remarks> |
| | | 11 | | /// Vincula as disciplinas que o professor está apto a lecionar. |
| | | 12 | | /// </remarks> |
| | | 13 | | [HttpPut("academic/teachers/{id}/assign-disciplines")] |
| | | 14 | | [SwaggerResponseExample(200, typeof(ResponseExamples))] |
| | | 15 | | [SwaggerResponseExample(400, typeof(ErrorsExamples))] |
| | | 16 | | public async Task<IActionResult> Assign([FromRoute] Guid id, [FromBody] AssignDisciplinesToTeacherIn data) |
| | | 17 | | { |
| | 208 | 18 | | var result = await service.Assign(User.InstitutionId, id, data); |
| | 208 | 19 | | return result.Match<IActionResult>(Ok, BadRequest); |
| | 208 | 20 | | } |
| | | 21 | | } |
| | | 22 | | |
| | | 23 | | internal class RequestExamples : ExamplesProvider<AssignDisciplinesToTeacherIn>; |
| | | 24 | | internal class ResponseExamples : ExamplesProvider<SuccessOut>; |
| | | 25 | | internal class ErrorsExamples : ErrorExamplesProvider< |
| | | 26 | | TeacherNotFound, |
| | | 27 | | InvalidDisciplinesList>; |