import 'package:json_annotation/json_annotation.dart'; import '../DiseaseType.dart'; part 'DiseaseStatistics.g.dart'; @JsonSerializable() class DiseaseStatistics { int? total; // 总数 List? disease_type_list; // 疾病类型列表 DiseaseStatistics(); // 从JSON中反序列化 static DiseaseStatistics fromJson(Map json) => _$DiseaseStatisticsFromJson(json); // 转换成JSON Map toJson() => _$DiseaseStatisticsToJson(this); static DiseaseStatistics fromQueryParameters(Map queryParameters) { var json = {}; queryParameters.forEach((key, value) { json[key] = value; }); return DiseaseStatistics.fromJson(json); } }