Skip to content

Commit

Permalink
fix: 미션 상태 하위 호환가능하도록 변경 (#86)
Browse files Browse the repository at this point in the history
* fix: api 하위 호환 가능하도록 수정

* fix: 임시 배포

* fix: 미션 상태 파라미터 교체
  • Loading branch information
songyi00 authored Oct 31, 2024
1 parent 051f8e5 commit 6c55bf2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- develop
- fix/#82-fix-mission-status

jobs:
build-and-push:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
@@ -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("생성"),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Objects;

@RequiredArgsConstructor
@RestController
Expand All @@ -32,9 +33,17 @@ public class MissionMemberController implements MissionMemberControllerDocs {
@GetMapping("/mission-members/me")
public ResponseEntity<MissionsResponse> getMissions(
@LoginMemberId final Long memberId,
@RequestParam(required = false) List<MissionStatus> filter
@RequestParam(required = false, defaultValue = "PENDING,ONGOING") List<MissionStatus> 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")
Expand Down

0 comments on commit 6c55bf2

Please sign in to comment.