import 'package:domain/generated/json/base/json_field.dart';
import 'package:domain/generated/json/latest_news_page_entity.g.dart';
import 'dart:convert';
export 'package:domain/generated/json/latest_news_page_entity.g.dart';

@JsonSerializable()
class LatestNewsPageEntity {
  int count = 0;
  int page = 0;
  int limit = 0;
  @JSONField(name: "count_page")
  int countPage = 0;
  List<LatestNewsList>? list = [];

  LatestNewsPageEntity();

  factory LatestNewsPageEntity.fromJson(Map<String, dynamic> json) => $LatestNewsPageEntityFromJson(json);

  Map<String, dynamic> toJson() => $LatestNewsPageEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class LatestNewsList {
  String? id;
  int type = 0;
  String? title;
  @JSONField(name: "cover_image")
  String? coverImage;
  String? content;
  @JSONField(name: "created_at")
  String? createdAt;

  LatestNewsList();

  factory LatestNewsList.fromJson(Map<String, dynamic> json) => $LatestNewsListFromJson(json);

  Map<String, dynamic> toJson() => $LatestNewsListToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
