identityApply.m.dart 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. import 'notification.m.dart';
  2. import 'liveConsultation.m.dart';
  3. class IdentityApplyDTO extends BaseDTO{
  4. String? identityApplyCode;
  5. String? userCode;
  6. String? applyRoleCode;
  7. List<String>? identityCard;
  8. List<String>? licenseCard;
  9. ApplyStateEnum applyState;
  10. String? applyNote;
  11. List<String>? fieldList;
  12. IdentityApplyDTO({
  13. this.identityApplyCode,
  14. this.userCode,
  15. this.applyRoleCode,
  16. this.identityCard,
  17. this.licenseCard,
  18. this.applyState = ApplyStateEnum.NotApply,
  19. this.applyNote,
  20. this.fieldList,
  21. DateTime? createTime,
  22. DateTime? updateTime,
  23. }) : super(
  24. createTime: createTime,
  25. updateTime: updateTime,
  26. );
  27. factory IdentityApplyDTO.fromJson(Map<String, dynamic> map) {
  28. return IdentityApplyDTO(
  29. identityApplyCode: map['IdentityApplyCode'],
  30. userCode: map['UserCode'],
  31. applyRoleCode: map['ApplyRoleCode'],
  32. identityCard: map['IdentityCard']?.cast<String>().toList(),
  33. licenseCard: map['LicenseCard']?.cast<String>().toList(),
  34. applyState: ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
  35. applyNote: map['ApplyNote'],
  36. fieldList: map['FieldList']?.cast<String>().toList(),
  37. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  38. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  39. );
  40. }
  41. Map<String, dynamic> toJson() {
  42. final map = super.toJson();
  43. if (identityApplyCode != null)
  44. map['IdentityApplyCode'] = identityApplyCode;
  45. if (userCode != null)
  46. map['UserCode'] = userCode;
  47. if (applyRoleCode != null)
  48. map['ApplyRoleCode'] = applyRoleCode;
  49. if (identityCard != null)
  50. map['IdentityCard'] = identityCard;
  51. if (licenseCard != null)
  52. map['LicenseCard'] = licenseCard;
  53. map['ApplyState'] = applyState.index;
  54. if (applyNote != null)
  55. map['ApplyNote'] = applyNote;
  56. if (fieldList != null)
  57. map['FieldList'] = fieldList;
  58. return map;
  59. }
  60. }
  61. class GetLastIdentityApplyRequest extends TokenRequest{
  62. String? applyRoleCode;
  63. GetLastIdentityApplyRequest({
  64. this.applyRoleCode,
  65. String? token,
  66. }) : super(
  67. token: token,
  68. );
  69. factory GetLastIdentityApplyRequest.fromJson(Map<String, dynamic> map) {
  70. return GetLastIdentityApplyRequest(
  71. applyRoleCode: map['ApplyRoleCode'],
  72. token: map['Token'],
  73. );
  74. }
  75. Map<String, dynamic> toJson() {
  76. final map = super.toJson();
  77. if (applyRoleCode != null)
  78. map['ApplyRoleCode'] = applyRoleCode;
  79. return map;
  80. }
  81. }
  82. class ApplyForRequest {
  83. String? token;
  84. String? extensionData;
  85. String? applyRoleCode;
  86. List<String>? identityCard;
  87. List<String>? licenseCard;
  88. List<String>? fieldList;
  89. ApplyForRequest({
  90. this.token,
  91. this.extensionData,
  92. this.applyRoleCode,
  93. this.identityCard,
  94. this.licenseCard,
  95. this.fieldList,
  96. });
  97. factory ApplyForRequest.fromJson(Map<String, dynamic> map) {
  98. return ApplyForRequest(
  99. token: map['Token'],
  100. extensionData: map['ExtensionData'],
  101. applyRoleCode: map['ApplyRoleCode'],
  102. identityCard: map['IdentityCard']?.cast<String>().toList(),
  103. licenseCard: map['LicenseCard']?.cast<String>().toList(),
  104. fieldList: map['FieldList']?.cast<String>().toList(),
  105. );
  106. }
  107. Map<String, dynamic> toJson() {
  108. final map = Map<String, dynamic>();
  109. if (token != null) {
  110. map['Token'] = token;
  111. }
  112. if (extensionData != null) {
  113. map['ExtensionData'] = extensionData;
  114. }
  115. if (applyRoleCode != null) {
  116. map['ApplyRoleCode'] = applyRoleCode;
  117. }
  118. if (identityCard != null) {
  119. map['IdentityCard'] = identityCard;
  120. }
  121. if (licenseCard != null) {
  122. map['LicenseCard'] = licenseCard;
  123. }
  124. if (fieldList != null) {
  125. map['FieldList'] = fieldList;
  126. }
  127. return map;
  128. }
  129. }