feat: add batch-import students to class endpoint

This commit is contained in:
2026-07-09 17:12:23 +08:00
parent 7b8691866e
commit 91035e9f2c
4 changed files with 80 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
import { IsOptional, IsString, IsNotEmpty, IsInt, IsArray, IsDateString, IsEnum } from 'class-validator';
import { IsOptional, IsString, IsNotEmpty, IsInt, IsArray, IsDateString, IsEnum, ArrayNotEmpty } from 'class-validator';
import { Type } from 'class-transformer';
import { ClassType, ClassStatus, TeacherRoleType } from '../../entities';
@@ -43,6 +43,11 @@ export class CreateClassDto {
studentIds?: number[];
@IsOptional() @IsArray()
@IsArray()
@IsString({ each: true })
@IsOptional()
dingUserIds?: string[];
teachers?: Array<{ userId: number; roleType: string; subject?: string }>;
}
@@ -135,3 +140,10 @@ export class QueryClassAttendanceSummaryDto {
@IsOptional() @IsDateString()
endDate?: string;
}
export class BatchImportStudentsDto {
@IsArray()
@IsString({ each: true })
@ArrayNotEmpty()
dingUserIds: string[];
}