feat: 完成代码
Build Android APK / 编译 libcore.aar (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
Build Android APK / 编译 Android APK (release) (push) Has been cancelled

This commit is contained in:
2025-10-31 04:00:26 -07:00
parent 74df08144f
commit 445b1e0352
11 changed files with 502 additions and 334 deletions
+3
View File
@@ -1,4 +1,5 @@
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';
@@ -23,6 +24,8 @@ abstract class EntityFromJsonUtil {
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":
+30
View File
@@ -0,0 +1,30 @@
/// 是否订阅(区分设备和邮箱)
class KRCheckSubscription {
/// 当前设备订阅状态
final bool deviceSubscribed;
/// 邮箱订阅状态
final bool emailSubscribed;
/// 构造函数,默认 false
KRCheckSubscription({
this.deviceSubscribed = false,
this.emailSubscribed = false,
});
/// 从 JSON 创建对象
KRCheckSubscription.fromJson(Map<String, dynamic>? json)
: deviceSubscribed = (json?['device_status'] == true || json?['deviceStatus'] == "true") ? true : false,
emailSubscribed = (json?['email_status'] == true || json?['emailStatus'] == "true") ? true : false;
/// 转换成 JSON
Map<String, dynamic> toJson() {
return {
'deviceStatus': deviceSubscribed,
'emailStatus': emailSubscribed,
};
}
/// 判断邮箱和设备是否都已订阅
bool get isFullySubscribed => deviceSubscribed && emailSubscribed;
}