Skip to content

Commit

Permalink
Merge pull request #18 from Ha-dam/feat/11-monthlyDiary
Browse files Browse the repository at this point in the history
fix: add diary title
  • Loading branch information
ziiyouth authored Dec 11, 2023
2 parents 6248bb0 + 8cf1753 commit 239de94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/hadam/hadam/domain/Diary.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public class Diary extends BaseTimeEntity {
@Column(columnDefinition = "LONGTEXT")
private String img;

private String title;

@Column(columnDefinition = "TEXT")
private String content;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/hadam/hadam/service/DiaryService.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public List<MonthlyListReq> getMonthlyAllDiaryNew(Long memberId, int year, int m
.map(diary -> new MonthlyListReq(
diary.getId(),
diary.getImg(),
truncateContent(diary.getContent()), // truncateContent 메서드 사용
truncateContent(diary.getTitle()), // truncateContent 메서드 사용
diary.getDate().format(formatter)
))
.sorted(Comparator.comparing(MonthlyListReq::date).reversed())
Expand All @@ -114,7 +114,7 @@ public List<MonthlyListReq> getMonthlyAllDiaryOld(Long memberId, int year, int m
.map(diary -> new MonthlyListReq(
diary.getId(),
diary.getImg(),
truncateContent(diary.getContent()), // truncateContent 메서드 사용
truncateContent(diary.getTitle()), // truncateContent 메서드 사용
diary.getDate().format(formatter)
))
.sorted(Comparator.comparing(MonthlyListReq::date))
Expand Down

0 comments on commit 239de94

Please sign in to comment.