-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Feat] #48 - OKR 전체 보기(대시보드) API
- Loading branch information
Showing
16 changed files
with
153 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
19 changes: 19 additions & 0 deletions
19
src/main/java/org/moonshot/server/domain/keyresult/dto/response/KeyResultResponseDto.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,19 @@ | ||
package org.moonshot.server.domain.keyresult.dto.response; | ||
|
||
import java.util.List; | ||
import org.moonshot.server.domain.keyresult.model.KeyResult; | ||
import org.moonshot.server.domain.task.dto.response.TaskResponseDto; | ||
|
||
public record KeyResultResponseDto( | ||
Long keyResultId, | ||
String keyResultTitle, | ||
List<TaskResponseDto> taskList | ||
) { | ||
public static List<KeyResultResponseDto> of(List<KeyResult> krList) { | ||
return krList.stream().map(kr -> new KeyResultResponseDto( | ||
kr.getId(), | ||
kr.getTitle(), | ||
TaskResponseDto.of(kr.getTaskList()) | ||
)).toList(); | ||
} | ||
} |
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
2 changes: 0 additions & 2 deletions
2
src/main/java/org/moonshot/server/domain/log/dto/response/LogResponseDto.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
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
23 changes: 23 additions & 0 deletions
23
src/main/java/org/moonshot/server/domain/objective/dto/response/DashboardResponseDto.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,23 @@ | ||
package org.moonshot.server.domain.objective.dto.response; | ||
|
||
import java.util.List; | ||
import org.moonshot.server.domain.keyresult.dto.response.KeyResultResponseDto; | ||
import org.moonshot.server.domain.objective.model.Objective; | ||
|
||
public record DashboardResponseDto( | ||
Long objId, | ||
String objTitle, | ||
int objListSize, | ||
List<KeyResultResponseDto> krList, | ||
List<ObjectiveResponseDto> objList | ||
) { | ||
public static DashboardResponseDto of(Objective objective, List<Objective> objList) { | ||
return new DashboardResponseDto( | ||
objective.getId(), | ||
objective.getTitle(), | ||
objList.size(), | ||
KeyResultResponseDto.of(objective.getKeyResultList()), | ||
objList.stream().map(ObjectiveResponseDto::of).toList() | ||
); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/org/moonshot/server/domain/objective/dto/response/ObjectiveResponseDto.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,22 @@ | ||
package org.moonshot.server.domain.objective.dto.response; | ||
|
||
import org.moonshot.server.domain.objective.model.Category; | ||
import org.moonshot.server.domain.objective.model.Objective; | ||
|
||
public record ObjectiveResponseDto( | ||
Long id, | ||
String title, | ||
String content, | ||
Category category, | ||
String date | ||
) { | ||
public static ObjectiveResponseDto of(Objective objective) { | ||
return new ObjectiveResponseDto( | ||
objective.getId(), | ||
objective.getTitle(), | ||
objective.getContent(), | ||
objective.getCategory(), | ||
objective.getDateString() | ||
); | ||
} | ||
} |
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
16 changes: 16 additions & 0 deletions
16
src/main/java/org/moonshot/server/domain/task/dto/response/TaskResponseDto.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,16 @@ | ||
package org.moonshot.server.domain.task.dto.response; | ||
|
||
import java.util.List; | ||
import org.moonshot.server.domain.task.model.Task; | ||
|
||
public record TaskResponseDto( | ||
Long id, | ||
String title | ||
) { | ||
public static List<TaskResponseDto> of(List<Task> taskList) { | ||
return taskList.stream().map(task -> new TaskResponseDto( | ||
task.getId(), | ||
task.getTitle() | ||
)).toList(); | ||
} | ||
} |
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