import 'liveConsultation.m.dart'; import 'notification.m.dart'; import 'device.m.dart'; enum DictionaryTypeEnum2 { Default, Label, Menu, DynamicType, } class CreateDictionaryRequest extends TokenRequest{ String? code; String? key; String? name; DictionaryTypeEnum2 type; String? description; CreateDictionaryRequest({ this.code, this.key, this.name, this.type = DictionaryTypeEnum2.Default, this.description, String? token, }) : super( token: token, ); factory CreateDictionaryRequest.fromJson(Map map) { return CreateDictionaryRequest( code: map['Code'], key: map['Key'], name: map['Name'], type: DictionaryTypeEnum2.values.firstWhere((e) => e.index == map['Type']), description: map['Description'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; if (key != null) map['Key'] = key; if (name != null) map['Name'] = name; map['Type'] = type.index; if (description != null) map['Description'] = description; return map; } } class DictionaryDTO2 extends BaseDTO{ String? code; String? key; String? name; DictionaryTypeEnum2 type; String? description; DictionaryDTO2({ this.code, this.key, this.name, this.type = DictionaryTypeEnum2.Default, this.description, DateTime? createTime, DateTime? updateTime, }) : super( createTime: createTime, updateTime: updateTime, ); factory DictionaryDTO2.fromJson(Map map) { return DictionaryDTO2( code: map['Code'], key: map['Key'], name: map['Name'], type: DictionaryTypeEnum2.values.firstWhere((e) => e.index == map['Type']), description: map['Description'], createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null, ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; if (key != null) map['Key'] = key; if (name != null) map['Name'] = name; map['Type'] = type.index; if (description != null) map['Description'] = description; return map; } } class GetDictionaryRequest extends TokenRequest{ String? code; GetDictionaryRequest({ this.code, String? token, }) : super( token: token, ); factory GetDictionaryRequest.fromJson(Map map) { return GetDictionaryRequest( code: map['Code'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; return map; } } class GetDictionaryByKeyRequest extends TokenRequest{ String? key; String? value; GetDictionaryByKeyRequest({ this.key, this.value, String? token, }) : super( token: token, ); factory GetDictionaryByKeyRequest.fromJson(Map map) { return GetDictionaryByKeyRequest( key: map['Key'], value: map['Value'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (key != null) map['Key'] = key; if (value != null) map['Value'] = value; return map; } } class DictionaryPageRequest extends PageRequest{ DictionaryPageRequest({ int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory DictionaryPageRequest.fromJson(Map map) { return DictionaryPageRequest( pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); return map; } } class RemoveDictionaryRequest extends TokenRequest{ String? code; RemoveDictionaryRequest({ this.code, String? token, }) : super( token: token, ); factory RemoveDictionaryRequest.fromJson(Map map) { return RemoveDictionaryRequest( code: map['Code'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; return map; } } class GetDictionaryListRequest extends TokenRequest{ List? codes; GetDictionaryListRequest({ this.codes, String? token, }) : super( token: token, ); factory GetDictionaryListRequest.fromJson(Map map) { return GetDictionaryListRequest( codes: map['Codes']?.cast().toList(), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (codes != null) map['Codes'] = codes; return map; } } class UpdateDictionaryRequest extends TokenRequest{ String? code; String? key; String? name; DictionaryTypeEnum2 type; String? description; UpdateDictionaryRequest({ this.code, this.key, this.name, this.type = DictionaryTypeEnum2.Default, this.description, String? token, }) : super( token: token, ); factory UpdateDictionaryRequest.fromJson(Map map) { return UpdateDictionaryRequest( code: map['Code'], key: map['Key'], name: map['Name'], type: DictionaryTypeEnum2.values.firstWhere((e) => e.index == map['Type']), description: map['Description'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; if (key != null) map['Key'] = key; if (name != null) map['Name'] = name; map['Type'] = type.index; if (description != null) map['Description'] = description; return map; } } class DictionaryWithUnitDTO extends DictionaryDTO2{ String? unit; DictionaryWithUnitDTO({ this.unit, String? code, String? key, String? name, DictionaryTypeEnum2 type = DictionaryTypeEnum2.Default, String? description, DateTime? createTime, DateTime? updateTime, }) : super( code: code, key: key, name: name, type: type, description: description, createTime: createTime, updateTime: updateTime, ); factory DictionaryWithUnitDTO.fromJson(Map map) { return DictionaryWithUnitDTO( unit: map['Unit'], code: map['Code'], key: map['Key'], name: map['Name'], type: DictionaryTypeEnum2.values.firstWhere((e) => e.index == map['Type']), description: map['Description'], createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null, ); } Map toJson() { final map = super.toJson(); if (unit != null) map['Unit'] = unit; return map; } } class GetDictionaryNameAndUnitByKeysRequest extends TokenRequest{ List? keys; GetDictionaryNameAndUnitByKeysRequest({ this.keys, String? token, }) : super( token: token, ); factory GetDictionaryNameAndUnitByKeysRequest.fromJson(Map map) { return GetDictionaryNameAndUnitByKeysRequest( keys: map['Keys']?.cast().toList(), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (keys != null) map['Keys'] = keys; return map; } }