Skip to content

Commit

Permalink
Merge pull request #66 from Tave100Shot/develop
Browse files Browse the repository at this point in the history
pr main <- develop search, compile
  • Loading branch information
toychip authored Jan 26, 2024
2 parents ec702dc + f9100e1 commit 6ec5567
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public UserCrawlingDto getUserInfo(String userName) throws IOException {
wrongCnt = row_data3;
}
}
log.info("{}, {}, {}", rank, rightCnt, wrongCnt);
log.info("{}, {}, {}, {}", rank, rightCnt, wrongCnt, tier);

// 맞은 문제 리스트
Elements table2 = document.select(".panel.panel-default");
Expand All @@ -75,7 +75,6 @@ public UserCrawlingDto getUserInfo(String userName) throws IOException {
list.add(data2);
}


return UserCrawlingDto.builder()
.rank(rank)
.rightCnt(rightCnt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public class RecommendService {
// 사용자 기반 추천 서비스
public RecResponseDto getListByUser() throws IOException {
UserCrawlingDto dto = getUserInfo();

WebClient webClient = WebClient.builder()
.baseUrl(lambda1)
.build();
Expand All @@ -52,7 +51,14 @@ public RecResponseDto getListByUser() throws IOException {
.bodyToMono(RecProResponseDto.class)
.block();

Integer tierCount = tierCountRepository.findByTier(Integer.parseInt(dto.getTier()));
Integer tierCount;
if(dto.getTier().equals("0")){
tierCount = 0;
}
else {
tierCount = tierCountRepository.findByTier(Integer.parseInt(dto.getTier()));
}
log.info("tier:{}", tierCount);

List<RecProDetailResponseDto> proDetailResponseDtos = getProblemDetail(proList);

Expand Down Expand Up @@ -88,7 +94,14 @@ public RecResponseDto getListByProblem(int solvedRecentId) throws IOException {
.bodyToMono(RecProResponseDto.class)
.block();

Integer tierCount = tierCountRepository.findByTier(Integer.parseInt(dto.getTier()));
Integer tierCount;
if(dto.getTier().equals("0")){
tierCount = 0;
}
else {
tierCount = tierCountRepository.findByTier(Integer.parseInt(dto.getTier()));
}
log.info("tier:{}", tierCount);

List<RecProDetailResponseDto> proDetailResponseDtos = getProblemDetail(proList);

Expand All @@ -106,7 +119,7 @@ public RecResponseDto getListByProblem(int solvedRecentId) throws IOException {
public UserCrawlingDto getUserInfo() throws IOException {
Member currentMember2 = getCurrentMember();
String bojName = currentMember2.getBojName();
// String bojName = "wjdrhs3473";
// String bojName = "cucubab";

UserCrawlingDto dto = crawlingService.getUserInfo(bojName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ public void modifyCreatedDate(){
}
else this.createdDate = created;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
,"/favicon.ico"
,"/login/**"
, "/api/health"
, "/api/v1/search"
, "/api/v1/search/**"
, "/api/compile/**"
).permitAll()
.anyRequest().authenticated());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ private boolean isPublicUri(final String requestURI) {
requestURI.startsWith("/api/health") ||
requestURI.startsWith("/favicon.ico") ||
requestURI.startsWith("/api/v1/search/**") ||
requestURI.startsWith("/api/compile/**") ||
requestURI.startsWith("/login/**");
}
}

0 comments on commit 6ec5567

Please sign in to comment.