class NewsCommEntity {

	NewsEntity news;
  List<TopNews> topNews;

	NewsCommEntity.fromJsonMap(Map<String, dynamic> map):
		news = NewsEntity.fromJsonMap(map["news"]),
		topNews = List<TopNews>.from(map["topNews"].map((it) => TopNews.fromJsonMap(it)));

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['news'] = news == null ? null : news.toJson();
		data['topNews'] = topNews != null ? 
			this.topNews.map((v) => v.toJson()).toList()
			: null;
		return data;
	}
}

class NewsEntity {

	int pageNum;
	int pageCount;
	int total;
	int pageSize;
	bool hasNext;
	bool hasPrev;
	List<NewsItem> rows;

	NewsEntity.fromJsonMap(Map<String, dynamic> map):
				pageNum = map["pageNum"],
				pageCount = map["pageCount"],
				total = map["total"],
				pageSize = map["pageSize"],
				hasNext = map["hasNext"],
				hasPrev = map["hasPrev"],
				rows = List<NewsItem>.from(map["rows"].map((it) => NewsItem.fromJsonMap(it)));

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['pageNum'] = pageNum;
		data['pageCount'] = pageCount;
		data['total'] = total;
		data['pageSize'] = pageSize;
		data['hasNext'] = hasNext;
		data['hasPrev'] = hasPrev;
		data['rows'] = rows != null ?
		this.rows.map((v) => v.toJson()).toList()
				: null;
		return data;
	}
}


class NewsItem {

	String videoPath;
	String releaseId;
	String releaseDate;
	String releaseUser;
	String id;
	String title;
	int topSerial;
	String content;
	String lookNum;
	String likeNum;

	NewsItem.fromJsonMap(Map<String, dynamic> map):
				videoPath = map["videoPath"],
				releaseId = map["releaseId"],
				releaseDate = map["releaseDate"],
				releaseUser = map["releaseUser"],
				id = map["id"],
				title = map["title"],
				topSerial = map["topSerial"],
				content = map["content"],
				lookNum = map["lookNum"].toString(),
				likeNum = map["likeNum"];

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['videoPath'] = videoPath;
		data['releaseId'] = releaseId;
		data['releaseDate'] = releaseDate;
		data['releaseUser'] = releaseUser;
		data['id'] = id;
		data['title'] = title;
		data['topSerial'] = topSerial;
		data['content'] = content;
		data['lookNum'] = lookNum;
		data['likeNum'] = likeNum;
		return data;
	}
}

class TopNews {

	String videoPath;
	String releaseId;
	String releaseDate;
	String releaseUser;
	String id;
	String title;
	int topSerial;
	String content;
	String lookNum;
	String likeNum;

	TopNews.fromJsonMap(Map<String, dynamic> map):
				videoPath = map["videoPath"],
				releaseId = map["releaseId"],
				releaseDate = map["releaseDate"],
				releaseUser = map["releaseUser"],
				id = map["id"],
				title = map["title"],
				topSerial = map["topSerial"],
				content = map["content"],
				lookNum = map["lookNum"],
				likeNum = map["likeNum"];

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['videoPath'] = videoPath;
		data['releaseId'] = releaseId;
		data['releaseDate'] = releaseDate;
		data['releaseUser'] = releaseUser;
		data['id'] = id;
		data['title'] = title;
		data['topSerial'] = topSerial;
		data['content'] = content;
		data['lookNum'] = lookNum;
		data['likeNum'] = likeNum;
		return data;
	}
}
