-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#38] refacotr: 유효성 검증 validation으로 변경
- Loading branch information
Showing
10 changed files
with
33 additions
and
44 deletions.
There are no files selected for viewing
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
8 changes: 8 additions & 0 deletions
8
BE/src/main/java/com/codesquad/airbnb/common/exception/InputMistakeException.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.codesquad.airbnb.common.exception; | ||
|
||
public class InputMistakeException extends RuntimeException { | ||
|
||
public InputMistakeException() { | ||
super(); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
BE/src/main/java/com/codesquad/airbnb/common/exception/InputNothingException.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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.codesquad.airbnb.common.exception; | ||
|
||
public class InputNothingException { | ||
} |
15 changes: 5 additions & 10 deletions
15
BE/src/main/java/com/codesquad/airbnb/reservation/domain/Guest.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,25 +1,20 @@ | ||
package com.codesquad.airbnb.reservation.domain; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.*; | ||
|
||
import javax.validation.constraints.Min; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@Setter | ||
@AllArgsConstructor | ||
@ToString | ||
public class Guest { | ||
|
||
@Min(1) | ||
private int numberOfAdults; | ||
|
||
private int numberOfKids; | ||
|
||
private int numberOfBabies; | ||
|
||
public void checkInput() { | ||
if(numberOfAdults == 0 && numberOfKids == 0 && numberOfBabies == 0) { | ||
throw new IllegalArgumentException("Please Input Guests!"); | ||
} | ||
} | ||
} |
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
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
6 changes: 2 additions & 4 deletions
6
BE/src/main/java/com/codesquad/airbnb/room/domain/Budget.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
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
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
2 changes: 0 additions & 2 deletions
2
BE/src/main/java/com/codesquad/airbnb/user/ui/LoginController.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