Skip to content

Commit

Permalink
refactor: 생성일 포멧 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
2Jin1031 committed Jan 3, 2025
1 parent faa2b65 commit 9045762
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.example.backend.news.domain.dto;

정import java.time.format.DateTimeFormatter;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
Expand Down Expand Up @@ -35,7 +36,7 @@ public static NewsResDto of(News news) {
.title(news.getTitle())
.content(news.getContent())
.view(news.getView())
.createDate(news.getCreateDate())
.createDate(news.getCreatedAt().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))
.link(news.getLink())
.image(news.getImage())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ public class News extends BaseEntity {
@Column(name = "view")
private int view;

@Column(name = "create_date")
private String createDate;

@Column(name = "link")
private String link;

Expand All @@ -42,12 +39,11 @@ public class News extends BaseEntity {


@Builder
private News(String title, String content, int view, String createDate, String link,
private News(String title, String content, int view, String link,
String image) {
this.title = title;
this.content = content;
this.view = view;
this.createDate = createDate;
this.link = link;
this.image = image;
}
Expand All @@ -57,7 +53,6 @@ public static News of(NewsReqDto dto) {
.title(dto.getTitle())
.content(dto.getContent())
.view(0)
.createDate(dto.getCreateDate())
.link(dto.getLink())
.image(dto.getImage())
.build();
Expand All @@ -66,7 +61,6 @@ public static News of(NewsReqDto dto) {
public void update(NewsReqDto dto) {
this.title = dto.getTitle();
this.content = dto.getContent();
this.createDate = dto.getCreateDate();
this.link = dto.getLink();
this.image = dto.getImage();
}
Expand Down

0 comments on commit 9045762

Please sign in to comment.