diff --git a/back/back/src/main/java/com/noto/back/dto/response/ProjectListEntity.java b/back/back/src/main/java/com/noto/back/dto/response/ProjectListEntity.java index ec891d1..250ce7f 100644 --- a/back/back/src/main/java/com/noto/back/dto/response/ProjectListEntity.java +++ b/back/back/src/main/java/com/noto/back/dto/response/ProjectListEntity.java @@ -7,6 +7,7 @@ @Builder public record ProjectListEntity( String name, - Long projectId + Long projectId, + String description ) { } diff --git a/back/back/src/main/java/com/noto/back/repository/ProjectRepository.java b/back/back/src/main/java/com/noto/back/repository/ProjectRepository.java index 9c2fa8c..38f8540 100644 --- a/back/back/src/main/java/com/noto/back/repository/ProjectRepository.java +++ b/back/back/src/main/java/com/noto/back/repository/ProjectRepository.java @@ -56,7 +56,7 @@ WHERE p.id IN ( List findSchedulesByCurrentMonthAndProjectId(Long projectId); - @Query("SELECT pp.project.name, pp.project.id FROM ProjectParticipate pp WHERE pp.user.id = :userId") + @Query("SELECT pp.project.name, pp.project.id, pp.project.description FROM ProjectParticipate pp WHERE pp.user.id = :userId") List findProjectNamesByUserId(@Param("userId") Long userId); @Query( """ diff --git a/back/back/src/main/java/com/noto/back/service/ProjectService.java b/back/back/src/main/java/com/noto/back/service/ProjectService.java index 3e40756..0e573b2 100644 --- a/back/back/src/main/java/com/noto/back/service/ProjectService.java +++ b/back/back/src/main/java/com/noto/back/service/ProjectService.java @@ -74,7 +74,8 @@ public ProjectListResponse getProjectListsByUserId(Long userId) { List projects = projectListEntities.stream() .map(result -> new ProjectListEntity( (String) result[0], // 이름 - (Long) result[1] // ID + (Long) result[1], + (String) result[2] )) .collect(Collectors.toList()); diff --git a/back/back/src/main/java/com/noto/back/service/RequestService.java b/back/back/src/main/java/com/noto/back/service/RequestService.java index c692ec3..30edcfb 100644 --- a/back/back/src/main/java/com/noto/back/service/RequestService.java +++ b/back/back/src/main/java/com/noto/back/service/RequestService.java @@ -54,8 +54,10 @@ public RequestInfoResponse getRequestInfo(Long requestId, Long userId) { String senderName = (String) result[5]; String receiverNames = (String) result[6]; String scheduleName = (String) result[7]; // 일정 이름 - - List receivers = Arrays.asList(receiverNames.split(",")); + List receivers = new ArrayList<>(); + if (receiverNames != null) { + receivers = Arrays.asList(receiverNames.split(",")); + } Long id = (Long)result[8]; Boolean isSender = false; if (tempUser.getName().equals(senderName)) {