123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626 |
- import 'liveConsultation.m.dart';
- import 'notification.m.dart';
- import 'device.m.dart';
- enum CustomTypeEnum {
- General,
- CustomFirst,
- }
- class CreateOrganizationRequest extends TokenRequest{
- String? code;
- String? provinceCode;
- String? cityCode;
- String? districtCode;
- String? townCode;
- String? residenceCode;
- String? organizationName;
- String? contactNumber;
- String? logoUrl;
- String? address;
- String? fatherCode;
- List<String>? featureCodes;
- CustomTypeEnum customType;
- List<String>? peripheralDeviceKeys;
- String? dynamicParameter;
- CreateOrganizationRequest({
- this.code,
- this.provinceCode,
- this.cityCode,
- this.districtCode,
- this.townCode,
- this.residenceCode,
- this.organizationName,
- this.contactNumber,
- this.logoUrl,
- this.address,
- this.fatherCode,
- this.featureCodes,
- this.customType = CustomTypeEnum.General,
- this.peripheralDeviceKeys,
- this.dynamicParameter,
- String? token,
- }) : super(
- token: token,
- );
- factory CreateOrganizationRequest.fromJson(Map<String, dynamic> map) {
- return CreateOrganizationRequest(
- code: map['Code'],
- provinceCode: map['ProvinceCode'],
- cityCode: map['CityCode'],
- districtCode: map['DistrictCode'],
- townCode: map['TownCode'],
- residenceCode: map['ResidenceCode'],
- organizationName: map['OrganizationName'],
- contactNumber: map['ContactNumber'],
- logoUrl: map['LogoUrl'],
- address: map['Address'],
- fatherCode: map['FatherCode'],
- featureCodes: map['FeatureCodes']?.cast<String>().toList(),
- customType: CustomTypeEnum.values.firstWhere((e) => e.index == map['CustomType']),
- peripheralDeviceKeys: map['PeripheralDeviceKeys']?.cast<String>().toList(),
- dynamicParameter: map['DynamicParameter'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- if (provinceCode != null)
- map['ProvinceCode'] = provinceCode;
- if (cityCode != null)
- map['CityCode'] = cityCode;
- if (districtCode != null)
- map['DistrictCode'] = districtCode;
- if (townCode != null)
- map['TownCode'] = townCode;
- if (residenceCode != null)
- map['ResidenceCode'] = residenceCode;
- if (organizationName != null)
- map['OrganizationName'] = organizationName;
- if (contactNumber != null)
- map['ContactNumber'] = contactNumber;
- if (logoUrl != null)
- map['LogoUrl'] = logoUrl;
- if (address != null)
- map['Address'] = address;
- if (fatherCode != null)
- map['FatherCode'] = fatherCode;
- if (featureCodes != null)
- map['FeatureCodes'] = featureCodes;
- map['CustomType'] = customType.index;
- if (peripheralDeviceKeys != null)
- map['PeripheralDeviceKeys'] = peripheralDeviceKeys;
- if (dynamicParameter != null)
- map['DynamicParameter'] = dynamicParameter;
- return map;
- }
- }
- class OrganizationDTO2 extends BaseDTO{
- String? code;
- String? provinceCode;
- String? cityCode;
- String? districtCode;
- String? townCode;
- String? residenceCode;
- String? townName;
- String? residenceName;
- String? organizationName;
- String? contactNumber;
- String? logoUrl;
- String? address;
- List<String>? directors;
- String? fatherCode;
- String? fatherName;
- List<String>? featureCodes;
- CustomTypeEnum customType;
- List<String>? peripheralDeviceKeys;
- String? dynamicParameter;
- String? organizationUniqueCode;
- OrganizationDTO2({
- this.code,
- this.provinceCode,
- this.cityCode,
- this.districtCode,
- this.townCode,
- this.residenceCode,
- this.townName,
- this.residenceName,
- this.organizationName,
- this.contactNumber,
- this.logoUrl,
- this.address,
- this.directors,
- this.fatherCode,
- this.fatherName,
- this.featureCodes,
- this.customType = CustomTypeEnum.General,
- this.peripheralDeviceKeys,
- this.dynamicParameter,
- this.organizationUniqueCode,
- DateTime? createTime,
- DateTime? updateTime,
- }) : super(
- createTime: createTime,
- updateTime: updateTime,
- );
- factory OrganizationDTO2.fromJson(Map<String, dynamic> map) {
- return OrganizationDTO2(
- code: map['Code'],
- provinceCode: map['ProvinceCode'],
- cityCode: map['CityCode'],
- districtCode: map['DistrictCode'],
- townCode: map['TownCode'],
- residenceCode: map['ResidenceCode'],
- townName: map['TownName'],
- residenceName: map['ResidenceName'],
- organizationName: map['OrganizationName'],
- contactNumber: map['ContactNumber'],
- logoUrl: map['LogoUrl'],
- address: map['Address'],
- directors: map['Directors']?.cast<String>().toList(),
- fatherCode: map['FatherCode'],
- fatherName: map['FatherName'],
- featureCodes: map['FeatureCodes']?.cast<String>().toList(),
- customType: CustomTypeEnum.values.firstWhere((e) => e.index == map['CustomType']),
- peripheralDeviceKeys: map['PeripheralDeviceKeys']?.cast<String>().toList(),
- dynamicParameter: map['DynamicParameter'],
- organizationUniqueCode: map['OrganizationUniqueCode'],
- createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
- updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- if (provinceCode != null)
- map['ProvinceCode'] = provinceCode;
- if (cityCode != null)
- map['CityCode'] = cityCode;
- if (districtCode != null)
- map['DistrictCode'] = districtCode;
- if (townCode != null)
- map['TownCode'] = townCode;
- if (residenceCode != null)
- map['ResidenceCode'] = residenceCode;
- if (townName != null)
- map['TownName'] = townName;
- if (residenceName != null)
- map['ResidenceName'] = residenceName;
- if (organizationName != null)
- map['OrganizationName'] = organizationName;
- if (contactNumber != null)
- map['ContactNumber'] = contactNumber;
- if (logoUrl != null)
- map['LogoUrl'] = logoUrl;
- if (address != null)
- map['Address'] = address;
- if (directors != null)
- map['Directors'] = directors;
- if (fatherCode != null)
- map['FatherCode'] = fatherCode;
- if (fatherName != null)
- map['FatherName'] = fatherName;
- if (featureCodes != null)
- map['FeatureCodes'] = featureCodes;
- map['CustomType'] = customType.index;
- if (peripheralDeviceKeys != null)
- map['PeripheralDeviceKeys'] = peripheralDeviceKeys;
- if (dynamicParameter != null)
- map['DynamicParameter'] = dynamicParameter;
- if (organizationUniqueCode != null)
- map['OrganizationUniqueCode'] = organizationUniqueCode;
- return map;
- }
- }
- class GetOrganizationRequest extends TokenRequest{
- String? code;
- GetOrganizationRequest({
- this.code,
- String? token,
- }) : super(
- token: token,
- );
- factory GetOrganizationRequest.fromJson(Map<String, dynamic> map) {
- return GetOrganizationRequest(
- code: map['Code'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- return map;
- }
- }
- class GetOrganizationByKeyRequest extends TokenRequest{
- String? key;
- String? value;
- GetOrganizationByKeyRequest({
- this.key,
- this.value,
- String? token,
- }) : super(
- token: token,
- );
- factory GetOrganizationByKeyRequest.fromJson(Map<String, dynamic> map) {
- return GetOrganizationByKeyRequest(
- key: map['Key'],
- value: map['Value'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (key != null)
- map['Key'] = key;
- if (value != null)
- map['Value'] = value;
- return map;
- }
- }
- class OrganizationPageRequest extends PageRequest{
- OrganizationPageRequest({
- int pageIndex = 0,
- int pageSize = 0,
- String? token,
- }) : super(
- pageIndex: pageIndex,
- pageSize: pageSize,
- token: token,
- );
- factory OrganizationPageRequest.fromJson(Map<String, dynamic> map) {
- return OrganizationPageRequest(
- pageIndex: map['PageIndex'],
- pageSize: map['PageSize'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- return map;
- }
- }
- class RemoveOrganizationRequest extends TokenRequest{
- String? code;
- RemoveOrganizationRequest({
- this.code,
- String? token,
- }) : super(
- token: token,
- );
- factory RemoveOrganizationRequest.fromJson(Map<String, dynamic> map) {
- return RemoveOrganizationRequest(
- code: map['Code'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- return map;
- }
- }
- class GetOrganizationListRequest extends TokenRequest{
- List<String>? codes;
- GetOrganizationListRequest({
- this.codes,
- String? token,
- }) : super(
- token: token,
- );
- factory GetOrganizationListRequest.fromJson(Map<String, dynamic> map) {
- return GetOrganizationListRequest(
- codes: map['Codes']?.cast<String>().toList(),
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (codes != null)
- map['Codes'] = codes;
- return map;
- }
- }
- class UpdateOrganizationRequest extends TokenRequest{
- String? code;
- String? provinceCode;
- String? cityCode;
- String? districtCode;
- String? townCode;
- String? residenceCode;
- String? organizationName;
- String? contactNumber;
- String? logoUrl;
- String? address;
- String? fatherCode;
- List<String>? featureCodes;
- CustomTypeEnum customType;
- List<String>? peripheralDeviceKeys;
- String? dynamicParameter;
- UpdateOrganizationRequest({
- this.code,
- this.provinceCode,
- this.cityCode,
- this.districtCode,
- this.townCode,
- this.residenceCode,
- this.organizationName,
- this.contactNumber,
- this.logoUrl,
- this.address,
- this.fatherCode,
- this.featureCodes,
- this.customType = CustomTypeEnum.General,
- this.peripheralDeviceKeys,
- this.dynamicParameter,
- String? token,
- }) : super(
- token: token,
- );
- factory UpdateOrganizationRequest.fromJson(Map<String, dynamic> map) {
- return UpdateOrganizationRequest(
- code: map['Code'],
- provinceCode: map['ProvinceCode'],
- cityCode: map['CityCode'],
- districtCode: map['DistrictCode'],
- townCode: map['TownCode'],
- residenceCode: map['ResidenceCode'],
- organizationName: map['OrganizationName'],
- contactNumber: map['ContactNumber'],
- logoUrl: map['LogoUrl'],
- address: map['Address'],
- fatherCode: map['FatherCode'],
- featureCodes: map['FeatureCodes']?.cast<String>().toList(),
- customType: CustomTypeEnum.values.firstWhere((e) => e.index == map['CustomType']),
- peripheralDeviceKeys: map['PeripheralDeviceKeys']?.cast<String>().toList(),
- dynamicParameter: map['DynamicParameter'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- if (provinceCode != null)
- map['ProvinceCode'] = provinceCode;
- if (cityCode != null)
- map['CityCode'] = cityCode;
- if (districtCode != null)
- map['DistrictCode'] = districtCode;
- if (townCode != null)
- map['TownCode'] = townCode;
- if (residenceCode != null)
- map['ResidenceCode'] = residenceCode;
- if (organizationName != null)
- map['OrganizationName'] = organizationName;
- if (contactNumber != null)
- map['ContactNumber'] = contactNumber;
- if (logoUrl != null)
- map['LogoUrl'] = logoUrl;
- if (address != null)
- map['Address'] = address;
- if (fatherCode != null)
- map['FatherCode'] = fatherCode;
- if (featureCodes != null)
- map['FeatureCodes'] = featureCodes;
- map['CustomType'] = customType.index;
- if (peripheralDeviceKeys != null)
- map['PeripheralDeviceKeys'] = peripheralDeviceKeys;
- if (dynamicParameter != null)
- map['DynamicParameter'] = dynamicParameter;
- return map;
- }
- }
- class TeamBaseDTO {
- String? teamName;
- String? code;
- TeamBaseDTO({
- this.teamName,
- this.code,
- });
- factory TeamBaseDTO.fromJson(Map<String, dynamic> map) {
- return TeamBaseDTO(
- teamName: map['TeamName'],
- code: map['Code'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (teamName != null) {
- map['TeamName'] = teamName;
- }
- if (code != null) {
- map['Code'] = code;
- }
- return map;
- }
- }
- class OrganizationTreeDTO extends BaseDTO{
- String? code;
- String? fatherCode;
- String? organizationName;
- List<TeamBaseDTO>? teams;
- OrganizationTreeDTO({
- this.code,
- this.fatherCode,
- this.organizationName,
- this.teams,
- DateTime? createTime,
- DateTime? updateTime,
- }) : super(
- createTime: createTime,
- updateTime: updateTime,
- );
- factory OrganizationTreeDTO.fromJson(Map<String, dynamic> map) {
- return OrganizationTreeDTO(
- code: map['Code'],
- fatherCode: map['FatherCode'],
- organizationName: map['OrganizationName'],
- teams: map['Teams'] != null ? (map['Teams'] as List).map((e)=>TeamBaseDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
- createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
- updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- if (fatherCode != null)
- map['FatherCode'] = fatherCode;
- if (organizationName != null)
- map['OrganizationName'] = organizationName;
- if (teams != null)
- map['Teams'] = teams;
- return map;
- }
- }
- class GetOrganizationTreeRequest extends TokenRequest{
- GetOrganizationTreeRequest({
- String? token,
- }) : super(
- token: token,
- );
- factory GetOrganizationTreeRequest.fromJson(Map<String, dynamic> map) {
- return GetOrganizationTreeRequest(
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- return map;
- }
- }
- class GetEnableDeviceKeysRequest extends TokenRequest{
- String? organizationCode;
- GetEnableDeviceKeysRequest({
- this.organizationCode,
- String? token,
- }) : super(
- token: token,
- );
- factory GetEnableDeviceKeysRequest.fromJson(Map<String, dynamic> map) {
- return GetEnableDeviceKeysRequest(
- organizationCode: map['OrganizationCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (organizationCode != null)
- map['OrganizationCode'] = organizationCode;
- return map;
- }
- }
- class DynamicParameterDTO {
- String? type;
- String? key;
- String? mode;
- DynamicParameterDTO({
- this.type,
- this.key,
- this.mode,
- });
- factory DynamicParameterDTO.fromJson(Map<String, dynamic> map) {
- return DynamicParameterDTO(
- type: map['Type'],
- key: map['Key'],
- mode: map['Mode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (type != null) {
- map['Type'] = type;
- }
- if (key != null) {
- map['Key'] = key;
- }
- if (mode != null) {
- map['Mode'] = mode;
- }
- return map;
- }
- }
- class GetDynamicParameterRequest extends TokenRequest{
- String? organizationCode;
- GetDynamicParameterRequest({
- this.organizationCode,
- String? token,
- }) : super(
- token: token,
- );
- factory GetDynamicParameterRequest.fromJson(Map<String, dynamic> map) {
- return GetDynamicParameterRequest(
- organizationCode: map['OrganizationCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (organizationCode != null)
- map['OrganizationCode'] = organizationCode;
- return map;
- }
- }
|