68 lines
1.9 KiB
Dart
68 lines
1.9 KiB
Dart
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,
|
||
};
|
||
}
|
||
}
|