Merge pull request '콘텐츠 메인 캐싱전략 수정' (#67) from test into main
Reviewed-on: #67
This commit is contained in:
		| @@ -400,8 +400,6 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) | |||||||
|         return queryFactory |         return queryFactory | ||||||
|             .selectFrom(audioContentCuration) |             .selectFrom(audioContentCuration) | ||||||
|             .where(where) |             .where(where) | ||||||
|             .offset(0) |  | ||||||
|             .limit(15) |  | ||||||
|             .orderBy(audioContentCuration.orders.asc()) |             .orderBy(audioContentCuration.orders.asc()) | ||||||
|             .fetch() |             .fetch() | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -20,7 +20,7 @@ class AudioContentMainController(private val service: AudioContentMainService) { | |||||||
|     ) = run { |     ) = run { | ||||||
|         if (member == null) throw SodaException("로그인 정보를 확인해주세요.") |         if (member == null) throw SodaException("로그인 정보를 확인해주세요.") | ||||||
|  |  | ||||||
|         ApiResponse.ok(service.getMain(member = member)) |         ApiResponse.ok(service.getMain(memberId = member.id!!, isAdult = member.auth != null)) | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @GetMapping("/new") |     @GetMapping("/new") | ||||||
|   | |||||||
| @@ -29,10 +29,8 @@ class AudioContentMainService( | |||||||
|     @Value("\${cloud.aws.cloud-front.host}") |     @Value("\${cloud.aws.cloud-front.host}") | ||||||
|     private val imageHost: String |     private val imageHost: String | ||||||
| ) { | ) { | ||||||
|     fun getMain(member: Member): GetAudioContentMainResponse { |     @Cacheable(cacheNames = ["default"], key = "'contentMain:' + #memberId + ':' + #isAdult") | ||||||
|         val isAdult = member.auth != null |     fun getMain(memberId: Long, isAdult: Boolean): GetAudioContentMainResponse { | ||||||
|         val memberId = member.id!! |  | ||||||
|  |  | ||||||
|         // 2주일 이내에 콘텐츠를 올린 크리에이터 20명 조회 |         // 2주일 이내에 콘텐츠를 올린 크리에이터 20명 조회 | ||||||
|         val newContentUploadCreatorList = getNewContentUploadCreatorList(memberId = memberId, isAdult = isAdult) |         val newContentUploadCreatorList = getNewContentUploadCreatorList(memberId = memberId, isAdult = isAdult) | ||||||
|  |  | ||||||
| @@ -40,7 +38,7 @@ class AudioContentMainService( | |||||||
|  |  | ||||||
|         // 구매목록 20개 |         // 구매목록 20개 | ||||||
|         val orderList = orderService.getAudioContentMainOrderList( |         val orderList = orderService.getAudioContentMainOrderList( | ||||||
|             member = member, |             memberId = memberId, | ||||||
|             limit = 20 |             limit = 20 | ||||||
|         ) |         ) | ||||||
|  |  | ||||||
| @@ -118,7 +116,6 @@ class AudioContentMainService( | |||||||
|         return GetNewContentAllResponse(totalCount, items) |         return GetNewContentAllResponse(totalCount, items) | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Cacheable(cacheNames = ["default"], key = "'newContentUploadCreatorList:' + #memberId + ':' + #isAdult") |  | ||||||
|     fun getNewContentUploadCreatorList(memberId: Long, isAdult: Boolean): List<GetNewContentUploadCreator> { |     fun getNewContentUploadCreatorList(memberId: Long, isAdult: Boolean): List<GetNewContentUploadCreator> { | ||||||
|         return repository.getNewContentUploadCreatorList( |         return repository.getNewContentUploadCreatorList( | ||||||
|             cloudfrontHost = imageHost, |             cloudfrontHost = imageHost, | ||||||
| @@ -129,7 +126,6 @@ class AudioContentMainService( | |||||||
|             .toList() |             .toList() | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Cacheable(cacheNames = ["default"], key = "'contentMainBannerList:' + #memberId + ':' + #isAdult") |  | ||||||
|     fun getAudioContentMainBannerList(memberId: Long, isAdult: Boolean) = |     fun getAudioContentMainBannerList(memberId: Long, isAdult: Boolean) = | ||||||
|         repository.getAudioContentMainBannerList(isAdult = isAdult) |         repository.getAudioContentMainBannerList(isAdult = isAdult) | ||||||
|             .asSequence() |             .asSequence() | ||||||
| @@ -178,7 +174,6 @@ class AudioContentMainService( | |||||||
|             } |             } | ||||||
|             .toList() |             .toList() | ||||||
|  |  | ||||||
|     @Cacheable(cacheNames = ["default"], key = "'contentCurationList:' + #memberId + ':' + #isAdult") |  | ||||||
|     fun getAudioContentCurationList(memberId: Long, isAdult: Boolean) = |     fun getAudioContentCurationList(memberId: Long, isAdult: Boolean) = | ||||||
|         repository.getAudioContentCurations(isAdult = isAdult) |         repository.getAudioContentCurations(isAdult = isAdult) | ||||||
|             .asSequence() |             .asSequence() | ||||||
|   | |||||||
| @@ -92,11 +92,11 @@ class OrderService( | |||||||
|         ) |         ) | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     fun getAudioContentMainOrderList(member: Member, limit: Int): List<GetAudioContentMainItem> { |     fun getAudioContentMainOrderList(memberId: Long, limit: Int): List<GetAudioContentMainItem> { | ||||||
|         return repository.getAudioContentMainOrderList( |         return repository.getAudioContentMainOrderList( | ||||||
|             dateTime = LocalDateTime.now(), |             dateTime = LocalDateTime.now(), | ||||||
|             coverImageHost = audioContentCoverImageHost, |             coverImageHost = audioContentCoverImageHost, | ||||||
|             memberId = member.id!!, |             memberId = memberId, | ||||||
|             offset = 0, |             offset = 0, | ||||||
|             limit = 20 |             limit = 20 | ||||||
|         ) |         ) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user