refactor(meeting): 将学生ID从长ID改为短ID以优化性能

- 修改SaveStudentOrderDto中的studentLongIds字段为studentShortIds
- 更新MeetingController中保存和传输的学生ID参数名称
- 重构MeetingRedisService中setStudentOrder方法参数为studentShortIds
- 调整WebSocket通信中的学生ID字段名称一致性
- 在前端API调用中使用studentShortIds替代studentLongIds
- 添加监控端对学生排序变更事件的处理逻辑
- 更新学生排序对话框中使用的ID映射方式
This commit is contained in:
2026-03-14 21:28:56 +08:00
parent bc5fa9a366
commit 0e88826a9c
8 changed files with 32 additions and 22 deletions

View File

@ -502,14 +502,14 @@ export class MeetingRedisService {
/**
* 设置学生排序顺序
* @param roomId - 房间 ID
* @param studentLongIds - 学生 ID 数组 (按排序顺序)
* @param studentShortIds - 学生 ID 数组 (按排序顺序)
*/
async setStudentOrder(roomId: string, studentLongIds: number[]): Promise<void> {
async setStudentOrder(roomId: string, studentShortIds: number[]): Promise<void> {
const key = `${this.KEY_PREFIX.STUDENT_ORDER}${roomId}`;
const client = this.getClient();
await client.del(key); // 先删除旧数据
if (studentLongIds.length > 0) {
const stringIds = studentLongIds.map((id) => String(id));
if (studentShortIds.length > 0) {
const stringIds = studentShortIds.map((id) => String(id));
await client.rpush(key, ...stringIds);
await client.expire(key, 24 * 60 * 60);
}