diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 66d9f125..d72eba4c 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -5,6 +5,7 @@ on: branches: - main - develop + - fix/#82-fix-mission-status jobs: build-and-push: diff --git a/src/main/java/com/nexters/goalpanzi/application/auth/AuthService.java b/src/main/java/com/nexters/goalpanzi/application/auth/AuthService.java index bdd8b977..4e42f7a2 100644 --- a/src/main/java/com/nexters/goalpanzi/application/auth/AuthService.java +++ b/src/main/java/com/nexters/goalpanzi/application/auth/AuthService.java @@ -75,9 +75,9 @@ public void logout(final Long memberId) { public TokenResponse reissueToken(final Long memberId, final String refreshToken) { // TODO : 토큰 만료기간 이슈로 무조건 재발급 - if (memberId == 104) { - validateRefreshToken(memberId, refreshToken); - } +// if (memberId == 104) { +// validateRefreshToken(memberId, refreshToken); +// } Jwt jwt = jwtProvider.generateTokens(memberId.toString()); refreshTokenRepository.save(memberId.toString(), jwt.refreshToken(), jwt.refreshExpiresIn()); diff --git a/src/main/java/com/nexters/goalpanzi/domain/mission/MissionStatus.java b/src/main/java/com/nexters/goalpanzi/domain/mission/MissionStatus.java index f388d1fc..199b552b 100644 --- a/src/main/java/com/nexters/goalpanzi/domain/mission/MissionStatus.java +++ b/src/main/java/com/nexters/goalpanzi/domain/mission/MissionStatus.java @@ -1,16 +1,18 @@ package com.nexters.goalpanzi.domain.mission; -import com.nexters.goalpanzi.common.time.TimeUtil; import lombok.Getter; import java.time.LocalDateTime; -import java.util.List; import static com.nexters.goalpanzi.exception.ErrorCode.UNKNOWN_MISSION; @Getter public enum MissionStatus { + // 레거시 + PENDING("생성(레거시)"), + ONGOING("진행중(레거시)"), + // 미션 시작 전 CREATED("생성"), diff --git a/src/main/java/com/nexters/goalpanzi/presentation/mission/MissionMemberController.java b/src/main/java/com/nexters/goalpanzi/presentation/mission/MissionMemberController.java index f86fe69b..d75f2937 100644 --- a/src/main/java/com/nexters/goalpanzi/presentation/mission/MissionMemberController.java +++ b/src/main/java/com/nexters/goalpanzi/presentation/mission/MissionMemberController.java @@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RestController; import java.util.List; +import java.util.Objects; @RequiredArgsConstructor @RestController @@ -32,9 +33,17 @@ public class MissionMemberController implements MissionMemberControllerDocs { @GetMapping("/mission-members/me") public ResponseEntity getMissions( @LoginMemberId final Long memberId, - @RequestParam(required = false) List filter + @RequestParam(required = false, defaultValue = "PENDING,ONGOING") List filter ) { - return ResponseEntity.ok(missionMemberService.findAllByMemberId(memberId, filter)); + // 레거시 상태 반영 위함 + var newFilter = filter.stream() + .map(it -> switch (it) { + case PENDING -> MissionStatus.CREATED; + case ONGOING -> MissionStatus.IN_PROGRESS; + default -> it; + }) + .toList(); + return ResponseEntity.ok(missionMemberService.findAllByMemberId(memberId, newFilter)); } @PostMapping("/mission-members")