Skip to content

Commit

Permalink
feat: 리뷰 쿼리 성능 테스트를 위한 세팅
Browse files Browse the repository at this point in the history
* 조인을 사용하는 쿼리와 사용하지 않는 쿼리
  • Loading branch information
EunChanNam committed Dec 4, 2023
1 parent f03d439 commit c28fea0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public void addInterceptors(final InterceptorRegistry registry) {
.addExcludePathPattern("/api/users/refresh/*")
.addExcludePathPattern("/api/like/test/clean")
.addExcludePathPattern("/api/like/test/count/**")
.addExcludePathPattern("/api/email/*");
.addExcludePathPattern("/api/email/*")
.addExcludePathPattern("/api/reviews/test/**");

registry
.addInterceptor(pathMatcherInterceptor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.List;

import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

Expand All @@ -23,6 +24,7 @@ public class ReviewQueryTestController {
private final ReviewQueryDslRepository reviewQueryDslRepository;

@Transactional(readOnly = true)
@GetMapping("/join")
public ResponseWrapper<ReviewResponse> withJoin() {
List<Review> reviews = reviewQueryDslRepository.joinWithLikeQuery()
.stream()
Expand All @@ -32,6 +34,7 @@ public ResponseWrapper<ReviewResponse> withJoin() {
}

@Transactional(readOnly = true)
@GetMapping("/no_join")
public ResponseWrapper<ReviewResponse> withoutJoin() {
List<Review> reviews = reviewQueryDslRepository.noJoinQuery();
return ReviewResponseAssembler.toWrappedReviewResponse(reviews);
Expand Down

0 comments on commit c28fea0

Please sign in to comment.