fiance_report_entity.g.dart 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/response/fiance_report_entity.dart';
  3. FianceReportEntity $FianceReportEntityFromJson(Map<String, dynamic> json) {
  4. final FianceReportEntity fianceReportEntity = FianceReportEntity();
  5. final List<FianceReportRateList>? rateList = (json['rate_list'] as List<dynamic>?)?.map(
  6. (e) => jsonConvert.convert<FianceReportRateList>(e) as FianceReportRateList).toList();
  7. if (rateList != null) {
  8. fianceReportEntity.rateList = rateList;
  9. }
  10. final int? requestTotal = jsonConvert.convert<int>(json['request_total']);
  11. if (requestTotal != null) {
  12. fianceReportEntity.requestTotal = requestTotal;
  13. }
  14. final int? actualTotal = jsonConvert.convert<int>(json['actual_total']);
  15. if (actualTotal != null) {
  16. fianceReportEntity.actualTotal = actualTotal;
  17. }
  18. return fianceReportEntity;
  19. }
  20. Map<String, dynamic> $FianceReportEntityToJson(FianceReportEntity entity) {
  21. final Map<String, dynamic> data = <String, dynamic>{};
  22. data['rate_list'] = entity.rateList.map((v) => v.toJson()).toList();
  23. data['request_total'] = entity.requestTotal;
  24. data['actual_total'] = entity.actualTotal;
  25. return data;
  26. }
  27. extension FianceReportEntityExtension on FianceReportEntity {
  28. FianceReportEntity copyWith({
  29. List<FianceReportRateList>? rateList,
  30. int? requestTotal,
  31. int? actualTotal,
  32. }) {
  33. return FianceReportEntity()
  34. ..rateList = rateList ?? this.rateList
  35. ..requestTotal = requestTotal ?? this.requestTotal
  36. ..actualTotal = actualTotal ?? this.actualTotal;
  37. }
  38. }
  39. FianceReportRateList $FianceReportRateListFromJson(Map<String, dynamic> json) {
  40. final FianceReportRateList fianceReportRateList = FianceReportRateList();
  41. final String? day = jsonConvert.convert<String>(json['day']);
  42. if (day != null) {
  43. fianceReportRateList.day = day;
  44. }
  45. final String? weekNum = jsonConvert.convert<String>(json['week_num']);
  46. if (weekNum != null) {
  47. fianceReportRateList.weekNum = weekNum;
  48. }
  49. final String? weekStr = jsonConvert.convert<String>(json['week_str']);
  50. if (weekStr != null) {
  51. fianceReportRateList.weekStr = weekStr;
  52. }
  53. final int? request = jsonConvert.convert<int>(json['request']);
  54. if (request != null) {
  55. fianceReportRateList.request = request;
  56. }
  57. final int? actual = jsonConvert.convert<int>(json['actual']);
  58. if (actual != null) {
  59. fianceReportRateList.actual = actual;
  60. }
  61. final String? ratio = jsonConvert.convert<String>(json['ratio']);
  62. if (ratio != null) {
  63. fianceReportRateList.ratio = ratio;
  64. }
  65. return fianceReportRateList;
  66. }
  67. Map<String, dynamic> $FianceReportRateListToJson(FianceReportRateList entity) {
  68. final Map<String, dynamic> data = <String, dynamic>{};
  69. data['day'] = entity.day;
  70. data['week_num'] = entity.weekNum;
  71. data['week_str'] = entity.weekStr;
  72. data['request'] = entity.request;
  73. data['actual'] = entity.actual;
  74. data['ratio'] = entity.ratio;
  75. return data;
  76. }
  77. extension FianceReportRateListExtension on FianceReportRateList {
  78. FianceReportRateList copyWith({
  79. String? day,
  80. String? weekNum,
  81. String? weekStr,
  82. int? request,
  83. int? actual,
  84. String? ratio,
  85. }) {
  86. return FianceReportRateList()
  87. ..day = day ?? this.day
  88. ..weekNum = weekNum ?? this.weekNum
  89. ..weekStr = weekStr ?? this.weekStr
  90. ..request = request ?? this.request
  91. ..actual = actual ?? this.actual
  92. ..ratio = ratio ?? this.ratio;
  93. }
  94. }