From 4c829c1bc3d5178d29c30fe5b3e2cddc4b66691f Mon Sep 17 00:00:00 2001 From: softmoca Date: Mon, 16 Dec 2024 17:10:46 +0900 Subject: [PATCH 1/4] =?UTF-8?q?feat=20:=20aboutsopt=20Get=20=EB=A7=88?= =?UTF-8?q?=EC=9D=B4=EA=B7=B8=EB=A0=88=EC=9D=B4=EC=85=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aboutsopt/AboutSoptController.java | 30 ++++++++ .../homepage/aboutsopt/AboutSoptService.java | 77 +++++++++++++++++++ .../aboutsopt/dto/AboutSoptResponseDto.java | 25 ++++++ .../aboutsopt/dto/CoreValueResponseDto.java | 23 ++++++ .../dto/GetAboutSoptResponseDto.java | 32 ++++++++ .../entity/AboutSoptEntity.java | 11 ++- .../entity/CoreValueEntity.java | 11 ++- .../repository/AboutSoptRepository.java | 13 ++++ .../homepage/exception/NotFoundException.java | 11 +++ .../playground/PlaygroundService.java | 2 +- .../org/homepage/project/ProjectService.java | 12 +++ 11 files changed, 244 insertions(+), 3 deletions(-) create mode 100644 src/main/java/sopt/org/homepage/aboutsopt/AboutSoptController.java create mode 100644 src/main/java/sopt/org/homepage/aboutsopt/AboutSoptService.java create mode 100644 src/main/java/sopt/org/homepage/aboutsopt/dto/AboutSoptResponseDto.java create mode 100644 src/main/java/sopt/org/homepage/aboutsopt/dto/CoreValueResponseDto.java create mode 100644 src/main/java/sopt/org/homepage/aboutsopt/dto/GetAboutSoptResponseDto.java rename src/main/java/sopt/org/homepage/{ => aboutsopt}/entity/AboutSoptEntity.java (83%) rename src/main/java/sopt/org/homepage/{ => aboutsopt}/entity/CoreValueEntity.java (73%) create mode 100644 src/main/java/sopt/org/homepage/aboutsopt/repository/AboutSoptRepository.java create mode 100644 src/main/java/sopt/org/homepage/exception/NotFoundException.java diff --git a/src/main/java/sopt/org/homepage/aboutsopt/AboutSoptController.java b/src/main/java/sopt/org/homepage/aboutsopt/AboutSoptController.java new file mode 100644 index 0000000..b577dd6 --- /dev/null +++ b/src/main/java/sopt/org/homepage/aboutsopt/AboutSoptController.java @@ -0,0 +1,30 @@ +package sopt.org.homepage.aboutsopt; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import sopt.org.homepage.aboutsopt.dto.GetAboutSoptResponseDto; + +@RestController +@RequiredArgsConstructor +@RequestMapping("aboutsopt") +@Tag(name = "AboutSopt") +public class AboutSoptController { + private final AboutSoptService aboutSoptService; + + @GetMapping("") + @Operation(summary = "사용자용 AboutSopt 조회", + description = "Query값이 null이면 최근 기수를 불러옵니다. 해당 기수의 AboutSOPT가 없으면 not found error") + public ResponseEntity getAboutSopt( + @Parameter(description = "기수") + @RequestParam(required = false) Integer generation + ) { + return ResponseEntity.ok(aboutSoptService.getAboutSopt(generation)); + } +} diff --git a/src/main/java/sopt/org/homepage/aboutsopt/AboutSoptService.java b/src/main/java/sopt/org/homepage/aboutsopt/AboutSoptService.java new file mode 100644 index 0000000..ef11230 --- /dev/null +++ b/src/main/java/sopt/org/homepage/aboutsopt/AboutSoptService.java @@ -0,0 +1,77 @@ +package sopt.org.homepage.aboutsopt; + +import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import sopt.org.homepage.aboutsopt.dto.AboutSoptResponseDto; +import sopt.org.homepage.aboutsopt.dto.CoreValueResponseDto; +import sopt.org.homepage.aboutsopt.dto.GetAboutSoptResponseDto; +import sopt.org.homepage.aboutsopt.entity.AboutSoptEntity; +import sopt.org.homepage.aboutsopt.entity.CoreValueEntity; +import sopt.org.homepage.aboutsopt.repository.AboutSoptRepository; +import sopt.org.homepage.exception.NotFoundException; +import sopt.org.homepage.internal.crew.CrewService; +import sopt.org.homepage.internal.playground.PlaygroundService; +import sopt.org.homepage.project.ProjectService; + +@Service +@RequiredArgsConstructor +@Transactional(readOnly = true) +public class AboutSoptService { + private final AboutSoptRepository aboutSoptRepository; + private final CrewService crewService; + private final PlaygroundService playgroundService; + private final ProjectService projectService; + + + public GetAboutSoptResponseDto getAboutSopt(Integer generation) { + AboutSoptEntity aboutSopt = generation != null ? + aboutSoptRepository.findByIdAndIsPublishedTrue(Long.valueOf(generation)) + .orElseThrow(() -> new NotFoundException("Not found Published about sopt with id: " + generation)) + : aboutSoptRepository.findTopByIsPublishedTrueOrderByIdDesc() + .orElseThrow(() -> new NotFoundException("Not found any published AboutSopt")); + int targetGeneration = 33; // TODO: 현재 34기 데이터가 모이지 않은 관계로 추후 돌려놓아야 함 + + var members = playgroundService.getAllMembers(targetGeneration); + var projects = projectService.findByGeneration(targetGeneration); + var studyCount = crewService.getStudyCount(targetGeneration); + + return GetAboutSoptResponseDto.builder() + .aboutSopt(convertToResponseDto(aboutSopt)) + .activitiesRecords(GetAboutSoptResponseDto.ActivitiesRecords.builder() + .activitiesMemberCount(members.numberOfMembersAtGeneration()) + .projectCounts(projects.size()) + .studyCounts(studyCount) + .build()) + .build(); + } + + private AboutSoptResponseDto convertToResponseDto(AboutSoptEntity entity) { + return AboutSoptResponseDto.builder() + .id((long) entity.getId()) + .isPublished(entity.isPublished()) + .title(entity.getTitle()) + .bannerImage(entity.getBannerImage()) + .coreDescription(entity.getCoreDescription()) + .planCurriculum(entity.getPlanCurriculum()) + .designCurriculum(entity.getDesignCurriculum()) + .androidCurriculum(entity.getAndroidCurriculum()) + .iosCurriculum(entity.getIosCurriculum()) + .webCurriculum(entity.getWebCurriculum()) + .serverCurriculum(entity.getServerCurriculum()) + .coreValues(entity.getCoreValues().stream() + .map(this::convertToCoreValueDto) + .collect(Collectors.toList())) + .build(); + } + + private CoreValueResponseDto convertToCoreValueDto(CoreValueEntity coreValue) { + return CoreValueResponseDto.builder() + .id((long) coreValue.getId()) + .title(coreValue.getTitle()) + .subTitle(coreValue.getSubTitle()) + .imageUrl(coreValue.getImageUrl()) + .build(); + } +} diff --git a/src/main/java/sopt/org/homepage/aboutsopt/dto/AboutSoptResponseDto.java b/src/main/java/sopt/org/homepage/aboutsopt/dto/AboutSoptResponseDto.java new file mode 100644 index 0000000..995e5df --- /dev/null +++ b/src/main/java/sopt/org/homepage/aboutsopt/dto/AboutSoptResponseDto.java @@ -0,0 +1,25 @@ +package sopt.org.homepage.aboutsopt.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.List; +import lombok.Builder; +import lombok.Getter; + +@Schema(description = "AboutSopt 상세 정보") +public record AboutSoptResponseDto( + Long id, + boolean isPublished, + String title, + String bannerImage, + String coreDescription, + String planCurriculum, + String designCurriculum, + String androidCurriculum, + String iosCurriculum, + String webCurriculum, + String serverCurriculum, + List coreValues +) { + @Builder + public AboutSoptResponseDto {} +} \ No newline at end of file diff --git a/src/main/java/sopt/org/homepage/aboutsopt/dto/CoreValueResponseDto.java b/src/main/java/sopt/org/homepage/aboutsopt/dto/CoreValueResponseDto.java new file mode 100644 index 0000000..6d3bff7 --- /dev/null +++ b/src/main/java/sopt/org/homepage/aboutsopt/dto/CoreValueResponseDto.java @@ -0,0 +1,23 @@ +package sopt.org.homepage.aboutsopt.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; +import lombok.Getter; + +@Schema(description = "Core Value 응답") +public record CoreValueResponseDto( + @Schema(description = "코어밸류 id") + Long id, + + @Schema(description = "코어밸류", nullable = false) + String title, + + @Schema(description = "코어밸루 설명", nullable = false) + String subTitle, + + @Schema(description = "핵심가치 이미지 주소", nullable = false) + String imageUrl +) { + @Builder + public CoreValueResponseDto {} +} diff --git a/src/main/java/sopt/org/homepage/aboutsopt/dto/GetAboutSoptResponseDto.java b/src/main/java/sopt/org/homepage/aboutsopt/dto/GetAboutSoptResponseDto.java new file mode 100644 index 0000000..39b82f7 --- /dev/null +++ b/src/main/java/sopt/org/homepage/aboutsopt/dto/GetAboutSoptResponseDto.java @@ -0,0 +1,32 @@ +package sopt.org.homepage.aboutsopt.dto; + + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; +import lombok.Getter; + +@Schema(description = "AboutSopt 응답") +public record GetAboutSoptResponseDto( + @Schema(description = "AboutSopt 정보") + AboutSoptResponseDto aboutSopt, + + @Schema(description = "활동 기록") + ActivitiesRecords activitiesRecords +) { + @Builder + public GetAboutSoptResponseDto {} + + public record ActivitiesRecords( + @Schema(description = "활동 멤버 수") + int activitiesMemberCount, + + @Schema(description = "프로젝트 수") + int projectCounts, + + @Schema(description = "스터디 수") + Integer studyCounts + ) { + @Builder + public ActivitiesRecords {} + } +} \ No newline at end of file diff --git a/src/main/java/sopt/org/homepage/entity/AboutSoptEntity.java b/src/main/java/sopt/org/homepage/aboutsopt/entity/AboutSoptEntity.java similarity index 83% rename from src/main/java/sopt/org/homepage/entity/AboutSoptEntity.java rename to src/main/java/sopt/org/homepage/aboutsopt/entity/AboutSoptEntity.java index b9c9c02..65c10c9 100644 --- a/src/main/java/sopt/org/homepage/entity/AboutSoptEntity.java +++ b/src/main/java/sopt/org/homepage/aboutsopt/entity/AboutSoptEntity.java @@ -1,12 +1,18 @@ -package sopt.org.homepage.entity; +package sopt.org.homepage.aboutsopt.entity; import jakarta.persistence.*; import java.sql.Timestamp; +import java.util.List; import java.util.Objects; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; @Entity @Table(name = "\"AboutSopt\"") +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) public class AboutSoptEntity { @GeneratedValue(strategy = GenerationType.IDENTITY) @Id @@ -49,4 +55,7 @@ public class AboutSoptEntity { @Column(name = "\"updatedAt\"", nullable = false) private Timestamp updatedAt; + @OneToMany(mappedBy = "aboutSopt", fetch = FetchType.LAZY) + private List coreValues; + } diff --git a/src/main/java/sopt/org/homepage/entity/CoreValueEntity.java b/src/main/java/sopt/org/homepage/aboutsopt/entity/CoreValueEntity.java similarity index 73% rename from src/main/java/sopt/org/homepage/entity/CoreValueEntity.java rename to src/main/java/sopt/org/homepage/aboutsopt/entity/CoreValueEntity.java index 3b39a09..da9bb16 100644 --- a/src/main/java/sopt/org/homepage/entity/CoreValueEntity.java +++ b/src/main/java/sopt/org/homepage/aboutsopt/entity/CoreValueEntity.java @@ -1,12 +1,17 @@ -package sopt.org.homepage.entity; +package sopt.org.homepage.aboutsopt.entity; import jakarta.persistence.*; import java.sql.Timestamp; import java.util.Objects; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; @Entity @Table(name = "\"CoreValue\"") +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) public class CoreValueEntity { @GeneratedValue(strategy = GenerationType.IDENTITY) @Id @@ -31,4 +36,8 @@ public class CoreValueEntity { @Column(name = "\"aboutSoptId\"", nullable = true) private Integer aboutSoptId; + @ManyToOne + @JoinColumn(name = "\"aboutSoptId\"", insertable = false, updatable = false) + private AboutSoptEntity aboutSopt; + } diff --git a/src/main/java/sopt/org/homepage/aboutsopt/repository/AboutSoptRepository.java b/src/main/java/sopt/org/homepage/aboutsopt/repository/AboutSoptRepository.java new file mode 100644 index 0000000..7bd21a3 --- /dev/null +++ b/src/main/java/sopt/org/homepage/aboutsopt/repository/AboutSoptRepository.java @@ -0,0 +1,13 @@ +package sopt.org.homepage.aboutsopt.repository; + + +import java.util.Optional; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; +import sopt.org.homepage.aboutsopt.entity.AboutSoptEntity; + +@Repository +public interface AboutSoptRepository extends JpaRepository { + Optional findTopByIsPublishedTrueOrderByIdDesc(); + Optional findByIdAndIsPublishedTrue(Long id); +} \ No newline at end of file diff --git a/src/main/java/sopt/org/homepage/exception/NotFoundException.java b/src/main/java/sopt/org/homepage/exception/NotFoundException.java new file mode 100644 index 0000000..0748a9d --- /dev/null +++ b/src/main/java/sopt/org/homepage/exception/NotFoundException.java @@ -0,0 +1,11 @@ +package sopt.org.homepage.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +@ResponseStatus(HttpStatus.NOT_FOUND) +public class NotFoundException extends RuntimeException { + public NotFoundException(String message) { + super(message); + } +} diff --git a/src/main/java/sopt/org/homepage/internal/playground/PlaygroundService.java b/src/main/java/sopt/org/homepage/internal/playground/PlaygroundService.java index 53ac255..517c6e7 100644 --- a/src/main/java/sopt/org/homepage/internal/playground/PlaygroundService.java +++ b/src/main/java/sopt/org/homepage/internal/playground/PlaygroundService.java @@ -135,7 +135,7 @@ public ProjectDetailResponseDto getProjectDetail(Long projectId){ return responseMapper.toProjectDetailResponse(projectResponse); } - public PlaygroundMemberListResponse getAllMembers(String part, Integer generation) { + public PlaygroundMemberListResponse getAllMembers(Integer generation) { return playgroundClient.getAllMembers(authConfig.getPlaygroundToken(), null, generation); } } diff --git a/src/main/java/sopt/org/homepage/project/ProjectService.java b/src/main/java/sopt/org/homepage/project/ProjectService.java index 552bbc4..b6c657f 100644 --- a/src/main/java/sopt/org/homepage/project/ProjectService.java +++ b/src/main/java/sopt/org/homepage/project/ProjectService.java @@ -1,6 +1,7 @@ package sopt.org.homepage.project; import java.util.List; +import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -39,5 +40,16 @@ public ProjectDetailResponseDto findOne(Long projectId) { } + public List findByGeneration(Integer generation) { + var allProjects = findAll(new GetProjectsRequestDto(1, Integer.MAX_VALUE, null, null)); + + + return allProjects.stream() + .filter(project -> project.getGeneration() != null && project.getGeneration().equals(generation)) + .collect(Collectors.toList()); + } + + + } From 1ff37c8d6a5b223410c76ed96f85902df9287f23 Mon Sep 17 00:00:00 2001 From: softmoca Date: Mon, 16 Dec 2024 17:22:51 +0900 Subject: [PATCH 2/4] =?UTF-8?q?docs=20:=20=EC=8A=A4=EC=9B=A8=EA=B1=B0=20Ne?= =?UTF-8?q?stJS=20=EC=99=80=20=ED=86=A0=EC=9D=BC=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aboutsopt/AboutSoptController.java | 4 ++-- .../aboutsopt/dto/AboutSoptResponseDto.java | 23 +++++++++++++++++++ .../aboutsopt/dto/CoreValueResponseDto.java | 3 +++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/main/java/sopt/org/homepage/aboutsopt/AboutSoptController.java b/src/main/java/sopt/org/homepage/aboutsopt/AboutSoptController.java index b577dd6..49cf4e0 100644 --- a/src/main/java/sopt/org/homepage/aboutsopt/AboutSoptController.java +++ b/src/main/java/sopt/org/homepage/aboutsopt/AboutSoptController.java @@ -19,8 +19,8 @@ public class AboutSoptController { private final AboutSoptService aboutSoptService; @GetMapping("") - @Operation(summary = "사용자용 AboutSopt 조회", - description = "Query값이 null이면 최근 기수를 불러옵니다. 해당 기수의 AboutSOPT가 없으면 not found error") + @Operation(summary = "사용자용 AboutSopt 조회를 조회합니다, Query값이 null이면 최근 기수를 불러옵니다. 해당 기수의 AboutSOPT가 없으면 not found error" + ) public ResponseEntity getAboutSopt( @Parameter(description = "기수") @RequestParam(required = false) Integer generation diff --git a/src/main/java/sopt/org/homepage/aboutsopt/dto/AboutSoptResponseDto.java b/src/main/java/sopt/org/homepage/aboutsopt/dto/AboutSoptResponseDto.java index 995e5df..6c5e996 100644 --- a/src/main/java/sopt/org/homepage/aboutsopt/dto/AboutSoptResponseDto.java +++ b/src/main/java/sopt/org/homepage/aboutsopt/dto/AboutSoptResponseDto.java @@ -7,17 +7,40 @@ @Schema(description = "AboutSopt 상세 정보") public record AboutSoptResponseDto( + @Schema(description = "기수", nullable = false, example = "33") Long id, + + @Schema(description = "배포 여부", nullable = false, example = "true") boolean isPublished, + + @Schema(description = "AboutTab 상단 타이틀", nullable = false, example = "SOPT 33기") String title, + + @Schema(description = "배너 이미지 주소", nullable = false, example = "https://example.com/banner.jpg") String bannerImage, + + @Schema(description = "핵심가치 설명", nullable = false, example = "SOPT는 혁신과 협업을 추구합니다.") String coreDescription, + + @Schema(description = "기획파트 커리큘럼", nullable = false, example = "기획 과정 내용") String planCurriculum, + + @Schema(description = "디자인파트 커리큘럼", nullable = false, example = "디자인 과정 내용") String designCurriculum, + + @Schema(description = "안드로이드 파트 커리큘럼", nullable = false, example = "안드로이드 과정 내용") String androidCurriculum, + + @Schema(description = "iOS 파트 커리큘럼", nullable = false, example = "iOS 과정 내용") String iosCurriculum, + + @Schema(description = "웹 파트 커리큘럼", nullable = false, example = "웹 과정 내용") String webCurriculum, + + @Schema(description = "서버 파트 커리큘럼", nullable = false, example = "서버 과정 내용") String serverCurriculum, + + @Schema(description = "코어밸류 리스트", nullable = false) List coreValues ) { @Builder diff --git a/src/main/java/sopt/org/homepage/aboutsopt/dto/CoreValueResponseDto.java b/src/main/java/sopt/org/homepage/aboutsopt/dto/CoreValueResponseDto.java index 6d3bff7..7bb2e4b 100644 --- a/src/main/java/sopt/org/homepage/aboutsopt/dto/CoreValueResponseDto.java +++ b/src/main/java/sopt/org/homepage/aboutsopt/dto/CoreValueResponseDto.java @@ -17,6 +17,9 @@ public record CoreValueResponseDto( @Schema(description = "핵심가치 이미지 주소", nullable = false) String imageUrl + + + ) { @Builder public CoreValueResponseDto {} From c7196d0b9bf0f1275bd5578494d7fbbb4ba2a2d3 Mon Sep 17 00:00:00 2001 From: softmoca Date: Mon, 16 Dec 2024 17:23:49 +0900 Subject: [PATCH 3/4] =?UTF-8?q?fix=20:=20CoreValueResponseDto=EC=97=90=20?= =?UTF-8?q?=EB=B9=A0=EC=A1=8C=EB=8D=98=20=EB=82=A0=EC=A7=9C=20=EC=86=8D?= =?UTF-8?q?=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/homepage/aboutsopt/dto/CoreValueResponseDto.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/sopt/org/homepage/aboutsopt/dto/CoreValueResponseDto.java b/src/main/java/sopt/org/homepage/aboutsopt/dto/CoreValueResponseDto.java index 7bb2e4b..2ef84be 100644 --- a/src/main/java/sopt/org/homepage/aboutsopt/dto/CoreValueResponseDto.java +++ b/src/main/java/sopt/org/homepage/aboutsopt/dto/CoreValueResponseDto.java @@ -1,6 +1,7 @@ package sopt.org.homepage.aboutsopt.dto; import io.swagger.v3.oas.annotations.media.Schema; +import java.time.LocalDateTime; import lombok.Builder; import lombok.Getter; @@ -16,9 +17,13 @@ public record CoreValueResponseDto( String subTitle, @Schema(description = "핵심가치 이미지 주소", nullable = false) - String imageUrl + String imageUrl, + @Schema(description = "생성일자", nullable = false, example = "2024-12-16T12:00:00") + LocalDateTime createdAt, + @Schema(description = "수정일자", nullable = false, example = "2024-12-16T15:00:00") + LocalDateTime updatedAt ) { @Builder From 210d8943c136495e95122e08a6d56b9eea8aeb6a Mon Sep 17 00:00:00 2001 From: softmoca Date: Mon, 16 Dec 2024 17:26:44 +0900 Subject: [PATCH 4/4] =?UTF-8?q?refactor=20:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=EA=B3=B5=EB=B0=B1=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/sopt/org/homepage/aboutsopt/AboutSoptService.java | 1 - .../homepage/aboutsopt/dto/GetAboutSoptResponseDto.java | 1 - .../java/sopt/org/homepage/project/ProjectService.java | 7 ------- 3 files changed, 9 deletions(-) diff --git a/src/main/java/sopt/org/homepage/aboutsopt/AboutSoptService.java b/src/main/java/sopt/org/homepage/aboutsopt/AboutSoptService.java index ef11230..3146462 100644 --- a/src/main/java/sopt/org/homepage/aboutsopt/AboutSoptService.java +++ b/src/main/java/sopt/org/homepage/aboutsopt/AboutSoptService.java @@ -24,7 +24,6 @@ public class AboutSoptService { private final PlaygroundService playgroundService; private final ProjectService projectService; - public GetAboutSoptResponseDto getAboutSopt(Integer generation) { AboutSoptEntity aboutSopt = generation != null ? aboutSoptRepository.findByIdAndIsPublishedTrue(Long.valueOf(generation)) diff --git a/src/main/java/sopt/org/homepage/aboutsopt/dto/GetAboutSoptResponseDto.java b/src/main/java/sopt/org/homepage/aboutsopt/dto/GetAboutSoptResponseDto.java index 39b82f7..967d38a 100644 --- a/src/main/java/sopt/org/homepage/aboutsopt/dto/GetAboutSoptResponseDto.java +++ b/src/main/java/sopt/org/homepage/aboutsopt/dto/GetAboutSoptResponseDto.java @@ -1,6 +1,5 @@ package sopt.org.homepage.aboutsopt.dto; - import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; import lombok.Getter; diff --git a/src/main/java/sopt/org/homepage/project/ProjectService.java b/src/main/java/sopt/org/homepage/project/ProjectService.java index b6c657f..04f50be 100644 --- a/src/main/java/sopt/org/homepage/project/ProjectService.java +++ b/src/main/java/sopt/org/homepage/project/ProjectService.java @@ -39,17 +39,10 @@ public ProjectDetailResponseDto findOne(Long projectId) { return playgroundService.getProjectDetail(projectId); } - public List findByGeneration(Integer generation) { var allProjects = findAll(new GetProjectsRequestDto(1, Integer.MAX_VALUE, null, null)); - - return allProjects.stream() .filter(project -> project.getGeneration() != null && project.getGeneration().equals(generation)) .collect(Collectors.toList()); } - - - - }