初始提交
This commit is contained in:
66
bin/model/ApiResponse.dart
Normal file
66
bin/model/ApiResponse.dart
Normal file
@@ -0,0 +1,66 @@
|
||||
import 'dart:convert';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:fixnum/fixnum.dart'; // 用于处理 Int64 类型
|
||||
|
||||
part 'ApiResponse.g.dart';
|
||||
|
||||
@JsonSerializable(genericArgumentFactories: true)
|
||||
class ApiResponse<T> {
|
||||
int? code;
|
||||
int? total;
|
||||
T? data;
|
||||
String? message;
|
||||
|
||||
ApiResponse();
|
||||
|
||||
// JSON 反序列化
|
||||
factory ApiResponse.fromJson(
|
||||
Map<String, dynamic> json,
|
||||
T Function(Object? json) fromJsonT,
|
||||
) =>
|
||||
_$ApiResponseFromJson(json, fromJsonT);
|
||||
|
||||
// JSON 序列化
|
||||
Map<String, dynamic> toJson(Object? Function(T value) toJsonT) =>
|
||||
_$ApiResponseToJson(this, toJsonT);
|
||||
|
||||
// 添加自定义的 toJson 序列化方法,确保能正确序列化泛型数据
|
||||
String serialize() {
|
||||
// 手动处理 data 中的 Int64 转换为 int
|
||||
var serializedData = _serializeData(data);
|
||||
return jsonEncode({
|
||||
'code': code,
|
||||
'total': total,
|
||||
'data': serializedData,
|
||||
'message': message,
|
||||
});
|
||||
}
|
||||
|
||||
// 递归处理 data 中的每个项,转换 Int64 为 int
|
||||
dynamic _serializeData(dynamic data) {
|
||||
if (data is List) {
|
||||
// 处理 List 中的 Int64 类型
|
||||
return data.map((e) => _serializeData(e)).toList();
|
||||
} else if (data is Map) {
|
||||
// 处理 Map 中的 Int64 类型
|
||||
var map = Map<String, dynamic>.from(data);
|
||||
map.forEach((key, value) {
|
||||
if (value is Int64) {
|
||||
map[key] = value.toInt();
|
||||
} else {
|
||||
map[key] = _serializeData(value);
|
||||
}
|
||||
});
|
||||
return map;
|
||||
} else if (data is Int64) {
|
||||
// 如果是 Int64 类型,转换为 int
|
||||
return data.toInt();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return serialize();
|
||||
}
|
||||
}
|
||||
40
bin/model/ApiResponse.g.dart
Normal file
40
bin/model/ApiResponse.g.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'ApiResponse.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ApiResponse<T> _$ApiResponseFromJson<T>(
|
||||
Map<String, dynamic> json,
|
||||
T Function(Object? json) fromJsonT,
|
||||
) =>
|
||||
ApiResponse<T>()
|
||||
..code = (json['code'] as num?)?.toInt()
|
||||
..total = (json['total'] as num?)?.toInt()
|
||||
..data = _$nullableGenericFromJson(json['data'], fromJsonT)
|
||||
..message = json['message'] as String?;
|
||||
|
||||
Map<String, dynamic> _$ApiResponseToJson<T>(
|
||||
ApiResponse<T> instance,
|
||||
Object? Function(T value) toJsonT,
|
||||
) =>
|
||||
<String, dynamic>{
|
||||
'code': instance.code,
|
||||
'total': instance.total,
|
||||
'data': _$nullableGenericToJson(instance.data, toJsonT),
|
||||
'message': instance.message,
|
||||
};
|
||||
|
||||
T? _$nullableGenericFromJson<T>(
|
||||
Object? input,
|
||||
T Function(Object? json) fromJson,
|
||||
) =>
|
||||
input == null ? null : fromJson(input);
|
||||
|
||||
Object? _$nullableGenericToJson<T>(
|
||||
T? input,
|
||||
Object? Function(T value) toJson,
|
||||
) =>
|
||||
input == null ? null : toJson(input);
|
||||
37
bin/model/Area.dart
Normal file
37
bin/model/Area.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'Area.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class Area {
|
||||
@JsonKey(name: '_id')
|
||||
String? id; // 区域id
|
||||
String? area_name; // 区域名称
|
||||
String? area_desc; // 区域描述
|
||||
int? created_at; // 创建时间(毫秒)
|
||||
int? updated_at; // 更新时间(毫秒)
|
||||
String? created_by_id; // 创建人ID
|
||||
String? created_by_name; // 创建人名称
|
||||
String? updated_by_id; // 更新人ID
|
||||
String? updated_by_name; // 更新人名称
|
||||
String? oid; // 机构ID
|
||||
int? deleted; // 是否删除
|
||||
String? points; // 坐标点集合
|
||||
String? tid; // 所属机构
|
||||
int? level; // 权限等级
|
||||
|
||||
Area();
|
||||
static Area fromJson(Map<String, dynamic> json) => _$AreaFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$AreaToJson(this);
|
||||
|
||||
// 使用查询参数填充 Area 对象
|
||||
static Area fromQueryParameters(Map<String, String> queryParameters, Map<String, dynamic> jwt) {
|
||||
var json = <String, dynamic>{};
|
||||
queryParameters.forEach((key, value) {
|
||||
json[key] = value;
|
||||
});
|
||||
json['tid'] = jwt['tid'];
|
||||
json['level'] = jwt['level'];
|
||||
return Area.fromJson(json);
|
||||
}
|
||||
}
|
||||
40
bin/model/Area.g.dart
Normal file
40
bin/model/Area.g.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'Area.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Area _$AreaFromJson(Map<String, dynamic> json) => Area()
|
||||
..id = json['_id'] as String?
|
||||
..area_name = json['area_name'] as String?
|
||||
..area_desc = json['area_desc'] as String?
|
||||
..created_at = (json['created_at'] as num?)?.toInt()
|
||||
..updated_at = (json['updated_at'] as num?)?.toInt()
|
||||
..created_by_id = json['created_by_id'] as String?
|
||||
..created_by_name = json['created_by_name'] as String?
|
||||
..updated_by_id = json['updated_by_id'] as String?
|
||||
..updated_by_name = json['updated_by_name'] as String?
|
||||
..oid = json['oid'] as String?
|
||||
..deleted = (json['deleted'] as num?)?.toInt()
|
||||
..points = json['points'] as String?
|
||||
..tid = json['tid'] as String?
|
||||
..level = (json['level'] as num?)?.toInt();
|
||||
|
||||
Map<String, dynamic> _$AreaToJson(Area instance) => <String, dynamic>{
|
||||
'_id': instance.id,
|
||||
'area_name': instance.area_name,
|
||||
'area_desc': instance.area_desc,
|
||||
'created_at': instance.created_at,
|
||||
'updated_at': instance.updated_at,
|
||||
'created_by_id': instance.created_by_id,
|
||||
'created_by_name': instance.created_by_name,
|
||||
'updated_by_id': instance.updated_by_id,
|
||||
'updated_by_name': instance.updated_by_name,
|
||||
'oid': instance.oid,
|
||||
'deleted': instance.deleted,
|
||||
'points': instance.points,
|
||||
'tid': instance.tid,
|
||||
'level': instance.level,
|
||||
};
|
||||
61
bin/model/Bed.dart
Normal file
61
bin/model/Bed.dart
Normal file
@@ -0,0 +1,61 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'Bed.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class Bed {
|
||||
@JsonKey(name: '_id')
|
||||
String? id; // 床位id
|
||||
String? bed_type_id; // 床位类型ID
|
||||
@JsonKey(ignore: true)
|
||||
String? bed_type_name; // 床位类型名称
|
||||
String? bed_name; // 床位名称
|
||||
bool? is_mapped; // 是否映射
|
||||
String? mapped_coordinates; // 映射坐标点
|
||||
String? device_model; // 设备型号
|
||||
String? device_name; // 设备名称
|
||||
String? device_id; // 设备ID
|
||||
int? status; // 当前状态 (0: 离线, 1: 在线)
|
||||
int? created_at; // 创建时间(毫秒数)
|
||||
int? updated_at; // 更新时间(毫秒数)
|
||||
String? created_by_id; // 创建人ID
|
||||
String? created_by_name; // 创建人名称
|
||||
String? updated_by_id; // 更新人ID
|
||||
String? updated_by_name; // 更新人名称
|
||||
String? oid; // 机构ID
|
||||
@JsonKey(ignore: true)
|
||||
int? start_time;
|
||||
@JsonKey(ignore: true)
|
||||
int? end_time;
|
||||
String? room_id; //房间id
|
||||
|
||||
int? deleted; // 是否删除(逻辑删除标识)
|
||||
String? tid; // 所属机构
|
||||
int? level; // 权限等级
|
||||
String? areaIds; //区域id集合
|
||||
String? roomIds; //房间id集合
|
||||
String? mapping; //是否映射
|
||||
String? device_status; //设备状态
|
||||
String? page;
|
||||
String? limit;
|
||||
List<String>? deviceIds;
|
||||
String? roomTypes; //房间类型
|
||||
|
||||
Bed();
|
||||
|
||||
// 从JSON中反序列化
|
||||
static Bed fromJson(Map<String, dynamic> json) => _$BedFromJson(json);
|
||||
|
||||
// 转换成JSON
|
||||
Map<String, dynamic> toJson() => _$BedToJson(this);
|
||||
|
||||
static Bed fromQueryParameters(Map<String, String> queryParameters, jwt) {
|
||||
var json = <String, dynamic>{};
|
||||
queryParameters.forEach((key, value) {
|
||||
json[key] = value;
|
||||
});
|
||||
json['tid'] = jwt['tid'];
|
||||
json['level'] = jwt['level'];
|
||||
return Bed.fromJson(json);
|
||||
}
|
||||
}
|
||||
69
bin/model/Bed.g.dart
Normal file
69
bin/model/Bed.g.dart
Normal file
@@ -0,0 +1,69 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'Bed.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Bed _$BedFromJson(Map<String, dynamic> json) => Bed()
|
||||
..id = json['_id'] as String?
|
||||
..bed_type_id = json['bed_type_id'] as String?
|
||||
..bed_name = json['bed_name'] as String?
|
||||
..is_mapped = json['is_mapped'] as bool?
|
||||
..mapped_coordinates = json['mapped_coordinates'] as String?
|
||||
..device_model = json['device_model'] as String?
|
||||
..device_name = json['device_name'] as String?
|
||||
..device_id = json['device_id'] as String?
|
||||
..status = (json['status'] as num?)?.toInt()
|
||||
..created_at = (json['created_at'] as num?)?.toInt()
|
||||
..updated_at = (json['updated_at'] as num?)?.toInt()
|
||||
..created_by_id = json['created_by_id'] as String?
|
||||
..created_by_name = json['created_by_name'] as String?
|
||||
..updated_by_id = json['updated_by_id'] as String?
|
||||
..updated_by_name = json['updated_by_name'] as String?
|
||||
..oid = json['oid'] as String?
|
||||
..room_id = json['room_id'] as String?
|
||||
..deleted = (json['deleted'] as num?)?.toInt()
|
||||
..tid = json['tid'] as String?
|
||||
..level = (json['level'] as num?)?.toInt()
|
||||
..areaIds = json['areaIds'] as String?
|
||||
..roomIds = json['roomIds'] as String?
|
||||
..mapping = json['mapping'] as String?
|
||||
..device_status = json['device_status'] as String?
|
||||
..page = json['page'] as String?
|
||||
..limit = json['limit'] as String?
|
||||
..deviceIds =
|
||||
(json['deviceIds'] as List<dynamic>?)?.map((e) => e as String).toList()
|
||||
..roomTypes = json['roomTypes'] as String?;
|
||||
|
||||
Map<String, dynamic> _$BedToJson(Bed instance) => <String, dynamic>{
|
||||
'_id': instance.id,
|
||||
'bed_type_id': instance.bed_type_id,
|
||||
'bed_name': instance.bed_name,
|
||||
'is_mapped': instance.is_mapped,
|
||||
'mapped_coordinates': instance.mapped_coordinates,
|
||||
'device_model': instance.device_model,
|
||||
'device_name': instance.device_name,
|
||||
'device_id': instance.device_id,
|
||||
'status': instance.status,
|
||||
'created_at': instance.created_at,
|
||||
'updated_at': instance.updated_at,
|
||||
'created_by_id': instance.created_by_id,
|
||||
'created_by_name': instance.created_by_name,
|
||||
'updated_by_id': instance.updated_by_id,
|
||||
'updated_by_name': instance.updated_by_name,
|
||||
'oid': instance.oid,
|
||||
'room_id': instance.room_id,
|
||||
'deleted': instance.deleted,
|
||||
'tid': instance.tid,
|
||||
'level': instance.level,
|
||||
'areaIds': instance.areaIds,
|
||||
'roomIds': instance.roomIds,
|
||||
'mapping': instance.mapping,
|
||||
'device_status': instance.device_status,
|
||||
'page': instance.page,
|
||||
'limit': instance.limit,
|
||||
'deviceIds': instance.deviceIds,
|
||||
'roomTypes': instance.roomTypes,
|
||||
};
|
||||
44
bin/model/BedType.dart
Normal file
44
bin/model/BedType.dart
Normal file
@@ -0,0 +1,44 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'BedType.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class BedType {
|
||||
@JsonKey(name: '_id')
|
||||
String? id; // 房间id
|
||||
String? bed_type_name; // 床位类型名称
|
||||
String? description; // 类型描述
|
||||
int? created_at; // 创建时间(毫秒数)
|
||||
int? updated_at; // 更新时间(毫秒数)
|
||||
String? created_by_id; // 创建人ID
|
||||
String? created_by_name; // 创建人名称
|
||||
String? updated_by_id; // 更新人ID
|
||||
String? updated_by_name; // 更新人名称
|
||||
int? deleted; // 是否删除(逻辑删除标识)
|
||||
String? oid; // 机构ID
|
||||
@JsonKey(ignore: true)
|
||||
int? start_time;
|
||||
@JsonKey(ignore: true)
|
||||
int? end_time;
|
||||
String? tid; // 所属机构
|
||||
int? level; // 权限等级
|
||||
|
||||
BedType();
|
||||
|
||||
// 从JSON中反序列化
|
||||
static BedType fromJson(Map<String, dynamic> json) => _$BedTypeFromJson(json);
|
||||
|
||||
// 转换成JSON
|
||||
Map<String, dynamic> toJson() => _$BedTypeToJson(this);
|
||||
|
||||
static BedType fromQueryParameters(
|
||||
Map<String, String> queryParameters, Map<String, dynamic> jwt) {
|
||||
var json = <String, dynamic>{};
|
||||
queryParameters.forEach((key, value) {
|
||||
json[key] = value;
|
||||
});
|
||||
json['tid'] = jwt['tid'];
|
||||
json['level'] = jwt['level'];
|
||||
return BedType.fromJson(json);
|
||||
}
|
||||
}
|
||||
38
bin/model/BedType.g.dart
Normal file
38
bin/model/BedType.g.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'BedType.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
BedType _$BedTypeFromJson(Map<String, dynamic> json) => BedType()
|
||||
..id = json['_id'] as String?
|
||||
..bed_type_name = json['bed_type_name'] as String?
|
||||
..description = json['description'] as String?
|
||||
..created_at = (json['created_at'] as num?)?.toInt()
|
||||
..updated_at = (json['updated_at'] as num?)?.toInt()
|
||||
..created_by_id = json['created_by_id'] as String?
|
||||
..created_by_name = json['created_by_name'] as String?
|
||||
..updated_by_id = json['updated_by_id'] as String?
|
||||
..updated_by_name = json['updated_by_name'] as String?
|
||||
..deleted = (json['deleted'] as num?)?.toInt()
|
||||
..oid = json['oid'] as String?
|
||||
..tid = json['tid'] as String?
|
||||
..level = (json['level'] as num?)?.toInt();
|
||||
|
||||
Map<String, dynamic> _$BedTypeToJson(BedType instance) => <String, dynamic>{
|
||||
'_id': instance.id,
|
||||
'bed_type_name': instance.bed_type_name,
|
||||
'description': instance.description,
|
||||
'created_at': instance.created_at,
|
||||
'updated_at': instance.updated_at,
|
||||
'created_by_id': instance.created_by_id,
|
||||
'created_by_name': instance.created_by_name,
|
||||
'updated_by_id': instance.updated_by_id,
|
||||
'updated_by_name': instance.updated_by_name,
|
||||
'deleted': instance.deleted,
|
||||
'oid': instance.oid,
|
||||
'tid': instance.tid,
|
||||
'level': instance.level,
|
||||
};
|
||||
36
bin/model/DictionaryType.dart
Normal file
36
bin/model/DictionaryType.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'DictionaryType.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class DictionaryType {
|
||||
@JsonKey(name: '_id')
|
||||
String? id; // 字典ID
|
||||
String? dict_name; // 字典名称
|
||||
String? dict_type; // 字典类型
|
||||
String? status; // 状态
|
||||
String? create_by; // 创建者
|
||||
int? create_time; // 创建时间(毫秒)
|
||||
String? update_by; // 更新者
|
||||
int? update_time; // 更新时间(毫秒)
|
||||
String? remark; // 备注
|
||||
|
||||
DictionaryType();
|
||||
|
||||
// 从 JSON 创建 Dictionary 实例
|
||||
static DictionaryType fromJson(Map<String, dynamic> json) => _$DictionaryTypeFromJson(json);
|
||||
|
||||
// 将 Dictionary 实例转换为 JSON
|
||||
Map<String, dynamic> toJson() => _$DictionaryTypeToJson(this);
|
||||
|
||||
// 使用查询参数填充 Dictionary 对象
|
||||
static DictionaryType fromQueryParameters(Map<String, String> queryParameters, Map<String, dynamic> jwt) {
|
||||
var json = <String, dynamic>{};
|
||||
queryParameters.forEach((key, value) {
|
||||
json[key] = value;
|
||||
});
|
||||
json['tid'] = jwt['tid'];
|
||||
json['level'] = jwt['level'];
|
||||
return DictionaryType.fromJson(json);
|
||||
}
|
||||
}
|
||||
32
bin/model/DictionaryType.g.dart
Normal file
32
bin/model/DictionaryType.g.dart
Normal file
@@ -0,0 +1,32 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'DictionaryType.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
DictionaryType _$DictionaryTypeFromJson(Map<String, dynamic> json) =>
|
||||
DictionaryType()
|
||||
..id = json['_id'] as String?
|
||||
..dict_name = json['dict_name'] as String?
|
||||
..dict_type = json['dict_type'] as String?
|
||||
..status = json['status'] as String?
|
||||
..create_by = json['create_by'] as String?
|
||||
..create_time = (json['create_time'] as num?)?.toInt()
|
||||
..update_by = json['update_by'] as String?
|
||||
..update_time = (json['update_time'] as num?)?.toInt()
|
||||
..remark = json['remark'] as String?;
|
||||
|
||||
Map<String, dynamic> _$DictionaryTypeToJson(DictionaryType instance) =>
|
||||
<String, dynamic>{
|
||||
'_id': instance.id,
|
||||
'dict_name': instance.dict_name,
|
||||
'dict_type': instance.dict_type,
|
||||
'status': instance.status,
|
||||
'create_by': instance.create_by,
|
||||
'create_time': instance.create_time,
|
||||
'update_by': instance.update_by,
|
||||
'update_time': instance.update_time,
|
||||
'remark': instance.remark,
|
||||
};
|
||||
47
bin/model/DiseaseType.dart
Normal file
47
bin/model/DiseaseType.dart
Normal file
@@ -0,0 +1,47 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'DiseaseType.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class DiseaseType {
|
||||
@JsonKey(name: '_id')
|
||||
String? id; // 疾病类型ID
|
||||
String? disease_type_name; // 疾病类型名称
|
||||
String? description; // 类型描述
|
||||
int? created_at; // 创建时间(毫秒数)
|
||||
int? updated_at; // 更新时间(毫秒数)
|
||||
String? created_by_id; // 创建人ID
|
||||
String? created_by_name; // 创建人名称
|
||||
String? updated_by_id; // 更新人ID
|
||||
String? updated_by_name; // 更新人名称
|
||||
int? deleted; // 是否删除(逻辑删除标识)
|
||||
String? oid; // 机构ID
|
||||
@JsonKey(ignore: true)
|
||||
int? start_time;
|
||||
@JsonKey(ignore: true)
|
||||
int? end_time;
|
||||
String? color; //疾病颜色
|
||||
|
||||
int? num; //统计人数
|
||||
String? tid; // 所属机构
|
||||
int? level; // 权限等级
|
||||
|
||||
DiseaseType();
|
||||
|
||||
// 从JSON中反序列化
|
||||
static DiseaseType fromJson(Map<String, dynamic> json) =>
|
||||
_$DiseaseTypeFromJson(json);
|
||||
|
||||
// 转换成JSON
|
||||
Map<String, dynamic> toJson() => _$DiseaseTypeToJson(this);
|
||||
|
||||
static DiseaseType fromQueryParameters(Map<String, String> queryParameters, Map<String, dynamic> jwt) {
|
||||
var json = <String, dynamic>{};
|
||||
queryParameters.forEach((key, value) {
|
||||
json[key] = value;
|
||||
});
|
||||
json['tid'] = jwt['tid'];
|
||||
json['level'] = jwt['level'];
|
||||
return DiseaseType.fromJson(json);
|
||||
}
|
||||
}
|
||||
43
bin/model/DiseaseType.g.dart
Normal file
43
bin/model/DiseaseType.g.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'DiseaseType.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
DiseaseType _$DiseaseTypeFromJson(Map<String, dynamic> json) => DiseaseType()
|
||||
..id = json['_id'] as String?
|
||||
..disease_type_name = json['disease_type_name'] as String?
|
||||
..description = json['description'] as String?
|
||||
..created_at = (json['created_at'] as num?)?.toInt()
|
||||
..updated_at = (json['updated_at'] as num?)?.toInt()
|
||||
..created_by_id = json['created_by_id'] as String?
|
||||
..created_by_name = json['created_by_name'] as String?
|
||||
..updated_by_id = json['updated_by_id'] as String?
|
||||
..updated_by_name = json['updated_by_name'] as String?
|
||||
..deleted = (json['deleted'] as num?)?.toInt()
|
||||
..oid = json['oid'] as String?
|
||||
..color = json['color'] as String?
|
||||
..num = (json['num'] as num?)?.toInt()
|
||||
..tid = json['tid'] as String?
|
||||
..level = (json['level'] as num?)?.toInt();
|
||||
|
||||
Map<String, dynamic> _$DiseaseTypeToJson(DiseaseType instance) =>
|
||||
<String, dynamic>{
|
||||
'_id': instance.id,
|
||||
'disease_type_name': instance.disease_type_name,
|
||||
'description': instance.description,
|
||||
'created_at': instance.created_at,
|
||||
'updated_at': instance.updated_at,
|
||||
'created_by_id': instance.created_by_id,
|
||||
'created_by_name': instance.created_by_name,
|
||||
'updated_by_id': instance.updated_by_id,
|
||||
'updated_by_name': instance.updated_by_name,
|
||||
'deleted': instance.deleted,
|
||||
'oid': instance.oid,
|
||||
'color': instance.color,
|
||||
'num': instance.num,
|
||||
'tid': instance.tid,
|
||||
'level': instance.level,
|
||||
};
|
||||
78
bin/model/Person.dart
Normal file
78
bin/model/Person.dart
Normal file
@@ -0,0 +1,78 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'Person.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class Person {
|
||||
@JsonKey(name: '_id')
|
||||
String? id; // 人员id
|
||||
String? room_id; // 选择的房间id
|
||||
String? room_name; // 选择的房间名称
|
||||
String? bed_id; // 选择的床位id
|
||||
String? bed_name; // 选择的床位名称
|
||||
int? check_in_start_time; // 入住的开始时间(毫秒数)
|
||||
int? check_in_end_time; // 入住的结束时间(毫秒数)
|
||||
String? contact_name; // 联系人名称
|
||||
String? contact_relationship; // 联系人关系类型
|
||||
String? contact_phone; // 联系人手机号码
|
||||
String? person_name; // 人员姓名
|
||||
String? gender; // 性别
|
||||
String? ethnicity; // 民族
|
||||
String? person_type_id; // 人员类型id
|
||||
String? person_type_name; // 人员类型名称
|
||||
String? id_card_number; // 身份证号码
|
||||
String? phone_number; // 手机号码
|
||||
String? service_level; // 服务等级
|
||||
String? health_info; // 健康信息
|
||||
String? height; // 身高
|
||||
String? weight; // 体重
|
||||
String? tid; // 机构ID
|
||||
String? oid; // 机构ID
|
||||
int? deleted;
|
||||
int? created_at; // 创建时间(毫秒)
|
||||
int? updated_at; // 更新时间(毫秒)
|
||||
int? data_level; //数据等级
|
||||
|
||||
String? age;
|
||||
String? desc; //备注
|
||||
int? level; // 权限等级
|
||||
// @JsonKey(ignore: true)
|
||||
String? bed_ids; //床位id列表
|
||||
|
||||
//查询条件
|
||||
// @JsonKey(ignore: true)
|
||||
String? query_gender; //性别
|
||||
// @JsonKey(ignore: true)
|
||||
String? deviceID; //设备id
|
||||
// @JsonKey(ignore: true)
|
||||
String? status; //入住状态
|
||||
// @JsonKey(ignore: true)
|
||||
String? start_time;
|
||||
// @JsonKey(ignore: true)
|
||||
String? end_time;
|
||||
// @JsonKey(ignore: true)
|
||||
String? query_person_type;
|
||||
// @JsonKey(ignore: true)
|
||||
String? page;
|
||||
// @JsonKey(ignore: true)
|
||||
String? limit;
|
||||
|
||||
Person();
|
||||
|
||||
// 从JSON中反序列化
|
||||
static Person fromJson(Map<String, dynamic> json) => _$PersonFromJson(json);
|
||||
|
||||
// 转换成JSON
|
||||
Map<String, dynamic> toJson() => _$PersonToJson(this);
|
||||
|
||||
static Person fromQueryParameters(
|
||||
Map<String, String> queryParameters, Map<String, dynamic> jwt) {
|
||||
var json = <String, dynamic>{};
|
||||
queryParameters.forEach((key, value) {
|
||||
json[key] = value;
|
||||
});
|
||||
json['tid'] = jwt['tid'];
|
||||
json['level'] = jwt['level'];
|
||||
return Person.fromJson(json);
|
||||
}
|
||||
}
|
||||
90
bin/model/Person.g.dart
Normal file
90
bin/model/Person.g.dart
Normal file
@@ -0,0 +1,90 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'Person.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Person _$PersonFromJson(Map<String, dynamic> json) => Person()
|
||||
..id = json['_id'] as String?
|
||||
..room_id = json['room_id'] as String?
|
||||
..room_name = json['room_name'] as String?
|
||||
..bed_id = json['bed_id'] as String?
|
||||
..bed_name = json['bed_name'] as String?
|
||||
..check_in_start_time = (json['check_in_start_time'] as num?)?.toInt()
|
||||
..check_in_end_time = (json['check_in_end_time'] as num?)?.toInt()
|
||||
..contact_name = json['contact_name'] as String?
|
||||
..contact_relationship = json['contact_relationship'] as String?
|
||||
..contact_phone = json['contact_phone'] as String?
|
||||
..person_name = json['person_name'] as String?
|
||||
..gender = json['gender'] as String?
|
||||
..ethnicity = json['ethnicity'] as String?
|
||||
..person_type_id = json['person_type_id'] as String?
|
||||
..person_type_name = json['person_type_name'] as String?
|
||||
..id_card_number = json['id_card_number'] as String?
|
||||
..phone_number = json['phone_number'] as String?
|
||||
..service_level = json['service_level'] as String?
|
||||
..health_info = json['health_info'] as String?
|
||||
..height = json['height'] as String?
|
||||
..weight = json['weight'] as String?
|
||||
..tid = json['tid'] as String?
|
||||
..oid = json['oid'] as String?
|
||||
..deleted = (json['deleted'] as num?)?.toInt()
|
||||
..created_at = (json['created_at'] as num?)?.toInt()
|
||||
..updated_at = (json['updated_at'] as num?)?.toInt()
|
||||
..data_level = (json['data_level'] as num?)?.toInt()
|
||||
..age = json['age'] as String?
|
||||
..desc = json['desc'] as String?
|
||||
..level = (json['level'] as num?)?.toInt()
|
||||
..bed_ids = json['bed_ids'] as String?
|
||||
..query_gender = json['query_gender'] as String?
|
||||
..deviceID = json['deviceID'] as String?
|
||||
..status = json['status'] as String?
|
||||
..start_time = json['start_time'] as String?
|
||||
..end_time = json['end_time'] as String?
|
||||
..query_person_type = json['query_person_type'] as String?
|
||||
..page = json['page'] as String?
|
||||
..limit = json['limit'] as String?;
|
||||
|
||||
Map<String, dynamic> _$PersonToJson(Person instance) => <String, dynamic>{
|
||||
'_id': instance.id,
|
||||
'room_id': instance.room_id,
|
||||
'room_name': instance.room_name,
|
||||
'bed_id': instance.bed_id,
|
||||
'bed_name': instance.bed_name,
|
||||
'check_in_start_time': instance.check_in_start_time,
|
||||
'check_in_end_time': instance.check_in_end_time,
|
||||
'contact_name': instance.contact_name,
|
||||
'contact_relationship': instance.contact_relationship,
|
||||
'contact_phone': instance.contact_phone,
|
||||
'person_name': instance.person_name,
|
||||
'gender': instance.gender,
|
||||
'ethnicity': instance.ethnicity,
|
||||
'person_type_id': instance.person_type_id,
|
||||
'person_type_name': instance.person_type_name,
|
||||
'id_card_number': instance.id_card_number,
|
||||
'phone_number': instance.phone_number,
|
||||
'service_level': instance.service_level,
|
||||
'health_info': instance.health_info,
|
||||
'height': instance.height,
|
||||
'weight': instance.weight,
|
||||
'tid': instance.tid,
|
||||
'oid': instance.oid,
|
||||
'deleted': instance.deleted,
|
||||
'created_at': instance.created_at,
|
||||
'updated_at': instance.updated_at,
|
||||
'data_level': instance.data_level,
|
||||
'age': instance.age,
|
||||
'desc': instance.desc,
|
||||
'level': instance.level,
|
||||
'bed_ids': instance.bed_ids,
|
||||
'query_gender': instance.query_gender,
|
||||
'deviceID': instance.deviceID,
|
||||
'status': instance.status,
|
||||
'start_time': instance.start_time,
|
||||
'end_time': instance.end_time,
|
||||
'query_person_type': instance.query_person_type,
|
||||
'page': instance.page,
|
||||
'limit': instance.limit,
|
||||
};
|
||||
40
bin/model/PersonType.dart
Normal file
40
bin/model/PersonType.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'PersonType.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class PersonType {
|
||||
@JsonKey(name: '_id')
|
||||
String? id; // 人员类型id
|
||||
String? person_type_name; // 人员类型名称
|
||||
String? description; // 类型描述
|
||||
int? created_at; // 创建时间(毫秒数)
|
||||
int? updated_at; // 更新时间(毫秒数)
|
||||
String? created_by_id; // 创建人ID
|
||||
String? created_by_name; // 创建人名称
|
||||
String? updated_by_id; // 更新人ID
|
||||
String? updated_by_name; // 更新人名称
|
||||
int? deleted; // 是否删除(逻辑删除标识)
|
||||
String? oid; // 机构ID
|
||||
|
||||
String? tid; // 所属机构
|
||||
int? level; // 权限等级
|
||||
PersonType();
|
||||
|
||||
// 从JSON中反序列化
|
||||
static PersonType fromJson(Map<String, dynamic> json) =>
|
||||
_$PersonTypeFromJson(json);
|
||||
|
||||
// 转换成JSON
|
||||
Map<String, dynamic> toJson() => _$PersonTypeToJson(this);
|
||||
|
||||
static PersonType fromQueryParameters(Map<String, String> queryParameters, Map<String, dynamic> jwt) {
|
||||
var json = <String, dynamic>{};
|
||||
queryParameters.forEach((key, value) {
|
||||
json[key] = value;
|
||||
});
|
||||
json['tid'] = jwt['tid'];
|
||||
json['level'] = jwt['level'];
|
||||
return PersonType.fromJson(json);
|
||||
}
|
||||
}
|
||||
39
bin/model/PersonType.g.dart
Normal file
39
bin/model/PersonType.g.dart
Normal file
@@ -0,0 +1,39 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'PersonType.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
PersonType _$PersonTypeFromJson(Map<String, dynamic> json) => PersonType()
|
||||
..id = json['_id'] as String?
|
||||
..person_type_name = json['person_type_name'] as String?
|
||||
..description = json['description'] as String?
|
||||
..created_at = (json['created_at'] as num?)?.toInt()
|
||||
..updated_at = (json['updated_at'] as num?)?.toInt()
|
||||
..created_by_id = json['created_by_id'] as String?
|
||||
..created_by_name = json['created_by_name'] as String?
|
||||
..updated_by_id = json['updated_by_id'] as String?
|
||||
..updated_by_name = json['updated_by_name'] as String?
|
||||
..deleted = (json['deleted'] as num?)?.toInt()
|
||||
..oid = json['oid'] as String?
|
||||
..tid = json['tid'] as String?
|
||||
..level = (json['level'] as num?)?.toInt();
|
||||
|
||||
Map<String, dynamic> _$PersonTypeToJson(PersonType instance) =>
|
||||
<String, dynamic>{
|
||||
'_id': instance.id,
|
||||
'person_type_name': instance.person_type_name,
|
||||
'description': instance.description,
|
||||
'created_at': instance.created_at,
|
||||
'updated_at': instance.updated_at,
|
||||
'created_by_id': instance.created_by_id,
|
||||
'created_by_name': instance.created_by_name,
|
||||
'updated_by_id': instance.updated_by_id,
|
||||
'updated_by_name': instance.updated_by_name,
|
||||
'deleted': instance.deleted,
|
||||
'oid': instance.oid,
|
||||
'tid': instance.tid,
|
||||
'level': instance.level,
|
||||
};
|
||||
47
bin/model/Reservation.dart
Normal file
47
bin/model/Reservation.dart
Normal file
@@ -0,0 +1,47 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'Reservation.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class Reservation {
|
||||
int? created_at; // 创建时间(毫秒数)
|
||||
String? created_by_name; // 创建人名称
|
||||
int? updated_at; // 更新时间(毫秒数)
|
||||
String? updated_by_name; // 更新人名称
|
||||
int? deleted; // 是否删除(逻辑删除标识)
|
||||
String? room_id; // 房间ID
|
||||
String? bed_id; // 床位ID
|
||||
int? start_time; // 开始时间(毫秒数)
|
||||
int? end_time; // 结束时间(毫秒数)
|
||||
int? total_days; // 总天数
|
||||
String? contact_name; // 联系人名称
|
||||
String? relationship_type; // 关系类型
|
||||
String? phone_number; // 手机号码
|
||||
int? oid; // 机构id
|
||||
String? desc; // 备注
|
||||
@JsonKey(name: '_id')
|
||||
String? id; // ID
|
||||
|
||||
String? tid; // 所属机构
|
||||
int? level; // 权限等级
|
||||
|
||||
Reservation();
|
||||
|
||||
// 从JSON中反序列化
|
||||
static Reservation fromJson(Map<String, dynamic> json) =>
|
||||
_$ReservationFromJson(json);
|
||||
|
||||
// 转换成JSON
|
||||
Map<String, dynamic> toJson() => _$ReservationToJson(this);
|
||||
|
||||
// 辅助方法:从查询参数生成对象
|
||||
static Reservation fromQueryParameters(Map<String, String> queryParameters, Map<String, dynamic> jwt) {
|
||||
var json = <String, dynamic>{};
|
||||
queryParameters.forEach((key, value) {
|
||||
json[key] = value;
|
||||
});
|
||||
json['tid'] = jwt['tid'];
|
||||
json['level'] = jwt['level'];
|
||||
return Reservation.fromJson(json);
|
||||
}
|
||||
}
|
||||
49
bin/model/Reservation.g.dart
Normal file
49
bin/model/Reservation.g.dart
Normal file
@@ -0,0 +1,49 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'Reservation.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Reservation _$ReservationFromJson(Map<String, dynamic> json) => Reservation()
|
||||
..created_at = (json['created_at'] as num?)?.toInt()
|
||||
..created_by_name = json['created_by_name'] as String?
|
||||
..updated_at = (json['updated_at'] as num?)?.toInt()
|
||||
..updated_by_name = json['updated_by_name'] as String?
|
||||
..deleted = (json['deleted'] as num?)?.toInt()
|
||||
..room_id = json['room_id'] as String?
|
||||
..bed_id = json['bed_id'] as String?
|
||||
..start_time = (json['start_time'] as num?)?.toInt()
|
||||
..end_time = (json['end_time'] as num?)?.toInt()
|
||||
..total_days = (json['total_days'] as num?)?.toInt()
|
||||
..contact_name = json['contact_name'] as String?
|
||||
..relationship_type = json['relationship_type'] as String?
|
||||
..phone_number = json['phone_number'] as String?
|
||||
..oid = (json['oid'] as num?)?.toInt()
|
||||
..desc = json['desc'] as String?
|
||||
..id = json['_id'] as String?
|
||||
..tid = json['tid'] as String?
|
||||
..level = (json['level'] as num?)?.toInt();
|
||||
|
||||
Map<String, dynamic> _$ReservationToJson(Reservation instance) =>
|
||||
<String, dynamic>{
|
||||
'created_at': instance.created_at,
|
||||
'created_by_name': instance.created_by_name,
|
||||
'updated_at': instance.updated_at,
|
||||
'updated_by_name': instance.updated_by_name,
|
||||
'deleted': instance.deleted,
|
||||
'room_id': instance.room_id,
|
||||
'bed_id': instance.bed_id,
|
||||
'start_time': instance.start_time,
|
||||
'end_time': instance.end_time,
|
||||
'total_days': instance.total_days,
|
||||
'contact_name': instance.contact_name,
|
||||
'relationship_type': instance.relationship_type,
|
||||
'phone_number': instance.phone_number,
|
||||
'oid': instance.oid,
|
||||
'desc': instance.desc,
|
||||
'_id': instance.id,
|
||||
'tid': instance.tid,
|
||||
'level': instance.level,
|
||||
};
|
||||
52
bin/model/Room.dart
Normal file
52
bin/model/Room.dart
Normal file
@@ -0,0 +1,52 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'Room.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class Room {
|
||||
@JsonKey(name: '_id')
|
||||
String? id; // 房间id
|
||||
String? room_name; // 房间名称
|
||||
String? room_desc; // 房间描述
|
||||
double? bed_num; // 总床位数
|
||||
double? bed_num_use; // 剩余可用床位数
|
||||
String? room_type; // 房间类型
|
||||
// @JsonKey(ignore: true)
|
||||
String? room_type_name; // 房间类型名称
|
||||
List<String>? imgs; // 图片地址列表
|
||||
int? deleted; //是否删除
|
||||
int? created_at; // 创建时间(毫秒)
|
||||
int? updated_at; // 更新时间(毫秒)
|
||||
String? created_by_id; // 创建人ID
|
||||
String? created_by_name; // 创建人名称
|
||||
String? updated_by_id; // 更新人ID
|
||||
String? updated_by_name; // 更新人名称
|
||||
String? oid; // 机构ID
|
||||
@JsonKey(ignore: true)
|
||||
int? start_time;
|
||||
@JsonKey(ignore: true)
|
||||
int? end_time;
|
||||
String? area_id; // 区域ID
|
||||
String? area_name; // 区域名称
|
||||
|
||||
String? tid; // 所属机构
|
||||
int? level; // 权限等级
|
||||
int? bed_count;//床位总数
|
||||
int? bed_use_count;//床位为使用
|
||||
|
||||
Room();
|
||||
static Room fromJson(Map<String, dynamic> json) => _$RoomFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$RoomToJson(this);
|
||||
|
||||
// 使用查询参数填充 RoomType 对象
|
||||
static Room fromQueryParameters(
|
||||
Map<String, String> queryParameters, Map<String, dynamic> jwt) {
|
||||
var json = <String, dynamic>{};
|
||||
queryParameters.forEach((key, value) {
|
||||
json[key] = value;
|
||||
});
|
||||
json['tid'] = jwt['tid'];
|
||||
json['level'] = jwt['level'];
|
||||
return Room.fromJson(json);
|
||||
}
|
||||
}
|
||||
56
bin/model/Room.g.dart
Normal file
56
bin/model/Room.g.dart
Normal file
@@ -0,0 +1,56 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'Room.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Room _$RoomFromJson(Map<String, dynamic> json) => Room()
|
||||
..id = json['_id'] as String?
|
||||
..room_name = json['room_name'] as String?
|
||||
..room_desc = json['room_desc'] as String?
|
||||
..bed_num = (json['bed_num'] as num?)?.toDouble()
|
||||
..bed_num_use = (json['bed_num_use'] as num?)?.toDouble()
|
||||
..room_type = json['room_type'] as String?
|
||||
..room_type_name = json['room_type_name'] as String?
|
||||
..imgs = (json['imgs'] as List<dynamic>?)?.map((e) => e as String).toList()
|
||||
..deleted = (json['deleted'] as num?)?.toInt()
|
||||
..created_at = (json['created_at'] as num?)?.toInt()
|
||||
..updated_at = (json['updated_at'] as num?)?.toInt()
|
||||
..created_by_id = json['created_by_id'] as String?
|
||||
..created_by_name = json['created_by_name'] as String?
|
||||
..updated_by_id = json['updated_by_id'] as String?
|
||||
..updated_by_name = json['updated_by_name'] as String?
|
||||
..oid = json['oid'] as String?
|
||||
..area_id = json['area_id'] as String?
|
||||
..area_name = json['area_name'] as String?
|
||||
..tid = json['tid'] as String?
|
||||
..level = (json['level'] as num?)?.toInt()
|
||||
..bed_count = (json['bed_count'] as num?)?.toInt()
|
||||
..bed_use_count = (json['bed_use_count'] as num?)?.toInt();
|
||||
|
||||
Map<String, dynamic> _$RoomToJson(Room instance) => <String, dynamic>{
|
||||
'_id': instance.id,
|
||||
'room_name': instance.room_name,
|
||||
'room_desc': instance.room_desc,
|
||||
'bed_num': instance.bed_num,
|
||||
'bed_num_use': instance.bed_num_use,
|
||||
'room_type': instance.room_type,
|
||||
'room_type_name': instance.room_type_name,
|
||||
'imgs': instance.imgs,
|
||||
'deleted': instance.deleted,
|
||||
'created_at': instance.created_at,
|
||||
'updated_at': instance.updated_at,
|
||||
'created_by_id': instance.created_by_id,
|
||||
'created_by_name': instance.created_by_name,
|
||||
'updated_by_id': instance.updated_by_id,
|
||||
'updated_by_name': instance.updated_by_name,
|
||||
'oid': instance.oid,
|
||||
'area_id': instance.area_id,
|
||||
'area_name': instance.area_name,
|
||||
'tid': instance.tid,
|
||||
'level': instance.level,
|
||||
'bed_count': instance.bed_count,
|
||||
'bed_use_count': instance.bed_use_count,
|
||||
};
|
||||
26
bin/model/RoomTest.dart
Normal file
26
bin/model/RoomTest.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'RoomTest.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class RoomTest {
|
||||
String? room_id; // 房间id
|
||||
String? room_name; // 房间名称
|
||||
String? room_desc; // 房间描述
|
||||
double? bed_num; // 总床位数
|
||||
double? bed_num_use; // 剩余可用床位数
|
||||
String? room_type; // 房间类型
|
||||
List<String>? imgs; // 图片地址列表
|
||||
String? oid; // 机构ID
|
||||
int? deleted; //是否删除
|
||||
int? created_at; // 创建时间(毫秒)
|
||||
int? updated_at; // 更新时间(毫秒)
|
||||
String? created_by_id; // 创建人ID
|
||||
String? created_by_name; // 创建人名称
|
||||
String? updated_by_id; // 更新人ID
|
||||
String? updated_by_name; // 更新人名称
|
||||
|
||||
RoomTest();
|
||||
static RoomTest fromJson(Map<String, dynamic> json) => _$RoomTestFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$RoomTestToJson(this);
|
||||
}
|
||||
42
bin/model/RoomTest.g.dart
Normal file
42
bin/model/RoomTest.g.dart
Normal file
@@ -0,0 +1,42 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'RoomTest.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
RoomTest _$RoomTestFromJson(Map<String, dynamic> json) => RoomTest()
|
||||
..room_id = json['room_id'] as String?
|
||||
..room_name = json['room_name'] as String?
|
||||
..room_desc = json['room_desc'] as String?
|
||||
..bed_num = (json['bed_num'] as num?)?.toDouble()
|
||||
..bed_num_use = (json['bed_num_use'] as num?)?.toDouble()
|
||||
..room_type = json['room_type'] as String?
|
||||
..imgs = (json['imgs'] as List<dynamic>?)?.map((e) => e as String).toList()
|
||||
..oid = json['oid'] as String?
|
||||
..deleted = (json['deleted'] as num?)?.toInt()
|
||||
..created_at = (json['created_at'] as num?)?.toInt()
|
||||
..updated_at = (json['updated_at'] as num?)?.toInt()
|
||||
..created_by_id = json['created_by_id'] as String?
|
||||
..created_by_name = json['created_by_name'] as String?
|
||||
..updated_by_id = json['updated_by_id'] as String?
|
||||
..updated_by_name = json['updated_by_name'] as String?;
|
||||
|
||||
Map<String, dynamic> _$RoomTestToJson(RoomTest instance) => <String, dynamic>{
|
||||
'room_id': instance.room_id,
|
||||
'room_name': instance.room_name,
|
||||
'room_desc': instance.room_desc,
|
||||
'bed_num': instance.bed_num,
|
||||
'bed_num_use': instance.bed_num_use,
|
||||
'room_type': instance.room_type,
|
||||
'imgs': instance.imgs,
|
||||
'oid': instance.oid,
|
||||
'deleted': instance.deleted,
|
||||
'created_at': instance.created_at,
|
||||
'updated_at': instance.updated_at,
|
||||
'created_by_id': instance.created_by_id,
|
||||
'created_by_name': instance.created_by_name,
|
||||
'updated_by_id': instance.updated_by_id,
|
||||
'updated_by_name': instance.updated_by_name,
|
||||
};
|
||||
47
bin/model/RoomType.dart
Normal file
47
bin/model/RoomType.dart
Normal file
@@ -0,0 +1,47 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'RoomType.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class RoomType {
|
||||
@JsonKey(name: '_id')
|
||||
String? id; // 房间类型ID
|
||||
String? room_type_name; // 房间类型名称
|
||||
String? description; // 房间类型描述
|
||||
int? created_at; // 创建时间(毫秒)
|
||||
int? updated_at; // 更新时间(毫秒)
|
||||
String? created_by_id; // 创建人ID
|
||||
String? created_by_name; // 创建人名称
|
||||
String? updated_by_id; // 更新人ID
|
||||
String? updated_by_name; // 更新人名称
|
||||
String? oid; //机构id
|
||||
@JsonKey(ignore: true)
|
||||
int? start_time;
|
||||
@JsonKey(ignore: true)
|
||||
int? end_time;
|
||||
int? deleted;
|
||||
|
||||
String? tid; // 所属机构
|
||||
int? level; // 权限等级
|
||||
|
||||
RoomType();
|
||||
|
||||
// 从 JSON 中生成 RoomType 对象
|
||||
static RoomType fromJson(Map<String, dynamic> json) =>
|
||||
_$RoomTypeFromJson(json);
|
||||
|
||||
// 将 RoomType 对象转化为 JSON
|
||||
Map<String, dynamic> toJson() => _$RoomTypeToJson(this);
|
||||
|
||||
// 使用查询参数填充 RoomType 对象
|
||||
static RoomType fromQueryParameters(
|
||||
Map<String, String> queryParameters, Map<String, dynamic> jwt) {
|
||||
var json = <String, dynamic>{};
|
||||
queryParameters.forEach((key, value) {
|
||||
json[key] = value;
|
||||
});
|
||||
json['tid'] = jwt['tid'];
|
||||
json['level'] = jwt['level'];
|
||||
return RoomType.fromJson(json);
|
||||
}
|
||||
}
|
||||
38
bin/model/RoomType.g.dart
Normal file
38
bin/model/RoomType.g.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'RoomType.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
RoomType _$RoomTypeFromJson(Map<String, dynamic> json) => RoomType()
|
||||
..id = json['_id'] as String?
|
||||
..room_type_name = json['room_type_name'] as String?
|
||||
..description = json['description'] as String?
|
||||
..created_at = (json['created_at'] as num?)?.toInt()
|
||||
..updated_at = (json['updated_at'] as num?)?.toInt()
|
||||
..created_by_id = json['created_by_id'] as String?
|
||||
..created_by_name = json['created_by_name'] as String?
|
||||
..updated_by_id = json['updated_by_id'] as String?
|
||||
..updated_by_name = json['updated_by_name'] as String?
|
||||
..oid = json['oid'] as String?
|
||||
..deleted = (json['deleted'] as num?)?.toInt()
|
||||
..tid = json['tid'] as String?
|
||||
..level = (json['level'] as num?)?.toInt();
|
||||
|
||||
Map<String, dynamic> _$RoomTypeToJson(RoomType instance) => <String, dynamic>{
|
||||
'_id': instance.id,
|
||||
'room_type_name': instance.room_type_name,
|
||||
'description': instance.description,
|
||||
'created_at': instance.created_at,
|
||||
'updated_at': instance.updated_at,
|
||||
'created_by_id': instance.created_by_id,
|
||||
'created_by_name': instance.created_by_name,
|
||||
'updated_by_id': instance.updated_by_id,
|
||||
'updated_by_name': instance.updated_by_name,
|
||||
'oid': instance.oid,
|
||||
'deleted': instance.deleted,
|
||||
'tid': instance.tid,
|
||||
'level': instance.level,
|
||||
};
|
||||
33
bin/model/StatisticsResult.dart
Normal file
33
bin/model/StatisticsResult.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'StatisticsResult.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class StatisticsResult {
|
||||
@JsonKey(name: '_id')
|
||||
String? id; // ID
|
||||
int? type; // type 1睡眠评分统计 2.hrv统计
|
||||
int? start_time; // 开始时间
|
||||
int? end_time; // 结束时间
|
||||
String? data; // 统计数据
|
||||
StatisticsResult();
|
||||
|
||||
// 从 JSON 中生成 RoomType 对象
|
||||
static StatisticsResult fromJson(Map<String, dynamic> json) =>
|
||||
_$StatisticsResultFromJson(json);
|
||||
|
||||
// 将 RoomType 对象转化为 JSON
|
||||
Map<String, dynamic> toJson() => _$StatisticsResultToJson(this);
|
||||
|
||||
// 使用查询参数填充 RoomType 对象
|
||||
static StatisticsResult fromQueryParameters(
|
||||
Map<String, String> queryParameters, Map<String, dynamic> jwt) {
|
||||
var json = <String, dynamic>{};
|
||||
queryParameters.forEach((key, value) {
|
||||
json[key] = value;
|
||||
});
|
||||
json['tid'] = jwt['tid'];
|
||||
json['level'] = jwt['level'];
|
||||
return StatisticsResult.fromJson(json);
|
||||
}
|
||||
}
|
||||
24
bin/model/StatisticsResult.g.dart
Normal file
24
bin/model/StatisticsResult.g.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'StatisticsResult.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
StatisticsResult _$StatisticsResultFromJson(Map<String, dynamic> json) =>
|
||||
StatisticsResult()
|
||||
..id = json['_id'] as String?
|
||||
..type = (json['type'] as num?)?.toInt()
|
||||
..start_time = (json['start_time'] as num?)?.toInt()
|
||||
..end_time = (json['end_time'] as num?)?.toInt()
|
||||
..data = json['data'] as String?;
|
||||
|
||||
Map<String, dynamic> _$StatisticsResultToJson(StatisticsResult instance) =>
|
||||
<String, dynamic>{
|
||||
'_id': instance.id,
|
||||
'type': instance.type,
|
||||
'start_time': instance.start_time,
|
||||
'end_time': instance.end_time,
|
||||
'data': instance.data,
|
||||
};
|
||||
1
bin/model/Test.dart
Normal file
1
bin/model/Test.dart
Normal file
@@ -0,0 +1 @@
|
||||
class Test {}
|
||||
18
bin/model/WebSocketMessage.dart
Normal file
18
bin/model/WebSocketMessage.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'WebSocketMessage.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class WebSocketMessage {
|
||||
String path;
|
||||
int? type;
|
||||
dynamic data;
|
||||
String? to;
|
||||
String? mac;
|
||||
|
||||
WebSocketMessage({required this.path, this.type, this.data, this.to,this.mac});
|
||||
|
||||
static WebSocketMessage fromJson(Map<String, dynamic> json) =>
|
||||
_$WebSocketMessageFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$WebSocketMessageToJson(this);
|
||||
}
|
||||
25
bin/model/WebSocketMessage.g.dart
Normal file
25
bin/model/WebSocketMessage.g.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'WebSocketMessage.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
WebSocketMessage _$WebSocketMessageFromJson(Map<String, dynamic> json) =>
|
||||
WebSocketMessage(
|
||||
path: json['path'] as String,
|
||||
type: (json['type'] as num?)?.toInt(),
|
||||
data: json['data'],
|
||||
to: json['to'] as String?,
|
||||
mac: json['mac'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$WebSocketMessageToJson(WebSocketMessage instance) =>
|
||||
<String, dynamic>{
|
||||
'path': instance.path,
|
||||
'type': instance.type,
|
||||
'data': instance.data,
|
||||
'to': instance.to,
|
||||
'mac': instance.mac,
|
||||
};
|
||||
29
bin/model/api_response.dart
Normal file
29
bin/model/api_response.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
class ApiResponse<T> {
|
||||
int? code;
|
||||
T? data;
|
||||
String? msg;
|
||||
int? total;
|
||||
dynamic rawResponse; // 原始 Dio 响应对象
|
||||
|
||||
ApiResponse({
|
||||
required this.code,
|
||||
this.data,
|
||||
this.msg,
|
||||
this.total,
|
||||
this.rawResponse,
|
||||
});
|
||||
|
||||
factory ApiResponse.fromJson(
|
||||
Map<String, dynamic> json,
|
||||
T Function(Object?) fromJsonT, {
|
||||
dynamic rawResponse,
|
||||
}) {
|
||||
return ApiResponse<T>(
|
||||
code: json['code'] as int?,
|
||||
data: json['data'] != null ? fromJsonT(json['data']) : null,
|
||||
msg: json['msg'] as String?,
|
||||
total: json['total'] as int?,
|
||||
rawResponse: rawResponse, // 保留 Dio 原始响应对象
|
||||
);
|
||||
}
|
||||
}
|
||||
19
bin/model/app_uri_status.dart
Normal file
19
bin/model/app_uri_status.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
// lib/http_status_codes.dart
|
||||
|
||||
class HttpStatusCodes {
|
||||
// Success codes
|
||||
static const int ok = 200;
|
||||
static const int created = 201;
|
||||
static const int accepted = 202;
|
||||
|
||||
// Client error codes
|
||||
static const int badRequest = 400;
|
||||
static const int unauthorized = 401;//401 参数错误
|
||||
static const int forbidden = 403;//403 禁止,多条数据,不允许修改
|
||||
static const int notFound = 404;//404 没有报告
|
||||
|
||||
// Server error codes
|
||||
static const int internalServerError = 500;//500 内部异常
|
||||
static const int notImplemented = 501;
|
||||
static const int serviceUnavailable = 503;
|
||||
}
|
||||
27
bin/model/dto/DiseaseStatistics.dart
Normal file
27
bin/model/dto/DiseaseStatistics.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import '../DiseaseType.dart';
|
||||
|
||||
part 'DiseaseStatistics.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class DiseaseStatistics {
|
||||
int? total; // 总数
|
||||
List<DiseaseType>? disease_type_list; // 疾病类型列表
|
||||
|
||||
DiseaseStatistics();
|
||||
|
||||
// 从JSON中反序列化
|
||||
static DiseaseStatistics fromJson(Map<String, dynamic> json) =>
|
||||
_$DiseaseStatisticsFromJson(json);
|
||||
|
||||
// 转换成JSON
|
||||
Map<String, dynamic> toJson() => _$DiseaseStatisticsToJson(this);
|
||||
|
||||
static DiseaseStatistics fromQueryParameters(Map<String, String> queryParameters) {
|
||||
var json = <String, dynamic>{};
|
||||
queryParameters.forEach((key, value) {
|
||||
json[key] = value;
|
||||
});
|
||||
return DiseaseStatistics.fromJson(json);
|
||||
}
|
||||
}
|
||||
20
bin/model/dto/DiseaseStatistics.g.dart
Normal file
20
bin/model/dto/DiseaseStatistics.g.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'DiseaseStatistics.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
DiseaseStatistics _$DiseaseStatisticsFromJson(Map<String, dynamic> json) =>
|
||||
DiseaseStatistics()
|
||||
..total = (json['total'] as num?)?.toInt()
|
||||
..disease_type_list = (json['disease_type_list'] as List<dynamic>?)
|
||||
?.map((e) => DiseaseType.fromJson(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
|
||||
Map<String, dynamic> _$DiseaseStatisticsToJson(DiseaseStatistics instance) =>
|
||||
<String, dynamic>{
|
||||
'total': instance.total,
|
||||
'disease_type_list': instance.disease_type_list,
|
||||
};
|
||||
Reference in New Issue
Block a user