From a7d9ed8c8b213bd994b0e4cbe7ef243bc17e4e4d Mon Sep 17 00:00:00 2001 From: HAJIHYUK <168079884+HAJIHYUK@users.noreply.github.com> Date: Sat, 22 Mar 2025 12:49:14 +0900 Subject: [PATCH 1/5] =?UTF-8?q?jsp=20=EA=B4=80=EB=A0=A8=20=ED=94=84?= =?UTF-8?q?=EB=A1=9C=ED=8D=BC=ED=8B=B0=EC=8A=A4=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EB=A1=9C=EC=BB=A4=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.properties | 2 -- 1 file changed, 2 deletions(-) diff --git a/Location-based-target-authentication/src/main/resources/application.properties b/Location-based-target-authentication/src/main/resources/application.properties index fdb3e0e..b4f1c2c 100644 --- a/Location-based-target-authentication/src/main/resources/application.properties +++ b/Location-based-target-authentication/src/main/resources/application.properties @@ -9,8 +9,6 @@ spring.config.import=classpath:application-secret.properties logging.level.com.swyp.location=INFO logging.level.org.springframework.web.reactive.function.client=INFO -spring.mvc.view.prefix=/WEB-INF/views/ -spring.mvc.view.suffix=.jsp # Server Configuration server.port=443 From 3dba7f65516ea2590bb735bdae0366a7a7e55146 Mon Sep 17 00:00:00 2001 From: HAJIHYUK <168079884+HAJIHYUK@users.noreply.github.com> Date: Sat, 22 Mar 2025 12:56:56 +0900 Subject: [PATCH 2/5] =?UTF-8?q?jsp=EA=B4=80=EB=A0=A8=20=EB=B7=B0=EB=A6=AC?= =?UTF-8?q?=EC=A1=B8=EB=B2=84=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/swyp/global/config/WebConfig.java | 10 ---------- .../src/main/resources/application.properties | 16 ++++++++-------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/Location-based-target-authentication/src/main/java/com/swyp/global/config/WebConfig.java b/Location-based-target-authentication/src/main/java/com/swyp/global/config/WebConfig.java index 632af73..4bbba98 100644 --- a/Location-based-target-authentication/src/main/java/com/swyp/global/config/WebConfig.java +++ b/Location-based-target-authentication/src/main/java/com/swyp/global/config/WebConfig.java @@ -1,22 +1,12 @@ package com.swyp.global.config; -import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import org.springframework.web.servlet.view.InternalResourceViewResolver; @Configuration public class WebConfig implements WebMvcConfigurer { - @Bean // 뷰 리졸버 설정 - public ViewResolver viewResolver() { - InternalResourceViewResolver resolver = new InternalResourceViewResolver(); - resolver.setPrefix("/WEB-INF/views/"); - resolver.setSuffix(".jsp"); - return resolver; - } @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { diff --git a/Location-based-target-authentication/src/main/resources/application.properties b/Location-based-target-authentication/src/main/resources/application.properties index b4f1c2c..c91b764 100644 --- a/Location-based-target-authentication/src/main/resources/application.properties +++ b/Location-based-target-authentication/src/main/resources/application.properties @@ -4,7 +4,7 @@ spring.application.name=Location-based-target-authentication spring.main.allow-bean-definition-overriding=true # Profile -spring.profiles.active=secret +spring.profiles.active=local spring.config.import=classpath:application-secret.properties logging.level.com.swyp.location=INFO logging.level.org.springframework.web.reactive.function.client=INFO @@ -16,13 +16,13 @@ server.http.port=8080 server.address=0.0.0.0 server.servlet.context-path=/ -# SSL Configuration -server.ssl.enabled=true -server.ssl.key-store=/etc/ssl/willgo/keystore.p12 -server.ssl.key-store-password=willgo86 -server.ssl.key-store-type=PKCS12 -server.ssl.key-alias=tomcat -security.require-ssl=true +# # SSL Configuration +# server.ssl.enabled=true +# server.ssl.key-store=/etc/ssl/willgo/keystore.p12 +# server.ssl.key-store-password=willgo86 +# server.ssl.key-store-type=PKCS12 +# server.ssl.key-alias=tomcat +# security.require-ssl=true # Database Configuration From cf40eb58bfceda62cd6f62a530cf81f0d49c250e Mon Sep 17 00:00:00 2001 From: HAJIHYUK <168079884+HAJIHYUK@users.noreply.github.com> Date: Sat, 22 Mar 2025 13:00:11 +0900 Subject: [PATCH 3/5] =?UTF-8?q?jsp=20=EA=B4=80=EB=A0=A8=20=ED=94=84?= =?UTF-8?q?=EB=A1=9C=ED=8D=BC=ED=8B=B0=EC=8A=A4=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EB=B0=8F=20=EB=B7=B0=EB=A6=AC=EC=A1=B8=EB=B2=84=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.properties | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Location-based-target-authentication/src/main/resources/application.properties b/Location-based-target-authentication/src/main/resources/application.properties index c91b764..b4f1c2c 100644 --- a/Location-based-target-authentication/src/main/resources/application.properties +++ b/Location-based-target-authentication/src/main/resources/application.properties @@ -4,7 +4,7 @@ spring.application.name=Location-based-target-authentication spring.main.allow-bean-definition-overriding=true # Profile -spring.profiles.active=local +spring.profiles.active=secret spring.config.import=classpath:application-secret.properties logging.level.com.swyp.location=INFO logging.level.org.springframework.web.reactive.function.client=INFO @@ -16,13 +16,13 @@ server.http.port=8080 server.address=0.0.0.0 server.servlet.context-path=/ -# # SSL Configuration -# server.ssl.enabled=true -# server.ssl.key-store=/etc/ssl/willgo/keystore.p12 -# server.ssl.key-store-password=willgo86 -# server.ssl.key-store-type=PKCS12 -# server.ssl.key-alias=tomcat -# security.require-ssl=true +# SSL Configuration +server.ssl.enabled=true +server.ssl.key-store=/etc/ssl/willgo/keystore.p12 +server.ssl.key-store-password=willgo86 +server.ssl.key-store-type=PKCS12 +server.ssl.key-alias=tomcat +security.require-ssl=true # Database Configuration From 83edbc976096b5c4e61cbaa3f928665cb15a8dfe Mon Sep 17 00:00:00 2001 From: HAJIHYUK <168079884+HAJIHYUK@users.noreply.github.com> Date: Sat, 22 Mar 2025 13:39:40 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=EC=A0=84=EC=B2=B4=EB=AA=A9=ED=91=9C?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EC=9D=B8=EC=A6=9D=EA=B0=92=20=EB=82=A0?= =?UTF-8?q?=EC=A7=9C=20=EB=A1=9C=EC=A7=81=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/swyp/global/config/WebConfig.java | 12 +++++++ .../goal/controller/GoalRestController.java | 35 ++++++++++++++----- .../src/main/resources/application.properties | 16 ++++----- 3 files changed, 46 insertions(+), 17 deletions(-) diff --git a/Location-based-target-authentication/src/main/java/com/swyp/global/config/WebConfig.java b/Location-based-target-authentication/src/main/java/com/swyp/global/config/WebConfig.java index 4bbba98..72fad62 100644 --- a/Location-based-target-authentication/src/main/java/com/swyp/global/config/WebConfig.java +++ b/Location-based-target-authentication/src/main/java/com/swyp/global/config/WebConfig.java @@ -1,12 +1,24 @@ package com.swyp.global.config; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import org.springframework.web.servlet.view.InternalResourceViewResolver; @Configuration public class WebConfig implements WebMvcConfigurer { + @Bean // 뷰 리졸버 설정 + public ViewResolver viewResolver() { + InternalResourceViewResolver resolver = new InternalResourceViewResolver(); + resolver.setPrefix("/WEB-INF/views/"); + resolver.setSuffix(".jsp"); + return resolver; + } + + @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { diff --git a/Location-based-target-authentication/src/main/java/com/swyp/goal/controller/GoalRestController.java b/Location-based-target-authentication/src/main/java/com/swyp/goal/controller/GoalRestController.java index 737d84c..78a5edc 100644 --- a/Location-based-target-authentication/src/main/java/com/swyp/goal/controller/GoalRestController.java +++ b/Location-based-target-authentication/src/main/java/com/swyp/goal/controller/GoalRestController.java @@ -242,16 +242,33 @@ public ResponseEntity getGoalList(@RequestParam("userId") Long userId) { List goalList = goalService.getGoalList(userId); List goalAllDto = new ArrayList<>(); for(Goal goal : goalList) { - List calender = goalService.DateRangeCalculator(goal.getId()); + List calender = goalService.DateRangeCalculator(goal.getId()); // 목표 달력을 위한 전체 날짜값(today가 startDate의 주에 속하면 이번 주 + 다음 주 , today가 startDate의 주에 속하지 않으면 지난주 + 이번 주) System.out.println(calender); - List goalDateDto = new ArrayList<>(); - List logs = goalAchievementLogRepository.findByGoal_IdAndAchievedSuccessIsTrue(goal.getId()); + List goalDateDto = new ArrayList<>(); // 목표 달력을 위한 인증 날짜값 + + // 목표의 시작일부터 종료일까지의 모든 날짜를 생성 + LocalDate startDate = goal.getStartDate(); + LocalDate endDate = goal.getEndDate(); + List allDates = new ArrayList<>(); + LocalDate currentDate = startDate; + while (!currentDate.isAfter(endDate)) { + allDates.add(currentDate); + currentDate = currentDate.plusDays(1); + } + // 인증 성공한 날짜들을 Set으로 변환 (속도 떄문에) + Set successDates = new HashSet<>(); + List achievementLogs = goalAchievementLogRepository + .findByGoal_IdAndAchievedSuccessIsTrue(goal.getId()); + for (GoalAchievementsLog log : achievementLogs) { + successDates.add(log.getAchievedAt()); + } - for (GoalAchievementsLog log : logs) { - GoalDateDto dto = new GoalDateDto(log.getAchievedAt(), log.isAchievedSuccess()); - goalDateDto.add(dto); - } + // 모든 날짜에 대해 인증 상태를 확인하여 DTO 생성 , 인증 성공한 날짜 확인 후 인증 날짜 값 추가 + for (LocalDate date : allDates) { + GoalDateDto dto = new GoalDateDto(date, successDates.contains(date)); + goalDateDto.add(dto); + } // goalDays : 요일 String값으로 가공 List goalDays = goalDayRepository.findByGoalId(goal.getId()); @@ -266,8 +283,8 @@ public ResponseEntity getGoalList(@RequestParam("userId") Long userId) { GoalAllSearchDto dto = new GoalAllSearchDto(goal.getId(),goal.getId(),goal.getName(),goal.getStatus(),goal.getStartDate(),goal.getEndDate(),goal.getLocationName(),goal.getLatitude(),goal.getLongitude(),goal.getRadius(),goal.getTargetCount(),goal.getAchievedCount(), goalDateDto, // 인증된 날짜들 - calender - ,days.toString()); // 날짜 값들 + calender // 날짜 값들 + ,days.toString()); goalAllDto.add(dto); diff --git a/Location-based-target-authentication/src/main/resources/application.properties b/Location-based-target-authentication/src/main/resources/application.properties index b4f1c2c..c91b764 100644 --- a/Location-based-target-authentication/src/main/resources/application.properties +++ b/Location-based-target-authentication/src/main/resources/application.properties @@ -4,7 +4,7 @@ spring.application.name=Location-based-target-authentication spring.main.allow-bean-definition-overriding=true # Profile -spring.profiles.active=secret +spring.profiles.active=local spring.config.import=classpath:application-secret.properties logging.level.com.swyp.location=INFO logging.level.org.springframework.web.reactive.function.client=INFO @@ -16,13 +16,13 @@ server.http.port=8080 server.address=0.0.0.0 server.servlet.context-path=/ -# SSL Configuration -server.ssl.enabled=true -server.ssl.key-store=/etc/ssl/willgo/keystore.p12 -server.ssl.key-store-password=willgo86 -server.ssl.key-store-type=PKCS12 -server.ssl.key-alias=tomcat -security.require-ssl=true +# # SSL Configuration +# server.ssl.enabled=true +# server.ssl.key-store=/etc/ssl/willgo/keystore.p12 +# server.ssl.key-store-password=willgo86 +# server.ssl.key-store-type=PKCS12 +# server.ssl.key-alias=tomcat +# security.require-ssl=true # Database Configuration From f8735963c78fa18d0688c996113551fe6e424985 Mon Sep 17 00:00:00 2001 From: HAJIHYUK <168079884+HAJIHYUK@users.noreply.github.com> Date: Sat, 22 Mar 2025 14:10:30 +0900 Subject: [PATCH 5/5] =?UTF-8?q?=EC=A0=84=EC=B2=B4=EB=AA=A9=ED=91=9C?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EC=9D=B8=EC=A6=9D=EA=B0=92=20=EB=82=A0?= =?UTF-8?q?=EC=A7=9C=20=EB=A1=9C=EC=A7=81=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.properties | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Location-based-target-authentication/src/main/resources/application.properties b/Location-based-target-authentication/src/main/resources/application.properties index c91b764..b4f1c2c 100644 --- a/Location-based-target-authentication/src/main/resources/application.properties +++ b/Location-based-target-authentication/src/main/resources/application.properties @@ -4,7 +4,7 @@ spring.application.name=Location-based-target-authentication spring.main.allow-bean-definition-overriding=true # Profile -spring.profiles.active=local +spring.profiles.active=secret spring.config.import=classpath:application-secret.properties logging.level.com.swyp.location=INFO logging.level.org.springframework.web.reactive.function.client=INFO @@ -16,13 +16,13 @@ server.http.port=8080 server.address=0.0.0.0 server.servlet.context-path=/ -# # SSL Configuration -# server.ssl.enabled=true -# server.ssl.key-store=/etc/ssl/willgo/keystore.p12 -# server.ssl.key-store-password=willgo86 -# server.ssl.key-store-type=PKCS12 -# server.ssl.key-alias=tomcat -# security.require-ssl=true +# SSL Configuration +server.ssl.enabled=true +server.ssl.key-store=/etc/ssl/willgo/keystore.p12 +server.ssl.key-store-password=willgo86 +server.ssl.key-store-type=PKCS12 +server.ssl.key-alias=tomcat +security.require-ssl=true # Database Configuration