mirror of
https://github.com/n08i40k/schedule-parser-next.git
synced 2025-12-06 09:47:46 +03:00
Пред-деплой
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { ApiProperty, IntersectionType, PickType } from "@nestjs/swagger";
|
||||
import { UserDto } from "./user.dto";
|
||||
import { IsString } from "class-validator";
|
||||
import { Expose } from "class-transformer";
|
||||
|
||||
// SignIn
|
||||
export class SignInReqDto extends PickType(UserDto, ["username"]) {
|
||||
@@ -20,6 +21,25 @@ export class SignUpReqDto extends IntersectionType(
|
||||
export class SignUpResDto extends SignInResDto {}
|
||||
|
||||
// Update token
|
||||
export class UpdateTokenDto extends PickType(UserDto, ["accessToken"]) {}
|
||||
export class UpdateTokenReqDto extends PickType(UserDto, ["accessToken"]) {}
|
||||
|
||||
export class UpdateTokenResultDto extends UpdateTokenDto {}
|
||||
export class UpdateTokenResDto extends UpdateTokenReqDto {}
|
||||
|
||||
// Update password
|
||||
export class ChangePasswordReqDto {
|
||||
@ApiProperty({
|
||||
example: "my-old-password",
|
||||
description: "Старый пароль",
|
||||
})
|
||||
@IsString()
|
||||
@Expose()
|
||||
oldPassword: string;
|
||||
|
||||
@ApiProperty({
|
||||
example: "my-new-password",
|
||||
description: "Новый пароль",
|
||||
})
|
||||
@IsString()
|
||||
@Expose()
|
||||
newPassword: string;
|
||||
}
|
||||
|
||||
@@ -56,11 +56,18 @@ export enum LessonTypeDto {
|
||||
export class LessonDto {
|
||||
@ApiProperty({
|
||||
example: LessonTypeDto.DEFAULT,
|
||||
description: "Тип занятия.",
|
||||
description: "Тип занятия",
|
||||
})
|
||||
@IsEnum(LessonTypeDto)
|
||||
type: LessonTypeDto;
|
||||
|
||||
@ApiProperty({
|
||||
example: 1,
|
||||
description: "Индекс пары, если присутствует",
|
||||
})
|
||||
@IsNumber()
|
||||
defaultIndex: number;
|
||||
|
||||
@ApiProperty({
|
||||
example: "Элементы высшей математики",
|
||||
description: "Название занятия",
|
||||
@@ -95,14 +102,16 @@ export class LessonDto {
|
||||
|
||||
constructor(
|
||||
type: LessonTypeDto,
|
||||
defaultIndex: number,
|
||||
time: LessonTimeDto,
|
||||
name: string,
|
||||
cabinets: Array<string>,
|
||||
teacherNames: Array<string>,
|
||||
) {
|
||||
this.type = type;
|
||||
this.name = name;
|
||||
this.defaultIndex = defaultIndex;
|
||||
this.time = time;
|
||||
this.name = name;
|
||||
this.cabinets = cabinets;
|
||||
this.teacherNames = teacherNames;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user