team_user_entity.dart 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. import 'package:azlistview/azlistview.dart';
  2. import 'package:lpinyin/lpinyin.dart';
  3. class TeamUserEntity {
  4. int pageNum;
  5. int pageCount;
  6. int total;
  7. int pageSize;
  8. bool hasNext;
  9. bool hasPrev;
  10. List<UserItem> rows;
  11. TeamUserEntity(
  12. {this.pageNum,
  13. this.pageCount,
  14. this.total,
  15. this.pageSize,
  16. this.hasNext,
  17. this.hasPrev,
  18. this.rows});
  19. TeamUserEntity.fromJsonMap(Map<String, dynamic> json) {
  20. pageNum = json['pageNum'];
  21. pageCount = json['pageCount'];
  22. total = json['total'];
  23. pageSize = json['pageSize'];
  24. hasNext = json['hasNext'];
  25. hasPrev = json['hasPrev'];
  26. if (json['rows'] != null) {
  27. rows = new List<UserItem>();
  28. json['rows'].forEach((v) {
  29. rows.add(new UserItem.fromJsonMap(v));
  30. });
  31. }
  32. }
  33. Map<String, dynamic> toJson() {
  34. final Map<String, dynamic> data = new Map<String, dynamic>();
  35. data['pageNum'] = pageNum;
  36. data['pageCount'] = pageCount;
  37. data['total'] = total;
  38. data['pageSize'] = pageSize;
  39. data['hasNext'] = hasNext;
  40. data['hasPrev'] = hasPrev;
  41. data['rows'] =
  42. rows != null ? this.rows.map((v) => v.toJson()).toList() : null;
  43. return data;
  44. }
  45. }
  46. class UserItem extends ISuspensionBean {
  47. String userId;
  48. String userName;
  49. String userAvatarUrl;
  50. String userRemarks;
  51. String userMobile;
  52. String userRoleId;
  53. String userRoleName;
  54. LiftCertificate liftCertificate;
  55. UserItem.fromJsonMap(Map<String, dynamic> map)
  56. : userId = map["userId"]??"",
  57. userName = map["userName"]??"",
  58. userAvatarUrl = map["userAvatarUrl"]??"",
  59. userRemarks = map["userRemarks"]??"",
  60. userMobile = map["userMobile"]??"",
  61. userRoleId = map["userRoleId"]??"",
  62. userRoleName = map["userRoleName"]??"",
  63. liftCertificate = map['liftCertificate'] != null
  64. ? new LiftCertificate.fromJsonMap(map['liftCertificate'])
  65. : null;
  66. Map<String, dynamic> toJson() {
  67. final Map<String, dynamic> data = new Map<String, dynamic>();
  68. data['userId'] = userId;
  69. data['userName'] = userName;
  70. data['userAvatarUrl'] = userAvatarUrl;
  71. data['userRemarks'] = userRemarks;
  72. data['userMobile'] = userMobile;
  73. data['userRoleId'] = userRoleId;
  74. data['userRoleName'] = userRoleName;
  75. data['liftCertificate'] =
  76. liftCertificate == null ? null : liftCertificate.toJson();
  77. return data;
  78. }
  79. @override
  80. String getSuspensionTag() {
  81. String py = PinyinHelper.getShortPinyin(userName).toUpperCase();
  82. return py.substring(0, 1);
  83. }
  84. }
  85. class LiftCertificate {
  86. String userId;
  87. String code;
  88. String issuanceAgency;
  89. String expirationDate;
  90. String certificateType;
  91. String firstImgUrl;
  92. String secondImgUrl;
  93. int status;
  94. LiftCertificate.fromJsonMap(Map<String, dynamic> map)
  95. : userId = map["userId"]??"",
  96. code = map["code"]??"",
  97. issuanceAgency = map["issuanceAgency"]??"",
  98. expirationDate = map["expirationDate"]??"",
  99. certificateType = map["certificateType"]??"",
  100. firstImgUrl = map["firstImgUrl"]??"",
  101. secondImgUrl = map["secondImgUrl"]??"",
  102. status = map["status"]??0;
  103. Map<String, dynamic> toJson() {
  104. final Map<String, dynamic> data = new Map<String, dynamic>();
  105. data['userId'] = userId;
  106. data['code'] = code;
  107. data['issuanceAgency'] = issuanceAgency;
  108. data['expirationDate'] = expirationDate;
  109. data['certificateType'] = certificateType;
  110. data['firstImgUrl'] = firstImgUrl;
  111. data['secondImgUrl'] = secondImgUrl;
  112. data['status'] = status;
  113. return data;
  114. }
  115. }