Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public RsData<JobRoadmapPagingResponse> getJobRoadmaps(
### 반환 정보

**로드맵 기본 정보:**
- id, jobId, jobName: 직업 정보
- id, jobId, jobName, jobDescription: 직업 정보
- totalNodeCount: 전체 노드 개수
- createdDate, modifiedDate: 생성/수정일

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ public record JobRoadmapResponse(
Long id,
Long jobId,
String jobName,
String jobDescription,
List<JobRoadmapNodeResponse> nodes,
int totalNodeCount,
LocalDateTime createdDate,
LocalDateTime modifiedDate
) {

// 정적 팩터리 메서드 - JobRoadmap과 Job 정보, 통계 정보로부터 Response DTO 생성
public static JobRoadmapResponse from(JobRoadmap jobRoadmap, String jobName, Map<Long, JobRoadmapNodeStat> statMap) {
public static JobRoadmapResponse from(JobRoadmap jobRoadmap, String jobName, String jobDescription, Map<Long, JobRoadmapNodeStat> statMap) {
// 부모-자식 관계 맵 생성
Map<Long, List<RoadmapNode>> childrenMap = jobRoadmap.getNodes().stream()
.filter(node -> node.getParent() != null)
Expand All @@ -47,6 +48,7 @@ public static JobRoadmapResponse from(JobRoadmap jobRoadmap, String jobName, Map
jobRoadmap.getId(),
jobRoadmap.getJob().getId(),
jobName,
jobDescription,
nodes,
jobRoadmap.getNodes().size(),
jobRoadmap.getCreateDate(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public JobRoadmapResponse getJobRoadmapById(Long id) {
Map<Long, JobRoadmapNodeStat> statMap = stats.stream()
.collect(Collectors.toMap(stat -> stat.getNode().getId(), stat -> stat));

return JobRoadmapResponse.from(jobRoadmap, jobRoadmap.getJob().getName(), statMap);
return JobRoadmapResponse.from(jobRoadmap, jobRoadmap.getJob().getName(),jobRoadmap.getJob().getDescription(), statMap);
}

private JobRoadmapListResponse toListResponse(JobRoadmap jobRoadmap) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.springframework.boot.ApplicationRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.transaction.annotation.Transactional;

import java.util.Comparator;
Expand All @@ -36,6 +37,7 @@
@Configuration
@RequiredArgsConstructor
@Transactional
@Profile("!prod")
public class RoadmapInitData {
private final JobService jobService;
private final JobRepository jobRepository;
Expand Down
Loading