diff --git a/src/main/java/com/gdschongik/gdsc/domain/study/api/MentorStudyController.java b/src/main/java/com/gdschongik/gdsc/domain/study/api/MentorStudyController.java index 69a615e9d..d85ba3af1 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/study/api/MentorStudyController.java +++ b/src/main/java/com/gdschongik/gdsc/domain/study/api/MentorStudyController.java @@ -3,7 +3,7 @@ import com.gdschongik.gdsc.domain.study.application.MentorStudyService; import com.gdschongik.gdsc.domain.study.dto.request.StudyAnnouncementCreateUpdateRequest; import com.gdschongik.gdsc.domain.study.dto.request.StudyUpdateRequest; -import com.gdschongik.gdsc.domain.study.dto.response.MentorStudyResponse; +import com.gdschongik.gdsc.domain.study.dto.response.StudyResponse; import com.gdschongik.gdsc.domain.study.dto.response.StudyStudentResponse; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; @@ -30,8 +30,8 @@ public ResponseEntity updateStudy(@PathVariable Long studyId, @RequestBody @Operation(summary = "내 스터디 조회", description = "내가 멘토로 있는 스터디를 조회합니다.") @GetMapping("/me") - public ResponseEntity> getStudiesInCharge() { - List response = mentorStudyService.getStudiesInCharge(); + public ResponseEntity> getStudiesInCharge() { + List response = mentorStudyService.getStudiesInCharge(); return ResponseEntity.ok(response); } diff --git a/src/main/java/com/gdschongik/gdsc/domain/study/application/MentorStudyService.java b/src/main/java/com/gdschongik/gdsc/domain/study/application/MentorStudyService.java index 31bcd0aaf..ed972f338 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/study/application/MentorStudyService.java +++ b/src/main/java/com/gdschongik/gdsc/domain/study/application/MentorStudyService.java @@ -15,7 +15,7 @@ import com.gdschongik.gdsc.domain.study.dto.request.StudyAnnouncementCreateUpdateRequest; import com.gdschongik.gdsc.domain.study.dto.request.StudyCurriculumCreateRequest; import com.gdschongik.gdsc.domain.study.dto.request.StudyUpdateRequest; -import com.gdschongik.gdsc.domain.study.dto.response.MentorStudyResponse; +import com.gdschongik.gdsc.domain.study.dto.response.StudyResponse; import com.gdschongik.gdsc.domain.study.dto.response.StudyStudentResponse; import com.gdschongik.gdsc.global.exception.CustomException; import com.gdschongik.gdsc.global.exception.ErrorCode; @@ -42,10 +42,10 @@ public class MentorStudyService { private final StudyDetailValidator studyDetailValidator; @Transactional(readOnly = true) - public List getStudiesInCharge() { + public List getStudiesInCharge() { Member currentMember = memberUtil.getCurrentMember(); List myStudies = studyRepository.findAllByMentor(currentMember); - return myStudies.stream().map(MentorStudyResponse::from).toList(); + return myStudies.stream().map(StudyResponse::from).toList(); } @Transactional(readOnly = true) diff --git a/src/main/java/com/gdschongik/gdsc/domain/study/dto/response/MentorStudyResponse.java b/src/main/java/com/gdschongik/gdsc/domain/study/dto/response/MentorStudyResponse.java deleted file mode 100644 index 7b0e710ec..000000000 --- a/src/main/java/com/gdschongik/gdsc/domain/study/dto/response/MentorStudyResponse.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.gdschongik.gdsc.domain.study.dto.response; - -import com.gdschongik.gdsc.domain.study.domain.Study; -import com.gdschongik.gdsc.domain.study.domain.StudyType; -import com.gdschongik.gdsc.global.util.formatter.SemesterFormatter; -import io.swagger.v3.oas.annotations.media.Schema; - -public record MentorStudyResponse( - Long studyId, - @Schema(description = "활동 학기") String semester, - @Schema(description = "이름") String title, - @Schema(description = "종류") StudyType studyType, - @Schema(description = "상세설명 노션 링크") String notionLink, - @Schema(description = "멘토 이름") String mentorName) { - - public static MentorStudyResponse from(Study study) { - return new MentorStudyResponse( - study.getId(), - SemesterFormatter.format(study.getAcademicYear(), study.getSemesterType()), - study.getTitle(), - study.getStudyType(), - study.getNotionLink(), - study.getMentor().getName()); - } -}