2024-03-19 08:59:08 +08:00
|
|
|
import 'package:sk_base_mobile/models/role.model.dart';
|
|
|
|
|
2024-03-18 13:23:58 +08:00
|
|
|
class UserInfoModel {
|
2024-03-19 08:59:08 +08:00
|
|
|
int? id;
|
|
|
|
String? createdAt;
|
|
|
|
String? updatedAt;
|
|
|
|
String? username;
|
2024-03-18 13:23:58 +08:00
|
|
|
String? nickname;
|
|
|
|
String? avatar;
|
2024-03-19 08:59:08 +08:00
|
|
|
String? qq;
|
|
|
|
String? email;
|
|
|
|
String? phone;
|
|
|
|
String? remark;
|
|
|
|
int? status;
|
|
|
|
List<RoleModel>? roles;
|
2024-03-18 13:23:58 +08:00
|
|
|
|
2024-03-19 08:59:08 +08:00
|
|
|
UserInfoModel(
|
|
|
|
{this.id,
|
|
|
|
this.createdAt,
|
|
|
|
this.updatedAt,
|
|
|
|
this.username,
|
|
|
|
this.nickname,
|
|
|
|
this.avatar,
|
|
|
|
this.qq,
|
|
|
|
this.email,
|
|
|
|
this.phone,
|
|
|
|
this.remark,
|
|
|
|
this.status,
|
|
|
|
this.roles});
|
2024-03-18 13:23:58 +08:00
|
|
|
|
|
|
|
UserInfoModel.fromJson(Map<String, dynamic> json) {
|
2024-03-19 08:59:08 +08:00
|
|
|
id = json['id'];
|
|
|
|
createdAt = json['createdAt'];
|
|
|
|
updatedAt = json['updatedAt'];
|
|
|
|
username = json['username'];
|
2024-03-18 13:23:58 +08:00
|
|
|
nickname = json['nickname'];
|
|
|
|
avatar = json['avatar'];
|
2024-03-19 08:59:08 +08:00
|
|
|
qq = json['qq'];
|
|
|
|
email = json['email'];
|
|
|
|
phone = json['phone'];
|
|
|
|
remark = json['remark'];
|
|
|
|
status = json['status'];
|
|
|
|
if (json['roles'] != null) {
|
|
|
|
roles = <RoleModel>[];
|
|
|
|
json['roles'].forEach((v) {
|
|
|
|
roles!.add(RoleModel.fromJson(v));
|
2024-03-18 13:23:58 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
2024-03-19 08:59:08 +08:00
|
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
|
|
data['id'] = id;
|
|
|
|
data['createdAt'] = createdAt;
|
|
|
|
data['updatedAt'] = updatedAt;
|
|
|
|
data['username'] = username;
|
2024-03-18 13:23:58 +08:00
|
|
|
data['nickname'] = nickname;
|
|
|
|
data['avatar'] = avatar;
|
2024-03-19 08:59:08 +08:00
|
|
|
data['qq'] = qq;
|
|
|
|
data['email'] = email;
|
|
|
|
data['phone'] = phone;
|
|
|
|
data['remark'] = remark;
|
|
|
|
data['status'] = status;
|
|
|
|
if (roles != null) {
|
|
|
|
data['roles'] = roles!.map((v) => v.toJson()).toList();
|
2024-03-18 13:23:58 +08:00
|
|
|
}
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
}
|