-
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.
[BE] refactor: dto 에 Nullable, validation 어노테이션 적용 (#410)
* refactor: 스프링 validation 어노테이션 추가 * refactor: Nullable 어노테이션 추가 * refactor: NotNull 추가 * refactor: NotNull에 메세지 추가
- Loading branch information
Showing
2 changed files
with
10 additions
and
1 deletion.
There are no files selected for viewing
7 changes: 6 additions & 1 deletion
7
backend/src/main/java/reviewme/review/service/dto/request/CreateReviewAnswerRequest.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,23 @@ | ||
package reviewme.review.service.dto.request; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.annotation.Nullable; | ||
import jakarta.validation.constraints.NotNull; | ||
import java.util.List; | ||
|
||
@Schema(name = "리뷰 답변 내용") | ||
public record CreateReviewAnswerRequest( | ||
|
||
@Schema(description = "질문 ID") | ||
long questionId, | ||
@NotNull(message = "질문 ID를 입력해주세요.") | ||
Long questionId, | ||
|
||
@Schema(description = "선택된 옵션 ID 목록", nullable = true) | ||
@Nullable | ||
List<Long> selectedOptionIds, | ||
|
||
@Schema(description = "답변 내용", nullable = true) | ||
@Nullable | ||
String text | ||
) { | ||
} |
4 changes: 4 additions & 0 deletions
4
backend/src/main/java/reviewme/review/service/dto/request/CreateReviewRequest.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,15 +1,19 @@ | ||
package reviewme.review.service.dto.request; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotEmpty; | ||
import java.util.List; | ||
|
||
@Schema(name = "리뷰 생성 요청") | ||
public record CreateReviewRequest( | ||
|
||
@Schema(description = "리뷰 요청 코드") | ||
@NotBlank(message = "리뷰 요청 코드를 입력해주세요.") | ||
String reviewRequestCode, | ||
|
||
@Schema(description = "답변 목록") | ||
@NotEmpty(message = "답변 내용을 입력해주세요.") | ||
List<CreateReviewAnswerRequest> answers | ||
) { | ||
} |