refactor: adapt models to the new api

This commit is contained in:
Polianin Nikita 2024-12-18 06:48:51 +03:00
parent 99958a2383
commit 21f89132ff
37 changed files with 199 additions and 189 deletions

View File

@ -0,0 +1,5 @@
export interface CreateUserRequest {
email: string;
username: string;
password: string;
}

View File

@ -0,0 +1,4 @@
export interface LoginRequest {
username: string;
password: string;
}

View File

@ -0,0 +1,7 @@
export interface ScheduleRequest {
groups?: Array<number>;
isEven?: boolean;
disciplines?: Array<number>;
professors?: Array<number>;
lectureHalls?: Array<number>;
}

View File

@ -1,29 +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.
*/
/**
* Represents a request to configure cache settings.
*/
export interface CacheRequest {
/**
* Gets or sets the server address.
*/
server: string;
/**
* Gets or sets the port number.
*/
port: number;
/**
* Gets or sets the password.
*/
password?: string;
}

View File

@ -0,0 +1,5 @@
export interface CacheRequest {
server: string;
port: number;
password?: string;
}

View File

@ -0,0 +1,8 @@
export interface DatabaseRequest {
server: string;
port: number;
database: string;
user: string;
ssl: boolean;
password?: string;
}

View File

@ -0,0 +1,8 @@
export interface EmailRequest {
server: string;
from: string;
password: string;
port: number;
ssl: boolean;
user: string;
}

View File

@ -0,0 +1,5 @@
export interface LoggingRequest {
enableLogToFile: boolean;
logFileName?: string;
logFilePath?: string;
}

View File

@ -0,0 +1,4 @@
export interface ScheduleConfigurationRequest {
cronUpdateSchedule?: string;
startTerm: string;
}

View File

@ -1,41 +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.
*/
/**
* Represents a request to configure the database connection settings.
*/
export interface DatabaseRequest {
/**
* Gets or sets the server address.
*/
server: string;
/**
* Gets or sets the port number.
*/
port: number;
/**
* Gets or sets the database name.
*/
database: string;
/**
* Gets or sets the username.
*/
user: string;
/**
* Gets or sets a value indicating whether SSL is enabled.
*/
ssl: boolean;
/**
* Gets or sets the password.
*/
password?: string;
}

View File

@ -1,29 +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.
*/
/**
* Represents a request to configure logging settings.
*/
export interface LoggingRequest {
/**
* Gets or sets a value indicating whether logging to file is enabled.
*/
enableLogToFile: boolean;
/**
* Gets or sets the log file name.
*/
logFileName?: string;
/**
* Gets or sets the log file path.
*/
logFilePath?: string;
}

View File

@ -1,24 +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.
*/
/**
* Represents a request to configure the schedule settings.
*/
export interface ScheduleConfigurationRequest {
/**
* Gets or sets the cron expression for updating the schedule.
*/
cronUpdateSchedule?: string;
/**
* Gets or sets the start date of the term.
*/
startTerm: string;
}

View File

@ -0,0 +1,6 @@
import {TwoFactorAuthentication} from "@model/twoFactorAuthentication";
export interface TwoFactorAuthRequest {
code: string;
method: TwoFactorAuthentication;
}

View File

@ -0,0 +1,5 @@
export interface CampusBasicInfoResponse {
id: number;
codeName: string;
fullName?: string;
}

View File

@ -0,0 +1,6 @@
export interface CampusDetailsResponse {
id: number;
codeName: string;
fullName?: string;
address?: string;
}

View File

@ -0,0 +1,4 @@
export interface DisciplineResponse {
id: number;
name: string;
}

View File

@ -0,0 +1,4 @@
export interface ErrorResponse {
error: string;
code: number;
}

View File

@ -0,0 +1,4 @@
export interface FacultyResponse {
id: number;
name: string;
}

View File

@ -0,0 +1,7 @@
export interface GroupDetailsResponse {
id: number;
name: string;
courseNumber: number;
facultyId?: number;
facultyName?: string;
}

