-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 입찰 이력이 없을 때 입찰 가능 횟수가 0으로 표시되는 문제 수정 (#70)
* fix: 로그인 한 상태에서 입찰 가능 횟수 버그 수정 - 한번도 입찰 안한상태에서 입찰 횟수가 0으로 나오는 버그 해결 - default 값을 0에서 3으로 변경 CHZZ-118 * test: 로그인 한 상태에서 입찰 가능 횟수 버그 수정으로 인한 테스트코드 수정 - 비로그인 상태에서 호출시 테스트 코드 추가 - 기존 테스트 코드에서 remainingBidCount 검증 추가 CHZZ-118 * chore: Redis 자동 구성을 제외하고 RedisConfig 설정 수정 CHZZ-118 * chore: .yml Redis 리포지토리 비활성화 추가 CHZZ-118 * feat: 경매 종료 임시 테스트 API 작성 CHZZ-118 * chore: branch Name feat/* 로만 허용 CHZZ-118 * refactor: BidOrder enum에서 'AMOUNT'의 name을 'bid-amount'로 변경 - bidAmount -> bid-amount 로 변경 CHZZ-118 * test: BidOrder enum에서 'AMOUNT'의 name 변경으로 인한 테스트 수정 - bidAmount -> bid-amount 로 변경 CHZZ-118
- Loading branch information
Showing
9 changed files
with
107 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/main/java/org/chzz/market/domain/auction/type/TestService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package org.chzz.market.domain.auction.type; | ||
|
||
import jakarta.transaction.Transactional; | ||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
import java.util.Random; | ||
import lombok.RequiredArgsConstructor; | ||
import org.chzz.market.domain.auction.entity.Auction; | ||
import org.chzz.market.domain.auction.repository.AuctionRepository; | ||
import org.chzz.market.domain.image.entity.Image; | ||
import org.chzz.market.domain.image.repository.ImageRepository; | ||
import org.chzz.market.domain.product.entity.Product; | ||
import org.chzz.market.domain.product.entity.Product.Category; | ||
import org.chzz.market.domain.product.repository.ProductRepository; | ||
import org.chzz.market.domain.user.entity.User; | ||
import org.chzz.market.domain.user.repository.UserRepository; | ||
import org.springframework.stereotype.Service; | ||
|
||
/** | ||
* 경매종료 테스트 서비스 삭제필요 | ||
*/ | ||
@Service | ||
@RequiredArgsConstructor | ||
public class TestService { | ||
private final AuctionRepository auctionRepository; | ||
private final ProductRepository productRepository; | ||
private final ImageRepository imageRepository; | ||
private final UserRepository userRepository; | ||
|
||
@Transactional | ||
public void test(Long userId, int minutes) { | ||
Random random = new Random(); | ||
int randomIndex = random.nextInt(1000) + 1; // 1부터 1000까지 랜덤 숫자 생성 | ||
int randomIndex1 = random.nextInt(1000) + 1; // 1부터 1000까지 랜덤 숫자 생성 | ||
User user = userRepository.findById(userId).get(); | ||
Product product = Product.builder() | ||
.name("테스트" + randomIndex) | ||
.description("test") | ||
.category(Category.ELECTRONICS) | ||
.user(user) | ||
.minPrice(10000) | ||
.build(); | ||
productRepository.save(product); | ||
|
||
Image image1 = Image.builder() | ||
.cdnPath("https://picsum.photos/id/" + randomIndex + "/200/200") | ||
.product(product) | ||
.build(); | ||
Image image2 = Image.builder() | ||
.cdnPath("https://picsum.photos/id/" + randomIndex1 + "/200/200") | ||
.product(product) | ||
.build(); | ||
imageRepository.save(image1); | ||
imageRepository.save(image2); | ||
product.addImages(List.of(image1, image2)); | ||
auctionRepository.save(Auction.builder() | ||
.status(AuctionStatus.PROCEEDING) | ||
.endDateTime(LocalDateTime.now().plusMinutes(minutes)) | ||
.product(product) | ||
.build()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters