更新睡眠报告
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'common_message_setting_controller.g.dart'; // 由json_serializable自动生成的部分
|
||||
|
||||
@JsonSerializable()
|
||||
class CommonMessageSettingModel {
|
||||
int? setting = 0;//总设置 0 关闭 1 开启
|
||||
int? appSetting = 0;//app消息设置
|
||||
int? serviceSetting = 0;//服务号消息
|
||||
int? tipSetting = 0;//设备放置说明
|
||||
int? deviceUpgradeSetting = 0;//设备升级提示
|
||||
int? deviceIssueSetting = 0;//设备故障提示
|
||||
|
||||
|
||||
CommonMessageSettingModel();
|
||||
|
||||
// 从JSON反序列化时的异常处理
|
||||
|
||||
factory CommonMessageSettingModel.fromJson(Map<String, dynamic> json) {
|
||||
try {
|
||||
return _$CommonMessageSettingModelFromJson(json);
|
||||
} catch (e) {
|
||||
// 在实际应用中,应该有更细致的异常处理策略和错误日志
|
||||
return CommonMessageSettingModel(); // 或者返回一个带有错误信息的特定DeviceInfoModel实例
|
||||
}
|
||||
}
|
||||
|
||||
// 序列化为JSON时的异常处理
|
||||
Map<String, dynamic> toJson() => _$CommonMessageSettingModelToJson(this);
|
||||
}
|
||||
|
||||
class CommonMessageSettingController extends GetControllerEx<CommonMessageSettingModel> {
|
||||
CommonMessageSettingController() {
|
||||
attr = GetModel(CommonMessageSettingModel()).obs;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'common_message_setting_controller.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
CommonMessageSettingModel _$CommonMessageSettingModelFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
CommonMessageSettingModel()
|
||||
..setting = (json['setting'] as num?)?.toInt()
|
||||
..appSetting = (json['appSetting'] as num?)?.toInt()
|
||||
..serviceSetting = (json['serviceSetting'] as num?)?.toInt()
|
||||
..tipSetting = (json['tipSetting'] as num?)?.toInt()
|
||||
..deviceUpgradeSetting = (json['deviceUpgradeSetting'] as num?)?.toInt()
|
||||
..deviceIssueSetting = (json['deviceIssueSetting'] as num?)?.toInt();
|
||||
|
||||
Map<String, dynamic> _$CommonMessageSettingModelToJson(
|
||||
CommonMessageSettingModel instance) =>
|
||||
<String, dynamic>{
|
||||
'setting': instance.setting,
|
||||
'appSetting': instance.appSetting,
|
||||
'serviceSetting': instance.serviceSetting,
|
||||
'tipSetting': instance.tipSetting,
|
||||
'deviceUpgradeSetting': instance.deviceUpgradeSetting,
|
||||
'deviceIssueSetting': instance.deviceIssueSetting,
|
||||
};
|
||||
34
lib/controller/message/message_setting_controller.dart
Normal file
34
lib/controller/message/message_setting_controller.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'message_setting_controller.g.dart'; // 由json_serializable自动生成的部分
|
||||
|
||||
@JsonSerializable()
|
||||
class MessageSettingModel {
|
||||
int? setting = 0;//总设置 0 关闭 1 开启
|
||||
int? appSetting = 0;//app消息设置
|
||||
int? serviceSetting = 0;//服务号消息
|
||||
|
||||
MessageSettingModel();
|
||||
|
||||
// 从JSON反序列化时的异常处理
|
||||
|
||||
factory MessageSettingModel.fromJson(Map<String, dynamic> json) {
|
||||
try {
|
||||
return _$MessageSettingModelFromJson(json);
|
||||
} catch (e) {
|
||||
// 在实际应用中,应该有更细致的异常处理策略和错误日志
|
||||
return MessageSettingModel(); // 或者返回一个带有错误信息的特定DeviceInfoModel实例
|
||||
}
|
||||
}
|
||||
|
||||
// 序列化为JSON时的异常处理
|
||||
Map<String, dynamic> toJson() => _$MessageSettingModelToJson(this);
|
||||
}
|
||||
|
||||
class MessageSettingController extends GetControllerEx<MessageSettingModel> {
|
||||
MessageSettingController() {
|
||||
attr = GetModel(MessageSettingModel()).obs;
|
||||
}
|
||||
|
||||
}
|
||||
21
lib/controller/message/message_setting_controller.g.dart
Normal file
21
lib/controller/message/message_setting_controller.g.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'message_setting_controller.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
MessageSettingModel _$MessageSettingModelFromJson(Map<String, dynamic> json) =>
|
||||
MessageSettingModel()
|
||||
..setting = (json['setting'] as num?)?.toInt()
|
||||
..appSetting = (json['appSetting'] as num?)?.toInt()
|
||||
..serviceSetting = (json['serviceSetting'] as num?)?.toInt();
|
||||
|
||||
Map<String, dynamic> _$MessageSettingModelToJson(
|
||||
MessageSettingModel instance) =>
|
||||
<String, dynamic>{
|
||||
'setting': instance.setting,
|
||||
'appSetting': instance.appSetting,
|
||||
'serviceSetting': instance.serviceSetting,
|
||||
};
|
||||
Reference in New Issue
Block a user