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, + ); + } +}