Skip to content

Commit 8768c8c

Browse files
committed
refactor: Validation 용 어노테이션 추가
1 parent da98010 commit 8768c8c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/main/java/com/example/log4u/domain/reports/dto/ReportCreateRequestDto.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@
22

33
import com.example.log4u.domain.reports.entity.Report;
44
import com.example.log4u.domain.reports.reportType.ReportType;
5+
import jakarta.validation.constraints.NotBlank;
6+
import jakarta.validation.constraints.NotNull;
7+
import org.hibernate.validator.constraints.Length;
58

69
public record ReportCreateRequestDto(
10+
@NotNull
711
ReportType reportType,
12+
13+
@NotBlank
14+
@Length(min = 2)
815
String content
916
) {
1017
public Report toEntity(Report.ReportTargetType reportTargetType, Long targetId){

src/main/java/com/example/log4u/domain/supports/dto/SupportCreateRequestDto.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
import com.example.log4u.domain.supports.entity.Support;
44
import com.example.log4u.domain.supports.supportType.SupportType;
55
import jakarta.validation.constraints.NotBlank;
6+
import jakarta.validation.constraints.NotNull;
67
import org.hibernate.validator.constraints.Length;
78

89
public record SupportCreateRequestDto(
10+
@NotNull
911
SupportType supportType,
1012

1113
@NotBlank

0 commit comments

Comments
 (0)