refactor: use ScheduleResponse instead other schedule responses

This commit is contained in:
Polianin Nikita 2024-06-10 21:52:42 +03:00
parent 704271cf6d
commit bd03cde151
9 changed files with 4 additions and 421 deletions

View File

@ -4,9 +4,6 @@ import {DateOnly} from "@model/DateOnly";
import {PeriodTimes} from "@model/pairPeriodTime";
import {ScheduleRequest} from "@api/v1/scheduleRequest";
import {ScheduleResponse} from "@api/v1/scheduleResponse";
import {GroupScheduleResponse} from "@api/v1/groupScheduleResponse";
import {ProfessorScheduleResponse} from "@api/v1/professorScheduleResponse";
import {LectureHallScheduleResponse} from "@api/v1/lectureHallScheduleResponse";
import {map} from "rxjs";
@Injectable()
@ -27,18 +24,18 @@ export class ScheduleService extends ApiService {
}
public getByGroup(id : number, isEven: boolean | null = null, disciplines: Array<number> | null = null, professors: Array<number> | null = null, lectureHalls: Array<number> | null = null) {
return this.get<GroupScheduleResponse>('GetByGroup' + id.toString(), {isEven: isEven, disciplines: disciplines, professors: professors, lectureHalls: lectureHalls});
return this.get<ScheduleResponse[]>('GetByGroup/' + id.toString(), {isEven: isEven, disciplines: disciplines, professors: professors, lectureHalls: lectureHalls});
}
public getByProfessor(id : number, isEven: boolean | null = null, disciplines: Array<number> | null = null, groups: Array<number> | null = null, lectureHalls: Array<number> | null = null) {
return this.get<ProfessorScheduleResponse>('GetByProfessor' + id.toString(), {isEven: isEven, disciplines: disciplines, groups: groups, lectureHalls: lectureHalls});
return this.get<ScheduleResponse[]>('GetByProfessor/' + id.toString(), {isEven: isEven, disciplines: disciplines, groups: groups, lectureHalls: lectureHalls});
}
public getByLectureHall(id : number, isEven: boolean | null = null, disciplines: Array<number> | null = null, groups: Array<number> | null = null, professors: Array<number> | null = null) {
return this.get<LectureHallScheduleResponse>('GetByLectureHall' + id.toString(), {isEven: isEven, disciplines: disciplines, groups: groups, professors: professors});
return this.get<ScheduleResponse[]>('GetByLectureHall/' + id.toString(), {isEven: isEven, disciplines: disciplines, groups: groups, professors: professors});
}
public getByDiscipline(id : number, isEven: boolean | null = null, groups: Array<number> | null = null, professors: Array<number> | null = null, lectureHalls: Array<number> | null = null) {
return this.get<GroupScheduleResponse>('GetByDiscipline' + id.toString(), {isEven: isEven, groups: groups, professors: professors, lectureHalls: lectureHalls});
return this.get<ScheduleResponse[]>('GetByDiscipline/' + id.toString(), {isEven: isEven, groups: groups, professors: professors, lectureHalls: lectureHalls});
}
}

View File

@ -1,67 +0,0 @@
/**
* MIREA Schedule Web API
* This API provides a convenient interface for retrieving data stored in the database. Special attention was paid to the lightweight and easy transfer of all necessary data. Made by the Winsomnia team.
*
* OpenAPI spec version: 1.0
* Contact: support@winsomnia.net
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { DayOfWeek } from '@model/dayOfWeek';
/**
* Represents information about a specific schedule entry for a professor.
*/
export interface DisciplineScheduleInfo {
dayOfWeek: DayOfWeek;
/**
* Gets or sets the pair number for the schedule entry.
*/
pairNumber: number;
/**
* Gets or sets a value indicating whether the pair is on an even week.
*/
isEven: boolean;
/**
* Gets or sets the type of occupation for the schedule entry.
*/
typeOfOccupation: Array<string>;
/**
* Gets or sets the names of the group for the schedule entry.
*/
group: string;
/**
* Gets or sets the IDs of the group for the schedule entry.
*/
groupId: number;
/**
* Gets or sets the names of the lecture halls for the schedule entry.
*/
lectureHalls: Array<string>;
/**
* Gets or sets the IDs of the lecture halls for the schedule entry.
*/
lectureHallsId: Array<number>;
/**
* Gets or sets the names of the professors for the schedule entry.
*/
professors: Array<string>;
/**
* Gets or sets the IDs of the professors for the schedule entry.
*/
professorsId: Array<number>;
/**
* Gets or sets the names of the campuses for the schedule entry.
*/
campus: Array<string>;
/**
* Gets or sets the IDs of the campuses for the schedule entry.
*/
campusId: Array<number>;
/**
* Gets or sets the links to online meetings for the schedule entry.
*/
linkToMeet: Array<string>;
}

View File

