user_friend.dart 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. import 'package:azlistview/azlistview.dart';
  2. import 'package:sport/bean/user_info.dart';
  3. import 'package:sport/services/Converter.dart';
  4. class UserFriend extends ISuspensionBean {
  5. int? uid;
  6. String? isFriends;
  7. int? isIgnore;
  8. String? groups;
  9. String? createdAt;
  10. String? updatedAt;
  11. UserInfo? socialInfo;
  12. String? makeFrom;
  13. String? name;
  14. String? avatar;
  15. String? relation;
  16. UserFriend({
  17. this.uid,
  18. this.isFriends,
  19. this.groups,
  20. this.createdAt,
  21. this.updatedAt,
  22. this.socialInfo,
  23. this.makeFrom,
  24. this.name,
  25. this.avatar,
  26. this.relation
  27. });
  28. UserFriend.fromJson(Map<String, dynamic> json) {
  29. uid = Converter.toInt(json['uid']);
  30. isFriends = json['is_friends'];
  31. isIgnore = Converter.toInt(json['is_ignore']);
  32. groups = json['groups'];
  33. createdAt = json['created_at'];
  34. updatedAt = json['updated_at'];
  35. socialInfo = json['socialInfo'] != null
  36. ? new UserInfo.fromJson(json['socialInfo'])
  37. : null;
  38. makeFrom = json['make_from'];
  39. name = json['name'];
  40. avatar = json['avatar'];
  41. relation = json['relation'];
  42. }
  43. Map<String, dynamic> toJson() {
  44. final Map<String, dynamic> data = new Map<String, dynamic>();
  45. data['uid'] = this.uid;
  46. data['is_friends'] = this.isFriends;
  47. data['groups'] = this.groups;
  48. data['created_at'] = this.createdAt;
  49. data['updated_at'] = this.updatedAt;
  50. if (this.socialInfo != null) {
  51. data['socialInfo'] = this.socialInfo!.toJson();
  52. }
  53. data['make_from'] = this.makeFrom;
  54. data['name'] = this.name;
  55. data['avatar'] = this.avatar;
  56. data['relation'] = this.relation;
  57. return data;
  58. }
  59. @override
  60. String getSuspensionTag() => '$uid';
  61. }
  62. class NewFriend {
  63. int? id;
  64. String? name;
  65. String? level;
  66. String? score;
  67. String? isBan;
  68. String? provinceId;
  69. String? cityId;
  70. String? districtId;
  71. String? gender;
  72. String? age;
  73. String? avatar;
  74. String? city;
  75. NewFriend(
  76. this.id,
  77. this.name,
  78. this.level,
  79. this.score,
  80. this.isBan,
  81. this.provinceId,
  82. this.cityId,
  83. this.districtId,
  84. this.gender,
  85. this.age,
  86. this.avatar,
  87. this.city);
  88. NewFriend.fromJson(Map<String, dynamic> json) {
  89. id = Converter.toInt(json['id']);
  90. name = json['name'];
  91. level = json['level'];
  92. score = json['score'];
  93. isBan = json['is_ban'];
  94. provinceId = json['province_id'];
  95. cityId = json['city_id'];
  96. districtId = json['district_id'];
  97. gender = json['gender'];
  98. age = json['age'];
  99. avatar = json['avatar'];
  100. city = json['city'];
  101. }
  102. Map<String, dynamic> toJson() {
  103. final Map<String, dynamic> data = new Map<String, dynamic>();
  104. data['id'] = this.id;
  105. data['name'] = this.name;
  106. data['level'] = this.level;
  107. data['isBan'] = this.isBan;
  108. data['provinceId'] = this.provinceId;
  109. data['cityId'] = this.cityId;
  110. data['districtId'] = this.districtId;
  111. data['gender'] = this.gender;
  112. data['age'] = this.age;
  113. data['avatar'] = this.avatar;
  114. data['city'] = this.city;
  115. return data;
  116. }
  117. }