123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- class UserEntity {
- String userId;
- String mobile;
- String name;
- String avatarUrl;
- String token;
- int userLevel;
- String userLevelName;
- MaintenanceCompany maintenanceCompany;
- Role role;
- List<AppMenus> appMenus;
- int expertFlag;
- int expertLevel;
- UserEntity(
- {this.userId,
- this.mobile,
- this.name,
- this.avatarUrl,
- this.token,
- this.userLevel,
- this.userLevelName,
- this.maintenanceCompany,
- this.role,
- this.expertFlag,
- this.expertLevel,
- this.appMenus});
- UserEntity.fromJsonMap(Map<String, dynamic> json) {
- userId = json['userId'];
- expertFlag = json['expertFlag'];
- expertLevel = json['expertLevel'];
- mobile = json['mobile'];
- name = json['name'];
- avatarUrl = json['avatarUrl'];
- token = json['token'];
- userLevel = json['userLevel'];
- userLevelName = json['userLevelName'];
- maintenanceCompany = json['maintenanceCompany'] != null
- ? new MaintenanceCompany.fromJsonMap(json['maintenanceCompany'])
- : null;
- role = json['role'] != null ? new Role.fromJsonMap(json['role']) : null;
- if (json['appMenus'] != null) {
- appMenus = new List<AppMenus>();
- json['appMenus'].forEach((v) {
- appMenus.add(new AppMenus.fromJsonMap(v));
- });
- }
- }
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['userId'] = this.userId;
- data['mobile'] = this.mobile;
- data['name'] = this.name;
- data['expertFlag'] = this.expertFlag;
- data['expertLevel'] = this.expertLevel;
- data['avatarUrl'] = this.avatarUrl;
- data['token'] = this.token;
- data['userLevel'] = this.userLevel;
- data['userLevelName'] = this.userLevelName;
- if (this.maintenanceCompany != null) {
- data['maintenanceCompany'] = this.maintenanceCompany.toJson();
- }
- if (this.role != null) {
- data['role'] = this.role.toJson();
- }
- if (this.appMenus != null) {
- data['appMenus'] = this.appMenus.map((v) => v.toJson()).toList();
- }
- return data;
- }
- }
- class MaintenanceCompany {
- String id;
- String name;
- String address;
- MaintenanceCompany({this.id, this.name, this.address});
- MaintenanceCompany.fromJsonMap(Map<String, dynamic> json) {
- id = json['id'];
- name = json['name'];
- address = json['address'];
- }
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['id'] = this.id;
- data['name'] = this.name;
- data['address'] = this.address;
- return data;
- }
- }
- class Role {
- String id;
- String name;
- String code;
- String description;
- Role({this.id, this.name, this.code, this.description});
- Role.fromJsonMap(Map<String, dynamic> json) {
- id = json['id'];
- name = json['name'];
- code = json['code'];
- description = json['description'];
- }
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['id'] = this.id;
- data['name'] = this.name;
- data['code'] = this.code;
- data['description'] = this.description;
- return data;
- }
- }
- class AppMenus {
- int id;
- String name;
- String router;
- int status;
- AppMenus({this.id, this.name, this.router, this.status});
- AppMenus.fromJsonMap(Map<String, dynamic> json) {
- id = json['id'];
- name = json['name'];
- router = json['router'];
- status = json['status'];
- }
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['id'] = this.id;
- data['name'] = this.name;
- data['router'] = this.router;
- data['status'] = this.status;
- return data;
- }
- }
|