You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

269 lines
5.8 KiB

4 years ago
import 'dart:convert';
import 'package:huixiang/retrofit/data/author.dart';
class Article {
String _id;
4 years ago
String _createTime;
dynamic _createUser;
String _updateTime;
dynamic _updateUser;
String _storeId;
4 years ago
String _mainTitle;
4 years ago
dynamic _viceTitle;
String _content;
String _coverImg;
dynamic _author;
4 years ago
int _type;
4 years ago
String _startTime;
String _categoryId;
4 years ago
String _endTime;
4 years ago
int _state;
4 years ago
int _isDelete;
4 years ago
int _likes;
3 years ago
bool _isHot;
3 years ago
bool _liked;
4 years ago
int _viewers;
3 years ago
int _comments;
String _authorName;
String _authorHeadImg;
3 years ago
bool isFollow;
4 years ago
dynamic _storeName;
4 years ago
String get id => _id;
4 years ago
String get createTime => _createTime;
dynamic get createUser => _createUser;
String get updateTime => _updateTime;
dynamic get updateUser => _updateUser;
String get storeId => _storeId;
4 years ago
String get mainTitle => _mainTitle;
4 years ago
dynamic get viceTitle => _viceTitle;
String get content => _content;
String get coverImg => _coverImg;
dynamic get author => _author;
4 years ago
int get type => _type;
4 years ago
String get startTime => _startTime;
String get categoryId => _categoryId;
4 years ago
String get endTime => _endTime;
4 years ago
int get state => _state;
4 years ago
int get isDelete => _isDelete;
4 years ago
int get likes => _likes;
3 years ago
bool get isHot => _isHot;
3 years ago
bool get liked => _liked;
4 years ago
int get viewers => _viewers;
3 years ago
int get comments => _comments;
String get authorName => _authorName;
String get authorHeadImg => _authorHeadImg;
4 years ago
dynamic get storeName => _storeName;
4 years ago
set id(String value) {
_id = value;
}
3 years ago
set likes(int value) {
_likes = value;
}
3 years ago
set liked(bool value) {
_liked = value;
}
3 years ago
set viewers(int value) {
_viewers = value;
}
3 years ago
set comments(int value) {
_comments = value;
}
set authorName(String value) {
_authorName = value;
}
set authorHeadImg(String value) {
_authorHeadImg = value;
}
4 years ago
Article({
String id,
String createTime,
dynamic createUser,
String updateTime,
dynamic updateUser,
String storeId,
String mainTitle,
dynamic viceTitle,
String content,
4 years ago
String coverImg,
3 years ago
Author author,
int type,
String startTime,
String endTime,
int state,
int isDelete,
4 years ago
int likes,
3 years ago
bool isHot,
4 years ago
int viewers,
3 years ago
int comments,
String authorName,
String authorHeadImg,
4 years ago
dynamic storeName}){
_id = id;
4 years ago
_createTime = createTime;
_createUser = createUser;
4 years ago
_updateTime = updateTime;
_updateUser = updateUser;
_storeId = storeId;
4 years ago
_mainTitle = mainTitle;
4 years ago
_viceTitle = viceTitle;
_content = content;
_coverImg = coverImg;
_author = author;
_type = type;
4 years ago
_startTime = startTime;
_categoryId = categoryId;
4 years ago
_endTime = endTime;
4 years ago
_state = state;
4 years ago
_isDelete = isDelete;
4 years ago
_likes = likes;
3 years ago
_isHot = isHot;
3 years ago
_liked = liked;
4 years ago
_viewers = viewers;
3 years ago
_comments = comments;
_authorName = authorName;
_authorHeadImg = authorHeadImg;
4 years ago
_storeName = storeName;
}
Article.fromJson(dynamic json) {
4 years ago
_id = json["id"];
4 years ago
_createTime = json["createTime"];
_createUser = json["createUser"];
4 years ago
_updateTime = json["updateTime"];
_updateUser = json["updateUser"];
_storeId = json["storeId"];
4 years ago
_mainTitle = json["mainTitle"];
4 years ago
_viceTitle = json["viceTitle"];
_content = json["content"];
_coverImg = json["coverImg"];
_author = json["author"] == null ? null : json["author"].toString().startsWith("{") ? Author.fromJson(jsonDecode(json["author"])):null;
4 years ago
_type = json["type"];
4 years ago
_startTime = json["startTime"];
_categoryId = json["categoryId"];
4 years ago
_endTime = json["endTime"];
4 years ago
_state = json["state"];
4 years ago
_isDelete = json["isDelete"];
4 years ago
_likes = json["likes"];
3 years ago
_isHot = json["isHot"];
3 years ago
_liked = json["liked"];
4 years ago
_viewers = json["viewers"];
3 years ago
_comments = json["comments"];
_authorName = json["authorName"];
_authorHeadImg = json["authorHeadImg"];
4 years ago
_storeName = json["storeName"];
}
Map<String, dynamic> toJson() {
var map = <String, dynamic>{};
4 years ago
map["id"] = _id;
4 years ago
map["createTime"] = _createTime;
map["createUser"] = _createUser;
4 years ago
map["updateTime"] = _updateTime;
map["updateUser"] = _updateUser;
map["storeId"] = _storeId;
4 years ago
map["mainTitle"] = _mainTitle;
4 years ago
map["viceTitle"] = _viceTitle;
map["content"] = _content;
map["coverImg"] = _coverImg;
map["author"] = _author.toJson();
map["type"] = _type;
4 years ago
map["startTime"] = _startTime;
map["categoryId"] = _categoryId;
4 years ago
map["endTime"] = _endTime;
4 years ago
map["state"] = _state;
4 years ago
map["isDelete"] = _isDelete;
4 years ago
map["likes"] = _likes;
3 years ago
map["isHot"] = _isHot;
3 years ago
map["liked"] = _liked;
4 years ago
map["viewers"] = _viewers;
3 years ago
map["comments"] = _comments;
map["authorName"] = _authorName;
map["authorHeadImg"] = _authorHeadImg;
4 years ago
map["storeName"] = _storeName;
return map;
}
set createTime(String value) {
_createTime = value;
}
set createUser(dynamic value) {
_createUser = value;
}
set updateTime(String value) {
_updateTime = value;
}
set updateUser(dynamic value) {
_updateUser = value;
}
set storeId(String value) {
_storeId = value;
}
set mainTitle(String value) {
_mainTitle = value;
}
set viceTitle(dynamic value) {
_viceTitle = value;
}
set content(String value) {
_content = value;
}
set coverImg(String value) {
_coverImg = value;
}
set author(dynamic value) {
_author = value;
}
set type(int value) {
_type = value;
}
set startTime(String value) {
_startTime = value;
}
set categoryId(String value) {
_categoryId = value;
}
set endTime(String value) {
_endTime = value;
}
set state(int value) {
_state = value;
}
set isDelete(int value) {
_isDelete = value;
}
set isHot(bool value) {
_isHot = value;
}
set storeName(dynamic value) {
_storeName = value;
}
4 years ago
}