From 69022da20cc611a8ba5fa8c38578724397bf3c59 Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Thu, 24 Oct 2024 15:22:05 +0900 Subject: [PATCH 01/20] =?UTF-8?q?FLASH-308=20feat:=20meta=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=EC=97=90=20=EA=B0=9C=EC=88=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/first/flash/global/paging/Meta.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/first/flash/global/paging/Meta.java b/src/main/java/com/first/flash/global/paging/Meta.java index 59287d17..3b0f9bf9 100644 --- a/src/main/java/com/first/flash/global/paging/Meta.java +++ b/src/main/java/com/first/flash/global/paging/Meta.java @@ -2,12 +2,12 @@ import java.util.Objects; -public record Meta(String cursor, boolean hasNext) { +public record Meta(String cursor, boolean hasNext, Integer count) { - public static Meta from(final String nextCursor) { + public static Meta of(final String nextCursor, final Integer count) { if (Objects.isNull(nextCursor) || nextCursor.isEmpty()) { - return new Meta(null, false); + return new Meta(null, false, count); } - return new Meta(nextCursor, true); + return new Meta(nextCursor, true, count); } } From 14d4a1134059e6de4e1632ed8fbc54a80b408d6f Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Thu, 24 Oct 2024 15:22:50 +0900 Subject: [PATCH 02/20] =?UTF-8?q?FLASH-308=20feat:=20problem=20=EC=97=AC?= =?UTF-8?q?=EB=9F=AC=20=EA=B1=B4=20=EC=A1=B0=ED=9A=8C=20=EC=9D=91=EB=8B=B5?= =?UTF-8?q?=EC=97=90=20=EA=B0=9C=EC=88=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../climbing/problem/application/dto/ProblemsResponseDto.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/first/flash/climbing/problem/application/dto/ProblemsResponseDto.java b/src/main/java/com/first/flash/climbing/problem/application/dto/ProblemsResponseDto.java index 79ece29c..cd5f3ef8 100644 --- a/src/main/java/com/first/flash/climbing/problem/application/dto/ProblemsResponseDto.java +++ b/src/main/java/com/first/flash/climbing/problem/application/dto/ProblemsResponseDto.java @@ -13,6 +13,6 @@ public static ProblemsResponseDto of( } return new ProblemsResponseDto(queryProblems.stream() .map(ProblemResponseDto::toDto) - .toList(), Meta.from(nextCursor)); + .toList(), Meta.of(nextCursor, queryProblems.size())); } } From 59be0c76805243deead9debebb7b6edb0fa28eef Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Thu, 24 Oct 2024 15:23:02 +0900 Subject: [PATCH 03/20] =?UTF-8?q?FLASH-308=20feat:=20my=20solution=20?= =?UTF-8?q?=EC=97=AC=EB=9F=AC=20=EA=B1=B4=20=EC=A1=B0=ED=9A=8C=20=EC=9D=91?= =?UTF-8?q?=EB=8B=B5=EC=97=90=20=EA=B0=9C=EC=88=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../solution/application/dto/SolutionsPageResponseDto.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/first/flash/climbing/solution/application/dto/SolutionsPageResponseDto.java b/src/main/java/com/first/flash/climbing/solution/application/dto/SolutionsPageResponseDto.java index 49ebe4c7..79a23334 100644 --- a/src/main/java/com/first/flash/climbing/solution/application/dto/SolutionsPageResponseDto.java +++ b/src/main/java/com/first/flash/climbing/solution/application/dto/SolutionsPageResponseDto.java @@ -11,6 +11,6 @@ public static SolutionsPageResponseDto of( if (solutions.isEmpty()) { return new SolutionsPageResponseDto(List.of(), null); } - return new SolutionsPageResponseDto(solutions, Meta.from(nextCursor)); + return new SolutionsPageResponseDto(solutions, Meta.of(nextCursor, solutions.size())); } } From 18e4d95f1afee1316f961538ae3b07ab5164b651 Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Thu, 24 Oct 2024 15:23:26 +0900 Subject: [PATCH 04/20] =?UTF-8?q?FLASH-308=20feat:=20=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EB=AA=A8=EB=8D=B8=EC=97=90=20=ED=95=B4?= =?UTF-8?q?=EC=84=A4=20=EC=98=81=EC=83=81=20=EA=B0=9C=EC=88=98=20=EA=B0=92?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../climbing/problem/application/dto/ProblemResponseDto.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/first/flash/climbing/problem/application/dto/ProblemResponseDto.java b/src/main/java/com/first/flash/climbing/problem/application/dto/ProblemResponseDto.java index 84193b17..fa0659ae 100644 --- a/src/main/java/com/first/flash/climbing/problem/application/dto/ProblemResponseDto.java +++ b/src/main/java/com/first/flash/climbing/problem/application/dto/ProblemResponseDto.java @@ -5,12 +5,13 @@ import java.util.UUID; public record ProblemResponseDto(UUID id, String sector, String difficulty, LocalDate settingDate, - LocalDate removalDate, boolean hasSolution, String imageUrl, Boolean isHoney) { + LocalDate removalDate, boolean hasSolution, String imageUrl, + Boolean isHoney, Integer solutionCount) { public static ProblemResponseDto toDto(QueryProblem queryProblem) { return new ProblemResponseDto(queryProblem.getId(), queryProblem.getSectorName(), queryProblem.getDifficultyName(), queryProblem.getSettingDate(), queryProblem.getRemovalDate(), queryProblem.getHasSolution(), - queryProblem.getImageUrl(), queryProblem.isHoney()); + queryProblem.getImageUrl(), queryProblem.isHoney(), queryProblem.getSolutionCount()); } } From 2f1cd59fb8908887a42b9b17e1d62d192c184011 Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Thu, 24 Oct 2024 15:45:20 +0900 Subject: [PATCH 05/20] =?UTF-8?q?FLASH-308=20feat:=20=EB=AA=A8=EB=93=A0=20?= =?UTF-8?q?=ED=95=B4=EC=84=A4=20=EC=A1=B0=ED=9A=8C=20=EC=8B=9C=20=EC=97=85?= =?UTF-8?q?=EB=A1=9C=EB=8D=94=EC=9D=98=20=EC=8B=A0=EC=B2=B4=20=EC=A1=B0?= =?UTF-8?q?=EA=B1=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infrastructure/SolutionQueryDslRepository.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionQueryDslRepository.java b/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionQueryDslRepository.java index 151c819d..f90458a2 100644 --- a/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionQueryDslRepository.java +++ b/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionQueryDslRepository.java @@ -1,5 +1,6 @@ package com.first.flash.climbing.solution.infrastructure; +import static com.first.flash.account.member.domain.QMember.member; import static com.first.flash.climbing.problem.domain.QQueryProblem.queryProblem; import static com.first.flash.climbing.solution.domain.QSolution.solution; import static com.first.flash.climbing.solution.domain.QSolutionComment.solutionComment; @@ -29,12 +30,14 @@ public List findAllExcludedBlockedMembers(final U return jpaQueryFactory.select(Projections.constructor(SolutionRepositoryResponseDto.class, solution.id, solution.uploaderDetail.uploader, solution.solutionDetail.review, solution.uploaderDetail.instagramId, solution.solutionDetail.videoUrl, - solution.uploaderDetail.uploaderId, solution.uploaderDetail.profileImageUrl, - solutionComment.count() + solution.uploaderDetail.uploaderId, member.height, member.reach, member.gender, + solution.uploaderDetail.profileImageUrl, solutionComment.count() )) .from(solution) .leftJoin(solutionComment) .on(solution.id.eq(solutionComment.solution.id)) + .leftJoin(member) + .on(solution.uploaderDetail.uploaderId.eq(member.id)) .where(solution.problemId.eq(problemId) .and(notInBlockedMembers(memberIds))) .groupBy(solution.id) @@ -77,7 +80,8 @@ public DetailSolutionDto findDetailSolutionById(final Long solutionId) { return jpaQueryFactory.select(Projections.constructor(DetailSolutionDto.class, solution.id, solution.solutionDetail.videoUrl, queryProblem.gymName, queryProblem.sectorName, solution.solutionDetail.review, - queryProblem.difficultyName, solutionComment.count(), solution.solutionDetail.perceivedDifficulty, + queryProblem.difficultyName, solutionComment.count(), + solution.solutionDetail.perceivedDifficulty, queryProblem.removalDate, queryProblem.settingDate, solution.createdAt )) .from(solution) From 6857ec2ff61f021ab96978fae7ff3443f1fa8b0d Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Thu, 24 Oct 2024 15:45:30 +0900 Subject: [PATCH 06/20] =?UTF-8?q?FLASH-308=20feat:=20=ED=95=B4=EC=84=A4=20?= =?UTF-8?q?=EC=9D=91=EB=8B=B5=EC=97=90=20=EC=97=85=EB=A1=9C=EB=8D=94?= =?UTF-8?q?=EC=9D=98=20=EC=8B=A0=EC=B2=B4=20=EC=A1=B0=EA=B1=B4=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../climbing/solution/domain/dto/SolutionResponseDto.java | 6 +++++- .../infrastructure/dto/SolutionRepositoryResponseDto.java | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/first/flash/climbing/solution/domain/dto/SolutionResponseDto.java b/src/main/java/com/first/flash/climbing/solution/domain/dto/SolutionResponseDto.java index 2e9c3b8e..200c5c49 100644 --- a/src/main/java/com/first/flash/climbing/solution/domain/dto/SolutionResponseDto.java +++ b/src/main/java/com/first/flash/climbing/solution/domain/dto/SolutionResponseDto.java @@ -1,11 +1,13 @@ package com.first.flash.climbing.solution.domain.dto; +import com.first.flash.account.member.domain.Gender; import com.first.flash.climbing.solution.infrastructure.dto.SolutionRepositoryResponseDto; import com.first.flash.global.util.AuthUtil; import java.util.UUID; public record SolutionResponseDto(Long id, String uploader, String review, String instagramId, - String videoUrl, UUID uploaderId, Boolean isUploader, + String videoUrl, UUID uploaderId, Double uploaderHeight, + Double uploaderReach, Gender uploaderGender, Boolean isUploader, String profileImageUrl, Long commentCount) { public static SolutionResponseDto from( @@ -13,6 +15,8 @@ public static SolutionResponseDto from( return new SolutionResponseDto(repositoryResponseDto.id(), repositoryResponseDto.uploader(), repositoryResponseDto.review(), repositoryResponseDto.instagramId(), repositoryResponseDto.videoUrl(), repositoryResponseDto.uploaderId(), + repositoryResponseDto.uploaderHeight(), repositoryResponseDto.uploaderReach(), + repositoryResponseDto.uploaderGender(), AuthUtil.isSameId(repositoryResponseDto.uploaderId()), repositoryResponseDto.profileImageUrl(), repositoryResponseDto.commentCount()); } diff --git a/src/main/java/com/first/flash/climbing/solution/infrastructure/dto/SolutionRepositoryResponseDto.java b/src/main/java/com/first/flash/climbing/solution/infrastructure/dto/SolutionRepositoryResponseDto.java index 4ac9c745..58a4605c 100644 --- a/src/main/java/com/first/flash/climbing/solution/infrastructure/dto/SolutionRepositoryResponseDto.java +++ b/src/main/java/com/first/flash/climbing/solution/infrastructure/dto/SolutionRepositoryResponseDto.java @@ -1,9 +1,12 @@ package com.first.flash.climbing.solution.infrastructure.dto; +import com.first.flash.account.member.domain.Gender; import java.util.UUID; public record SolutionRepositoryResponseDto(Long id, String uploader, String review, String instagramId, String videoUrl, UUID uploaderId, - String profileImageUrl, Long commentCount) { + Double uploaderHeight, Double uploaderReach, + Gender uploaderGender, String profileImageUrl, + Long commentCount) { } From 8ccd7c3a6671f8c440cc00d0e45b86fa0c6c9e89 Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Thu, 24 Oct 2024 15:55:11 +0900 Subject: [PATCH 07/20] =?UTF-8?q?FLASH-308=20feat:=20=ED=81=B4=EB=9D=BC?= =?UTF-8?q?=EC=9D=B4=EB=B0=8D=EC=9E=A5=20=EC=97=94=ED=8B=B0=ED=8B=B0?= =?UTF-8?q?=EC=97=90=20=EC=BA=98=EB=A6=B0=EB=8D=94=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=EC=BB=AC=EB=9F=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../first/flash/climbing/gym/domian/ClimbingGym.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/first/flash/climbing/gym/domian/ClimbingGym.java b/src/main/java/com/first/flash/climbing/gym/domian/ClimbingGym.java index 8161d331..f97e8df7 100644 --- a/src/main/java/com/first/flash/climbing/gym/domian/ClimbingGym.java +++ b/src/main/java/com/first/flash/climbing/gym/domian/ClimbingGym.java @@ -30,6 +30,7 @@ public class ClimbingGym { private String gymName; private String thumbnailUrl; private String mapImageUrl; + private String calendarImageUrl; @ElementCollection(fetch = FetchType.EAGER) @CollectionTable(name = "DIFFICULTY", @@ -39,17 +40,18 @@ public class ClimbingGym { private List difficulties; public ClimbingGym(final String gymName, final String thumbnailUrl, final String mapImageUrl, - final List difficulties) { + final String calendarImageUrl, final List difficulties) { this.gymName = gymName; this.thumbnailUrl = thumbnailUrl; this.mapImageUrl = mapImageUrl; this.difficulties = difficulties; + this.calendarImageUrl = calendarImageUrl; } public Difficulty getDifficultyByName(final String difficultyName) { return difficulties.stream() - .filter(difficulty -> difficulty.hasSameName(difficultyName)) - .findAny() - .orElseThrow(() -> new DifficultyNotFoundException(difficultyName)); + .filter(difficulty -> difficulty.hasSameName(difficultyName)) + .findAny() + .orElseThrow(() -> new DifficultyNotFoundException(difficultyName)); } } From cd4d7aee85d467b8506e1664f44fbca81b92fd14 Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Thu, 24 Oct 2024 15:55:22 +0900 Subject: [PATCH 08/20] =?UTF-8?q?FLASH-308=20test:=20=EC=9C=A0=EB=8B=9B?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=EA=B0=80=20=EC=9D=B4=EC=83=81?= =?UTF-8?q?=EC=97=86=EC=9D=B4=20=EB=8F=99=EC=9E=91=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../climbing/gym/infrastructure/FakeClimbingGymRepository.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/first/flash/climbing/gym/infrastructure/FakeClimbingGymRepository.java b/src/test/java/com/first/flash/climbing/gym/infrastructure/FakeClimbingGymRepository.java index ccdcdf1c..02121f7b 100644 --- a/src/test/java/com/first/flash/climbing/gym/infrastructure/FakeClimbingGymRepository.java +++ b/src/test/java/com/first/flash/climbing/gym/infrastructure/FakeClimbingGymRepository.java @@ -16,7 +16,7 @@ public class FakeClimbingGymRepository implements ClimbingGymRepository { @Override public ClimbingGym save(final ClimbingGym gym) { ClimbingGym savedGym = new ClimbingGym(id++, gym.getGymName(), gym.getThumbnailUrl(), - gym.getMapImageUrl(), gym.getDifficulties()); + gym.getMapImageUrl(), "example image", gym.getDifficulties()); db.put(savedGym.getId(), savedGym); return savedGym; From 2d875826e762c5870682aa5f96c3de1c8d9bd5c1 Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Thu, 24 Oct 2024 15:55:54 +0900 Subject: [PATCH 09/20] =?UTF-8?q?FLASH-308=20feat:=20=ED=81=B4=EB=9D=BC?= =?UTF-8?q?=EC=9D=B4=EB=B0=8D=EC=9E=A5=20=EC=83=9D=EC=84=B1=20=EC=8B=9C=20?= =?UTF-8?q?=EC=9D=BC=EC=A0=95=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EA=B0=92=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gym/application/dto/ClimbingGymCreateRequestDto.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/first/flash/climbing/gym/application/dto/ClimbingGymCreateRequestDto.java b/src/main/java/com/first/flash/climbing/gym/application/dto/ClimbingGymCreateRequestDto.java index e11f5b99..4a9b6dbf 100644 --- a/src/main/java/com/first/flash/climbing/gym/application/dto/ClimbingGymCreateRequestDto.java +++ b/src/main/java/com/first/flash/climbing/gym/application/dto/ClimbingGymCreateRequestDto.java @@ -11,10 +11,11 @@ public record ClimbingGymCreateRequestDto( @NotEmpty(message = "클라이밍장 이름은 필수입니다.") String gymName, @NotEmpty(message = "썸네일 URL은 필수입니다.") String thumbnailUrl, @NotEmpty(message = "지도 이미지 URL은 필수입니다.") String mapImageUrl, + @NotEmpty(message = "일정 이미지 URL은 필수입니다.") String calendarImageUrl, @NotEmpty(message = "난이도 정보는 최소 하나 이상이어야 합니다.") List<@Valid @NotNull(message = "난이도 정보는 비어있을 수 없습니다.") Difficulty> difficulties) { public ClimbingGym toEntity() { - return new ClimbingGym(gymName, thumbnailUrl, mapImageUrl, difficulties); + return new ClimbingGym(gymName, thumbnailUrl, mapImageUrl, calendarImageUrl, difficulties); } } From b29eb04c57f512b6d6c9efc9a07b48225adf7da5 Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Thu, 24 Oct 2024 15:56:19 +0900 Subject: [PATCH 10/20] =?UTF-8?q?FLASH-308=20feat:=20=ED=81=B4=EB=9D=BC?= =?UTF-8?q?=EC=9D=B4=EB=B0=8D=EC=9E=A5=20=EC=A0=95=EB=B3=B4=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EC=8B=9C=20=EC=9D=BC=EC=A0=95=20=EC=82=AC=EC=A7=84?= =?UTF-8?q?=20url=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flash/climbing/gym/application/ClimbingGymService.java | 2 +- .../gym/application/dto/ClimbingGymDetailResponseDto.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/first/flash/climbing/gym/application/ClimbingGymService.java b/src/main/java/com/first/flash/climbing/gym/application/ClimbingGymService.java index e8fb4a13..35ef6600 100644 --- a/src/main/java/com/first/flash/climbing/gym/application/ClimbingGymService.java +++ b/src/main/java/com/first/flash/climbing/gym/application/ClimbingGymService.java @@ -42,7 +42,7 @@ public ClimbingGymDetailResponseDto findClimbingGymDetail(final Long id) { List sectorNames = findSectorNamesById(id); List difficultyNames = getDifficultyNames(climbingGym); return new ClimbingGymDetailResponseDto(climbingGym.getGymName(), - climbingGym.getMapImageUrl(), + climbingGym.getMapImageUrl(), climbingGym.getCalendarImageUrl(), difficultyNames, sectorNames); } diff --git a/src/main/java/com/first/flash/climbing/gym/application/dto/ClimbingGymDetailResponseDto.java b/src/main/java/com/first/flash/climbing/gym/application/dto/ClimbingGymDetailResponseDto.java index 625de764..f2f1f822 100644 --- a/src/main/java/com/first/flash/climbing/gym/application/dto/ClimbingGymDetailResponseDto.java +++ b/src/main/java/com/first/flash/climbing/gym/application/dto/ClimbingGymDetailResponseDto.java @@ -3,6 +3,7 @@ import java.util.List; public record ClimbingGymDetailResponseDto(String gymName, String mapImageUrl, + String calendarImageUrl, List difficulties, List sectors) { From ae57e24516558cdd624179a118407e279a5008b7 Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Thu, 24 Oct 2024 16:36:12 +0900 Subject: [PATCH 11/20] =?UTF-8?q?FLASH-308=20feat:=20=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EC=9D=91=EB=8B=B5=EC=97=90=20?= =?UTF-8?q?=EA=B0=9C=EC=88=98=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../problem/application/dto/ProblemsResponseDto.java | 2 +- .../application/dto/SolutionsPageResponseDto.java | 2 +- src/main/java/com/first/flash/global/paging/Meta.java | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/first/flash/climbing/problem/application/dto/ProblemsResponseDto.java b/src/main/java/com/first/flash/climbing/problem/application/dto/ProblemsResponseDto.java index cd5f3ef8..79ece29c 100644 --- a/src/main/java/com/first/flash/climbing/problem/application/dto/ProblemsResponseDto.java +++ b/src/main/java/com/first/flash/climbing/problem/application/dto/ProblemsResponseDto.java @@ -13,6 +13,6 @@ public static ProblemsResponseDto of( } return new ProblemsResponseDto(queryProblems.stream() .map(ProblemResponseDto::toDto) - .toList(), Meta.of(nextCursor, queryProblems.size())); + .toList(), Meta.from(nextCursor)); } } diff --git a/src/main/java/com/first/flash/climbing/solution/application/dto/SolutionsPageResponseDto.java b/src/main/java/com/first/flash/climbing/solution/application/dto/SolutionsPageResponseDto.java index 79a23334..49ebe4c7 100644 --- a/src/main/java/com/first/flash/climbing/solution/application/dto/SolutionsPageResponseDto.java +++ b/src/main/java/com/first/flash/climbing/solution/application/dto/SolutionsPageResponseDto.java @@ -11,6 +11,6 @@ public static SolutionsPageResponseDto of( if (solutions.isEmpty()) { return new SolutionsPageResponseDto(List.of(), null); } - return new SolutionsPageResponseDto(solutions, Meta.of(nextCursor, solutions.size())); + return new SolutionsPageResponseDto(solutions, Meta.from(nextCursor)); } } diff --git a/src/main/java/com/first/flash/global/paging/Meta.java b/src/main/java/com/first/flash/global/paging/Meta.java index 3b0f9bf9..59287d17 100644 --- a/src/main/java/com/first/flash/global/paging/Meta.java +++ b/src/main/java/com/first/flash/global/paging/Meta.java @@ -2,12 +2,12 @@ import java.util.Objects; -public record Meta(String cursor, boolean hasNext, Integer count) { +public record Meta(String cursor, boolean hasNext) { - public static Meta of(final String nextCursor, final Integer count) { + public static Meta from(final String nextCursor) { if (Objects.isNull(nextCursor) || nextCursor.isEmpty()) { - return new Meta(null, false, count); + return new Meta(null, false); } - return new Meta(nextCursor, true, count); + return new Meta(nextCursor, true); } } From dca1ab8d01c3e80fb3675898d43a8baa46d1e381 Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Thu, 24 Oct 2024 17:09:36 +0900 Subject: [PATCH 12/20] =?UTF-8?q?FLASH-308=20feat:=20=ED=95=B4=EC=84=A4=20?= =?UTF-8?q?=EC=97=85=EB=A1=9C=EB=8D=94=EC=97=90=20=ED=82=A4,=20=EB=A6=AC?= =?UTF-8?q?=EC=B9=98,=20=EC=84=B1=EB=B3=84=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../climbing/solution/domain/Solution.java | 23 +++++++++---------- .../solution/domain/vo/UploaderDetail.java | 20 +++++++++++++--- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/first/flash/climbing/solution/domain/Solution.java b/src/main/java/com/first/flash/climbing/solution/domain/Solution.java index bf0e43ce..788cd888 100644 --- a/src/main/java/com/first/flash/climbing/solution/domain/Solution.java +++ b/src/main/java/com/first/flash/climbing/solution/domain/Solution.java @@ -1,5 +1,6 @@ package com.first.flash.climbing.solution.domain; +import com.first.flash.account.member.domain.Gender; import com.first.flash.climbing.solution.domain.vo.SolutionDetail; import com.first.flash.climbing.solution.domain.vo.UploaderDetail; import com.first.flash.global.domain.BaseEntity; @@ -41,30 +42,28 @@ public class Solution extends BaseEntity { protected Solution(final String uploader, final String review, final String instagramId, final String videoUrl, final UUID problemId, final UUID uploaderId, - final String profileImageUrl, final PerceivedDifficulty perceivedDifficulty) { + final String profileImageUrl, final PerceivedDifficulty perceivedDifficulty, + final Double height, + final Double reach, final Gender gender) { this.solutionDetail = SolutionDetail.of(review, videoUrl, perceivedDifficulty); - this.uploaderDetail = UploaderDetail.of(uploaderId, uploader, instagramId, profileImageUrl); + this.uploaderDetail = UploaderDetail.of(uploaderId, uploader, instagramId, profileImageUrl, + height, reach, gender); this.optionalWeight = DEFAULT_OPTIONAL_WEIGHT; this.problemId = problemId; } public static Solution of(final String uploader, final String review, final String instagramId, final String videoUrl, final UUID problemId, final UUID uploaderId, - final String profileImageUrl, final PerceivedDifficulty perceivedDifficulty) { + final String profileImageUrl, final PerceivedDifficulty perceivedDifficulty, + final Double height, final Double reach, final Gender gender) { return new Solution(uploader, review, instagramId, videoUrl, problemId, uploaderId, - profileImageUrl, perceivedDifficulty); + profileImageUrl, perceivedDifficulty, height, reach, gender); } - public void updateUploaderInfo(final String uploader, final String instagramId, - final String profileImageUrl) { - UUID uploaderId = this.uploaderDetail.getUploaderId(); - - this.uploaderDetail = UploaderDetail.of(uploaderId, uploader, instagramId, profileImageUrl); - } - - public void updateContentInfo(final String review, final String videoUrl, final PerceivedDifficulty perceivedDifficulty) { + public void updateContentInfo(final String review, final String videoUrl, + final PerceivedDifficulty perceivedDifficulty) { this.solutionDetail = SolutionDetail.of(review, videoUrl, perceivedDifficulty); } } diff --git a/src/main/java/com/first/flash/climbing/solution/domain/vo/UploaderDetail.java b/src/main/java/com/first/flash/climbing/solution/domain/vo/UploaderDetail.java index 08ab88c6..dcab822e 100644 --- a/src/main/java/com/first/flash/climbing/solution/domain/vo/UploaderDetail.java +++ b/src/main/java/com/first/flash/climbing/solution/domain/vo/UploaderDetail.java @@ -1,7 +1,10 @@ package com.first.flash.climbing.solution.domain.vo; +import com.first.flash.account.member.domain.Gender; import jakarta.persistence.Column; import jakarta.persistence.Embeddable; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; import java.util.UUID; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -20,17 +23,28 @@ public class UploaderDetail { private String uploader; private String instagramId; private String profileImageUrl; + private Double height; + private Double reach; + @Enumerated(EnumType.STRING) + private Gender gender; protected UploaderDetail(final UUID uploaderId, final String uploader, - final String instagramId, final String profileImageUrl) { + final String instagramId, final String profileImageUrl, final Double height, + final Double reach, + final Gender gender) { this.uploaderId = uploaderId; this.uploader = uploader; this.instagramId = instagramId; this.profileImageUrl = profileImageUrl; + this.height = height; + this.reach = reach; + this.gender = gender; } public static UploaderDetail of(final UUID uploaderId, final String uploader, - final String instagramId, final String profileImageUrl) { - return new UploaderDetail(uploaderId, uploader, instagramId, profileImageUrl); + final String instagramId, final String profileImageUrl, final Double height, + final Double reach, final Gender gender) { + return new UploaderDetail(uploaderId, uploader, instagramId, profileImageUrl, height, reach, + gender); } } From ac8091f8ce7929cfb532c2f119eeb2de27aa35fe Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Thu, 24 Oct 2024 17:11:21 +0900 Subject: [PATCH 13/20] =?UTF-8?q?FLASH-308=20feat:=20=EB=A9=A4=EB=B2=84?= =?UTF-8?q?=EC=9D=98=20=ED=82=A4,=20=EB=A6=AC=EC=B9=98,=20=EC=84=B1?= =?UTF-8?q?=EB=B3=84=EC=9D=B4=20=EC=88=98=EC=A0=95=EB=90=98=EB=A9=B4=20?= =?UTF-8?q?=ED=95=B4=EB=8B=B9=20=EC=82=AC=ED=95=AD=EC=9D=B4=20=ED=95=B4?= =?UTF-8?q?=EC=84=A4=EC=97=90=EB=8F=84=20=EB=B0=98=EC=98=81=EB=90=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flash/account/member/application/MemberService.java | 3 ++- .../account/member/domain/MemberInfoUpdatedEvent.java | 9 +++++++-- .../solution/application/SolutionEventHandler.java | 3 ++- .../solution/application/SolutionSaveService.java | 6 ++++-- .../climbing/solution/domain/SolutionRepository.java | 4 +++- .../infrastructure/SolutionQueryDslRepository.java | 7 ++++++- .../solution/infrastructure/SolutionRepositoryImpl.java | 6 ++++-- 7 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/first/flash/account/member/application/MemberService.java b/src/main/java/com/first/flash/account/member/application/MemberService.java index fc5cb681..a312ec38 100644 --- a/src/main/java/com/first/flash/account/member/application/MemberService.java +++ b/src/main/java/com/first/flash/account/member/application/MemberService.java @@ -49,7 +49,8 @@ public MemberCompleteRegistrationResponse completeMemberRegistration( request.gender(), request.reach(), request.profileImageUrl()); Events.raise(MemberInfoUpdatedEvent.of(member.getId(), member.getNickName(), - member.getInstagramId(), member.getProfileImageUrl())); + member.getInstagramId(), member.getProfileImageUrl(), member.getHeight(), + member.getReach(), member.getGender())); return MemberCompleteRegistrationResponse.toDto(member); } diff --git a/src/main/java/com/first/flash/account/member/domain/MemberInfoUpdatedEvent.java b/src/main/java/com/first/flash/account/member/domain/MemberInfoUpdatedEvent.java index 7195d9c9..05627eb5 100644 --- a/src/main/java/com/first/flash/account/member/domain/MemberInfoUpdatedEvent.java +++ b/src/main/java/com/first/flash/account/member/domain/MemberInfoUpdatedEvent.java @@ -13,9 +13,14 @@ public class MemberInfoUpdatedEvent extends Event { private final String nickName; private final String instagramId; private final String profileImageUrl; + private final Double height; + private final Double reach; + private final Gender gender; public static MemberInfoUpdatedEvent of(final UUID memberId, final String nickName, - final String instagramId, final String profileImageUrl) { - return new MemberInfoUpdatedEvent(memberId, nickName, instagramId, profileImageUrl); + final String instagramId, final String profileImageUrl, final Double height, + final Double reach, final Gender gender) { + return new MemberInfoUpdatedEvent(memberId, nickName, instagramId, profileImageUrl, height, + reach, gender); } } diff --git a/src/main/java/com/first/flash/climbing/solution/application/SolutionEventHandler.java b/src/main/java/com/first/flash/climbing/solution/application/SolutionEventHandler.java index 15a5175f..ae0f77ff 100644 --- a/src/main/java/com/first/flash/climbing/solution/application/SolutionEventHandler.java +++ b/src/main/java/com/first/flash/climbing/solution/application/SolutionEventHandler.java @@ -19,7 +19,8 @@ public class SolutionEventHandler { @Transactional public void updateSolutionInfo(final MemberInfoUpdatedEvent event) { solutionSaveService.updateUploaderInfo(event.getMemberId(), event.getNickName(), - event.getInstagramId(), event.getProfileImageUrl()); + event.getInstagramId(), event.getProfileImageUrl(), event.getHeight(), event.getReach(), + event.getGender()); solutionCommentService.updateCommenterInfo(event.getMemberId(), event.getNickName(), event.getProfileImageUrl()); diff --git a/src/main/java/com/first/flash/climbing/solution/application/SolutionSaveService.java b/src/main/java/com/first/flash/climbing/solution/application/SolutionSaveService.java index a3eeb401..faf8a2bf 100644 --- a/src/main/java/com/first/flash/climbing/solution/application/SolutionSaveService.java +++ b/src/main/java/com/first/flash/climbing/solution/application/SolutionSaveService.java @@ -1,6 +1,7 @@ package com.first.flash.climbing.solution.application; import com.first.flash.account.member.application.MemberService; +import com.first.flash.account.member.domain.Gender; import com.first.flash.account.member.domain.Member; import com.first.flash.climbing.solution.application.dto.SolutionWriteResponseDto; import com.first.flash.climbing.solution.application.dto.UnregisteredMemberSolutionCreateRequest; @@ -44,8 +45,9 @@ public SolutionWriteResponseDto saveSolution(final UUID problemId, @Transactional public void updateUploaderInfo(final UUID uploaderId, final String nickName, - final String instagramId, final String profileImageUrl) { - solutionRepository.updateUploaderInfo(uploaderId, nickName, instagramId, profileImageUrl); + final String instagramId, final String profileImageUrl, final Double height, + final Double reach, final Gender gender) { + solutionRepository.updateUploaderInfo(uploaderId, nickName, instagramId, profileImageUrl, height, reach, gender); } @Transactional diff --git a/src/main/java/com/first/flash/climbing/solution/domain/SolutionRepository.java b/src/main/java/com/first/flash/climbing/solution/domain/SolutionRepository.java index 9c2611af..39c5d202 100644 --- a/src/main/java/com/first/flash/climbing/solution/domain/SolutionRepository.java +++ b/src/main/java/com/first/flash/climbing/solution/domain/SolutionRepository.java @@ -1,5 +1,6 @@ package com.first.flash.climbing.solution.domain; +import com.first.flash.account.member.domain.Gender; import com.first.flash.climbing.solution.infrastructure.dto.DetailSolutionDto; import com.first.flash.climbing.solution.infrastructure.dto.MySolutionDto; import com.first.flash.climbing.solution.infrastructure.dto.SolutionRepositoryResponseDto; @@ -20,7 +21,8 @@ List findAllByProblemId(final UUID problemId, void deleteById(final Long id); void updateUploaderInfo(final UUID uploaderId, final String nickName, final String instagramId, - final String profileImageUrl); + final String profileImageUrl, final Double height, + final Double reach, final Gender gender); DetailSolutionDto findDetailSolutionById(final Long solutionId); diff --git a/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionQueryDslRepository.java b/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionQueryDslRepository.java index f90458a2..8e548556 100644 --- a/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionQueryDslRepository.java +++ b/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionQueryDslRepository.java @@ -5,6 +5,7 @@ import static com.first.flash.climbing.solution.domain.QSolution.solution; import static com.first.flash.climbing.solution.domain.QSolutionComment.solutionComment; +import com.first.flash.account.member.domain.Gender; import com.first.flash.climbing.solution.infrastructure.dto.DetailSolutionDto; import com.first.flash.climbing.solution.infrastructure.dto.MySolutionDto; import com.first.flash.climbing.solution.infrastructure.dto.SolutionRepositoryResponseDto; @@ -67,11 +68,15 @@ public List findByUploaderId(final UUID uploaderId, } public void updateUploaderInfo(final UUID uploaderId, final String nickName, - final String instagramId, final String profileImageUrl) { + final String instagramId, final String profileImageUrl, final Double height, + final Double reach, final Gender gender) { jpaQueryFactory.update(solution) .set(solution.uploaderDetail.uploader, nickName) .set(solution.uploaderDetail.instagramId, instagramId) .set(solution.uploaderDetail.profileImageUrl, profileImageUrl) + .set(solution.uploaderDetail.height, height) + .set(solution.uploaderDetail.reach, reach) + .set(solution.uploaderDetail.gender, gender) .where(solution.uploaderDetail.uploaderId.eq(uploaderId)) .execute(); } diff --git a/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionRepositoryImpl.java b/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionRepositoryImpl.java index 551c12c4..31c27741 100644 --- a/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionRepositoryImpl.java +++ b/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionRepositoryImpl.java @@ -1,5 +1,6 @@ package com.first.flash.climbing.solution.infrastructure; +import com.first.flash.account.member.domain.Gender; import com.first.flash.climbing.solution.domain.Solution; import com.first.flash.climbing.solution.domain.SolutionRepository; import com.first.flash.climbing.solution.infrastructure.dto.DetailSolutionDto; @@ -43,9 +44,10 @@ public void deleteById(final Long id) { @Override public void updateUploaderInfo(final UUID uploaderId, final String nickName, - final String instagramId, final String profileImageUrl) { + final String instagramId, final String profileImageUrl, final Double height, + final Double reach, final Gender gender) { solutionQueryDslRepository.updateUploaderInfo(uploaderId, nickName, instagramId, - profileImageUrl); + profileImageUrl, height, reach, gender); } @Override From 0c19c8a1826964ac6f8950cb71970f6bad318b84 Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Thu, 24 Oct 2024 17:11:50 +0900 Subject: [PATCH 14/20] =?UTF-8?q?FLASH-308=20feat:=20=ED=95=B4=EC=84=A4?= =?UTF-8?q?=EC=9D=B4=20=EC=A0=80=EC=9E=A5=EB=90=A0=20=EB=95=8C=20=ED=95=B4?= =?UTF-8?q?=EB=8B=B9=20=EB=A9=A4=EB=B2=84=EC=9D=98=20=ED=82=A4,=20?= =?UTF-8?q?=EB=A6=AC=EC=B9=98,=20=EC=84=B1=EB=B3=84=EC=9D=84=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../solution/application/SolutionSaveService.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/first/flash/climbing/solution/application/SolutionSaveService.java b/src/main/java/com/first/flash/climbing/solution/application/SolutionSaveService.java index faf8a2bf..4a66aaf9 100644 --- a/src/main/java/com/first/flash/climbing/solution/application/SolutionSaveService.java +++ b/src/main/java/com/first/flash/climbing/solution/application/SolutionSaveService.java @@ -35,8 +35,10 @@ public SolutionWriteResponseDto saveSolution(final UUID problemId, PerceivedDifficulty perceivedDifficulty = createRequestDto.perceivedDifficulty(); Solution solution = Solution.of(member.getNickName(), createRequestDto.review(), member.getInstagramId(), createRequestDto.videoUrl(), problemId, member.getId(), - member.getProfileImageUrl(), perceivedDifficulty); - Events.raise(PerceivedDifficultySetEvent.of(solution.getProblemId(), perceivedDifficulty.getValue())); + member.getProfileImageUrl(), perceivedDifficulty, member.getHeight(), member.getReach(), + member.getGender()); + Events.raise(PerceivedDifficultySetEvent.of(solution.getProblemId(), + perceivedDifficulty.getValue())); Solution savedSolution = solutionRepository.save(solution); Events.raise(SolutionSavedEvent.of(savedSolution.getProblemId())); @@ -59,10 +61,12 @@ public SolutionWriteResponseDto saveUnregisteredMemberSolution(final UUID proble PerceivedDifficulty perceivedDifficulty = requestDto.perceivedDifficulty(); Solution solution = Solution.of(requestDto.nickName(), requestDto.review(), requestDto.instagramId(), requestDto.videoUrl(), problemId, member.getId(), - requestDto.profileImageUrl(), perceivedDifficulty); + requestDto.profileImageUrl(), perceivedDifficulty, member.getHeight(), + member.getReach(), member.getGender()); Solution savedSolution = solutionRepository.save(solution); - Events.raise(PerceivedDifficultySetEvent.of(solution.getProblemId(), perceivedDifficulty.getValue())); + Events.raise(PerceivedDifficultySetEvent.of(solution.getProblemId(), + perceivedDifficulty.getValue())); Events.raise(SolutionSavedEvent.of(savedSolution.getProblemId())); return SolutionWriteResponseDto.toDto(savedSolution); } From f8e5c6e6c7f40491ff4d4de8b7fda0df166233d8 Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Thu, 24 Oct 2024 17:12:08 +0900 Subject: [PATCH 15/20] =?UTF-8?q?FLASH-308=20test:=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=EA=B0=80=20=EA=B8=B0=EC=A1=B4=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?=EC=82=AC=ED=95=AD=EC=97=90=20=EC=98=81=ED=96=A5=20=EB=B0=9B?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../first/flash/climbing/gym/fixture/ClimbingGymFixture.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/first/flash/climbing/gym/fixture/ClimbingGymFixture.java b/src/test/java/com/first/flash/climbing/gym/fixture/ClimbingGymFixture.java index e7fcb545..328cfbd0 100644 --- a/src/test/java/com/first/flash/climbing/gym/fixture/ClimbingGymFixture.java +++ b/src/test/java/com/first/flash/climbing/gym/fixture/ClimbingGymFixture.java @@ -8,12 +8,12 @@ public class ClimbingGymFixture { public static ClimbingGym createDefaultGym() { - return new ClimbingGym("test gym", "example.com", "example.com", + return new ClimbingGym("test gym", "example.com", "example.com", "example.com", List.of(new Difficulty("빨강", 1))); } public static ClimbingGymCreateRequestDto createDefaultGymCreateRequestDto() { return new ClimbingGymCreateRequestDto("test gym", "example.com", "example.com", - List.of(new Difficulty("빨강", 1))); + "example.com", List.of(new Difficulty("빨강", 1))); } } From e23041c5a6305bce614a61fd375226dabe698a0c Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Thu, 24 Oct 2024 17:14:15 +0900 Subject: [PATCH 16/20] =?UTF-8?q?FLASH-308=20feat:=20=ED=95=B4=EC=84=A4=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EC=8B=9C=20member=20join=EC=9D=B4=20?= =?UTF-8?q?=EC=95=84=EB=8B=8C=20=EA=B0=92=20=EA=B0=9D=EC=B2=B4=EB=A1=9C=20?= =?UTF-8?q?=EB=B0=9B=EC=95=84=EC=98=A4=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../solution/infrastructure/SolutionQueryDslRepository.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionQueryDslRepository.java b/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionQueryDslRepository.java index 8e548556..9791c4d7 100644 --- a/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionQueryDslRepository.java +++ b/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionQueryDslRepository.java @@ -31,14 +31,13 @@ public List findAllExcludedBlockedMembers(final U return jpaQueryFactory.select(Projections.constructor(SolutionRepositoryResponseDto.class, solution.id, solution.uploaderDetail.uploader, solution.solutionDetail.review, solution.uploaderDetail.instagramId, solution.solutionDetail.videoUrl, - solution.uploaderDetail.uploaderId, member.height, member.reach, member.gender, + solution.uploaderDetail.uploaderId, solution.uploaderDetail.height, + solution.uploaderDetail.reach, solution.uploaderDetail.gender, solution.uploaderDetail.profileImageUrl, solutionComment.count() )) .from(solution) .leftJoin(solutionComment) .on(solution.id.eq(solutionComment.solution.id)) - .leftJoin(member) - .on(solution.uploaderDetail.uploaderId.eq(member.id)) .where(solution.problemId.eq(problemId) .and(notInBlockedMembers(memberIds))) .groupBy(solution.id) From f6eee271ce8fbfa1cf44e507ac9060065266363d Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Thu, 24 Oct 2024 17:27:50 +0900 Subject: [PATCH 17/20] =?UTF-8?q?FLASH-308=20refactor:=20=EC=97=85?= =?UTF-8?q?=EB=A1=9C=EB=8D=94=EC=9D=98=20=EC=8B=A0=EC=B2=B4=20=EC=A1=B0?= =?UTF-8?q?=EA=B1=B4=20=EC=95=9E=EC=97=90=20uploader=20prefix=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/SolutionSaveService.java | 7 ++++--- .../climbing/solution/domain/Solution.java | 10 +++++----- .../solution/domain/SolutionRepository.java | 4 ++-- .../solution/domain/vo/UploaderDetail.java | 18 +++++++++--------- .../SolutionQueryDslRepository.java | 11 +++++------ .../infrastructure/SolutionRepositoryImpl.java | 6 +++--- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/first/flash/climbing/solution/application/SolutionSaveService.java b/src/main/java/com/first/flash/climbing/solution/application/SolutionSaveService.java index 4a66aaf9..3d3e89ce 100644 --- a/src/main/java/com/first/flash/climbing/solution/application/SolutionSaveService.java +++ b/src/main/java/com/first/flash/climbing/solution/application/SolutionSaveService.java @@ -47,9 +47,10 @@ public SolutionWriteResponseDto saveSolution(final UUID problemId, @Transactional public void updateUploaderInfo(final UUID uploaderId, final String nickName, - final String instagramId, final String profileImageUrl, final Double height, - final Double reach, final Gender gender) { - solutionRepository.updateUploaderInfo(uploaderId, nickName, instagramId, profileImageUrl, height, reach, gender); + final String instagramId, final String profileImageUrl, final Double uploaderHeight, + final Double uploaderReach, final Gender uploaderGender) { + solutionRepository.updateUploaderInfo(uploaderId, nickName, instagramId, profileImageUrl, + uploaderHeight, uploaderReach, uploaderGender); } @Transactional diff --git a/src/main/java/com/first/flash/climbing/solution/domain/Solution.java b/src/main/java/com/first/flash/climbing/solution/domain/Solution.java index 788cd888..0049a0f8 100644 --- a/src/main/java/com/first/flash/climbing/solution/domain/Solution.java +++ b/src/main/java/com/first/flash/climbing/solution/domain/Solution.java @@ -43,12 +43,12 @@ public class Solution extends BaseEntity { protected Solution(final String uploader, final String review, final String instagramId, final String videoUrl, final UUID problemId, final UUID uploaderId, final String profileImageUrl, final PerceivedDifficulty perceivedDifficulty, - final Double height, - final Double reach, final Gender gender) { + final Double uploaderHeight, + final Double uploaderReach, final Gender uploaderGender) { this.solutionDetail = SolutionDetail.of(review, videoUrl, perceivedDifficulty); this.uploaderDetail = UploaderDetail.of(uploaderId, uploader, instagramId, profileImageUrl, - height, reach, gender); + uploaderHeight, uploaderReach, uploaderGender); this.optionalWeight = DEFAULT_OPTIONAL_WEIGHT; this.problemId = problemId; } @@ -56,10 +56,10 @@ protected Solution(final String uploader, final String review, final String inst public static Solution of(final String uploader, final String review, final String instagramId, final String videoUrl, final UUID problemId, final UUID uploaderId, final String profileImageUrl, final PerceivedDifficulty perceivedDifficulty, - final Double height, final Double reach, final Gender gender) { + final Double uploaderHeight, final Double uploaderReach, final Gender uploaderGender) { return new Solution(uploader, review, instagramId, videoUrl, problemId, uploaderId, - profileImageUrl, perceivedDifficulty, height, reach, gender); + profileImageUrl, perceivedDifficulty, uploaderHeight, uploaderReach, uploaderGender); } public void updateContentInfo(final String review, final String videoUrl, diff --git a/src/main/java/com/first/flash/climbing/solution/domain/SolutionRepository.java b/src/main/java/com/first/flash/climbing/solution/domain/SolutionRepository.java index 39c5d202..0d4b4cff 100644 --- a/src/main/java/com/first/flash/climbing/solution/domain/SolutionRepository.java +++ b/src/main/java/com/first/flash/climbing/solution/domain/SolutionRepository.java @@ -21,8 +21,8 @@ List findAllByProblemId(final UUID problemId, void deleteById(final Long id); void updateUploaderInfo(final UUID uploaderId, final String nickName, final String instagramId, - final String profileImageUrl, final Double height, - final Double reach, final Gender gender); + final String profileImageUrl, final Double uploaderHeight, + final Double uploaderReach, final Gender uploaderGender); DetailSolutionDto findDetailSolutionById(final Long solutionId); diff --git a/src/main/java/com/first/flash/climbing/solution/domain/vo/UploaderDetail.java b/src/main/java/com/first/flash/climbing/solution/domain/vo/UploaderDetail.java index dcab822e..3c8b0ce8 100644 --- a/src/main/java/com/first/flash/climbing/solution/domain/vo/UploaderDetail.java +++ b/src/main/java/com/first/flash/climbing/solution/domain/vo/UploaderDetail.java @@ -23,22 +23,22 @@ public class UploaderDetail { private String uploader; private String instagramId; private String profileImageUrl; - private Double height; - private Double reach; + private Double uploaderHeight; + private Double uploaderReach; @Enumerated(EnumType.STRING) - private Gender gender; + private Gender uploaderGender; protected UploaderDetail(final UUID uploaderId, final String uploader, - final String instagramId, final String profileImageUrl, final Double height, - final Double reach, - final Gender gender) { + final String instagramId, final String profileImageUrl, final Double uploaderHeight, + final Double uploaderReach, + final Gender uploaderGender) { this.uploaderId = uploaderId; this.uploader = uploader; this.instagramId = instagramId; this.profileImageUrl = profileImageUrl; - this.height = height; - this.reach = reach; - this.gender = gender; + this.uploaderHeight = uploaderHeight; + this.uploaderReach = uploaderReach; + this.uploaderGender = uploaderGender; } public static UploaderDetail of(final UUID uploaderId, final String uploader, diff --git a/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionQueryDslRepository.java b/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionQueryDslRepository.java index 9791c4d7..5014ec99 100644 --- a/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionQueryDslRepository.java +++ b/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionQueryDslRepository.java @@ -1,6 +1,5 @@ package com.first.flash.climbing.solution.infrastructure; -import static com.first.flash.account.member.domain.QMember.member; import static com.first.flash.climbing.problem.domain.QQueryProblem.queryProblem; import static com.first.flash.climbing.solution.domain.QSolution.solution; import static com.first.flash.climbing.solution.domain.QSolutionComment.solutionComment; @@ -67,15 +66,15 @@ public List findByUploaderId(final UUID uploaderId, } public void updateUploaderInfo(final UUID uploaderId, final String nickName, - final String instagramId, final String profileImageUrl, final Double height, - final Double reach, final Gender gender) { + final String instagramId, final String profileImageUrl, final Double uploaderHeight, + final Double uploaderReach, final Gender uploaderGender) { jpaQueryFactory.update(solution) .set(solution.uploaderDetail.uploader, nickName) .set(solution.uploaderDetail.instagramId, instagramId) .set(solution.uploaderDetail.profileImageUrl, profileImageUrl) - .set(solution.uploaderDetail.height, height) - .set(solution.uploaderDetail.reach, reach) - .set(solution.uploaderDetail.gender, gender) + .set(solution.uploaderDetail.height, uploaderHeight) + .set(solution.uploaderDetail.reach, uploaderReach) + .set(solution.uploaderDetail.gender, uploaderGender) .where(solution.uploaderDetail.uploaderId.eq(uploaderId)) .execute(); } diff --git a/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionRepositoryImpl.java b/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionRepositoryImpl.java index 31c27741..0eb02cfb 100644 --- a/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionRepositoryImpl.java +++ b/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionRepositoryImpl.java @@ -44,10 +44,10 @@ public void deleteById(final Long id) { @Override public void updateUploaderInfo(final UUID uploaderId, final String nickName, - final String instagramId, final String profileImageUrl, final Double height, - final Double reach, final Gender gender) { + final String instagramId, final String profileImageUrl, final Double uploaderHeight, + final Double uploaderReach, final Gender uploaderGender) { solutionQueryDslRepository.updateUploaderInfo(uploaderId, nickName, instagramId, - profileImageUrl, height, reach, gender); + profileImageUrl, uploaderHeight, uploaderReach, uploaderGender); } @Override From 83c44b9ead32fd96294b5b6ad2c9c3b741c98dfa Mon Sep 17 00:00:00 2001 From: WonyuChoi Date: Thu, 24 Oct 2024 17:30:06 +0900 Subject: [PATCH 18/20] =?UTF-8?q?FLASH-308=20refactor:=20querydsl=EC=97=90?= =?UTF-8?q?=EC=84=9C=EB=8F=84=20=EC=97=85=EB=A1=9C=EB=8D=94=EC=9D=98=20?= =?UTF-8?q?=EC=8B=A0=EC=B2=B4=20=EC=A1=B0=EA=B1=B4=20=EC=95=9E=EC=97=90=20?= =?UTF-8?q?uploader=20prefix=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infrastructure/SolutionQueryDslRepository.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionQueryDslRepository.java b/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionQueryDslRepository.java index 5014ec99..620b6e28 100644 --- a/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionQueryDslRepository.java +++ b/src/main/java/com/first/flash/climbing/solution/infrastructure/SolutionQueryDslRepository.java @@ -30,8 +30,8 @@ public List findAllExcludedBlockedMembers(final U return jpaQueryFactory.select(Projections.constructor(SolutionRepositoryResponseDto.class, solution.id, solution.uploaderDetail.uploader, solution.solutionDetail.review, solution.uploaderDetail.instagramId, solution.solutionDetail.videoUrl, - solution.uploaderDetail.uploaderId, solution.uploaderDetail.height, - solution.uploaderDetail.reach, solution.uploaderDetail.gender, + solution.uploaderDetail.uploaderId, solution.uploaderDetail.uploaderHeight, + solution.uploaderDetail.uploaderReach, solution.uploaderDetail.uploaderGender, solution.uploaderDetail.profileImageUrl, solutionComment.count() )) .from(solution) @@ -72,9 +72,9 @@ public void updateUploaderInfo(final UUID uploaderId, final String nickName, .set(solution.uploaderDetail.uploader, nickName) .set(solution.uploaderDetail.instagramId, instagramId) .set(solution.uploaderDetail.profileImageUrl, profileImageUrl) - .set(solution.uploaderDetail.height, uploaderHeight) - .set(solution.uploaderDetail.reach, uploaderReach) - .set(solution.uploaderDetail.gender, uploaderGender) + .set(solution.uploaderDetail.uploaderHeight, uploaderHeight) + .set(solution.uploaderDetail.uploaderReach, uploaderReach) + .set(solution.uploaderDetail.uploaderGender, uploaderGender) .where(solution.uploaderDetail.uploaderId.eq(uploaderId)) .execute(); } From 666c22f35d9aa545861395f4876316212916ff1a Mon Sep 17 00:00:00 2001 From: wonyangs Date: Thu, 24 Oct 2024 18:07:53 +0900 Subject: [PATCH 19/20] =?UTF-8?q?feat:=20=ED=81=B4=EB=9D=BC=EC=9D=B4?= =?UTF-8?q?=EB=B0=8D=20=EC=83=9D=EC=84=B1=20=EC=8B=9C=20=EC=A7=80=EB=8F=84?= =?UTF-8?q?=20=EC=82=AC=EC=A7=84=20url=EC=9D=84=20nullable=ED=95=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gym/application/dto/ClimbingGymCreateRequestDto.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/first/flash/climbing/gym/application/dto/ClimbingGymCreateRequestDto.java b/src/main/java/com/first/flash/climbing/gym/application/dto/ClimbingGymCreateRequestDto.java index 4a9b6dbf..832890eb 100644 --- a/src/main/java/com/first/flash/climbing/gym/application/dto/ClimbingGymCreateRequestDto.java +++ b/src/main/java/com/first/flash/climbing/gym/application/dto/ClimbingGymCreateRequestDto.java @@ -10,7 +10,7 @@ public record ClimbingGymCreateRequestDto( @NotEmpty(message = "클라이밍장 이름은 필수입니다.") String gymName, @NotEmpty(message = "썸네일 URL은 필수입니다.") String thumbnailUrl, - @NotEmpty(message = "지도 이미지 URL은 필수입니다.") String mapImageUrl, + String mapImageUrl, @NotEmpty(message = "일정 이미지 URL은 필수입니다.") String calendarImageUrl, @NotEmpty(message = "난이도 정보는 최소 하나 이상이어야 합니다.") List<@Valid @NotNull(message = "난이도 정보는 비어있을 수 없습니다.") Difficulty> difficulties) { From 9ebbf848a6c2fdc6b52b1f3c02b9f030c7759712 Mon Sep 17 00:00:00 2001 From: wonyangs Date: Thu, 24 Oct 2024 18:10:16 +0900 Subject: [PATCH 20/20] =?UTF-8?q?feat:=20=ED=81=B4=EB=9D=BC=EC=9D=B4?= =?UTF-8?q?=EB=B0=8D=EC=9E=A5=20=EC=83=9D=EC=84=B1=20=EC=8B=9C=20=EC=9D=91?= =?UTF-8?q?=EB=8B=B5=EC=97=90=20calendar=20image=20url=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gym/application/dto/ClimbingGymCreateResponseDto.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/first/flash/climbing/gym/application/dto/ClimbingGymCreateResponseDto.java b/src/main/java/com/first/flash/climbing/gym/application/dto/ClimbingGymCreateResponseDto.java index 0b5885d1..db360e4d 100644 --- a/src/main/java/com/first/flash/climbing/gym/application/dto/ClimbingGymCreateResponseDto.java +++ b/src/main/java/com/first/flash/climbing/gym/application/dto/ClimbingGymCreateResponseDto.java @@ -5,10 +5,10 @@ import java.util.List; public record ClimbingGymCreateResponseDto(Long id, String gymName, String thumbnailUrl, - String mapImageUrl, List difficulties) { + String mapImageUrl, String calendarImageUrl, List difficulties) { public static ClimbingGymCreateResponseDto toDto(final ClimbingGym gym) { return new ClimbingGymCreateResponseDto(gym.getId(), gym.getGymName(), - gym.getThumbnailUrl(), gym.getMapImageUrl(), gym.getDifficulties()); + gym.getThumbnailUrl(), gym.getMapImageUrl(), gym.getCalendarImageUrl(), gym.getDifficulties()); } }