fmk
3 years ago
10 changed files with 378 additions and 89 deletions
@ -0,0 +1,145 @@ |
|||||||
|
/// id : "1450279348069203968" |
||||||
|
/// subject : "哈哈哈哈哈哈😃😃😃😃" |
||||||
|
/// subjectInfo : {"type":"image","images":["https://pos.upload.gznl.top/admin/2021/10/9a15049b-9828-4056-84d7-21b9055d2cb0.jpeg"],"video":""} |
||||||
|
/// memberInfo : {"mid":null,"nickname":null,"avatar":""} |
||||||
|
/// likes : 0 |
||||||
|
/// viewers : 0 |
||||||
|
/// comments : 0 |
||||||
|
/// selfLike : false |
||||||
|
/// selfFollow : false |
||||||
|
/// createTime : "2021-10-19 09:55:16" |
||||||
|
|
||||||
|
class ComunityComment { |
||||||
|
|
||||||
|
ComunityComment({ |
||||||
|
String id, |
||||||
|
String subject, |
||||||
|
SubjectInfo subjectInfo, |
||||||
|
MemberInfo memberInfo, |
||||||
|
int likes, |
||||||
|
int viewers, |
||||||
|
int comments, |
||||||
|
bool selfLike, |
||||||
|
bool selfFollow, |
||||||
|
String createTime,}){ |
||||||
|
this.id = id; |
||||||
|
this.subject = subject; |
||||||
|
this.subjectInfo = subjectInfo; |
||||||
|
this.memberInfo = memberInfo; |
||||||
|
this.likes = likes; |
||||||
|
this.viewers = viewers; |
||||||
|
this.comments = comments; |
||||||
|
this.selfLike = selfLike; |
||||||
|
this.selfFollow = selfFollow; |
||||||
|
this.createTime = createTime; |
||||||
|
} |
||||||
|
|
||||||
|
ComunityComment.fromJson(dynamic json) { |
||||||
|
this.id = json['id']; |
||||||
|
this.subject = json['subject']; |
||||||
|
this.subjectInfo = json['subjectInfo'] != null ? SubjectInfo.fromJson(json['subjectInfo']) : null; |
||||||
|
this.memberInfo = json['memberInfo'] != null ? MemberInfo.fromJson(json['memberInfo']) : null; |
||||||
|
this.likes = json['likes']; |
||||||
|
this.viewers = json['viewers']; |
||||||
|
this.comments = json['comments']; |
||||||
|
this.selfLike = json['selfLike']; |
||||||
|
this.selfFollow = json['selfFollow']; |
||||||
|
this.createTime = json['createTime']; |
||||||
|
} |
||||||
|
String id; |
||||||
|
String subject; |
||||||
|
SubjectInfo subjectInfo; |
||||||
|
MemberInfo memberInfo; |
||||||
|
int likes; |
||||||
|
int viewers; |
||||||
|
int comments; |
||||||
|
bool selfLike; |
||||||
|
bool selfFollow; |
||||||
|
String createTime; |
||||||
|
|
||||||
|
Map<String, dynamic> toJson() { |
||||||
|
final map = <String, dynamic>{}; |
||||||
|
map['id'] = this.id; |
||||||
|
map['subject'] = this.subject; |
||||||
|
if (this.subjectInfo != null) { |
||||||
|
map['subjectInfo'] = this.subjectInfo.toJson(); |
||||||
|
} |
||||||
|
if (this.memberInfo != null) { |
||||||
|
map['memberInfo'] = this.memberInfo.toJson(); |
||||||
|
} |
||||||
|
map['likes'] = this.likes; |
||||||
|
map['viewers'] = this.viewers; |
||||||
|
map['comments'] = this.comments; |
||||||
|
map['selfLike'] = this.selfLike; |
||||||
|
map['selfFollow'] = this.selfFollow; |
||||||
|
map['createTime'] = this.createTime; |
||||||
|
return map; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
/// mid : null |
||||||
|
/// nickname : null |
||||||
|
/// avatar : "" |
||||||
|
|
||||||
|
class MemberInfo { |
||||||
|
MemberInfo({ |
||||||
|
dynamic mid, |
||||||
|
dynamic nickname, |
||||||
|
String avatar,}){ |
||||||
|
this.mid = mid; |
||||||
|
this.nickname = nickname; |
||||||
|
this.avatar = avatar; |
||||||
|
} |
||||||
|
|
||||||
|
MemberInfo.fromJson(dynamic json) { |
||||||
|
this.mid = json['mid']; |
||||||
|
this.nickname = json['nickname']; |
||||||
|
this.avatar = json['avatar']; |
||||||
|
} |
||||||
|
dynamic mid; |
||||||
|
dynamic nickname; |
||||||
|
String avatar; |
||||||
|
|
||||||
|
Map<String, dynamic> toJson() { |
||||||
|
final map = <String, dynamic>{}; |
||||||
|
map['mid'] = this.mid; |
||||||
|
map['nickname'] = this.nickname; |
||||||
|
map['avatar'] = this.avatar; |
||||||
|
return map; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
/// type : "image" |
||||||
|
/// images : ["https://pos.upload.gznl.top/admin/2021/10/9a15049b-9828-4056-84d7-21b9055d2cb0.jpeg"] |
||||||
|
/// video : "" |
||||||
|
|
||||||
|
class SubjectInfo { |
||||||
|
SubjectInfo({ |
||||||
|
String type, |
||||||
|
List<String> images, |
||||||
|
String video,}){ |
||||||
|
this.type = type; |
||||||
|
this.images = images; |
||||||
|
this.video = video; |
||||||
|
} |
||||||
|
|
||||||
|
SubjectInfo.fromJson(dynamic json) { |
||||||
|
this.type = json['type']; |
||||||
|
this.images = json['images'] != null ? json['images'].cast<String>() : []; |
||||||
|
this.video = json['video']; |
||||||
|
} |
||||||
|
String type; |
||||||
|
List<String> images; |
||||||
|
String video; |
||||||
|
|
||||||
|
Map<String, dynamic> toJson() { |
||||||
|
final map = <String, dynamic>{}; |
||||||
|
map['type'] = this.type; |
||||||
|
map['images'] = this.images; |
||||||
|
map['video'] = this.video; |
||||||
|
return map; |
||||||
|
} |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue