Skip to content

Commit

Permalink
[Feat] #39 - ValidLimitValue 어노테이션 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
0lynny committed Jan 9, 2024
1 parent af316b8 commit 0296c9f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import jakarta.validation.constraints.Size;
import java.time.LocalDateTime;
import org.hibernate.validator.constraints.Range;
import org.moonshot.server.global.common.model.validator.ValidLimitValue;
import org.moonshot.server.global.common.model.validator.ValidTargetNumber;
import org.springframework.format.annotation.DateTimeFormat;

Expand All @@ -23,6 +24,7 @@ public record KeyResultCreateRequestDto(
Short idx,
@NotNull(message = "KR 목표 수치를 입력해주세요.")
@ValidTargetNumber
@ValidLimitValue
Long target,
@NotNull(message = "KR 목표 수치의 단위를 입력해주세요.")
String metric,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.List;
import org.moonshot.server.domain.task.dto.request.TaskCreateRequestDto;
import org.hibernate.validator.constraints.Range;
import org.moonshot.server.global.common.model.validator.ValidLimitValue;
import org.moonshot.server.global.common.model.validator.ValidTargetNumber;
import org.springframework.format.annotation.DateTimeFormat;

Expand All @@ -24,6 +25,7 @@ public record KeyResultCreateRequestInfoDto(
Short idx,
@NotNull(message = "KR 목표 수치를 입력해주세요.")
@ValidTargetNumber
@ValidLimitValue
Long target,
@NotNull(message = "KR 목표 수치의 단위를 입력해주세요.")
String metric,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import jakarta.validation.constraints.Size;
import java.time.LocalDateTime;
import org.moonshot.server.domain.keyresult.model.KRState;
import org.moonshot.server.global.common.model.validator.ValidLimitValue;
import org.moonshot.server.global.common.model.validator.ValidTargetNumber;
import org.springframework.format.annotation.DateTimeFormat;

Expand All @@ -17,6 +18,7 @@ public record KeyResultModifyRequestDto(
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
LocalDateTime expireAt,
@ValidTargetNumber
@ValidLimitValue
Long target,
KRState state,
@Size(min = 1, max = 100, message = "본문은 100자 이하여야 합니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import org.moonshot.server.global.common.model.validator.ValidLimitValue;

public record LogCreateRequestDto(
Long keyResultId,

@NotNull(message = "Log의 수치를 입력해주세요.")
@Size(min = 1, max = 30, message = "진척정도의 수치 값은 30자 이하여야 합니다.")
@ValidLimitValue
long logNum,

@NotNull(message = "Log의 체크인 본문을 입력해주세요.")
Expand Down

0 comments on commit 0296c9f

Please sign in to comment.