Skip to content

Commit

Permalink
♻️ :: 조회수 증가 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
jyk1029 committed Nov 16, 2023
1 parent 5f615cf commit 018a359
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Feed(
this.type = type
}

fun plusViews(add: Int) {
this.views = views + add
fun updateViewsCount() {
this.views++
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ class QueryFeedDetailService(
private val feedFacade: FeedFacade,
private val userFacade: UserFacade,
) {
@Transactional(readOnly = true)
@Transactional
fun execute(feedId: UUID): QueryFeedDetailResponse {
val feed = feedFacade.getByFeedId(feedId)
feed.plusViews(1)
feed.updateViewsCount()

return QueryFeedDetailResponse(
feedId = feed.id,
Expand Down

0 comments on commit 018a359

Please sign in to comment.