feat(meeting): 添加学生排序功能和黑名单用户DTO
- 在MeetingController中添加BlacklistUserDto导入并移除内联定义 - 将BlacklistUserDto移动到meeting.dto.ts文件中并添加数据验证装饰器 - 在SaveStudentOrderDto中添加@IsNotEmpty和@IsArray验证规则 - 创建saveStudentOrderAxios API函数用于保存学生排序 - 更新MeetingRoomTeacher组件以处理新的API响应格式 - 使用vue-slicksort库替换原生拖拽实现学生排序功能 - 修改StudentSortDialog组件使用SlickList和SlickItem组件 - 通过API调用保存排序结果并添加成功提示 - 调整样式以适配新的排序组件结构
This commit is contained in:
@ -1,25 +1,14 @@
|
||||
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, ParseIntPipe, Post, Query } from '@nestjs/common';
|
||||
import { ApiParam, ApiProperty, ApiQuery, ApiTags } from '@nestjs/swagger';
|
||||
import { ApiParam, ApiQuery, ApiTags } from '@nestjs/swagger';
|
||||
import { FailResult, OkResult } from '../../common/dto/result.dto';
|
||||
import { MeetingService } from './meeting.service';
|
||||
import { NonEmptyStringPipe } from '@/common/pipes/non-empty-string.pipe';
|
||||
import { Uint32Pipe } from '@/common/pipes/uint32.pipe';
|
||||
import { ApiCustomOkResponse } from '@/common/decorators/swagger.decorator';
|
||||
import { SaveStudentOrderDto, StudentDetailResponseDto, TokenResponseDto } from './meeting.dto';
|
||||
import { BlacklistUserDto, SaveStudentOrderDto, StudentDetailResponseDto, TokenResponseDto } from './meeting.dto';
|
||||
import { MeetingRedisService } from '../websocket/meeting-redis.service';
|
||||
import { MeetingWebSocketGateway } from '../websocket/meeting.websocket';
|
||||
|
||||
/**
|
||||
* 黑名单用户 DTO
|
||||
*/
|
||||
class BlacklistUserDto {
|
||||
@ApiProperty({ description: '短 UID', example: 1001 })
|
||||
shortUid?: number;
|
||||
|
||||
@ApiProperty({ description: '用户名称', example: '张三' })
|
||||
userName?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会议控制器
|
||||
* 处理会议相关的 API 请求
|
||||
|
||||
@ -1,5 +1,16 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsArray, IsNotEmpty, IsString } from 'class-validator';
|
||||
|
||||
/**
|
||||
* 黑名单用户 DTO
|
||||
*/
|
||||
export class BlacklistUserDto {
|
||||
@ApiProperty({ description: '短 UID', example: 1001 })
|
||||
shortUid?: number;
|
||||
|
||||
@ApiProperty({ description: '用户名称', example: '张三' })
|
||||
userName?: string;
|
||||
}
|
||||
/**
|
||||
* Token 响应数据 DTO
|
||||
*/
|
||||
@ -33,8 +44,12 @@ export class StudentDetailResponseDto {
|
||||
*/
|
||||
export class SaveStudentOrderDto {
|
||||
@ApiProperty({ description: '房间 ID', example: 'room_123' })
|
||||
@IsNotEmpty({ message: 'roomId 不能为空' })
|
||||
@IsString({ message: 'roomId 必须是字符串' })
|
||||
roomId!: string;
|
||||
|
||||
@ApiProperty({ description: '学生长 ID 数组 (按排序顺序)', example: [1234567890, 1234567891, 1234567892] })
|
||||
@IsNotEmpty({ message: 'studentLongIds 不能为空' })
|
||||
@IsArray({ message: 'studentLongIds 必须是数组' })
|
||||
studentLongIds!: number[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user