user_model.dart 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import 'package:flutter_tracker/model/message_model.dart';
  2. /// Description:
  3. /// Time : 2021年12月03日 Friday
  4. /// Author : liuyuqi.gov@msncn
  5. class UserModel {
  6. String id; // 用户id
  7. String username; //用户名
  8. String pwd; // 密码
  9. String deviceid;
  10. String updateTime;
  11. String nickname;
  12. int sex; // 性别:1男2女
  13. String avatar; // 头像
  14. int healthStatus; //类型:2商家,1顾客
  15. UserModel(
  16. {this.id,
  17. this.username,
  18. this.nickname,
  19. this.deviceid,
  20. this.updateTime,
  21. this.pwd,
  22. this.sex,
  23. this.avatar,
  24. this.healthStatus});
  25. UserModel.fromJson(Map<String, dynamic> json) {
  26. username = json["username"];
  27. pwd = json["password"];
  28. avatar = json["avatar"];
  29. updateTime = json["modifytime"];
  30. healthStatus = int.parse(json["health_status"]);
  31. }
  32. }
  33. class UserEntity {
  34. UserModel user;
  35. MessageModel msg;
  36. UserEntity(this.user, this.msg);
  37. UserEntity.fromJson(Map<String, dynamic> json) {
  38. msg = MessageModel.fromJson(json);
  39. if (msg.success) {
  40. user = UserModel.fromJson(json["data"]);
  41. }
  42. }
  43. }