Files
xueguang_flutter_app/lib/request/dto/room/rtc_token_dto.dart
zhutao 5784a0a5d4 1
2025-11-21 18:21:47 +08:00

28 lines
577 B
Dart

class RtcTokenDto {
RtcTokenDto({
required this.uid,
required this.expiresAt,
required this.channel,
required this.token,
});
int uid;
DateTime expiresAt;
String channel;
String token;
factory RtcTokenDto.fromJson(Map<dynamic, dynamic> json) => RtcTokenDto(
uid: json["uid"],
expiresAt: DateTime.parse(json["expires_at"]),
channel: json["channel"],
token: json["token"],
);
Map<dynamic, dynamic> toJson() => {
"uid": uid,
"expires_at": expiresAt.toIso8601String(),
"channel": channel,
"token": token,
};
}