/// 新闻分页 request class NewsPageListRequest { String? categoryCode; String? channelCode; String? tag; String? keyword; int? pageNum; int? pageSize; NewsPageListRequest({ this.categoryCode, this.channelCode, this.tag, this.keyword, this.pageNum, this.pageSize, }); Map toJson() => { "categoryCode": categoryCode, "channelCode": channelCode, "tag": tag, "keyword": keyword, "pageNum": pageNum, "pageSize": pageSize, }; } /// 新闻分页 response class NewsPageListResponse { int? counts; int? pagesize; int? pages; int? page; List? items; NewsPageListResponse({ this.counts, this.pagesize, this.pages, this.page, this.items, }); factory NewsPageListResponse.fromJson(Map json) => NewsPageListResponse( counts: json["counts"], pagesize: json["pagesize"], pages: json["pages"], page: json["page"], items: json["items"] == null ? [] : List.from( json["items"].map((x) => NewsItem.fromJson(x))), ); Map toJson() => { "counts": counts ?? 0, "pagesize": pagesize ?? 0, "pages": pages ?? 0, "page": page ?? 0, "items": items == null ? [] : List.from(items!.map((x) => x.toJson())), }; } class NewsItem { String? id; String? title; String? category; String? thumbnail; String? author; DateTime? addtime; String? url; NewsItem({ this.id, this.title, this.category, this.thumbnail, this.author, this.addtime, this.url, }); factory NewsItem.fromJson(Map json) => NewsItem( id: json["id"], title: json["title"], category: json["category"], thumbnail: json["thumbnail"], author: json["author"], addtime: DateTime.parse(json["addtime"]), url: json["url"], ); Map toJson() => { "id": id, "title": title, "category": category, "thumbnail": thumbnail, "author": author, "addtime": addtime?.toIso8601String(), "url": url, }; } /// 新闻推荐 request class NewsRecommendRequest { String? categoryCode; String? channelCode; String? tag; String? keyword; NewsRecommendRequest({ this.categoryCode, this.channelCode, this.tag, this.keyword, }); Map toJson() => { "categoryCode": categoryCode, "channelCode": channelCode, "tag": tag, "keyword": keyword, }; }