自习室优化ok

This commit is contained in:
zhutao
2025-11-28 13:31:23 +08:00
parent 4ecb0c35d6
commit 57305c5804
57 changed files with 2500 additions and 597 deletions

View File

@@ -0,0 +1,24 @@
class QiuTokenDto {
String? uploadUrl;
String? upToken;
String? fileKey;
String? domain;
QiuTokenDto({this.uploadUrl, this.upToken, this.fileKey, this.domain});
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map["upload_url"] = uploadUrl;
map["up_token"] = upToken;
map["file_key"] = fileKey;
map["domain"] = domain;
return map;
}
QiuTokenDto.fromJson(dynamic json) {
uploadUrl = json["upload_url"] ?? "";
upToken = json["up_token"] ?? "";
fileKey = json["file_key"] ?? "";
domain = json["domain"] ?? "";
}
}

View File

@@ -0,0 +1,47 @@
class VersionDto {
VersionDto({
required this.latestVersion,
required this.updatedAt,
required this.downloadUrl,
required this.updateContent,
required this.createdAt,
required this.lowVersion,
required this.id,
required this.downloadSize,
required this.platform,
});
String latestVersion;
DateTime updatedAt;
String downloadUrl;
List<String> updateContent;
DateTime createdAt;
String lowVersion;
int id;
String downloadSize;
int platform;
factory VersionDto.fromJson(Map<dynamic, dynamic> json) => VersionDto(
latestVersion: json["latest_version"],
updatedAt: DateTime.parse(json["updated_at"]),
downloadUrl: json["download_url"],
updateContent: List<String>.from(json["update_content"].map((x) => x)),
createdAt: DateTime.parse(json["created_at"]),
lowVersion: json["low_version"],
id: json["id"],
downloadSize: json["download_size"],
platform: json["platform"],
);
Map<dynamic, dynamic> toJson() => {
"latest_version": latestVersion,
"updated_at": updatedAt.toIso8601String(),
"download_url": downloadUrl,
"update_content": List<dynamic>.from(updateContent.map((x) => x)),
"created_at": createdAt.toIso8601String(),
"low_version": lowVersion,
"id": id,
"download_size": downloadSize,
"platform": platform,
};
}

View File

@@ -1,41 +1,52 @@
class RoomInfoDto {
final int studyRoomId;
final int teacherId;
final int teacherRtcUid;
final String teacherWsClientId;
final int roomStatus;
final String dataType;
final String roomStartTime;
final String roomEndTime;
final String boardUuid;
RoomInfoDto({
required this.teacherBackground,
required this.teacherAvatar,
required this.roomName,
required this.startTime,
required this.teacherName,
required this.endTime,
required this.id,
required this.studyRoomId,
required this.teacherId,
required this.teacherRtcUid,
required this.teacherWsClientId,
required this.roomStatus,
required this.dataType,
required this.roomStartTime,
required this.roomEndTime,
required this.boardUuid,
});
String teacherBackground;
String teacherAvatar;
String roomName;
String startTime;
String teacherName;
String endTime;
int id;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map["study_room_id"] = studyRoomId;
map["teacher_id"] = teacherId;
map["teacher_rtc_uid"] = teacherRtcUid;
map["teacher_ws_client_id"] = teacherWsClientId;
map["room_status"] = roomStatus;
map["data_type"] = dataType;
map["room_start_time"] = roomStartTime;
map["room_end_time"] = roomEndTime;
map["whiteboard_uuid"] = boardUuid;
return map;
}
factory RoomInfoDto.fromJson(Map<dynamic, dynamic> json) =>
RoomInfoDto(
teacherBackground: json["teacher_background"],
teacherAvatar: json["teacher_avatar"],
roomName: json["room_name"],
startTime: json["start_time"],
teacherName: json["teacher_name"],
endTime: json["end_time"],
id: json["id"],
);
Map<dynamic, dynamic> toJson() =>
{
"teacher_background": teacherBackground,
"teacher_avatar": teacherAvatar,
"room_name": roomName,
"start_time": startTime,
"teacher_name": teacherName,
"end_time": endTime,
"id": id,
};
factory RoomInfoDto.fromJson(Map<String, dynamic> json) {
return RoomInfoDto(
studyRoomId: json["study_room_id"] ?? 0,
teacherId: json["teacher_id"] ?? 0,
teacherRtcUid: json["teacher_rtc_uid"] ?? 0,
teacherWsClientId: json["teacher_ws_client_id"] ?? "",
roomStatus: json["room_status"] ?? 0,
dataType: json["data_type"] ?? "",
roomStartTime: json["room_start_time"] ?? "",
roomEndTime: json["room_end_time"] ?? "",
boardUuid: json["whiteboard_uuid"] ?? "",
);
}
}

View File

@@ -0,0 +1,51 @@
class RoomListItemDto {
RoomListItemDto({
required this.teacherGrade,
required this.roomName,
required this.startTime,
required this.teacherName,
required this.teacherAvatar,
required this.endTime,
required this.teacherSchoolName,
required this.teacherIntroduction,
required this.id,
required this.teacherMajor,
});
String teacherGrade;
String roomName;
String startTime;
String teacherName;
String teacherAvatar;
String endTime;
String teacherSchoolName;
String teacherIntroduction;
int id;
String teacherMajor;
factory RoomListItemDto.fromJson(Map<dynamic, dynamic> json) => RoomListItemDto(
teacherGrade: json["teacher_grade"],
roomName: json["room_name"],
startTime: json["start_time"],
teacherName: json["teacher_name"],
teacherAvatar: json["teacher_avatar"],
endTime: json["end_time"],
teacherSchoolName: json["teacher_school_name"],
teacherIntroduction: json["teacher_introduction"],
id: json["id"],
teacherMajor: json["teacher_major"],
);
Map<dynamic, dynamic> toJson() => {
"teacher_grade": teacherGrade,
"room_name": roomName,
"start_time": startTime,
"teacher_name": teacherName,
"teacher_avatar": teacherAvatar,
"end_time": endTime,
"teacher_school_name": teacherSchoolName,
"teacher_introduction": teacherIntroduction,
"id": id,
"teacher_major": teacherMajor,
};
}

View File

@@ -1,39 +0,0 @@
class RoomTypeDto {
final int studyRoomId;
final int teacherId;
final int teacherRtcUid;
final String teacherWsClientId;
final int roomStatus;
final String dataType;
RoomTypeDto({
required this.studyRoomId,
required this.teacherId,
required this.teacherRtcUid,
required this.teacherWsClientId,
required this.roomStatus,
required this.dataType,
});
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map["study_room_id"] = studyRoomId;
map["teacher_id"] = teacherId;
map["teacher_rtc_uid"] = teacherRtcUid;
map["teacher_ws_client_id"] = teacherWsClientId;
map["room_status"] = roomStatus;
map["data_type"] = dataType;
return map;
}
factory RoomTypeDto.fromJson(Map<String, dynamic> json) {
return RoomTypeDto(
studyRoomId: json["study_room_id"] ?? 0,
teacherId: json["teacher_id"] ?? 0,
teacherRtcUid: json["teacher_rtc_uid"] ?? 0,
teacherWsClientId: json["teacher_ws_client_id"] ?? "",
roomStatus: json["room_status"] ?? 0,
dataType: json["data_type"] ?? "",
);
}
}

View File

@@ -10,7 +10,7 @@ class RoomUserDto {
/// 1是学生2是老师
final int userType;
final List<String> filesList;
List<String> filesList;
final String dataType;
int handup;
int online; //0离线1在线