submit_model.dart 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import 'package:flutter_tracker/utils/time_util.dart';
  2. import 'message_model.dart';
  3. /// Description:
  4. /// Time : 2021年12月03日 Friday
  5. /// Author : liuyuqi.gov@msncn
  6. class SubmitModel {
  7. int id;
  8. int userid;
  9. DateTime time;
  10. String address;
  11. String telphone;
  12. int health;
  13. String pic;
  14. SubmitModel(
  15. {this.id,
  16. this.userid,
  17. this.time,
  18. this.address,
  19. this.telphone,
  20. this.health,
  21. this.pic});
  22. SubmitModel.fromJson(Map<String, dynamic> json) {
  23. id = int.parse(json["submitid"]);
  24. // userid = int.parse(json['userid']);
  25. time = TimeUtil.getDateTime(json['time']);
  26. address = json['address'];
  27. telphone = json['telphone'];
  28. health = json['health'];
  29. }
  30. }
  31. class SubmitEntity {
  32. SubmitModel submitModel;
  33. MessageModel msg;
  34. SubmitEntity(this.submitModel, this.msg);
  35. SubmitEntity.fromJson(Map<String, dynamic> json) {
  36. msg = MessageModel.fromJson(json);
  37. if (msg.success) {
  38. submitModel = SubmitModel.fromJson(json["data"]);
  39. }
  40. }
  41. }