@ -1,30 +0,0 @@
/**
* MIREA Schedule Web API
* This API provides a convenient interface for retrieving data stored in the database. Special attention was paid to the lightweight and easy transfer of all necessary data. Made by the Winsomnia team.
*
* OpenAPI spec version: 1.0
* Contact: support@winsomnia.net
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { DisciplineScheduleInfo } from './disciplineScheduleInfo';
/**
* Represents a response containing schedule information for a professor.
*/
export interface DisciplineScheduleResponse {
/**
* Gets or sets the name of the discipline.
*/
discipline: string;
/**
* Gets or sets the ID of the discipline.
*/
disciplineId: number;
/**
* Gets or sets the schedules for the professor.
*/
schedules: Array<DisciplineScheduleInfo>;
}

View File

@ -1,75 +0,0 @@
/**
* MIREA Schedule Web API
* This API provides a convenient interface for retrieving data stored in the database. Special attention was paid to the lightweight and easy transfer of all necessary data. Made by the Winsomnia team.
*
* OpenAPI spec version: 1.0
* Contact: support@winsomnia.net
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { DayOfWeek } from '@/shared/structs/dayOfWeek';
/**
* Represents information about a specific schedule entry for a group.
*/
export interface GroupScheduleInfo {
dayOfWeek: DayOfWeek;
/**
* Gets or sets the pair number for the schedule entry.
*/
pairNumber: number;
/**
* Gets or sets a value indicating whether the pair is on an even week.
*/
isEven: boolean;
/**
* Gets or sets the name of the discipline for the schedule entry.
*/
discipline: string;
/**
* Gets or sets the ID of the discipline for the schedule entry.
*/
disciplineId: number;
/**
* Gets or sets exclude or include weeks for a specific discipline.
*/
isExcludedWeeks?: boolean;
/**
* The week numbers required for the correct display of the schedule. Whether there will be Mirea.Api.Dto.Responses.Schedule.GroupScheduleInfo.Discipline during the week or not depends on the Mirea.Api.Dto.Responses.Schedule.GroupScheduleInfo.IsExcludedWeeks property.
*/
weeks?: Array<number>;
/**
* Gets or sets the type of occupation for the schedule entry.
*/
typeOfOccupations: Array<string>;
/**
* Gets or sets the names of the lecture halls for the schedule entry.
*/
lectureHalls: Array<string>;
/**
* Gets or sets the IDs of the lecture halls for the schedule entry.
*/
lectureHallsId: Array<number>;
/**
* Gets or sets the names of the professors for the schedule entry.
*/
professors: Array<string>;
/**
* Gets or sets the IDs of the professors for the schedule entry.
*/
professorsId: Array<number>;
/**
* Gets or sets the names of the campuses for the schedule entry.
*/
campus: Array<string>;
/**
* Gets or sets the IDs of the campuses for the schedule entry.
*/
campusId: Array<number>;
/**
* Gets or sets the links to online meetings for the schedule entry.
*/
linkToMeet: Array<string>;
}

View File

@ -1,30 +0,0 @@
/**
* MIREA Schedule Web API
* This API provides a convenient interface for retrieving data stored in the database. Special attention was paid to the lightweight and easy transfer of all necessary data. Made by the Winsomnia team.
*
* OpenAPI spec version: 1.0
* Contact: support@winsomnia.net
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { GroupScheduleInfo } from './groupScheduleInfo';
/**
* Represents a response containing schedule information for a group.
*/
export interface GroupScheduleResponse {
/**
* Gets or sets the name of the group.
*/
group: string;
/**
* Gets or sets the ID of the group.
*/
groupId: number;
/**
* Gets or sets the schedules for the group.
*/
schedules: Array<GroupScheduleInfo>;
}

View File

@ -1,76 +0,0 @@
/**
* MIREA Schedule Web API
* This API provides a convenient interface for retrieving data stored in the database. Special attention was paid to the lightweight and easy transfer of all necessary data. Made by the Winsomnia team.
*
* OpenAPI spec version: 1.0
* Contact: support@winsomnia.net
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import {DayOfWeek} from "@model/dayOfWeek";
/**
* Represents information about a specific schedule entry for a lecture hall.
*/
export interface LectureHallScheduleInfo {
dayOfWeek: DayOfWeek;
/**
* Gets or sets the pair number for the schedule entry.
*/
pairNumber: number;
/**
* Gets or sets a value indicating whether the pair is on an even week.
*/
isEven: boolean;
/**
* Gets or sets the name of the discipline for the schedule entry.
*/
discipline: string;
/**
* Gets or sets the ID of the discipline for the schedule entry.
*/
disciplineId: number;
/**
* Gets or sets exclude or include weeks for a specific discipline.
*/
isExcludedWeeks?: boolean;
/**
* The week numbers required for the correct display of the schedule. Whether there will be Mirea.Api.Dto.Responses.Schedule.LectureHallScheduleInfo.Discipline during the week or not depends on the Mirea.Api.Dto.Responses.Schedule.LectureHallScheduleInfo.IsExcludedWeeks property.
*/
weeks?: Array<number>;
/**
* Gets or sets the type of occupation for the schedule entry.
*/
typeOfOccupations: Array<string>;
/**
* Gets or sets the names of the group for the schedule entry.
*/
group: string;
/**
* Gets or sets the IDs of the group for the schedule entry.
*/
groupId: number;
/**
* Gets or sets the names of the campuses for the schedule entry.
*/
campus: Array<string>;
/**
* Gets or sets the IDs of the campuses for the schedule entry.
*/
campusId: Array<number>;
/**
* Gets or sets the names of the professors for the schedule entry.
*/
professors: Array<string>;
/**
* Gets or sets the IDs of the professors for the schedule entry.
*/
professorsId: Array<number>;
/**
* Gets or sets the links to online meetings for the schedule entry.
*/
linkToMeet: Array<string>;
}

