Skip to content

Commit

Permalink
refactor: (#95) h2-console 동작을 위한 설정 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
tjdtls690 committed Jul 30, 2023
1 parent b9180c9 commit a25923b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ public boolean hasPostOption(final PostOption postOption) {
return postOptions.contains(postOption);
}

public void validateDeadlineNotExceedThreeDays() {
LocalDateTime threeDaysFromNow = LocalDateTime.now().plusDays(3);
if (this.deadline.isAfter(threeDaysFromNow)) {
throw new IllegalStateException("마감 기한은 현재 시간으로부터 3일을 초과할 수 없습니다.");
}
}

public void validateWriter(final Member member) {
if (!Objects.equals(this.writer.getId(), member.getId())) {
throw new BadRequestException(PostExceptionType.NOT_WRITER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
"/health-check",
"/auth/kakao/callback",
"/categories/guest",
"/swagger-ui.html"
"/swagger-ui.html",
"/h2-console"
);

private static final List<String> ALLOWED_START_URIS = List.of(
Expand Down
4 changes: 4 additions & 0 deletions backend/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ spring:
hibernate:
ddl-auto: create

h2:
console:
enabled: true

logging:
level:
org:
Expand Down

0 comments on commit a25923b

Please sign in to comment.