Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ public Long getRedisViewCount(long sharedNoteId) {

if (value == null) {
Long viewCountFromDb = sharedNoteFinder.findViewCountById(sharedNoteId);

if (viewCountFromDb == null) {
log.warn("DB의 sharedNote 조회수가 null sharedNoteId={}", sharedNoteId);
viewCountFromDb = 0L;
}

redisTemplate.opsForValue().set(key, viewCountFromDb.toString());
return viewCountFromDb;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,14 @@ public static SharedNote toSharedNote(Member member, Limjang limjang, SharedNote
.month(dto.month())
.period(dto.period())
.isImageShared(dto.isImageShared())
.viewCount(0L)
.build();
}

public void updatePrice(long price) {
this.price = price;
}

public void updateDeletedAt(Timestamp deletedAt) {
this.deletedAt = deletedAt;
}
Expand Down