1
This commit is contained in:
33
lib/api/dto/article_detail_dto.dart
Normal file
33
lib/api/dto/article_detail_dto.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
class ArticleDetailDto {
|
||||
int? id;
|
||||
String? title;
|
||||
String? subtitle;
|
||||
String? content;
|
||||
int? status;
|
||||
String? createdAt;
|
||||
String? updatedAt;
|
||||
|
||||
ArticleDetailDto({this.id, this.title, this.subtitle, this.content, this.status, this.createdAt, this.updatedAt});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final map = <String, dynamic>{};
|
||||
map["id"] = id;
|
||||
map["title"] = title;
|
||||
map["subtitle"] = subtitle;
|
||||
map["content"] = content;
|
||||
map["status"] = status;
|
||||
map["created_at"] = createdAt;
|
||||
map["updated_at"] = updatedAt;
|
||||
return map;
|
||||
}
|
||||
|
||||
ArticleDetailDto.fromJson(dynamic json){
|
||||
id = json["id"] ?? 0;
|
||||
title = json["title"] ?? "";
|
||||
subtitle = json["subtitle"] ?? "";
|
||||
content = json["content"] ?? "";
|
||||
status = json["status"] ?? 0;
|
||||
createdAt = json["created_at"] ?? "";
|
||||
updatedAt = json["updated_at"] ?? "";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user