Пред-деплой

This commit is contained in:
2024-09-12 21:40:57 +04:00
parent 8fb9214246
commit 6d77476a57
12 changed files with 152 additions and 53 deletions

View File

@@ -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;
}

View File

@@ -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;
}