Skip to content

Commit

Permalink
feat: dto 의 예외 메시지 지정한다
Browse files Browse the repository at this point in the history
  • Loading branch information
BGuga committed Aug 15, 2023
1 parent d768640 commit 25e516e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
4 changes: 3 additions & 1 deletion backend/src/main/java/com/festago/auth/dto/LoginRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.festago.auth.domain.SocialType;
import jakarta.validation.constraints.NotNull;

public record LoginRequest(@NotNull SocialType socialType, @NotNull String accessToken) {
public record LoginRequest(
@NotNull(message = "socialType 은 null 일 수 없습니다.") SocialType socialType,
@NotNull(message = "acessToken 은 null 일 수 없습니다.") String accessToken) {

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.springframework.format.annotation.DateTimeFormat.ISO;

public record FestivalCreateRequest(
@NotNull String name,
@NotNull(message = "name 은 null 일 수 없습니다.") String name,
@DateTimeFormat(iso = ISO.DATE) LocalDate startDate,
@DateTimeFormat(iso = ISO.DATE) LocalDate endDate,
String thumbnail) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ public record StageCreateRequest(
@DateTimeFormat(iso = ISO.DATE_TIME) LocalDateTime startTime,
String lineUp,
@DateTimeFormat(iso = ISO.DATE_TIME) LocalDateTime ticketOpenTime,
@NotNull Long festivalId) {
@NotNull(message = "festivalId 는 null 일 수 없습니다.") Long festivalId) {

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import org.springframework.format.annotation.DateTimeFormat.ISO;

public record TicketCreateRequest(
@NotNull Long stageId,
@NotNull TicketType ticketType,
@NotNull Integer amount,
@NotNull(message = "stageId 는 null 일 수 없습니다.") Long stageId,
@NotNull(message = "ticketType 은 null 일 수 없습니다.") TicketType ticketType,
@NotNull(message = "amount 는 null 일 수 없습니다.") Integer amount,
@DateTimeFormat(iso = ISO.DATE_TIME) LocalDateTime entryTime) {

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import jakarta.validation.constraints.NotNull;

public record TicketValidationRequest(@NotNull String code) {
public record TicketValidationRequest(
@NotNull(message = "code 는 null 일 수 없습니다.") String code) {

}
3 changes: 2 additions & 1 deletion backend/src/main/java/com/festago/dto/TicketingRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import jakarta.validation.constraints.NotNull;

public record TicketingRequest(@NotNull Long ticketId) {
public record TicketingRequest(
@NotNull(message = "ticketId 는 null 일 수 없습니다.") Long ticketId) {

}

0 comments on commit 25e516e

Please sign in to comment.