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.

158 lines
3.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;
Author _author;
int _type;
4 years ago
String _startTime;
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
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;
Author get author => _author;
int get type => _type;
4 years ago
String get startTime => _startTime;
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;
4 years ago
dynamic get storeName => _storeName;
4 years ago
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;
}
4 years ago
Article({
4 years ago
String id,
4 years ago
String createTime,
4 years ago
dynamic createUser,
String updateTime,
dynamic updateUser,
String storeId,
4 years ago
String mainTitle,
4 years ago
dynamic viceTitle,
String content,
String coverImg,
Author author,
4 years ago
int type,
4 years ago
String startTime,
String endTime,
int state,
int isDelete,
4 years ago
int likes,
3 years ago
bool isHot,
4 years ago
int viewers,
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;
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;
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"];
3 years ago
_author = json["author"] == null ? null : Author.fromJson(jsonDecode(json["author"]));
4 years ago
_type = json["type"];
4 years ago
_startTime = json["startTime"];
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"];
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;
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;
4 years ago
map["storeName"] = _storeName;
return map;
}
}