mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-07-08 01:30:28 +08:00
Update
This commit is contained in:
52
lib/api/file.dart
Normal file
52
lib/api/file.dart
Normal file
@@ -0,0 +1,52 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'file.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class EhFileBasic {
|
||||
const EhFileBasic({
|
||||
required this.id,
|
||||
required this.width,
|
||||
required this.height,
|
||||
required this.isOriginal,
|
||||
});
|
||||
final int id;
|
||||
final int width;
|
||||
final int height;
|
||||
@JsonKey(name: 'is_original')
|
||||
final bool isOriginal;
|
||||
factory EhFileBasic.fromJson(Map<String, dynamic> json) =>
|
||||
_$EhFileBasicFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$EhFileBasicToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class EhFileExtend {
|
||||
const EhFileExtend({
|
||||
required this.id,
|
||||
required this.width,
|
||||
required this.height,
|
||||
required this.isOriginal,
|
||||
required this.token,
|
||||
});
|
||||
final int id;
|
||||
final int width;
|
||||
final int height;
|
||||
@JsonKey(name: 'is_original')
|
||||
final bool isOriginal;
|
||||
final String token;
|
||||
factory EhFileExtend.fromJson(Map<String, dynamic> json) =>
|
||||
_$EhFileExtendFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$EhFileExtendToJson(this);
|
||||
}
|
||||
|
||||
class EhFiles {
|
||||
const EhFiles({required this.files});
|
||||
final Map<String, EhFileBasic> files;
|
||||
factory EhFiles.fromJson(Map<String, dynamic> json) => EhFiles(
|
||||
files: (json).map(
|
||||
(k, e) =>
|
||||
MapEntry(k, EhFileBasic.fromJson(e as Map<String, dynamic>)),
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user