From b46a6d8a3244160aa2a4adb3af1b5ec8d603ba89 Mon Sep 17 00:00:00 2001 From: hgh1472 Date: Mon, 9 Dec 2024 16:55:12 +0900 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20=EC=A0=95=EC=A7=80=20=EC=9C=A0?= =?UTF-8?q?=EC=A0=80=20=EC=A0=91=EA=B7=BC=20=EA=B6=8C=ED=95=9C=20=EC=A0=9C?= =?UTF-8?q?=ED=95=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/postman/bottler/config/SecurityConfig.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/postman/bottler/config/SecurityConfig.java b/src/main/java/postman/bottler/config/SecurityConfig.java index eef7aa55..be015ce2 100644 --- a/src/main/java/postman/bottler/config/SecurityConfig.java +++ b/src/main/java/postman/bottler/config/SecurityConfig.java @@ -5,6 +5,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpMethod; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; @@ -59,6 +60,11 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti .requestMatchers("/v3/api-docs/**").permitAll() .requestMatchers("/v3/**").permitAll() .requestMatchers("/healthcheck").permitAll() + .requestMatchers(HttpMethod.POST,"/letters").hasAnyRole("USER", "DEVELOPER") + .requestMatchers(HttpMethod.POST, "/map/public").hasAnyRole("USER", "DEVELOPER") + .requestMatchers(HttpMethod.POST, "/map/target").hasAnyRole("USER", "DEVELOPER") + .requestMatchers(HttpMethod.POST, "/letters/replies/{letterId}").hasAnyRole("USER", "DEVELOPER") + .requestMatchers(HttpMethod.POST, "/map/reply").hasAnyRole("USER", "DEVELOPER") .anyRequest().authenticated() ) .sessionManagement(session -> session From 85303efcf1f1137fe7d628b47624f23b4815f607 Mon Sep 17 00:00:00 2001 From: hgh1472 Date: Mon, 9 Dec 2024 17:08:39 +0900 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20=EC=8A=A4=EC=BC=80=EC=A5=B4?= =?UTF-8?q?=EB=9F=AC=20=EC=A3=BC=EC=84=9D=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bottler/scheduler/SchedulerConfig.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/java/postman/bottler/scheduler/SchedulerConfig.java b/src/main/java/postman/bottler/scheduler/SchedulerConfig.java index 51e44aab..28742e26 100644 --- a/src/main/java/postman/bottler/scheduler/SchedulerConfig.java +++ b/src/main/java/postman/bottler/scheduler/SchedulerConfig.java @@ -13,18 +13,18 @@ public class SchedulerConfig { private final RecommendationScheduler recommendationScheduler; private final UnbanScheduler unbanScheduler; -// @Scheduled(cron = "0 0 0 * * ?") -// public void unban() { -// unbanScheduler.unbanUsers(LocalDateTime.now()); -// } -// -// @Scheduled(cron = "0 0 8,17,22 * * *") -// public void executeRecommendationJob() { -// recommendationScheduler.processAllUserRecommendations(); -// } -// -// @Scheduled(cron = "0 0 9,18,23 * * ?") -// public void recommendKeywordLetter() { -// recommendationScheduler.updateAllRecommendations(); -// } + @Scheduled(cron = "0 0 0 * * ?") + public void unban() { + unbanScheduler.unbanUsers(LocalDateTime.now()); + } + + @Scheduled(cron = "0 0 23,11,17 * * *") + public void executeRecommendationJob() { + recommendationScheduler.processAllUserRecommendations(); + } + + @Scheduled(cron = "0 0 0,12,18 * * ?") + public void recommendKeywordLetter() { + recommendationScheduler.updateAllRecommendations(); + } }