Skip to content

Commit

Permalink
fix: work viewCount +1 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
GaHee99 committed May 12, 2024
1 parent d2c5ada commit 1b875e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ public WorkPortfolioGetResponseDTO getPortfolio(Long requestUserId, Long userId)
val user = findUser(userId);
user.setViewCount(user.getViewCount() + 1);
val works = getUserPortfolios(userId);
works.forEach(w -> w.viewCountUp());

val scrapList = requestUser.getUserScraps().stream()
.map(UserScrap::getTargetId)
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/gam/api/domain/work/entity/Work.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,8 @@ private void setUser(User user) {
public void setIsFirst(boolean status){
this.isFirst = status;
}

public void viewCountUp() {
this.viewCount += 1;
}
}

0 comments on commit 1b875e1

Please sign in to comment.