-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/8 : 이미지 추가 및 수정 #22
base: main
Are you sure you want to change the base?
Conversation
class UnAuthorizationException : RuntimeException() | ||
|
||
class UnsupportedFileExtensionException : RuntimeException() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
예외가 발생할 때마다 클래스를 만들 수 없으니 응답 코드, 메세지를 받는 예외 클래스를 만들어보시죠
fileNames.forEach { delete(it) } | ||
} | ||
|
||
fun delete(fileName: String) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 함수 private으로 바꾸시죠
throw UnsupportedFileExtensionException() | ||
} | ||
val extension = fileName.substring(extensionIndex + 1) | ||
require(IMAGE_EXTENSIONS.contains(extension)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확장자가 대문자로 오는 경우도 예외 발생 안하게 해주세요
@Convert(converter = ProductImagesConverter::class) | ||
@Column(name = "IMAGES") | ||
val images: ProductImagesVo, | ||
@Convert(converter = ProductImagesConverter::class) @Column(name = "IMAGES") val images: ProductImagesVo, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
왜 한줄로 하시나요??,
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) var id: Long = 0L, | ||
) : AuditingTimeEntity() { | ||
fun updateProduct(dto: ProductEditReq): Product { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Product를 리턴할 필요가 있을까요?
|
||
companion object { | ||
fun validateProduct(startPrice: Int, startDate: LocalDateTime, endDate: LocalDateTime) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 로직이 static 함수로 명시가 되있는게 이상합니다.
kotlin에 init을 활용해 Product 생성시 검증을 진행하는게 더 적합하빈다.
} | ||
|
||
private fun validateStartPrice(startPrice: Int) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
마찬가지로 static 함수로 명시된게 이상합니다.
Quality Gate passedIssues Measures |
#️⃣연관된 이슈
📝작업 내용
스크린샷 (선택)