Skip to content

Commit 7f2eede

Browse files
authored
Merge pull request #164 from team-gogo/fix/community-board-info-cache
[community] 게시글 상세 조회 캐시 이슈로 인해 제거
2 parents 62ce9ea + 00d26d9 commit 7f2eede

File tree

3 files changed

+0
-24
lines changed

3 files changed

+0
-24
lines changed

src/main/kotlin/gogo/gogostage/domain/community/root/application/CommunityProcessor.kt

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import gogo.gogostage.domain.community.comment.persistence.CommentRepository
99
import gogo.gogostage.domain.community.commentlike.persistence.CommentLike
1010
import gogo.gogostage.domain.community.commentlike.persistence.CommentLikeRepository
1111
import gogo.gogostage.domain.community.root.application.dto.*
12-
import gogo.gogostage.global.cache.CacheConstant
13-
import gogo.gogostage.global.cache.RedisCacheService
1412
import gogo.gogostage.global.error.StageException
1513
import gogo.gogostage.global.internal.student.stub.StudentByIdStub
1614
import org.springframework.data.repository.findByIdOrNull
@@ -26,7 +24,6 @@ class CommunityProcessor(
2624
private val commentLikeRepository: CommentLikeRepository,
2725
private val commentMapper: CommunityMapper,
2826
private val boardRepository: BoardRepository,
29-
private val redisCacheService: RedisCacheService
3027
) {
3128

3229
fun likeBoard(studentId: Long, board: Board): LikeResDto {
@@ -41,9 +38,6 @@ class CommunityProcessor(
4138
board.minusLikeCount()
4239
boardRepository.save(board)
4340

44-
redisCacheService.deleteFromCache("${CacheConstant.COMMUNITY_INFO_CACHE_VALUE}::${board.id}:true")
45-
redisCacheService.deleteFromCache("${CacheConstant.COMMUNITY_INFO_CACHE_VALUE}::${board.id}:false")
46-
4741
return LikeResDto(
4842
isLiked = false
4943
)
@@ -58,9 +52,6 @@ class CommunityProcessor(
5852
board.plusLikeCount()
5953
boardRepository.save(board)
6054

61-
redisCacheService.deleteFromCache("${CacheConstant.COMMUNITY_INFO_CACHE_VALUE}::${board.id}:true")
62-
redisCacheService.deleteFromCache("${CacheConstant.COMMUNITY_INFO_CACHE_VALUE}::${board.id}:false")
63-
6455
return LikeResDto(
6556
isLiked = true
6657
)
@@ -86,9 +77,6 @@ class CommunityProcessor(
8677
board.plusCommentCount()
8778
boardRepository.save(board)
8879

89-
redisCacheService.deleteFromCache("${CacheConstant.COMMUNITY_INFO_CACHE_VALUE}::${comment.board.id}:true")
90-
redisCacheService.deleteFromCache("${CacheConstant.COMMUNITY_INFO_CACHE_VALUE}::${comment.board.id}:false")
91-
9280
return commentMapper.mapWriteBoardCommentResDto(comment, writeBoardCommentDto, student)
9381
}
9482

@@ -100,10 +88,6 @@ class CommunityProcessor(
10088
?: throw StageException("CommentLike Not Found, commentId=${comment.id}, studentId=${student.studentId}", HttpStatus.NOT_FOUND.value())
10189

10290
commentLikeRepository.delete(commentLike)
103-
104-
redisCacheService.deleteFromCache("${CacheConstant.COMMUNITY_INFO_CACHE_VALUE}::${comment.board.id}:true")
105-
redisCacheService.deleteFromCache("${CacheConstant.COMMUNITY_INFO_CACHE_VALUE}::${comment.board.id}:false")
106-
10791
comment.minusLikeCount()
10892
commentRepository.save(comment)
10993

@@ -118,9 +102,6 @@ class CommunityProcessor(
118102

119103
commentLikeRepository.save(boardLike)
120104

121-
redisCacheService.deleteFromCache("${CacheConstant.COMMUNITY_INFO_CACHE_VALUE}::${comment.board.id}:true")
122-
redisCacheService.deleteFromCache("${CacheConstant.COMMUNITY_INFO_CACHE_VALUE}::${comment.board.id}:false")
123-
124105
comment.plusLikeCount()
125106
commentRepository.save(comment)
126107

src/main/kotlin/gogo/gogostage/domain/community/root/application/CommunityServiceImpl.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@ import gogo.gogostage.domain.community.root.event.CommentCreateEvent
88
import gogo.gogostage.domain.community.root.persistence.SortType
99
import gogo.gogostage.domain.game.persistence.GameCategory
1010
import gogo.gogostage.domain.stage.root.application.StageValidator
11-
import gogo.gogostage.global.cache.CacheConstant
1211
import gogo.gogostage.global.internal.student.stub.StudentByIdStub
1312
import gogo.gogostage.global.util.UserContextUtil
14-
import org.springframework.cache.annotation.CacheEvict
15-
import org.springframework.cache.annotation.Cacheable
1613
import org.springframework.context.ApplicationEventPublisher
1714
import org.springframework.stereotype.Service
1815
import org.springframework.transaction.annotation.Transactional
@@ -54,7 +51,6 @@ class CommunityServiceImpl(
5451
}
5552

5653
@Transactional(readOnly = true)
57-
@Cacheable(value = [CacheConstant.COMMUNITY_INFO_CACHE_VALUE], key = "#boardId + ':' + #isFiltered", cacheManager = "cacheManager")
5854
override fun getStageBoardInfo(boardId: Long, isFiltered: Boolean, student: StudentByIdStub): GetCommunityBoardInfoResDto {
5955
val board = boardReader.read(boardId)
6056
stageValidator.validStage(student, board.community.stage.id)

src/main/kotlin/gogo/gogostage/global/cache/CacheConstant.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ object CacheConstant {
88
const val GAME_CACHE_VALE = "game"
99
const val GAME_FORMAT_CACHE_VALUE = "game_format"
1010
const val MATCH_INFO_CACHE_VALUE = "match_info"
11-
const val COMMUNITY_INFO_CACHE_VALUE = "community_info"
1211
}

0 commit comments

Comments
 (0)