/*
 * @Author: XianKaiQun
 * @Date: 2020-09-04 15:47:19
 * @LastEditors: XianKaiQun
 * @LastEditTime: 2020-09-04 15:52:47
 * @Description: 
 */

import 'package:wisdom_cli/wisdom_ui.dart';

///门禁列表
class DoorGroupModel implements WPickerEntity {
  String? doorGroupId;
  String? doorGroupName;
  bool? disabled;

  DoorGroupModel({
    this.doorGroupId,
    this.doorGroupName,
    this.disabled = false,
  });

  DoorGroupModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    doorGroupId = map['doorGroupId'];
    doorGroupName = map['doorGroupName'];
    disabled = map['disabled'] ?? this.disabled;
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['doorGroupId'] = this.doorGroupId;
    json['doorGroupName'] = this.doorGroupName;
    json['disabled'] = this.disabled;

    return json;
  }

  @override
  String get selectName => doorGroupName ?? '';

  @override
  Object get selectUnique => doorGroupId ?? '';

  @override
  bool get selectDisabled => this.disabled ?? false;
}
