-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 미션 전체 현황 - 날짜로 미션 목록 조회 (#315)
* feat: 미션 전체 현황 - 날짜로 미션 목록 조회 * fix: Transactional readOnly 추가 * fix: isCompletedMissionToday에 COMPLETE 비교 추가 * fix: 로직 stream으로 변경 * fix: findMissionsWithRecordsByDate 날짜 비교 00으로 변경 * style: spotless * fix: sorted stream과 합치고 missionSummaryItem메소드 추출
- Loading branch information
Showing
7 changed files
with
133 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/com/depromeet/domain/mission/dto/response/MissionSummaryItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.depromeet.domain.mission.dto.response; | ||
|
||
import com.depromeet.domain.mission.domain.*; | ||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.time.LocalDateTime; | ||
|
||
public record MissionSummaryItem( | ||
@Schema(description = "미션 ID", defaultValue = "1") Long missionId, | ||
@Schema(description = "미션 이름", defaultValue = "default name") String name, | ||
@Schema(description = "미션 카테고리", defaultValue = "STUDY") MissionCategory category, | ||
@Schema(description = "미션 공개여부", defaultValue = "ALL") MissionVisibility visibility, | ||
@Schema(description = "미션 상태", defaultValue = "1") MissionStatus missionStatus, | ||
@JsonFormat( | ||
shape = JsonFormat.Shape.STRING, | ||
pattern = "yyyy-MM-dd HH:mm:ss", | ||
timezone = "Asia/Seoul") | ||
@Schema( | ||
description = "미션 종료 시간", | ||
defaultValue = "2024-01-03 00:34:00", | ||
type = "string") | ||
LocalDateTime finishedAt) { | ||
|
||
public static MissionSummaryItem of(Mission mission, MissionStatus missionStatus) { | ||
return new MissionSummaryItem( | ||
mission.getId(), | ||
mission.getName(), | ||
mission.getCategory(), | ||
mission.getVisibility(), | ||
missionStatus, | ||
mission.getFinishedAt()); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/com/depromeet/domain/mission/dto/response/MissionSummaryListResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.depromeet.domain.mission.dto.response; | ||
|
||
import java.util.List; | ||
|
||
public record MissionSummaryListResponse( | ||
long missionAllCount, | ||
long missionCompleteCount, | ||
long missionNoneCount, | ||
List<MissionSummaryItem> missionSummaryItems) { | ||
public static MissionSummaryListResponse of( | ||
long missionAllCount, | ||
long missionCompleteCount, | ||
long missionNoneCount, | ||
List<MissionSummaryItem> missionSummaryItems) { | ||
return new MissionSummaryListResponse( | ||
missionAllCount, missionCompleteCount, missionNoneCount, missionSummaryItems); | ||
} | ||
} |