-
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.
- Loading branch information
Showing
9 changed files
with
270 additions
and
14 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
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
37 changes: 37 additions & 0 deletions
37
src/main/java/com/depromeet/domain/missionRecord/dto/response/FocusMissionRecordItem.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,37 @@ | ||
package com.depromeet.domain.missionRecord.dto.response; | ||
|
||
import com.depromeet.domain.missionRecord.domain.MissionRecord; | ||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.time.LocalDateTime; | ||
|
||
public record FocusMissionRecordItem( | ||
@Schema(description = "번개 수", defaultValue = "3") long symbolStack, | ||
@Schema(description = "미션 수행 시간 (Minute)", defaultValue = "34") long durationMinute, | ||
@JsonFormat( | ||
shape = JsonFormat.Shape.STRING, | ||
pattern = "yyyy-MM-dd HH:mm:ss", | ||
timezone = "Asia/Seoul") | ||
@Schema( | ||
description = "미션 기록 시작 시간", | ||
defaultValue = "2024-01-01 00:34:00", | ||
type = "string") | ||
LocalDateTime startedAt, | ||
@JsonFormat( | ||
shape = JsonFormat.Shape.STRING, | ||
pattern = "yyyy-MM-dd HH:mm:ss", | ||
timezone = "Asia/Seoul") | ||
@Schema( | ||
description = "미션 기록 종료 시간", | ||
defaultValue = "2024-01-15 00:34:00", | ||
type = "string") | ||
LocalDateTime finishedAt) { | ||
|
||
public static FocusMissionRecordItem from(MissionRecord record) { | ||
return new FocusMissionRecordItem( | ||
record.getDuration().toMinutes() / 10, | ||
record.getDuration().toMinutes(), | ||
record.getStartedAt(), | ||
record.getFinishedAt()); | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
src/main/java/com/depromeet/domain/missionRecord/dto/response/MissionStatisticsResponse.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,56 @@ | ||
package com.depromeet.domain.missionRecord.dto.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
public record MissionStatisticsResponse( | ||
@Schema(description = "수행 시간(시간)", defaultValue = "3") long totalMissionHour, | ||
@Schema(description = "수행 시간(분)", defaultValue = "8") long totalMissionMinute, | ||
@Schema(description = "번개 수", defaultValue = "8") long totalSymbolStack, | ||
@Schema(description = "연속 성공일", defaultValue = "4") long continuousSuccessDay, | ||
@Schema(description = "총 성공일", defaultValue = "9") long totalSuccessDay, | ||
@Schema(description = "달성률", defaultValue = "20.4") double totalMissionAttainRate, | ||
@JsonFormat( | ||
shape = JsonFormat.Shape.STRING, | ||
pattern = "yyyy-MM-dd HH:mm:ss", | ||
timezone = "Asia/Seoul") | ||
@Schema( | ||
description = "집중 시작 시각", | ||
defaultValue = "2024-01-01 00:34:00", | ||
type = "string") | ||
LocalDateTime startedAt, | ||
@JsonFormat( | ||
shape = JsonFormat.Shape.STRING, | ||
pattern = "yyyy-MM-dd HH:mm:ss", | ||
timezone = "Asia/Seoul") | ||
@Schema( | ||
description = "집중 마친 시각", | ||
defaultValue = "2024-01-15 00:34:00", | ||
type = "string") | ||
LocalDateTime finishedAt, | ||
@Schema(description = "미션 수행 타임 테이블") List<FocusMissionRecordItem> timeTable) { | ||
|
||
public static MissionStatisticsResponse of( | ||
long totalMissionHour, | ||
long totalMissionMinute, | ||
long totalSymbolStack, | ||
long continuousSuccessDay, | ||
long totalSuccessDay, | ||
double totalMissionAttainRate, | ||
LocalDateTime startedAt, | ||
LocalDateTime finishedAt, | ||
List<FocusMissionRecordItem> timeTable) { | ||
return new MissionStatisticsResponse( | ||
totalMissionHour, | ||
totalMissionMinute, | ||
totalSymbolStack, | ||
continuousSuccessDay, | ||
totalSuccessDay, | ||
totalMissionAttainRate, | ||
startedAt, | ||
finishedAt, | ||
timeTable); | ||
} | ||
} |
Oops, something went wrong.