From 6e5366810ed45d6a2b254abbc424db8d64083c20 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Sun, 7 Apr 2024 22:52:43 +0900 Subject: [PATCH] =?UTF-8?q?feat=20::=20=EA=B3=B5=EC=A7=80=20=EA=B8=80=20re?= =?UTF-8?q?sponse=20dto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/data/dto/response/notice_response.dart | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 lib/data/dto/response/notice_response.dart diff --git a/lib/data/dto/response/notice_response.dart b/lib/data/dto/response/notice_response.dart new file mode 100644 index 00000000..cd36704b --- /dev/null +++ b/lib/data/dto/response/notice_response.dart @@ -0,0 +1,32 @@ +import 'package:lotura/domain/entity/notice_entity.dart'; + +class NoticeResponse { + final int id; + final String title; + final String contents; + final String date; + + NoticeResponse({ + required this.id, + required this.title, + required this.contents, + required this.date, + }); + + factory NoticeResponse.fromJson(Map json) { + return NoticeResponse( + id: json['id'], + title: json['title'], + contents: json['contents'], + date: json['date'], + ); + } + + NoticeEntity toEntity() { + return NoticeEntity( + title: title, + contents: contents, + date: date, + ); + } +}