mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-09 10:00:27 +00:00
feat: direct call download api by cgo dart
This commit is contained in:
1 parent
467ada5500
commit
91dfd78b77
71 files changed
+6936
-1883
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'invoke_request.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class InvokeRequest {
|
||||
String method;
|
||||
List<String> params;
|
||||
|
||||
InvokeRequest({
|
||||
this.method = '',
|
||||
this.params = const [],
|
||||
});
|
||||
|
||||
factory InvokeRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$InvokeRequestFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$InvokeRequestToJson(this);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'invoke_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
InvokeRequest _$InvokeRequestFromJson(Map<String, dynamic> json) =>
|
||||
InvokeRequest(
|
||||
method: json['method'] as String? ?? '',
|
||||
params: (json['params'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
const [],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$InvokeRequestToJson(InvokeRequest instance) =>
|
||||
<String, dynamic>{
|
||||
'method': instance.method,
|
||||
'params': instance.params,
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'start_config.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class StartConfig {
|
||||
String storage;
|
||||
String storageDir;
|
||||
|
||||
StartConfig({
|
||||
this.storage = '',
|
||||
this.storageDir = '',
|
||||
});
|
||||
|
||||
factory StartConfig.fromJson(Map<String, dynamic> json) =>
|
||||
_$StartConfigFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$StartConfigToJson(this);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'start_config.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
StartConfig _$StartConfigFromJson(Map<String, dynamic> json) => StartConfig(
|
||||
storage: json['storage'] as String? ?? '',
|
||||
storageDir: json['storageDir'] as String? ?? '',
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$StartConfigToJson(StartConfig instance) =>
|
||||
<String, dynamic>{
|
||||
'storage': instance.storage,
|
||||
'storageDir': instance.storageDir,
|
||||
};
|
||||
Reference in new issue
Block a user