import 'liveConsultation.m.dart'; import 'notification.m.dart'; import 'device.m.dart'; enum ApplicationTypeEnum { Web, App, } enum FeatureTypeEnum { Menu, Operation, } class CreateUserFeatureRequest extends TokenRequest{ String? code; String? featureName; String? featureShowName; String? description; String? fatherCode; int sort; ApplicationTypeEnum appType; FeatureTypeEnum featureType; CreateUserFeatureRequest({ this.code, this.featureName, this.featureShowName, this.description, this.fatherCode, this.sort = 0, this.appType = ApplicationTypeEnum.Web, this.featureType = FeatureTypeEnum.Menu, String? token, }) : super( token: token, ); factory CreateUserFeatureRequest.fromJson(Map map) { return CreateUserFeatureRequest( code: map['Code'], featureName: map['FeatureName'], featureShowName: map['FeatureShowName'], description: map['Description'], fatherCode: map['FatherCode'], sort: map['Sort'], appType: ApplicationTypeEnum.values.firstWhere((e) => e.index == map['AppType']), featureType: FeatureTypeEnum.values.firstWhere((e) => e.index == map['FeatureType']), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; if (featureName != null) map['FeatureName'] = featureName; if (featureShowName != null) map['FeatureShowName'] = featureShowName; if (description != null) map['Description'] = description; if (fatherCode != null) map['FatherCode'] = fatherCode; map['Sort'] = sort; map['AppType'] = appType.index; map['FeatureType'] = featureType.index; return map; } } class UserFeatureDTO extends BaseDTO{ String? code; String? featureName; String? featureShowName; String? description; String? fatherCode; int sort; ApplicationTypeEnum appType; FeatureTypeEnum featureType; UserFeatureDTO({ this.code, this.featureName, this.featureShowName, this.description, this.fatherCode, this.sort = 0, this.appType = ApplicationTypeEnum.Web, this.featureType = FeatureTypeEnum.Menu, DateTime? createTime, DateTime? updateTime, }) : super( createTime: createTime, updateTime: updateTime, ); factory UserFeatureDTO.fromJson(Map map) { return UserFeatureDTO( code: map['Code'], featureName: map['FeatureName'], featureShowName: map['FeatureShowName'], description: map['Description'], fatherCode: map['FatherCode'], sort: map['Sort'], appType: ApplicationTypeEnum.values.firstWhere((e) => e.index == map['AppType']), featureType: FeatureTypeEnum.values.firstWhere((e) => e.index == map['FeatureType']), 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 (featureName != null) map['FeatureName'] = featureName; if (featureShowName != null) map['FeatureShowName'] = featureShowName; if (description != null) map['Description'] = description; if (fatherCode != null) map['FatherCode'] = fatherCode; map['Sort'] = sort; map['AppType'] = appType.index; map['FeatureType'] = featureType.index; return map; } } class GetUserFeatureRequest extends TokenRequest{ String? code; GetUserFeatureRequest({ this.code, String? token, }) : super( token: token, ); factory GetUserFeatureRequest.fromJson(Map map) { return GetUserFeatureRequest( code: map['Code'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; return map; } } class GetUserFeatureByKeyRequest extends TokenRequest{ String? key; String? value; GetUserFeatureByKeyRequest({ this.key, this.value, String? token, }) : super( token: token, ); factory GetUserFeatureByKeyRequest.fromJson(Map map) { return GetUserFeatureByKeyRequest( 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 UserFeaturePageRequest extends PageRequest{ UserFeaturePageRequest({ int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory UserFeaturePageRequest.fromJson(Map map) { return UserFeaturePageRequest( pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); return map; } } class RemoveUserFeatureRequest extends TokenRequest{ String? code; RemoveUserFeatureRequest({ this.code, String? token, }) : super( token: token, ); factory RemoveUserFeatureRequest.fromJson(Map map) { return RemoveUserFeatureRequest( code: map['Code'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; return map; } } class GetUserFeatureListRequest extends TokenRequest{ List? codes; GetUserFeatureListRequest({ this.codes, String? token, }) : super( token: token, ); factory GetUserFeatureListRequest.fromJson(Map map) { return GetUserFeatureListRequest( codes: map['Codes']?.cast().toList(), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (codes != null) map['Codes'] = codes; return map; } } class UpdateUserFeatureRequest extends TokenRequest{ String? code; String? featureName; String? featureShowName; String? description; String? fatherCode; int sort; ApplicationTypeEnum appType; FeatureTypeEnum featureType; UpdateUserFeatureRequest({ this.code, this.featureName, this.featureShowName, this.description, this.fatherCode, this.sort = 0, this.appType = ApplicationTypeEnum.Web, this.featureType = FeatureTypeEnum.Menu, String? token, }) : super( token: token, ); factory UpdateUserFeatureRequest.fromJson(Map map) { return UpdateUserFeatureRequest( code: map['Code'], featureName: map['FeatureName'], featureShowName: map['FeatureShowName'], description: map['Description'], fatherCode: map['FatherCode'], sort: map['Sort'], appType: ApplicationTypeEnum.values.firstWhere((e) => e.index == map['AppType']), featureType: FeatureTypeEnum.values.firstWhere((e) => e.index == map['FeatureType']), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; if (featureName != null) map['FeatureName'] = featureName; if (featureShowName != null) map['FeatureShowName'] = featureShowName; if (description != null) map['Description'] = description; if (fatherCode != null) map['FatherCode'] = fatherCode; map['Sort'] = sort; map['AppType'] = appType.index; map['FeatureType'] = featureType.index; return map; } }