import 'notification.m.dart'; import 'liveConsultation.m.dart'; class UserRoleLanguageConfigDTO { String? language; String? roleName; String? description; List? fieldList; UserRoleLanguageConfigDTO({ this.language, this.roleName, this.description, this.fieldList, }); factory UserRoleLanguageConfigDTO.fromJson(Map map) { return UserRoleLanguageConfigDTO( language: map['Language'], roleName: map['RoleName'], description: map['Description'], fieldList: map['FieldList']?.cast().toList(), ); } Map toJson() { final map = Map(); if (language != null) { map['Language'] = language; } if (roleName != null) { map['RoleName'] = roleName; } if (description != null) { map['Description'] = description; } if (fieldList != null) { map['FieldList'] = fieldList; } return map; } } class BaseRoleDTO extends BaseDTO{ String? roleCode; String? roleName; String? description; List? languageConfigs; BaseRoleDTO({ this.roleCode, this.roleName, this.description, this.languageConfigs, DateTime? createTime, DateTime? updateTime, }) : super( createTime: createTime, updateTime: updateTime, ); factory BaseRoleDTO.fromJson(Map map) { return BaseRoleDTO( roleCode: map['RoleCode'], roleName: map['RoleName'], description: map['Description'], languageConfigs: map['LanguageConfigs'] != null ? (map['LanguageConfigs'] as List).map((e)=>UserRoleLanguageConfigDTO.fromJson(e as Map)).toList() : null, 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 (roleCode != null) map['RoleCode'] = roleCode; if (roleName != null) map['RoleName'] = roleName; if (description != null) map['Description'] = description; if (languageConfigs != null) map['LanguageConfigs'] = languageConfigs; return map; } } enum RoleShowTypeEnum { NotShow, ISShow, } enum RoleQualificationEnum { NoNeed, ID, DocLicense, Both, } class RoleDTO extends BaseRoleDTO{ RoleShowTypeEnum roleShowType; String? iConUrl; String? colorStart; String? colorEnd; RoleQualificationEnum roleQualification; String? userGroupCode; RoleShowTypeEnum fieldShowType; List? fieldList; RoleDTO({ this.roleShowType = RoleShowTypeEnum.NotShow, this.iConUrl, this.colorStart, this.colorEnd, this.roleQualification = RoleQualificationEnum.NoNeed, this.userGroupCode, this.fieldShowType = RoleShowTypeEnum.NotShow, this.fieldList, String? roleCode, String? roleName, String? description, List? languageConfigs, DateTime? createTime, DateTime? updateTime, }) : super( roleCode: roleCode, roleName: roleName, description: description, languageConfigs: languageConfigs, createTime: createTime, updateTime: updateTime, ); factory RoleDTO.fromJson(Map map) { return RoleDTO( roleShowType: RoleShowTypeEnum.values.firstWhere((e) => e.index == map['RoleShowType']), iConUrl: map['IConUrl'], colorStart: map['ColorStart'], colorEnd: map['ColorEnd'], roleQualification: RoleQualificationEnum.values.firstWhere((e) => e.index == map['RoleQualification']), userGroupCode: map['UserGroupCode'], fieldShowType: RoleShowTypeEnum.values.firstWhere((e) => e.index == map['FieldShowType']), fieldList: map['FieldList']?.cast().toList(), roleCode: map['RoleCode'], roleName: map['RoleName'], description: map['Description'], languageConfigs: map['LanguageConfigs'] != null ? (map['LanguageConfigs'] as List).map((e)=>UserRoleLanguageConfigDTO.fromJson(e as Map)).toList() : null, createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null, ); } Map toJson() { final map = super.toJson(); map['RoleShowType'] = roleShowType.index; if (iConUrl != null) map['IConUrl'] = iConUrl; if (colorStart != null) map['ColorStart'] = colorStart; if (colorEnd != null) map['ColorEnd'] = colorEnd; map['RoleQualification'] = roleQualification.index; if (userGroupCode != null) map['UserGroupCode'] = userGroupCode; map['FieldShowType'] = fieldShowType.index; if (fieldList != null) map['FieldList'] = fieldList; return map; } } class GetRoleByCodeRequest extends TokenRequest{ String? roleCode; String? language; GetRoleByCodeRequest({ this.roleCode, this.language, String? token, }) : super( token: token, ); factory GetRoleByCodeRequest.fromJson(Map map) { return GetRoleByCodeRequest( roleCode: map['RoleCode'], language: map['Language'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (roleCode != null) map['RoleCode'] = roleCode; if (language != null) map['Language'] = language; return map; } } class FindDefaultRolesRequest extends TokenRequest{ String? organizationCode; String? language; FindDefaultRolesRequest({ this.organizationCode, this.language, String? token, }) : super( token: token, ); factory FindDefaultRolesRequest.fromJson(Map map) { return FindDefaultRolesRequest( organizationCode: map['OrganizationCode'], language: map['Language'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (organizationCode != null) map['OrganizationCode'] = organizationCode; if (language != null) map['Language'] = language; return map; } } class FindAuthenticationRolesRequest extends TokenRequest{ String? language; FindAuthenticationRolesRequest({ this.language, String? token, }) : super( token: token, ); factory FindAuthenticationRolesRequest.fromJson(Map map) { return FindAuthenticationRolesRequest( language: map['Language'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (language != null) map['Language'] = language; return map; } }