Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

플랫폼 미션 상태 조회에 synchronized 처리 #458

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,21 @@ public void setToValue(MissionStrategyType missionStrategyType, MemberGeneration
}

@Transactional
public MissionStatus missionStatus(Long memberGenerationId, MashongMission mashongMission) {
public MissionStatus getMissionStatus(Long memberGenerationId, MashongMission mashongMission) {
MemberGeneration memberGeneration = memberService.findByMemberGenerationId(memberGenerationId);

if (mashongMission.getMissionType() == MissionType.TEAM) {
return missionStatus(memberGeneration.getPlatform(), memberGeneration.getGeneration().getId(), mashongMission);
return getMissionStatus(memberGeneration.getPlatform(), memberGeneration.getGeneration().getId(), mashongMission);
} else {
return missionStatus(memberGeneration, mashongMission);
return getMissionStatus(memberGeneration, mashongMission);
}
}

@Transactional
public List<MissionStatus> missionStatusList(Long memberGenerationId) {
public List<MissionStatus> getMissionStatusList(Long memberGenerationId) {
List<MashongMission> mashongMissionList = mashongMissionService.findAll();
return mashongMissionList.stream()
.map(mission -> missionStatus(memberGenerationId, mission))
.map(mission -> getMissionStatus(memberGenerationId, mission))
.collect(Collectors.toList());
}

Expand Down Expand Up @@ -107,13 +107,13 @@ private MashongMissionLevel getLatestMissionLevel(Platform platform, Long genera
}
}

private MissionStatus missionStatus(MemberGeneration memberGeneration, MashongMission mashongMission) {
private MissionStatus getMissionStatus(MemberGeneration memberGeneration, MashongMission mashongMission) {
MashongMissionLevel latestMissionLevel = getLatestMissionLevel(memberGeneration, mashongMission);
MashongMissionLog mashongMissionLog = mashongMissionLogService.getMissionLog(latestMissionLevel, memberGeneration.getId());
return MissionStatus.of(mashongMission, latestMissionLevel, mashongMissionLog);
}

private MissionStatus missionStatus(Platform platform, Long generationId, MashongMission mashongMission) {
synchronized private MissionStatus getMissionStatus(Platform platform, Long generationId, MashongMission mashongMission) {
MashongMissionLevel latestMissionLevel = getLatestMissionLevel(platform, generationId, mashongMission);
MashongMissionTeamLog mashongMissionLog = mashongMissionTeamLogService.getMissionLog(latestMissionLevel, platform, generationId);
return MissionStatus.of(mashongMission, latestMissionLevel, mashongMissionLog);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class MashongMissionController {
public ApiResponse<List<MissionStatus>> missionStatusList(
@ApiIgnore MemberAuth memberAuth
) {
return ApiResponse.success(mashongMissionFacadeService.missionStatusList(memberAuth.getMemberGenerationId()));
return ApiResponse.success(mashongMissionFacadeService.getMissionStatusList(memberAuth.getMemberGenerationId()));
}

@ApiOperation(value = "매숑이 출석 현황")
Expand Down
Loading