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.7 KiB
139 lines
3.7 KiB
import 'dart:convert'; |
|
|
|
import 'package:huixiang/retrofit/data/author.dart'; |
|
|
|
/// id : "4" |
|
/// createTime : "2021-07-05 14:20:43" |
|
/// createUser : null |
|
/// updateTime : "2021-07-05 14:23:47" |
|
/// updateUser : null |
|
/// storeId : "0" |
|
/// mainTitle : "牡丹花的养护知识" |
|
/// viceTitle : null |
|
/// content : "阿斯顿发斯蒂芬" |
|
/// coverImg : "https://pos.upload.gznl.top/MDAwMA==/2021/06/2a1060d8-08f6-4036-935a-0514aaade9d8.jpg" |
|
/// author : "{\"name\":\"百花谷\",\"avatar\":\"https://pos.upload.gznl.top/MDAwMA==/2021/06/6a3586dc-a340-470f-b645-1e3155d5f558.jpg\"}" |
|
/// type : 2 |
|
/// startTime : "2021-07-05 14:25:10" |
|
/// endTime : "2099-01-01 00:00:00" |
|
/// state : 1 |
|
/// isDelete : 0 |
|
/// storeName : null |
|
|
|
class Article { |
|
String _id; |
|
String _createTime; |
|
dynamic _createUser; |
|
String _updateTime; |
|
dynamic _updateUser; |
|
String _storeId; |
|
String _mainTitle; |
|
dynamic _viceTitle; |
|
String _content; |
|
String _coverImg; |
|
Author _author; |
|
int _type; |
|
String _startTime; |
|
String _endTime; |
|
int _state; |
|
int _isDelete; |
|
dynamic _storeName; |
|
|
|
String get id => _id; |
|
String get createTime => _createTime; |
|
dynamic get createUser => _createUser; |
|
String get updateTime => _updateTime; |
|
dynamic get updateUser => _updateUser; |
|
String get storeId => _storeId; |
|
String get mainTitle => _mainTitle; |
|
dynamic get viceTitle => _viceTitle; |
|
String get content => _content; |
|
String get coverImg => _coverImg; |
|
Author get author => _author; |
|
int get type => _type; |
|
String get startTime => _startTime; |
|
String get endTime => _endTime; |
|
int get state => _state; |
|
int get isDelete => _isDelete; |
|
dynamic get storeName => _storeName; |
|
|
|
Article({ |
|
String id, |
|
String createTime, |
|
dynamic createUser, |
|
String updateTime, |
|
dynamic updateUser, |
|
String storeId, |
|
String mainTitle, |
|
dynamic viceTitle, |
|
String content, |
|
String coverImg, |
|
Author author, |
|
int type, |
|
String startTime, |
|
String endTime, |
|
int state, |
|
int isDelete, |
|
dynamic storeName}){ |
|
_id = id; |
|
_createTime = createTime; |
|
_createUser = createUser; |
|
_updateTime = updateTime; |
|
_updateUser = updateUser; |
|
_storeId = storeId; |
|
_mainTitle = mainTitle; |
|
_viceTitle = viceTitle; |
|
_content = content; |
|
_coverImg = coverImg; |
|
_author = author; |
|
_type = type; |
|
_startTime = startTime; |
|
_endTime = endTime; |
|
_state = state; |
|
_isDelete = isDelete; |
|
_storeName = storeName; |
|
} |
|
|
|
Article.fromJson(dynamic json) { |
|
_id = json["id"]; |
|
_createTime = json["createTime"]; |
|
_createUser = json["createUser"]; |
|
_updateTime = json["updateTime"]; |
|
_updateUser = json["updateUser"]; |
|
_storeId = json["storeId"]; |
|
_mainTitle = json["mainTitle"]; |
|
_viceTitle = json["viceTitle"]; |
|
_content = json["content"]; |
|
_coverImg = json["coverImg"]; |
|
_author = Author.fromJson(jsonDecode(json["author"])); |
|
_type = json["type"]; |
|
_startTime = json["startTime"]; |
|
_endTime = json["endTime"]; |
|
_state = json["state"]; |
|
_isDelete = json["isDelete"]; |
|
_storeName = json["storeName"]; |
|
} |
|
|
|
Map<String, dynamic> toJson() { |
|
var map = <String, dynamic>{}; |
|
map["id"] = _id; |
|
map["createTime"] = _createTime; |
|
map["createUser"] = _createUser; |
|
map["updateTime"] = _updateTime; |
|
map["updateUser"] = _updateUser; |
|
map["storeId"] = _storeId; |
|
map["mainTitle"] = _mainTitle; |
|
map["viceTitle"] = _viceTitle; |
|
map["content"] = _content; |
|
map["coverImg"] = _coverImg; |
|
map["author"] = _author.toJson(); |
|
map["type"] = _type; |
|
map["startTime"] = _startTime; |
|
map["endTime"] = _endTime; |
|
map["state"] = _state; |
|
map["isDelete"] = _isDelete; |
|
map["storeName"] = _storeName; |
|
return map; |
|
} |
|
|
|
} |