Skip to content
This repository has been archived by the owner on Aug 13, 2022. It is now read-only.

Commit

Permalink
chore : 성능테스를 위한 cache 해제
Browse files Browse the repository at this point in the history
1. ngrinder 성능테스트 비교를 위한 cahce 임시 해제
  • Loading branch information
kihyuk-jeong committed May 25, 2021
1 parent 7759dfc commit 437eedd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public TradeResource obtainResourceForBid(@CurrentUser String email,
return resourceForBid;
}

// @LoginCheck(authority = UserLevel.AUTH)
@LoginCheck(authority = UserLevel.AUTH)
@PostMapping("/sell/bid")
@ResponseStatus(HttpStatus.CREATED)
public void salesBid(@CurrentUser String email, @RequestBody TradeDto.SaveRequest requestDto) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import com.flab.shoeauction.service.storage.AwsS3Service;
import javax.annotation.Nullable;
import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
Expand Down Expand Up @@ -43,7 +41,7 @@ public void saveProduct(SaveRequest requestDto, @Nullable MultipartFile productI
}

@Transactional(readOnly = true)
@Cacheable(value = "product", key = "#id")
// @Cacheable(value = "product", key = "#id")
public ProductInfoResponse getProductInfo(Long id) {
return productRepository.findById(id).orElseThrow(
ProductNotFoundException::new)
Expand All @@ -56,7 +54,7 @@ public Page<ThumbnailResponse> findProducts(SearchCondition condition,
return productRepository.findAllBySearchCondition(condition, pageable);
}

@CacheEvict(value = "product", key = "#id")
// @CacheEvict(value = "product", key = "#id")
public void deleteProduct(Long id) {
Product product = productRepository.findById(id)
.orElseThrow(ProductNotFoundException::new);
Expand All @@ -69,7 +67,7 @@ public void deleteProduct(Long id) {
}
}

@CacheEvict(value = "product", key = "#id")
// @CacheEvict(value = "product", key = "#id")
@Transactional
public void updateProduct(Long id, SaveRequest updatedProduct,
@Nullable MultipartFile productImage) {
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/com/flab/shoeauction/service/TradeService.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.flab.shoeauction.exception.user.UserNotFoundException;
import com.flab.shoeauction.service.message.MessageService;
import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
Expand Down Expand Up @@ -66,7 +65,7 @@ private TradeResource makeTradeResource(User user, Product product, double size)
}

@Transactional
@CacheEvict(value = "product", key = "#requestDto.productId")
// @CacheEvict(value = "product", key = "#requestDto.productId")
public void createSalesBid(String email, SaveRequest requestDto) {
User user = userRepository.findByEmail(email)
.orElseThrow(() -> new UserNotFoundException("존재하지 않는 사용자 입니다."));
Expand All @@ -80,7 +79,7 @@ public void createSalesBid(String email, SaveRequest requestDto) {
}

@Transactional
@CacheEvict(value = "product", key = "#requestDto.productId")
// @CacheEvict(value = "product", key = "#requestDto.productId")
public void createPurchaseBid(String email, SaveRequest requestDto) {
User user = userRepository.findByEmail(email)
.orElseThrow(() -> new UserNotFoundException("존재하지 않는 사용자 입니다."));
Expand All @@ -99,7 +98,7 @@ public void createPurchaseBid(String email, SaveRequest requestDto) {
}

@Transactional
@CacheEvict(value = "product", key = "#requestDto.productId")
// @CacheEvict(value = "product", key = "#requestDto.productId")
public void immediatePurchase(String email, ImmediateTradeRequest requestDto) {
User buyer = userRepository.findByEmail(email)
.orElseThrow(() -> new UserNotFoundException("존재하지 않는 사용자 입니다."));
Expand All @@ -119,7 +118,7 @@ public void immediatePurchase(String email, ImmediateTradeRequest requestDto) {
}

@Transactional
@CacheEvict(value = "product", key = "#requestDto.productId")
// @CacheEvict(value = "product", key = "#requestDto.productId")
public void immediateSale(String email, ImmediateTradeRequest requestDto) {
User seller = userRepository.findByEmail(email)
.orElseThrow(() -> new UserNotFoundException("존재하지 않는 사용자 입니다."));
Expand Down

0 comments on commit 437eedd

Please sign in to comment.