From c232a1a0ca7fee6db6675505a5123c64e1fb8fd5 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Sat, 20 Feb 2021 14:52:29 +0800 Subject: [PATCH] refactor userInfoModel --- lib/models/user/user_info_model.dart | 111 ++------------------------- lib/ui/settings/user_info_page.dart | 2 +- 2 files changed, 8 insertions(+), 105 deletions(-) diff --git a/lib/models/user/user_info_model.dart b/lib/models/user/user_info_model.dart index c248d15..498119a 100644 --- a/lib/models/user/user_info_model.dart +++ b/lib/models/user/user_info_model.dart @@ -1,124 +1,27 @@ class UserInfoModel { int id; - String userName; - String pwd; - String actualName; - String tel; - int sex; - String userCode; - String birthday; - String email; - String idCard; - int organizationId; - String organizationIdPath; - int positionId; String roleId; - int status; - int isDelete; - int createId; - String createDate; - int modifyId; - String modifyDate; - String lastLoginIp; - String lastLoginDate; String nickName; - String code; - String codeSendDate; - int remake; - int reportTo; - String entryDate; + List jurisdiction; - UserInfoModel( - {this.id, - this.userName, - this.pwd, - this.actualName, - this.tel, - this.sex, - this.userCode, - this.birthday, - this.email, - this.idCard, - this.organizationId, - this.organizationIdPath, - this.positionId, - this.roleId, - this.status, - this.isDelete, - this.createId, - this.createDate, - this.modifyId, - this.modifyDate, - this.lastLoginIp, - this.lastLoginDate, - this.nickName, - this.code, - this.codeSendDate, - this.remake, - this.reportTo, - this.entryDate}); + UserInfoModel({this.id, this.roleId, this.nickName, this.jurisdiction}); UserInfoModel.fromJson(Map json) { id = json['id']; - userName = json['userName']; - pwd = json['pwd']; - actualName = json['actualName']; - tel = json['tel']; - sex = json['sex']; - userCode = json['userCode']; - birthday = json['birthday']; - email = json['email']; - idCard = json['idCard']; - organizationId = json['organizationId']; - organizationIdPath = json['organizationIdPath']; - positionId = json['positionId']; roleId = json['roleId']; - status = json['status']; - isDelete = json['isDelete']; - createId = json['createId']; - createDate = json['createDate']; - modifyId = json['modifyId']; - modifyDate = json['modifyDate']; - lastLoginIp = json['lastLoginIp']; - lastLoginDate = json['lastLoginDate']; nickName = json['nickName']; - code = json['code']; - codeSendDate = json['codeSendDate']; - remake = json['remake']; - reportTo = json['reportTo']; - entryDate = json['entryDate']; + if (json['jurisdiction'] != null) + jurisdiction = json['jurisdiction'].cast(); + else + json['jurisdiction'] = []; } Map toJson() { final Map data = new Map(); data['id'] = this.id; - data['userName'] = this.userName; - data['pwd'] = this.pwd; - data['actualName'] = this.actualName; - data['tel'] = this.tel; - data['sex'] = this.sex; - data['userCode'] = this.userCode; - data['birthday'] = this.birthday; - data['email'] = this.email; - data['idCard'] = this.idCard; - data['organizationId'] = this.organizationId; - data['organizationIdPath'] = this.organizationIdPath; - data['positionId'] = this.positionId; data['roleId'] = this.roleId; - data['status'] = this.status; - data['isDelete'] = this.isDelete; - data['createId'] = this.createId; - data['createDate'] = this.createDate; - data['modifyId'] = this.modifyId; - data['modifyDate'] = this.modifyDate; - data['lastLoginIp'] = this.lastLoginIp; - data['lastLoginDate'] = this.lastLoginDate; data['nickName'] = this.nickName; - data['code'] = this.code; - data['codeSendDate'] = this.codeSendDate; - data['remake'] = this.remake; - data['reportTo'] = this.reportTo; - data['entryDate'] = this.entryDate; + data['jurisdiction'] = this.jurisdiction; return data; } } diff --git a/lib/ui/settings/user_info_page.dart b/lib/ui/settings/user_info_page.dart index d928bd2..deaf2ba 100644 --- a/lib/ui/settings/user_info_page.dart +++ b/lib/ui/settings/user_info_page.dart @@ -49,7 +49,7 @@ class _UserInfoPageState extends State { AkuTile( onTap: () {}, title: Text('手机'), - suffix: Text(TextUtil.hideNumber(userProvider.infoModel.tel)), + suffix: Text(TextUtil.hideNumber(userProvider.profileModel.tel)), ), ].sepWidget(separate: AkuDivider.horizontal()), ),