forked from codesquad-members-2024/be-airdnb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request codesquad-members-2024#36 from CodeSquad-Airbnb-Te…
…am07/Dev [Team07] 2주차 두 번째 PR
- Loading branch information
Showing
128 changed files
with
2,100 additions
and
1,083 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
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
24 changes: 0 additions & 24 deletions
24
BE/src/main/java/team07/airbnb/common/GlobalExceptionHandler.java
This file was deleted.
Oops, something went wrong.
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: 1 addition & 1 deletion
2
BE/src/main/java/team07/airbnb/common/auth/aop/Authenticated.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
8 changes: 0 additions & 8 deletions
8
BE/src/main/java/team07/airbnb/common/auth/exception/AuthorizeException.java
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
...airbnb/common/auth/JwtAuthentication.java → ...nb/common/auth/jwt/JwtAuthentication.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
5 changes: 2 additions & 3 deletions
5
...07/airbnb/common/auth/JwtUserDetails.java → ...irbnb/common/auth/jwt/JwtUserDetails.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
17 changes: 17 additions & 0 deletions
17
BE/src/main/java/team07/airbnb/common/util/DateHelper.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,17 @@ | ||
package team07.airbnb.common.util; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import java.time.LocalDate; | ||
import java.time.YearMonth; | ||
|
||
@Component | ||
public class DateHelper { | ||
public boolean isDateInMonthYear(int year, int month, LocalDate date) { | ||
YearMonth yearMonth = YearMonth.of(year, month); | ||
LocalDate startOfMonth = yearMonth.atDay(1); | ||
LocalDate endOfMonth = yearMonth.atEndOfMonth(); | ||
|
||
return !date.isBefore(startOfMonth) && !date.isAfter(endOfMonth); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
BE/src/main/java/team07/airbnb/common/validation/CheckOutAfterCheckIn.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,14 @@ | ||
package team07.airbnb.common.validation; | ||
|
||
import jakarta.validation.Constraint; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Target(ElementType.TYPE) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Constraint(validatedBy = CheckOutAfterCheckInValidator.class) | ||
public @interface CheckOutAfterCheckIn { | ||
} |
27 changes: 27 additions & 0 deletions
27
BE/src/main/java/team07/airbnb/common/validation/CheckOutAfterCheckInValidator.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,27 @@ | ||
package team07.airbnb.common.validation; | ||
|
||
import jakarta.validation.ConstraintValidator; | ||
import jakarta.validation.ConstraintValidatorContext; | ||
import team07.airbnb.data.booking.dto.request.BookingRequest; | ||
|
||
import java.time.LocalDate; | ||
|
||
public class CheckOutAfterCheckInValidator implements ConstraintValidator<CheckOutAfterCheckIn, BookingRequest> { | ||
|
||
@Override | ||
public void initialize(CheckOutAfterCheckIn constraintAnnotation) { | ||
ConstraintValidator.super.initialize(constraintAnnotation); | ||
} | ||
|
||
@Override | ||
public boolean isValid(BookingRequest request, ConstraintValidatorContext context) { | ||
LocalDate checkIn = request.checkIn(); | ||
LocalDate checkOut = request.checkOut(); | ||
|
||
if (checkIn == null || checkOut == null) { | ||
return true; // null 값은 다른 validator가 처리 | ||
} | ||
|
||
return !checkOut.isBefore(checkIn); | ||
} | ||
} |
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,7 @@ | ||
package team07.airbnb.config; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class JpaConfig { | ||
} |
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
Oops, something went wrong.