123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- import 'package:azlistview/azlistview.dart';
- import 'package:lpinyin/lpinyin.dart';
- class TeamUserEntity {
- int pageNum;
- int pageCount;
- int total;
- int pageSize;
- bool hasNext;
- bool hasPrev;
- List<UserItem> rows;
- TeamUserEntity(
- {this.pageNum,
- this.pageCount,
- this.total,
- this.pageSize,
- this.hasNext,
- this.hasPrev,
- this.rows});
- TeamUserEntity.fromJsonMap(Map<String, dynamic> json) {
- pageNum = json['pageNum'];
- pageCount = json['pageCount'];
- total = json['total'];
- pageSize = json['pageSize'];
- hasNext = json['hasNext'];
- hasPrev = json['hasPrev'];
- if (json['rows'] != null) {
- rows = new List<UserItem>();
- json['rows'].forEach((v) {
- rows.add(new UserItem.fromJsonMap(v));
- });
- }
- }
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['pageNum'] = pageNum;
- data['pageCount'] = pageCount;
- data['total'] = total;
- data['pageSize'] = pageSize;
- data['hasNext'] = hasNext;
- data['hasPrev'] = hasPrev;
- data['rows'] =
- rows != null ? this.rows.map((v) => v.toJson()).toList() : null;
- return data;
- }
- }
- class UserItem extends ISuspensionBean {
- String userId;
- String userName;
- String userAvatarUrl;
- String userRemarks;
- String userMobile;
- String userRoleId;
- String userRoleName;
- LiftCertificate liftCertificate;
- UserItem.fromJsonMap(Map<String, dynamic> map)
- : userId = map["userId"]??"",
- userName = map["userName"]??"",
- userAvatarUrl = map["userAvatarUrl"]??"",
- userRemarks = map["userRemarks"]??"",
- userMobile = map["userMobile"]??"",
- userRoleId = map["userRoleId"]??"",
- userRoleName = map["userRoleName"]??"",
- liftCertificate = map['liftCertificate'] != null
- ? new LiftCertificate.fromJsonMap(map['liftCertificate'])
- : null;
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['userId'] = userId;
- data['userName'] = userName;
- data['userAvatarUrl'] = userAvatarUrl;
- data['userRemarks'] = userRemarks;
- data['userMobile'] = userMobile;
- data['userRoleId'] = userRoleId;
- data['userRoleName'] = userRoleName;
- data['liftCertificate'] =
- liftCertificate == null ? null : liftCertificate.toJson();
- return data;
- }
- @override
- String getSuspensionTag() {
- String py = PinyinHelper.getShortPinyin(userName).toUpperCase();
- return py.substring(0, 1);
- }
- }
- class LiftCertificate {
- String userId;
- String code;
- String issuanceAgency;
- String expirationDate;
- String certificateType;
- String firstImgUrl;
- String secondImgUrl;
- int status;
- LiftCertificate.fromJsonMap(Map<String, dynamic> map)
- : userId = map["userId"]??"",
- code = map["code"]??"",
- issuanceAgency = map["issuanceAgency"]??"",
- expirationDate = map["expirationDate"]??"",
- certificateType = map["certificateType"]??"",
- firstImgUrl = map["firstImgUrl"]??"",
- secondImgUrl = map["secondImgUrl"]??"",
- status = map["status"]??0;
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['userId'] = userId;
- data['code'] = code;
- data['issuanceAgency'] = issuanceAgency;
- data['expirationDate'] = expirationDate;
- data['certificateType'] = certificateType;
- data['firstImgUrl'] = firstImgUrl;
- data['secondImgUrl'] = secondImgUrl;
- data['status'] = status;
- return data;
- }
- }
|