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.

139 lines
3.3 KiB

4 years ago
import 'dart:convert';
import 'package:huixiang/retrofit/data/author.dart';
/// author : ""
/// content : ""
/// coverImg : ""
/// createTime : ""
/// createUser : 0
/// endTime : ""
/// id : 0
/// isDelete : 0
/// mainTitle : ""
/// startTime : ""
/// state : 0
/// storeId : 0
/// storeName : ""
/// type : 0
/// updateTime : ""
/// updateUser : 0
/// viceTitle : ""
class Article {
Author _author;
String _content;
String _coverImg;
String _createTime;
int _createUser;
String _endTime;
String _id;
int _isDelete;
String _mainTitle;
String _startTime;
int _state;
String _storeId;
String _storeName;
int _type;
String _updateTime;
int _updateUser;
String _viceTitle;
Author get author => _author;
String get content => _content;
String get coverImg => _coverImg;
String get createTime => _createTime;
int get createUser => _createUser;
String get endTime => _endTime;
String get id => _id;
int get isDelete => _isDelete;
String get mainTitle => _mainTitle;
String get startTime => _startTime;
int get state => _state;
String get storeId => _storeId;
String get storeName => _storeName;
int get type => _type;
String get updateTime => _updateTime;
int get updateUser => _updateUser;
String get viceTitle => _viceTitle;
Article({
Author author,
String content,
String coverImg,
String createTime,
int createUser,
String endTime,
String id,
int isDelete,
String mainTitle,
String startTime,
int state,
String storeId,
String storeName,
int type,
String updateTime,
int updateUser,
String viceTitle}){
_author = author;
_content = content;
_coverImg = coverImg;
_createTime = createTime;
_createUser = createUser;
_endTime = endTime;
_id = id;
_isDelete = isDelete;
_mainTitle = mainTitle;
_startTime = startTime;
_state = state;
_storeId = storeId;
_storeName = storeName;
_type = type;
_updateTime = updateTime;
_updateUser = updateUser;
_viceTitle = viceTitle;
}
Article.fromJson(dynamic json) {
_author = Author.fromJson(jsonDecode(json["author"]));
_content = json["content"];
_coverImg = json["coverImg"];
_createTime = json["createTime"];
_createUser = json["createUser"];
_endTime = json["endTime"];
_id = json["id"];
_isDelete = json["isDelete"];
_mainTitle = json["mainTitle"];
_startTime = json["startTime"];
_state = json["state"];
_storeId = json["storeId"];
_storeName = json["storeName"];
_type = json["type"];
_updateTime = json["updateTime"];
_updateUser = json["updateUser"];
_viceTitle = json["viceTitle"];
}
Map<String, dynamic> toJson() {
var map = <String, dynamic>{};
map["author"] = _author.toJson();
map["content"] = _content;
map["coverImg"] = _coverImg;
map["createTime"] = _createTime;
map["createUser"] = _createUser;
map["endTime"] = _endTime;
map["id"] = _id;
map["isDelete"] = _isDelete;
map["mainTitle"] = _mainTitle;
map["startTime"] = _startTime;
map["state"] = _state;
map["storeId"] = _storeId;
map["storeName"] = _storeName;
map["type"] = _type;
map["updateTime"] = _updateTime;
map["updateUser"] = _updateUser;
map["viceTitle"] = _viceTitle;
return map;
}
}