Skip to content

Commit

Permalink
[REFACTOR] 테마 제한 시간, 힌트 제한 수 validation 추가(#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
eunsol-an committed Oct 1, 2024
1 parent 5905045 commit 615fdfa
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/java/com/nextroom/nextRoomServer/dto/ThemeDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.nextroom.nextRoomServer.util.Timestamped;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Positive;
import jakarta.validation.constraints.NotNull;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
Expand All @@ -19,7 +19,9 @@ public class ThemeDto {
public static class AddThemeRequest {
@NotBlank(message = "테마 이름을 입력해 주세요.")
private final String title;
@NotNull(message = "제한 시간을 입력해 주세요.")
private final Integer timeLimit;
@NotNull(message = "힌트 제한 수를 입력해 주세요.")
private final Integer hintLimit;
}

Expand Down Expand Up @@ -55,18 +57,20 @@ public ThemeListResponse(Theme theme) {
@RequiredArgsConstructor
@NoArgsConstructor(force = true)
public static class EditThemeRequest {
@Positive(message = "THEME ID를 입력해 주세요.")
@NotNull(message = "테마 ID를 입력해 주세요.")
private final Long id;
@NotBlank(message = "테마 이름을 입력해 주세요.")
private final String title;
@NotNull(message = "제한 시간을 입력해 주세요.")
private final Integer timeLimit;
@NotNull(message = "힌트 제한 수를 입력해 주세요.")
private final Integer hintLimit;
}

@Getter
@NoArgsConstructor
public static class RemoveThemeRequest {
@Positive(message = "THEME ID를 입력해 주세요.")
@NotNull(message = "테마 ID를 입력해 주세요.")
private Long id;
}
}

0 comments on commit 615fdfa

Please sign in to comment.