Добавлено получение расписания по имени преподавателя.

This commit is contained in:
2024-11-03 07:04:52 +04:00
parent 2bb09f1f52
commit 7f6ab874db
11 changed files with 3737 additions and 463 deletions

View File

@@ -3,7 +3,7 @@ import {
Controller,
Get,
HttpCode,
HttpStatus,
HttpStatus, Param,
Patch,
UseGuards,
UseInterceptors,
@@ -31,6 +31,8 @@ import { V2UpdateDownloadUrlDto } from "./dto/v2/v2-update-download-url.dto";
import { V2GroupScheduleByNameDto } from "./dto/v2/v2-group-schedule-by-name.dto";
import { V2GroupScheduleDto } from "./dto/v2/v2-group-schedule.dto";
import { V2ScheduleGroupNamesDto } from "./dto/v2/v2-schedule-group-names.dto";
import { V2TeacherScheduleDto } from "./dto/v2/v2-teacher-schedule.dto";
import { V2ScheduleTeacherNamesDto } from "./dto/v2/v2-schedule-teacher-names.dto";
@ApiTags("v2/schedule")
@ApiBearerAuth()
@@ -85,10 +87,6 @@ export class V2ScheduleController {
description: "Список получен успешно",
type: V2ScheduleGroupNamesDto,
})
@ApiResponse({
status: HttpStatus.NOT_FOUND,
description: "Требуемая группа не найдена",
})
@ResultDto(V2ScheduleGroupNamesDto)
@CacheKey("v2-schedule-group-names")
@UseInterceptors(CacheInterceptor)
@@ -99,6 +97,42 @@ export class V2ScheduleController {
return await this.scheduleService.getGroupNames();
}
@ApiOperation({ summary: "Получение расписания преподавателя" })
@ApiBody({ type: V2GroupScheduleByNameDto })
@ApiResponse({
status: HttpStatus.OK,
description: "Расписание получено успешно",
type: V2TeacherScheduleDto,
})
@ApiResponse({
status: HttpStatus.NOT_FOUND,
description: "Требуемый преподаватель не найден",
})
@ResultDto(V2TeacherScheduleDto)
@HttpCode(HttpStatus.OK)
@Get("teacher/:name")
async getTeacherSchedule(
@Param("name") name: string,
): Promise<V2TeacherScheduleDto> {
return await this.scheduleService.getTeacher(name);
}
@ApiOperation({ summary: "Получение списка ФИО преподавателей" })
@ApiResponse({
status: HttpStatus.OK,
description: "Список получен успешно",
type: V2ScheduleTeacherNamesDto,
})
@ResultDto(V2ScheduleTeacherNamesDto)
@CacheKey("v2-schedule-teacher-names")
@UseInterceptors(CacheInterceptor)
@AuthUnauthorized()
@HttpCode(HttpStatus.OK)
@Get("teacher-names")
async getTeacherNames(): Promise<V2ScheduleTeacherNamesDto> {
return await this.scheduleService.getTeacherNames();
}
@ApiOperation({ summary: "Обновление основной страницы политехникума" })
@ApiResponse({
status: HttpStatus.OK,