user_model.dart 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import 'package:flutter_tracker/model/base_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; // 性别:1男2女
  13. String avatar = ""; // 头像
  14. int type = 1; //类型:2商家,1顾客
  15. UserModel(
  16. {this.id = "",
  17. this.username = "",
  18. this.nickname = "",
  19. required this.deviceid,
  20. this.updateTime = "",
  21. this.pwd = "",
  22. this.sex = 1,
  23. this.avatar = "",
  24. this.type = 1});
  25. UserModel.fromJson(Map<String, dynamic> json) {
  26. avatar = json["avatar"];
  27. }
  28. }
  29. class UserEntity {
  30. late UserModel user;
  31. late BaseModel msg;
  32. UserEntity(this.user, this.msg);
  33. UserEntity.fromJson(Map<String, dynamic> json) {
  34. msg = BaseModel.fromJson(json);
  35. if (msg.success) {
  36. user = UserModel.fromJson(json);
  37. }
  38. }
  39. }