From f40451da2daea55c403c314f155af959c8ba7db5 Mon Sep 17 00:00:00 2001 From: Jaehyun Ahn <91878695+uwoobeat@users.noreply.github.com> Date: Sat, 2 Mar 2024 00:03:31 +0900 Subject: [PATCH] =?UTF-8?q?feat:=202=EC=B0=A8=20=EB=AA=A8=EC=A7=91?= =?UTF-8?q?=EA=B8=B0=EA=B0=84=20=EC=9D=B4=EC=A0=84=20=EC=83=88=EB=A1=9C=20?= =?UTF-8?q?=EA=B0=80=EC=9E=85=ED=95=9C=20=EB=A9=A4=EB=B2=84=EB=8A=94=20?= =?UTF-8?q?=EB=8C=80=EA=B8=B0=20=ED=8E=98=EC=9D=B4=EC=A7=80=EB=A1=9C=20?= =?UTF-8?q?=EB=9E=9C=EB=94=A9=ED=95=98=EB=8F=84=EB=A1=9D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20(#217)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat: 대기 페이지 랜딩 로직 구현 --- .../gdsc/global/security/LandingStatus.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/com/gdschongik/gdsc/global/security/LandingStatus.java b/src/main/java/com/gdschongik/gdsc/global/security/LandingStatus.java index abaf7f122..3abc80e72 100644 --- a/src/main/java/com/gdschongik/gdsc/global/security/LandingStatus.java +++ b/src/main/java/com/gdschongik/gdsc/global/security/LandingStatus.java @@ -1,14 +1,24 @@ package com.gdschongik.gdsc.global.security; import com.gdschongik.gdsc.domain.member.domain.Member; +import java.time.LocalDate; +import java.time.LocalDateTime; public enum LandingStatus { + ONBOARDING_NOT_OPENED, // 대기 페이지로 랜딩 TO_STUDENT_AUTHENTICATION, // 재학생 인증 페이지로 랜딩 TO_REGISTRATION, // 가입신청 페이지로 랜딩 TO_DASHBOARD, // 대시보드로 랜딩 ; public static LandingStatus of(Member member) { + // 1차 모집기간 종료 ~ 2차 모집기간 시작 사이 가입했고, 현재는 2차 모집기간이 아닐 때 대기 페이지로 랜딩 + if (member.getCreatedAt().isAfter(Constants.FIRST_RECRUITMENT_END_DATE.atStartOfDay()) + && member.getCreatedAt().isBefore(Constants.SECOND_RECRUITMENT_START_DATE.atStartOfDay()) + && LocalDateTime.now().isBefore(Constants.SECOND_RECRUITMENT_START_DATE.atStartOfDay())) { + return ONBOARDING_NOT_OPENED; + } + // 아직 재학생 인증을 하지 않았다면 재학생 인증 페이지로 랜딩 if (!member.getRequirement().isUnivVerified()) { return TO_STUDENT_AUTHENTICATION; @@ -23,4 +33,9 @@ public static LandingStatus of(Member member) { // 재학생 인증과 가입신청을 모두 완료했다면 대시보드로 랜딩 return TO_DASHBOARD; } + + private static class Constants { + private static final LocalDate FIRST_RECRUITMENT_END_DATE = LocalDate.of(2024, 3, 2); + private static final LocalDate SECOND_RECRUITMENT_START_DATE = LocalDate.of(2024, 3, 4); + } }