UserInfo.dart 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import 'package:json_annotation/json_annotation.dart';
  2. part 'UserInfo.g.dart';
  3. @JsonSerializable()
  4. class UserInfo {
  5. UserInfo(this.id, this.nickname, this.username, this.icon, this.phone, this.sex, this.moneyCoin, this.moneyPoint, this.birthday, this.noticeFlag,
  6. this.remindFlag, this.createFlag, this.houseCard, this.recommender, this.levelId, this.moneyTicket, this.channel, this.rank);
  7. int id;
  8. String nickname;
  9. String username;
  10. String icon;
  11. String phone;
  12. String sex;
  13. double moneyCoin; //余额
  14. double moneyPoint; //积分
  15. int birthday;
  16. bool noticeFlag; //是否通知
  17. bool remindFlag; //是否通知
  18. bool createFlag; //创建房间权限
  19. int houseCard;
  20. int recommender; //上级ID
  21. int levelId; //用户级别ID
  22. int moneyTicket; //门票数量
  23. int channel; //渠道ID
  24. int rank; //排名
  25. factory UserInfo.fromJson(Map<String, dynamic> json) => _$UserInfoFromJson(json);
  26. Map<String, dynamic> toJson() => _$UserInfoToJson(this);
  27. // 命名构造函数
  28. UserInfo.empty();
  29. @override
  30. String toString() {
  31. return _$UserInfoToJson(this).toString();
  32. }
  33. }