Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 0 additions & 73 deletions src/main/java/com/ryu/studyhelper/problem/ProblemController.java

This file was deleted.

32 changes: 0 additions & 32 deletions src/main/java/com/ryu/studyhelper/problem/domain/TeamProblem.java

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import com.ryu.studyhelper.common.enums.CustomResponseStatus;
import com.ryu.studyhelper.common.exception.CustomException;
import com.ryu.studyhelper.infrastructure.solvedac.SolvedAcClient;
import com.ryu.studyhelper.infrastructure.solvedac.dto.ProblemInfo;
import com.ryu.studyhelper.member.domain.Member;
import com.ryu.studyhelper.problem.domain.Problem;
import com.ryu.studyhelper.problem.service.ProblemService;
import com.ryu.studyhelper.problem.service.ProblemSyncService;
import com.ryu.studyhelper.recommendation.domain.Recommendation;
import com.ryu.studyhelper.recommendation.domain.RecommendationProblem;
Expand Down Expand Up @@ -34,7 +34,7 @@ class RecommendationCreator {

private final TeamMemberRepository teamMemberRepository;
private final TeamIncludeTagRepository teamIncludeTagRepository;
private final ProblemService problemService;
private final SolvedAcClient solvedAcClient;
private final ProblemSyncService problemSyncService;
private final RecommendationRepository recommendationRepository;
private final RecommendationProblemRepository recommendationProblemRepository;
Expand Down Expand Up @@ -86,7 +86,7 @@ private List<Problem> recommendProblemsForTeam(Team team) {

List<String> tagKeys = teamIncludeTagRepository.findTagKeysByTeamId(team.getId());

List<ProblemInfo> problemInfos = problemService.recommend(
List<ProblemInfo> problemInfos = solvedAcClient.recommendUnsolvedProblems(
handles,
team.getProblemCount(),
team.getEffectiveMinProblemLevel(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import com.ryu.studyhelper.common.enums.CustomResponseStatus;
import com.ryu.studyhelper.common.exception.CustomException;
import com.ryu.studyhelper.infrastructure.solvedac.SolvedAcClient;
import com.ryu.studyhelper.infrastructure.solvedac.dto.ProblemInfo;
import com.ryu.studyhelper.member.domain.Member;
import com.ryu.studyhelper.problem.domain.Problem;
import com.ryu.studyhelper.problem.service.ProblemService;
import com.ryu.studyhelper.problem.service.ProblemSyncService;
import com.ryu.studyhelper.recommendation.domain.Recommendation;
import com.ryu.studyhelper.recommendation.domain.RecommendationType;
Expand Down Expand Up @@ -43,7 +43,7 @@ class RecommendationCreatorTest {
private TeamIncludeTagRepository teamIncludeTagRepository;

@Mock
private ProblemService problemService;
private SolvedAcClient solvedAcClient;

@Mock
private ProblemSyncService problemSyncService;
Expand Down Expand Up @@ -76,7 +76,7 @@ void createManualRecommendation() {

when(teamMemberRepository.findHandlesByTeamId(TEAM_ID)).thenReturn(List.of("handle1"));
when(teamIncludeTagRepository.findTagKeysByTeamId(TEAM_ID)).thenReturn(List.of());
when(problemService.recommend(anyList(), anyInt(), anyInt(), anyInt(), anyList()))
when(solvedAcClient.recommendUnsolvedProblems(anyList(), anyInt(), anyInt(), anyInt(), anyList()))
.thenReturn(List.of(mock(ProblemInfo.class)));
when(problemSyncService.syncProblems(anyList())).thenReturn(problems);
when(recommendationRepository.save(any(Recommendation.class)))
Expand Down Expand Up @@ -104,7 +104,7 @@ void createScheduledRecommendation() {

when(teamMemberRepository.findHandlesByTeamId(TEAM_ID)).thenReturn(List.of("handle1"));
when(teamIncludeTagRepository.findTagKeysByTeamId(TEAM_ID)).thenReturn(List.of());
when(problemService.recommend(anyList(), anyInt(), anyInt(), anyInt(), anyList()))
when(solvedAcClient.recommendUnsolvedProblems(anyList(), anyInt(), anyInt(), anyInt(), anyList()))
.thenReturn(List.of(mock(ProblemInfo.class)));
when(problemSyncService.syncProblems(anyList())).thenReturn(problems);
when(recommendationRepository.save(any(Recommendation.class)))
Expand All @@ -128,7 +128,7 @@ void createsMemberRecommendationsForAllMembers() {

when(teamMemberRepository.findHandlesByTeamId(TEAM_ID)).thenReturn(List.of("handle1"));
when(teamIncludeTagRepository.findTagKeysByTeamId(TEAM_ID)).thenReturn(List.of());
when(problemService.recommend(anyList(), anyInt(), anyInt(), anyInt(), anyList()))
when(solvedAcClient.recommendUnsolvedProblems(anyList(), anyInt(), anyInt(), anyInt(), anyList()))
.thenReturn(List.of(mock(ProblemInfo.class)));
when(problemSyncService.syncProblems(anyList())).thenReturn(problems);
when(recommendationRepository.save(any(Recommendation.class)))
Expand Down