mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-04 15:49:49 +00:00
42 lines
843 B
Dart
42 lines
843 B
Dart
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'resource.g.dart';
|
|
|
|
@JsonSerializable(explicitToJson: true)
|
|
class Resource {
|
|
String name;
|
|
int size;
|
|
bool range;
|
|
List<FileInfo> files;
|
|
String hash;
|
|
|
|
Resource(
|
|
{required this.name,
|
|
required this.size,
|
|
required this.range,
|
|
required this.files,
|
|
required this.hash});
|
|
|
|
factory Resource.fromJson(Map<String, dynamic> json) =>
|
|
_$ResourceFromJson(json);
|
|
|
|
Map<String, dynamic> toJson() => _$ResourceToJson(this);
|
|
}
|
|
|
|
@JsonSerializable()
|
|
class FileInfo {
|
|
String name;
|
|
String path;
|
|
int size;
|
|
|
|
FileInfo({
|
|
required this.name,
|
|
required this.path,
|
|
required this.size,
|
|
});
|
|
|
|
factory FileInfo.fromJson(Map<String, dynamic> json) =>
|
|
_$FileInfoFromJson(json);
|
|
Map<String, dynamic> toJson() => _$FileInfoToJson(this);
|
|
}
|