Files
derma_flutter/lib/api/dto/article_detail_dto.dart
zhutao 99a1ce601e 1
2025-08-22 14:15:02 +08:00

33 lines
867 B
Dart

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"] ?? "";
}
}