Skip to content

Commit

Permalink
Feat/synch (#43)
Browse files Browse the repository at this point in the history
* Feat: synchronized 테스트

* Feat: Controller synchronized 테스트
  • Loading branch information
klkim1913 authored Aug 3, 2023
1 parent d6bb115 commit 3fc37b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public AuctionController(AuctionService auctionService) {
}

@PostMapping("/{auction-id}")
public ResponseEntity<BiddingResponse> bidding(
public synchronized ResponseEntity<BiddingResponse> bidding(
@PathVariable("auction-id") long auctionId,
@RequestBody BiddingRequest request) { // 인증정보 받기 추가 예정
return ResponseEntity.ok(auctionService.Bidding(auctionId, request));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/anywayclear/service/AuctionService.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public AuctionService(AuctionRepository auctionRepository) {
}

@Transactional
public synchronized BiddingResponse Bidding(long auctionId, BiddingRequest request) {
public BiddingResponse Bidding(long auctionId, BiddingRequest request) {
Auction auction = auctionRepository.findById(auctionId).orElseThrow(() -> new CustomException(INVALID_AUCTION_ID));
if (request.getPrice() < auction.getPrice() + 100) { // 가격 기준 정해지면 수정할 로직
throw new CustomException(INVALID_PRICE);
Expand Down

0 comments on commit 3fc37b6

Please sign in to comment.