feat: change dingUserIds to users array with name/mobile in DTOs
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { IsOptional, IsString, IsNotEmpty, IsInt, IsArray, IsDateString, IsEnum, ArrayNotEmpty } from 'class-validator';
|
import { IsOptional, IsString, IsNotEmpty, IsInt, IsArray, IsDateString, IsEnum, ArrayNotEmpty, ValidateNested } from 'class-validator';
|
||||||
import { Type } from 'class-transformer';
|
import { Type } from 'class-transformer';
|
||||||
import { ClassType, ClassStatus, TeacherRoleType } from '../../entities';
|
import { ClassType, ClassStatus, TeacherRoleType } from '../../entities';
|
||||||
|
|
||||||
@@ -40,10 +40,11 @@ export class CreateClassDto {
|
|||||||
@IsOptional() @IsArray()
|
@IsOptional() @IsArray()
|
||||||
studentIds?: number[];
|
studentIds?: number[];
|
||||||
|
|
||||||
@IsArray()
|
|
||||||
@IsString({ each: true })
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
dingUserIds?: string[];
|
@IsArray()
|
||||||
|
@ValidateNested({ each: true })
|
||||||
|
@Type(() => ImportUserItem)
|
||||||
|
users?: ImportUserItem[];
|
||||||
|
|
||||||
@IsOptional() @IsArray()
|
@IsOptional() @IsArray()
|
||||||
teachers?: Array<{ userId: number; roleType: string; subject?: string }>;
|
teachers?: Array<{ userId: number; roleType: string; subject?: string }>;
|
||||||
@@ -132,10 +133,21 @@ export class QueryClassAttendanceSummaryDto {
|
|||||||
@IsOptional() @IsDateString()
|
@IsOptional() @IsDateString()
|
||||||
endDate?: string;
|
endDate?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class BatchImportStudentsDto {
|
export class BatchImportStudentsDto {
|
||||||
@IsArray()
|
@IsArray()
|
||||||
@IsString({ each: true })
|
|
||||||
@ArrayNotEmpty()
|
@ArrayNotEmpty()
|
||||||
dingUserIds: string[];
|
@ValidateNested({ each: true })
|
||||||
|
@Type(() => ImportUserItem)
|
||||||
|
users: ImportUserItem[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ImportUserItem {
|
||||||
|
@IsString() @IsNotEmpty()
|
||||||
|
dingUserId: string;
|
||||||
|
|
||||||
|
@IsString() @IsNotEmpty()
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
@IsOptional() @IsString()
|
||||||
|
mobile?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user