View File

@ -0,0 +1,6 @@
export interface GroupResponse {
id: number;
name: string;
courseNumber: number;
facultyId?: number;
}

View File

@ -0,0 +1,7 @@
export interface LectureHallDetailsResponse {
id: number;
name: string;
campusId: number;
campusName?: string;
campusCode?: string;
}

View File

@ -0,0 +1,5 @@
export interface LectureHallResponse {
id: number;
name: string;
campusId: number;
}

View File

@ -0,0 +1,5 @@
export interface ProfessorResponse {
id: number;
name: string;
altName?: string;
}

View File

@ -0,0 +1,21 @@
import {DayOfWeek} from "@model/dayOfWeek";
export interface ScheduleResponse {
dayOfWeek: DayOfWeek;
pairNumber: number;
isEven: boolean;
discipline: string;
disciplineId: number;
isExcludedWeeks?: boolean;
weeks?: Array<number>;
typeOfOccupations: Array<string>;
group: string;
groupId: number;
lectureHalls: Array<string | null>;
lectureHallsId: Array<number | null>;
professors: Array<string | null>;
professorsId: Array<number | null>;
campus: Array<string | null>;
campusId: Array<number | null>;
linkToMeet: Array<string | null>;
}

View File

@ -0,0 +1,7 @@
import {OAuthProvider} from "@model/oAuthProvider";
export interface AvailableOAuthProvidersResponse {
providerName: string;
provider: OAuthProvider;
redirect: string;
}

View File

@ -0,0 +1,8 @@
import {CacheType} from "@model/cacheType";
export interface CacheResponse {
type: CacheType;
server?: string;
port: number;
password?: string;
}

View File

@ -0,0 +1,12 @@
import {DatabaseType} from "@model/databaseType";
export interface DatabaseResponse {
type: DatabaseType;
server?: string;
port: number;
database?: string;
user?: string;
ssl: boolean;
password?: string;
pathToDatabase?: string;
}

View File

@ -1,41 +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.
*/
/**
* Represents a request to configure email settings.
*/
export interface EmailRequest {
/**
* Gets or sets the server address.
*/
server: string;
/**
* Gets or sets the email address from which emails will be sent.
*/
from: string;
/**
* Gets or sets the password for the email account.
*/
password: string;
/**
* Gets or sets the port number.
*/
port: number;
/**
* Gets or sets a value indicating whether SSL is enabled.
*/
ssl: boolean;
/**
* Gets or sets the username.
*/
user: string;
}

View File

@ -1,25 +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.
*/
/**
*
*/
export interface TokenResponse {
/**
*
*/
accessToken : string;
/**
*
*/
expiresIn: Date;
}

View File

@ -0,0 +1,8 @@
import {OAuthProvider} from "@model/oAuthProvider";
export interface UserResponse {
email: string;
username: string;
twoFactorAuthenticatorEnabled: boolean;
usedOAuthProviders: OAuthProvider[];
}

View File

@ -0,0 +1,4 @@
export enum CacheType {
Memcached,
Redis
}

View File

@ -0,0 +1,5 @@
export enum DatabaseType {
Mysql,
Sqlite,
PostgresSql
}

View File

@ -0,0 +1,9 @@
export enum DayOfWeek {
Sunday,
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday
}

View File

@ -0,0 +1,5 @@
export enum OAuthProvider {
Google,
Yandex,
MailRu
}

View File

@ -0,0 +1,4 @@
export interface PairPeriodTime {
start: string;
end: string;
}

View File

@ -0,0 +1,7 @@
export interface PasswordPolicy {
minimumLength: number;
requireLetter: boolean;
requireLettersDifferentCase: boolean;
requireDigit: boolean;
requireSpecialCharacter: boolean;
}

View File

@ -0,0 +1,4 @@
export enum TwoFactorAuthentication {
None,
TotpRequired
}