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 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(); + } }