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 json) => _$PersonFromJson(json); // 转换成JSON Map toJson() => _$PersonToJson(this); static Person fromQueryParameters( Map queryParameters, Map jwt) { var json = {}; queryParameters.forEach((key, value) { json[key] = value; }); json['tid'] = jwt['tid']; json['level'] = jwt['level']; return Person.fromJson(json); } }