Skip to content

Commit

Permalink
Feat: 누락된 랭킹 복구 코드 뼈대 구현 (#124)
Browse files Browse the repository at this point in the history
* Feat: 누락된 랭킹 복구 코드 뼈대 구현

* Feat: 누락된 일간 랭킹 복구 (통합 랭킹 제외)

* Feat: 누락된 일간 통합 랭킹 복구

* Feat: 누락된 주간 랭킹 복구

* Feat: 일간 통합 랭킹 로직 수정에 따라, 8/16~17 통합 랭킹 재산정
  • Loading branch information
emes-g authored Aug 18, 2024
1 parent 19b9088 commit 5409bec
Show file tree
Hide file tree
Showing 6 changed files with 340 additions and 40 deletions.
2 changes: 1 addition & 1 deletion src/main/java/store/itpick/backend/config/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(jwtAuthenticationInterceptor)
.order(1)
.addPathPatterns("/**")
.excludePathPatterns("/auth/login", "/auth/signup", "/auth/refresh","/auth/emails/**", "/rank/**","/auth/email/check","/auth/nickname/check","/favicon.ico","/keyword/**","/debate/keyword");
.excludePathPatterns("/auth/login", "/auth/signup", "/auth/refresh","/auth/emails/**", "/rank/**","/auth/email/check","/auth/nickname/check","/favicon.ico","/keyword/**","/debate/keyword", "/test/**");
//인터셉터 적용 범위 수정
registry.addInterceptor(getJwtInterceptor)
.addPathPatterns("/user/email");
Expand Down
35 changes: 6 additions & 29 deletions src/main/java/store/itpick/backend/controller/RankController.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ public void updateWeekly() {
rankService.performWeeklyTasks();
}



@GetMapping("/naver")
public List<Reference> getRankFromSignal() {
String url = "https://www.signal.bz/";
Expand Down Expand Up @@ -174,24 +172,8 @@ public ResponseStatus getRankingBadgeForKeyword(@RequestParam String keyword, @R
return new BaseResponse<>(redis.getRankingBadgeResponse(keyword, periodType, date));
}

@GetMapping("/day/test")
public void dayTest() {
redis.saveDay();
}

@GetMapping("/week/test")
public void weekTest() {
redis.saveWeek();
}

@GetMapping("/total/test")
public void totalTest() {
redis.saveTotalRanking(PeriodType.BY_REAL_TIME);
redis.saveTotalRanking(PeriodType.BY_DAY);
redis.saveTotalRanking(PeriodType.BY_WEEK);
}

private static boolean isValidatedDate(PeriodType periodType, String date) {
// private static boolean isValidatedDate(PeriodType periodType, String date) {
public static boolean isValidatedDate(PeriodType periodType, String date) {
if (periodType == PeriodType.BY_REAL_TIME) { // 무조건 통과
return true;
}
Expand All @@ -201,7 +183,8 @@ private static boolean isValidatedDate(PeriodType periodType, String date) {
return false;
}

private static CommunityType getCommunityType(String community) {
// private static CommunityType getCommunityType(String community) {
public static CommunityType getCommunityType(String community) {
return switch (community) {
case "naver" -> CommunityType.NAVER;
case "nate" -> CommunityType.NATE;
Expand All @@ -213,19 +196,13 @@ private static CommunityType getCommunityType(String community) {
};
}

private static PeriodType getPeriodType(String period) {
// private static PeriodType getPeriodType(String period) {
public static PeriodType getPeriodType(String period) {
return switch (period) {
case "real_time" -> PeriodType.BY_REAL_TIME;
case "day" -> PeriodType.BY_DAY;
case "week" -> PeriodType.BY_WEEK;
default -> null;
};
}

// @GetMapping("/nate")
// public String getRankFromNate() {
// String url = "https://nate.com/";
//
// return selenium.useDriverForMnate(url);
// }
}
Loading

0 comments on commit 5409bec

Please sign in to comment.