1
This commit is contained in:
27
lib/request/dto/room/rtc_token_dto.dart
Normal file
27
lib/request/dto/room/rtc_token_dto.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
class RtcTokenDto {
|
||||
RtcTokenDto({
|
||||
required this.uid,
|
||||
required this.expiresAt,
|
||||
required this.channel,
|
||||
required this.token,
|
||||
});
|
||||
|
||||
String 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,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user