自习室优化ok
This commit is contained in:
24
lib/request/dto/common/qiu_token_dto.dart
Normal file
24
lib/request/dto/common/qiu_token_dto.dart
Normal 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"] ?? "";
|
||||
}
|
||||
}
|
||||
47
lib/request/dto/common/version_dto.dart
Normal file
47
lib/request/dto/common/version_dto.dart
Normal 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,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user