-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KL-68/feat: validate product update request
- 상품 정보 수정 시 유효성 검사 - 상품명, 상품설명, 주소 길이 검사 - 가격 범위 검사 - 상품 정보 수정 dto 필드 순서 변경 - 이에 따라 테스트코드 수정
- Loading branch information
Showing
6 changed files
with
128 additions
and
54 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
22 changes: 19 additions & 3 deletions
22
src/main/java/taco/klkl/domain/product/dto/request/ProductUpdateRequestDto.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 |
---|---|---|
@@ -1,12 +1,28 @@ | ||
package taco.klkl.domain.product.dto.request; | ||
|
||
import jakarta.validation.constraints.PositiveOrZero; | ||
import jakarta.validation.constraints.Size; | ||
import taco.klkl.global.common.constants.ProductConstants; | ||
import taco.klkl.global.common.constants.ProductValidationMessages; | ||
|
||
public record ProductUpdateRequestDto( | ||
@Size(max = ProductConstants.NAME_MAX_LENGTH, message = ProductValidationMessages.NAME_SIZE) | ||
String name, | ||
|
||
@Size(max = ProductConstants.DESCRIPTION_MAX_LENGTH, message = ProductValidationMessages.DESCRIPTION_SIZE) | ||
String description, | ||
|
||
@Size(max = ProductConstants.ADDRESS_MAX_LENGTH, message = ProductValidationMessages.ADDRESS_SIZE) | ||
String address, | ||
|
||
@PositiveOrZero(message = ProductValidationMessages.PRICE_POSITIVE_OR_ZERO) | ||
Integer price, | ||
|
||
Long cityId, | ||
|
||
Long subcategoryId, | ||
Long currencyId, | ||
String address, | ||
Integer price | ||
|
||
Long currencyId | ||
|
||
) { | ||
} |
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