123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320 |
- 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<String, dynamic> 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<String, dynamic> 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<String, dynamic> 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<String, dynamic> 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<String, dynamic> map) {
- return GetUserFeatureRequest(
- code: map['Code'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> 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<String, dynamic> map) {
- return GetUserFeatureByKeyRequest(
- 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 UserFeaturePageRequest extends PageRequest{
- UserFeaturePageRequest({
- int pageIndex = 0,
- int pageSize = 0,
- String? token,
- }) : super(
- pageIndex: pageIndex,
- pageSize: pageSize,
- token: token,
- );
- factory UserFeaturePageRequest.fromJson(Map<String, dynamic> map) {
- return UserFeaturePageRequest(
- pageIndex: map['PageIndex'],
- pageSize: map['PageSize'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> 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<String, dynamic> map) {
- return RemoveUserFeatureRequest(
- code: map['Code'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- return map;
- }
- }
- class GetUserFeatureListRequest extends TokenRequest{
- List<String>? codes;
- GetUserFeatureListRequest({
- this.codes,
- String? token,
- }) : super(
- token: token,
- );
- factory GetUserFeatureListRequest.fromJson(Map<String, dynamic> map) {
- return GetUserFeatureListRequest(
- 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 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<String, dynamic> 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<String, dynamic> 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;
- }
- }
|