Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: 사전등록 수정 요청 DTO 일부 필드 이름 수정 #75

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.List;
import lombok.Getter;
import org.chzz.market.domain.auction.type.AuctionStatus;
import org.chzz.market.domain.product.entity.Product.Category;

@Getter
public class AuctionDetailsResponse {
Expand All @@ -13,6 +14,7 @@ public class AuctionDetailsResponse {
private final String productName;
private final String description;
private final Integer minPrice;
private final Category category;
private final Long timeRemaining;
private final AuctionStatus status;
private final Boolean isSeller;
Expand All @@ -25,7 +27,7 @@ public class AuctionDetailsResponse {

@QueryProjection
public AuctionDetailsResponse(Long productId, String sellerNickname, String productName, String description,
Integer minPrice, Long timeRemaining, AuctionStatus status,
Integer minPrice, Category category, Long timeRemaining, AuctionStatus status,
Boolean isSeller,
Long participantCount, Boolean isParticipated, Long bidId, Long bidAmount,
int remainingBidCount) {
Expand All @@ -34,6 +36,7 @@ public AuctionDetailsResponse(Long productId, String sellerNickname, String prod
this.productName = productName;
this.description = description;
this.minPrice = minPrice;
this.category = category;
this.timeRemaining = timeRemaining;
this.status = status;
this.isSeller = isSeller;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public Optional<AuctionDetailsResponse> findAuctionDetailsById(Long auctionId, L
product.name,
product.description,
product.minPrice,
product.category,
timeRemaining().longValue(),
auction.status,
userIdEq(userId),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@AllArgsConstructor
public class UpdateProductRequest {
@Size(min = 2, message = "제목은 최소 2글자 이상이어야 합니다")
private String name;
private String productName;

@Size(max = 1000, message = "상품 설명은 최대 1000자까지 가능합니다")
private String description;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.chzz.market.common.validation.annotation.ThousandMultiple;
import org.chzz.market.domain.base.entity.BaseTimeEntity;
import org.chzz.market.domain.image.entity.Image;
import org.chzz.market.domain.like.entity.Like;
Expand Down Expand Up @@ -103,7 +102,7 @@ public void removeLike(Like like) {


public void update(UpdateProductRequest modifiedProduct) {
this.name = modifiedProduct.getName();
this.name = modifiedProduct.getProductName();
this.description = modifiedProduct.getDescription();
this.category = modifiedProduct.getCategory();
this.minPrice = modifiedProduct.getMinPrice();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public void testGetAuctionDetails_ExistingAuction_NoException() {
Long existingAuctionId = 1L;
Long userId = 1L;
AuctionDetailsResponse auctionDetails = new AuctionDetailsResponse(1L, "닉네임2", "제품1", null, 1000,
123L, PROCEEDING, false, 0L, false, null, 0L, 0);
ELECTRONICS, 123L, PROCEEDING, false, 0L, false, null, 0L, 0);

// when
when(auctionRepository.findAuctionDetailsById(anyLong(), anyLong())).thenReturn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void setUp() {
.build();

updateRequest = UpdateProductRequest.builder()
.name("수정된 상품")
.productName("수정된 상품")
.description("수정된 설명")
.category(HOME_APPLIANCES)
.minPrice(20000)
Expand Down Expand Up @@ -204,7 +204,7 @@ void updateProduct_WithoutImages() {
void updateProduct_InvalidUser() {
// given
UpdateProductRequest invalidUserRequest = UpdateProductRequest.builder()
.name("수정된 상품")
.productName("수정된 상품")
.description("수정된 설명")
.category(HOME_APPLIANCES)
.minPrice(20000)
Expand All @@ -221,7 +221,7 @@ void updateProduct_InvalidUser() {
void updateProduct_InvalidOwner() {
// given
UpdateProductRequest invalidUserRequest = UpdateProductRequest.builder()
.name("수정된 상품")
.productName("수정된 상품")
.description("수정된 설명")
.category(HOME_APPLIANCES)
.minPrice(20000)
Expand Down
Loading