Files
xueguang_flutter_app/lib/request/dto/room/room_user_dto.dart
zhutao b7239292d1 1
2025-11-20 18:00:34 +08:00

68 lines
1.9 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
class RoomUserDto {
final int userId;
final String rtcUid;
final int microphoneStatus;
final int cameraStatus;
final int speekerStatus;
final String wsClientId;
final String userName;
final String avatar;
final int userType;
final List<String> filesList;
final String dataType;
final int handup;
final int online; //0离线1在线
const RoomUserDto({
required this.userId,
required this.rtcUid,
required this.microphoneStatus,
required this.cameraStatus,
required this.speekerStatus,
required this.wsClientId,
required this.userName,
required this.avatar,
required this.userType,
required this.filesList,
required this.dataType,
required this.handup,
required this.online,
});
factory RoomUserDto.fromJson(Map<String, dynamic> json) {
return RoomUserDto(
userId: json["user_id"] ?? 0,
rtcUid: json["rtc_uid"] ?? "",
microphoneStatus: json["microphone_status"] ?? 0,
cameraStatus: json["camera_status"] ?? 0,
speekerStatus: json["speeker_status"] ?? 0,
wsClientId: json["ws_client_id"] ?? "",
userName: json["user_name"] ?? "",
avatar: json["avatar"] ?? "",
userType: json["user_type"] ?? 0,
filesList: json["files"] != null ? List<String>.from(json["files"]) : <String>[],
dataType: json["data_type"] ?? "",
handup: json["handup"] ?? 0,
online: json["online"] ?? 0,
);
}
Map<String, dynamic> toJson() {
return {
"user_id": userId,
"rtc_uid": rtcUid,
"microphone_status": microphoneStatus,
"camera_status": cameraStatus,
"speeker_status": speekerStatus,
"ws_client_id": wsClientId,
"user_name": userName,
"avatar": avatar,
"user_type": userType,
"files": filesList,
"data_type": dataType,
"handup": handup,
"online": online,
};
}
}