View File

@ -1,30 +0,0 @@
/**
* MIREA Schedule Web API
* This API provides a convenient interface for retrieving data stored in the database. Special attention was paid to the lightweight and easy transfer of all necessary data. Made by the Winsomnia team.
*
* OpenAPI spec version: 1.0
* Contact: support@winsomnia.net
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { LectureHallScheduleInfo } from './lectureHallScheduleInfo';
/**
* Represents a response containing schedule information for a lecture hall.
*/
export interface LectureHallScheduleResponse {
/**
* Gets or sets the names of the lecture halls.
*/
lectureHalls: string;
/**
* Gets or sets the IDs of the lecture halls.
*/
lectureHallsId: number;
/**
* Gets or sets the schedules for the lecture hall.
*/
schedules: Array<LectureHallScheduleInfo>;
}

View File

@ -1,76 +0,0 @@
/**
* MIREA Schedule Web API
* This API provides a convenient interface for retrieving data stored in the database. Special attention was paid to the lightweight and easy transfer of all necessary data. Made by the Winsomnia team.
*
* OpenAPI spec version: 1.0
* Contact: support@winsomnia.net
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import {DayOfWeek} from "@model/dayOfWeek";
/**
* Represents information about a specific schedule entry for a professor.
*/
export interface ProfessorScheduleInfo {
dayOfWeek: DayOfWeek;
/**
* Gets or sets the pair number for the schedule entry.
*/
pairNumber: number;
/**
* Gets or sets a value indicating whether the pair is on an even week.
*/
isEven: boolean;
/**
* Gets or sets the name of the discipline for the schedule entry.
*/
discipline: string;
/**
* Gets or sets the ID of the discipline for the schedule entry.
*/
disciplineId: number;
/**
* Gets or sets exclude or include weeks for a specific discipline.
*/
isExcludedWeeks?: boolean;
/**
* The week numbers required for the correct display of the schedule. Whether there will be Mirea.Api.Dto.Responses.Schedule.ProfessorScheduleInfo.Discipline during the week or not depends on the Mirea.Api.Dto.Responses.Schedule.ProfessorScheduleInfo.IsExcludedWeeks property.
*/
weeks?: Array<number>;
/**
* Gets or sets the type of occupation for the schedule entry.
*/
typeOfOccupations: Array<string>;
/**
* Gets or sets the names of the group for the schedule entry.
*/
group: string;
/**
* Gets or sets the IDs of the group for the schedule entry.
*/
groupId: number;
/**
* Gets or sets the names of the lecture halls for the schedule entry.
*/
lectureHalls: Array<string>;
/**
* Gets or sets the IDs of the lecture halls for the schedule entry.
*/
lectureHallsId: Array<number>;
/**
* Gets or sets the names of the campuses for the schedule entry.
*/
campus: Array<string>;
/**
* Gets or sets the IDs of the campuses for the schedule entry.
*/
campusId: Array<number>;
/**
* Gets or sets the links to online meetings for the schedule entry.
*/
linkToMeet: Array<string>;
}

View File

@ -1,30 +0,0 @@
/**
* MIREA Schedule Web API
* This API provides a convenient interface for retrieving data stored in the database. Special attention was paid to the lightweight and easy transfer of all necessary data. Made by the Winsomnia team.
*
* OpenAPI spec version: 1.0
* Contact: support@winsomnia.net
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { ProfessorScheduleInfo } from './professorScheduleInfo';
/**
* Represents a response containing schedule information for a professor.
*/
export interface ProfessorScheduleResponse {
/**
* Gets or sets the name of the professor.
*/
professor: string;
/**
* Gets or sets the ID of the professor.
*/
professorId: number;
/**
* Gets or sets the schedules for the professor.
*/
schedules: Array<ProfessorScheduleInfo>;
}