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