hi-client/lib/app/model/entity_from_json_util.dart
speakeloudest 445b1e0352
Some checks failed
Build Android APK / 编译 libcore.aar (push) Has been cancelled
Build Android APK / 编译 Android APK (release) (push) Has been cancelled
Build Android APK / 创建 GitHub Release (push) Has been cancelled
Build Multi-Platform / 编译 libcore (iOS/tvOS) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Android) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Windows) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (macOS) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Linux) (push) Has been cancelled
Build Multi-Platform / 构建 Android APK (push) Has been cancelled
Build Multi-Platform / 构建 Windows (push) Has been cancelled
Build Multi-Platform / 构建 macOS (push) Has been cancelled
Build Multi-Platform / 构建 Linux (push) Has been cancelled
Build Multi-Platform / 构建 iOS (push) Has been cancelled
Build Multi-Platform / 创建 Release (push) Has been cancelled
Build Windows / 编译 libcore (Windows) (push) Has been cancelled
Build Windows / build (push) Has been cancelled
feat: 完成代码
2025-10-31 04:00:26 -07:00

70 lines
2.8 KiB
Dart
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:kaer_with_panels/app/model/response/kr_is_register.dart';
import 'package:kaer_with_panels/app/model/response/kr_check_subscription.dart';
import 'package:kaer_with_panels/app/model/response/kr_login_data.dart';
import 'package:kaer_with_panels/app/model/response/kr_node_list.dart';
import 'package:kaer_with_panels/app/model/response/kr_package_list.dart';
import 'response/kr_already_subscribe.dart';
import 'response/kr_config_data.dart';
import 'response/kr_kr_affiliate_count.dart';
import 'response/kr_message_list.dart';
import 'response/kr_node_group_list.dart';
import 'response/kr_order_status.dart';
import 'response/kr_payment_methods.dart';
import 'response/kr_purchase_order_no.dart';
import 'response/kr_status.dart';
import 'response/kr_user_available_subscribe.dart';
import 'response/kr_user_info.dart';
import 'response/kr_user_online_duration.dart';
import 'response/kr_web_text.dart';
/// json转换成实体类每新建一个实体类就新增加一个case
abstract class EntityFromJsonUtil {
static T parseJsonToEntity<T>(Map<String, dynamic> json) {
switch (T.toString()) {
case "KRIsRegister":
return KRIsRegister.fromJson(json) as T;
case "KRCheckSubscription":
return KRCheckSubscription.fromJson(json) as T;
case "KRLoginData":
return KRLoginData.fromJson(json) as T;
case "KRPackageList":
return KRPackageList.fromJson(json) as T;
case "KRNodeList":
return KRNodeList.fromJson(json) as T;
case "KRMessageList":
return KRMessageList.fromJson(json) as T;
case "KRUserInfo":
return KRUserInfo.fromJson(json) as T;
case "KRAffiliateCount":
return KRAffiliateCount.fromJson(json) as T;
case "KRPaymentMethods":
return KRPaymentMethods.fromJson(json) as T;
case "KRConfigData":
return KRConfigData.fromJson(json) as T;
case "KRPurchaseOrderNo":
return KRPurchaseOrderNo.fromJson(json) as T;
case "KRPurchaseOrderUrl":
return KRPurchaseOrderUrl.fromJson(json) as T;
case "KRCheckoutResponse":
return KRCheckoutResponse.fromJson(json) as T;
case "KROrderStatus":
return KROrderStatus.fromJson(json) as T;
case "KRAlreadySubscribeList":
return KRAlreadySubscribeList.fromJson(json) as T;
case "KRNodeGroupList":
return KRNodeGroupList.fromJson(json) as T;
case "KRWebText":
return KRWebText.fromJson(json) as T;
case "KRUserOnlineDurationResponse":
return KRUserOnlineDurationResponse.fromJson(json) as T;
case "KRUserAvailableSubscribeList":
return KRUserAvailableSubscribeList.fromJson(json) as T;
case "KRStatus":
return KRStatus.fromJson(json) as T;
default:
throw ("类型转换错误,是否忘记添加了case!");
}
}
}