Skip to content

Commit

Permalink
fix: Deprecate MissionCategoryResponseDto
Browse files Browse the repository at this point in the history
  • Loading branch information
jinsu4755 committed Dec 21, 2023
1 parent ab5d9fb commit 2d105e6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ public class MissionController implements MissionControllerContract {
private final MissionService missionService;

@GetMapping("/{missionCategoryId}")
@Deprecated
@ResponseStatus(HttpStatus.OK)
@Override
public MissionCategoryResponseDto getMissionCategory(@PathVariable Long missionCategoryId) {
return missionService.getMissionCategory(missionCategoryId);
}

@GetMapping()
@Deprecated
@ResponseStatus(HttpStatus.OK)
@Override
public List<MissionCategoryResponseDto> getMissionCategoryList() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ public class MissionCategory {
@Column(name = "image", nullable = false)
private String image;

@Deprecated
@Column(name = "level", nullable = false)
private int level;

@Deprecated
@Column(name = "expected_time", nullable = false)
private int expectedTime;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ public class MissionCategoryDto {
private final String tip;
private final String example;
private final String image;
@Schema(deprecated = true)
@Deprecated
private final int level;
@Schema(deprecated = true)
@Deprecated
private final int expectedTime;
@Schema(description = "미션 타입 [SAME, DIFFERENCE] enum 값")
private final MissionType missionType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

import java.util.List;

@Schema(description = "미션 카테고리 상세 정보 응답 DTO")
@Schema(description = "미션 카테고리 상세 정보 응답 DTO", deprecated = true)
@Deprecated
@JsonPropertyOrder({"id", "title", "description", "rule", "tip", "image", "missionContentList"})
@Builder
public record MissionCategoryResponseDto(
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/universe/uni/service/MissionService.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ public MissionContent getMissionContentByRandom(MissionCategory missionCategory)
}
}

@Deprecated
public MissionCategoryResponseDto getMissionCategory(Long missionCategoryId) {
MissionCategory missionCategory = missionCategoryRepository.findById(missionCategoryId)
.orElseThrow(() -> new NotFoundException(NOT_FOUND_MISSION_CATEGORY_EXCEPTION));
return fromMissionCategoryToMissionCategoryResponseDto(missionCategory);
}

@Deprecated
public List<MissionCategoryResponseDto> getMissionCategoryList() {
List<MissionCategory> missionCategoryList = missionCategoryRepository.findAll();
return missionCategoryList
Expand All @@ -58,6 +60,7 @@ public List<MissionCategoryResponseDto> getMissionCategoryList() {
.toList();
}

@Deprecated
private MissionCategoryResponseDto fromMissionCategoryToMissionCategoryResponseDto(
MissionCategory missionCategory) {

Expand Down

0 comments on commit 2d105e6

Please sign in to comment.