sai_you_yun_birthday_temp.dart 3.88 KB

class SaiYouYunBirthdayModel {
  final int? ret;
  final List<SaiYouYunBirthdaySunModel>? data;
  final String? msg;
  const SaiYouYunBirthdayModel({this.ret, this.data, this.msg});
  SaiYouYunBirthdayModel copyWith(
      {int? ret, List<SaiYouYunBirthdaySunModel>? data, String? msg}) {
    return SaiYouYunBirthdayModel(
        ret: ret ?? this.ret, data: data ?? this.data, msg: msg ?? this.msg);
  }

  Map<String, Object?> toJson() {
    return {
      'ret': ret,
      'data': data?.map<Map<String, dynamic>>((data) => data.toJson()).toList(),
      'msg': msg
    };
  }

  static SaiYouYunBirthdayModel fromJson(Map<dynamic, dynamic> json) {
    return SaiYouYunBirthdayModel(
        ret: json['ret'] == null ? null : json['ret'] as int?,
        data: json['data'] == null
            ? null
            : (json['data'] as List)
                .map<SaiYouYunBirthdaySunModel>((data) =>
                    SaiYouYunBirthdaySunModel.fromJson(
                        data))
                .toList(),
        msg: json['msg'] == null ? null : json['msg'] as String?);
  }

  @override
  String toString() {
    return '''SaiYouYunBirthdayModel(
                ret:$ret,
data:${data.toString()},
msg:$msg
    ) ''';
  }

  @override
  bool operator ==(Object other) {
    return other is SaiYouYunBirthdayModel &&
        other.runtimeType == runtimeType &&
        other.ret == ret &&
        other.data == data &&
        other.msg == msg;
  }

  @override
  int get hashCode {
    return Object.hash(runtimeType, ret, data, msg);
  }
}

class SaiYouYunBirthdaySunModel {
  final String? id;
  final String? templateCode;
  final String? templateParam;
  final dynamic templateDemo;
  final String? type;
  final dynamic bestwish;
  const SaiYouYunBirthdaySunModel({
    this.id,
    this.templateCode,
    this.templateParam,
    this.templateDemo,
    this.type,
    this.bestwish,
  });
  SaiYouYunBirthdaySunModel copyWith({
    String? id,
    String? templateCode,
    String? templateParam,
    dynamic templateDemo,
    String? type,
    dynamic bestwish,
  }) {
    return SaiYouYunBirthdaySunModel(
      id: id ?? this.id,
      templateCode: templateCode ?? this.templateCode,
      templateParam: templateParam ?? this.templateParam,
      templateDemo: templateDemo ?? this.templateDemo,
      type: type ?? this.type,
      bestwish: bestwish ?? this.bestwish,
    );
  }

  Map<String, Object?> toJson() {
    return {
      'id': id,
      'template_code': templateCode,
      'template_param': templateParam,
      'template_demo': templateDemo,
      'type': type,
      'bestwish': bestwish
    };
  }

  static SaiYouYunBirthdaySunModel fromJson(Map<dynamic, dynamic> json) {
    return SaiYouYunBirthdaySunModel(
        id: json['id'] == null ? null : json['id'] as String?,
        templateCode: json['template_code'] == null
            ? null
            : json['template_code'] as String?,
        templateParam: json['template_param'] == null
            ? null
            : json['template_param'] as String?,
        templateDemo: json['template_demo'] as dynamic,
        type: json['type'] == null ? null : json['type'] as String?,
        bestwish: json['bestwish'] as dynamic);
  }

  @override
  String toString() {
    return '''Data(
                id:$id,
templateCode:$templateCode,
templateParam:$templateParam,
templateDemo:$templateDemo,
type:$type,
bestwish:$bestwish
    ) ''';
  }

  @override
  bool operator ==(Object other) {
    return other is SaiYouYunBirthdaySunModel &&
        other.runtimeType == runtimeType &&
        other.id == id &&
        other.templateCode == templateCode &&
        other.templateParam == templateParam &&
        other.templateDemo == templateDemo &&
        other.type == type &&
        other.bestwish == bestwish;
  }

  @override
  int get hashCode {
    return Object.hash(runtimeType, id, templateCode, templateParam,
        templateDemo, type, bestwish);
  }
}