-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #203 from ITA-OneByte/dev
[Release] 메인 클래스 추가 API 배포
- Loading branch information
Showing
3 changed files
with
44 additions
and
36 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: 8 additions & 14 deletions
22
src/main/java/classfit/example/classfit/category/dto/request/MainClassRequest.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,18 +1,12 @@ | ||
package classfit.example.classfit.category.dto.request; | ||
|
||
import classfit.example.classfit.common.exception.ClassfitException; | ||
import org.springframework.http.HttpStatus; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.Size; | ||
|
||
public record MainClassRequest(String mainClassName) { | ||
|
||
public MainClassRequest { | ||
if (mainClassName == null || mainClassName.isBlank()) { | ||
throw new ClassfitException("메인 클래스 이름은 비어 있을 수 없습니다.", | ||
HttpStatus.UNPROCESSABLE_ENTITY); | ||
} | ||
if (mainClassName.length() > 20) { | ||
throw new ClassfitException("메인 클래스 이름은 20자를 초과할 수 없습니다.", | ||
HttpStatus.UNPROCESSABLE_ENTITY); | ||
} | ||
} | ||
public record MainClassRequest | ||
( | ||
@NotBlank(message = "메인 클래스 이름은 비어 있을 수 없습니다.") | ||
@Size(max = 10, message = "메인 클래스 이름은 10자를 초과할 수 없습니다.") | ||
String mainClassName | ||
) { | ||
} |
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