From 79d4f89923a1738fc9b103250a9627b1599ce445 Mon Sep 17 00:00:00 2001 From: wonyangs Date: Fri, 13 Dec 2024 15:49:39 +0900 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20=EB=AC=B8=EC=A0=9C=EC=9D=98=20?= =?UTF-8?q?=ED=99=80=EB=93=9C=20=EC=A0=95=EB=B3=B4=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?API=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../problem/application/ProblemsService.java | 12 +++++++++++ .../dto/ProblemHoldRequestDto.java | 8 +++++++ .../climbing/problem/domain/Problem.java | 3 +++ .../domain/QueryProblemRepository.java | 2 ++ .../QueryProblemQueryDslRepository.java | 15 +++++++++++++ .../QueryProblemRepositoryImpl.java | 5 +++++ .../problem/ui/ProblemController.java | 21 +++++++++++++++++++ 7 files changed, 66 insertions(+) create mode 100644 src/main/java/com/first/flash/climbing/problem/application/dto/ProblemHoldRequestDto.java diff --git a/src/main/java/com/first/flash/climbing/problem/application/ProblemsService.java b/src/main/java/com/first/flash/climbing/problem/application/ProblemsService.java index f6b92015..ca4bdfa0 100644 --- a/src/main/java/com/first/flash/climbing/problem/application/ProblemsService.java +++ b/src/main/java/com/first/flash/climbing/problem/application/ProblemsService.java @@ -105,6 +105,18 @@ public ProblemDetailResponseDto setPerceivedDifficulty(final UUID problemId, return ProblemDetailResponseDto.of(queryProblem); } + @Transactional + public ProblemDetailResponseDto updateHold(final UUID problemId, + final Long holdId) { + Problem problem = problemReadService.findProblemById(problemId); + + problem.setHoldId(holdId); + queryProblemRepository.updateHoldInfoByHoldId(problemId, holdId); + + QueryProblem queryProblem = problemReadService.findQueryProblemById(problemId); + return ProblemDetailResponseDto.of(queryProblem); + } + public void updateQueryProblemFixedInfo(final List sectorIds, final String sectorName) { queryProblemRepository.updateSectorNameBySectorIds(sectorIds, sectorName); } diff --git a/src/main/java/com/first/flash/climbing/problem/application/dto/ProblemHoldRequestDto.java b/src/main/java/com/first/flash/climbing/problem/application/dto/ProblemHoldRequestDto.java new file mode 100644 index 00000000..82407017 --- /dev/null +++ b/src/main/java/com/first/flash/climbing/problem/application/dto/ProblemHoldRequestDto.java @@ -0,0 +1,8 @@ +package com.first.flash.climbing.problem.application.dto; + +import jakarta.validation.constraints.NotNull; + +public record ProblemHoldRequestDto( + @NotNull(message = "변경할 홀드 id는 필수입니다.") Long holdId) { + +} diff --git a/src/main/java/com/first/flash/climbing/problem/domain/Problem.java b/src/main/java/com/first/flash/climbing/problem/domain/Problem.java index fdd54423..308a668a 100644 --- a/src/main/java/com/first/flash/climbing/problem/domain/Problem.java +++ b/src/main/java/com/first/flash/climbing/problem/domain/Problem.java @@ -10,6 +10,7 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; +import lombok.Setter; import lombok.ToString; @Entity @@ -36,6 +37,7 @@ public class Problem { private Long sectorId; private String imageSource; private Long thumbnailSolutionId; + @Setter private Long holdId; public static Problem createDefault(final UUID id, final String imageUrl, @@ -70,4 +72,5 @@ public void setThumbnailInfo(final Long thumbnailSolutionId, final String imageU this.imageUrl = imageUrl; this.imageSource = imageSource; } + } diff --git a/src/main/java/com/first/flash/climbing/problem/domain/QueryProblemRepository.java b/src/main/java/com/first/flash/climbing/problem/domain/QueryProblemRepository.java index e4782f2b..223d7a62 100644 --- a/src/main/java/com/first/flash/climbing/problem/domain/QueryProblemRepository.java +++ b/src/main/java/com/first/flash/climbing/problem/domain/QueryProblemRepository.java @@ -26,6 +26,8 @@ void updateQueryProblemInfo(final Long sectorId, final String sectorName, void updateSectorNameBySectorIds(final List sectorIds, final String sectorName); + void updateHoldInfoByHoldId(UUID id, final Long holdId); + void deleteByProblemId(final UUID problemId); List findBySectorIdAndHoldIdAndDifficulty(Long sectorId, Long holdId, String difficulty); diff --git a/src/main/java/com/first/flash/climbing/problem/infrastructure/QueryProblemQueryDslRepository.java b/src/main/java/com/first/flash/climbing/problem/infrastructure/QueryProblemQueryDslRepository.java index 351650ef..e7eda580 100644 --- a/src/main/java/com/first/flash/climbing/problem/infrastructure/QueryProblemQueryDslRepository.java +++ b/src/main/java/com/first/flash/climbing/problem/infrastructure/QueryProblemQueryDslRepository.java @@ -1,9 +1,11 @@ package com.first.flash.climbing.problem.infrastructure; +import static com.first.flash.climbing.hold.domain.QHold.hold; import static com.first.flash.climbing.problem.domain.QQueryProblem.queryProblem; import static com.first.flash.climbing.problem.infrastructure.paging.ProblemSortBy.DIFFICULTY; import static com.first.flash.climbing.problem.infrastructure.paging.ProblemSortBy.VIEWS; +import com.first.flash.climbing.hold.domain.Hold; import com.first.flash.climbing.problem.domain.QueryProblem; import com.first.flash.climbing.problem.infrastructure.paging.ProblemCursor; import com.first.flash.climbing.problem.infrastructure.paging.ProblemSortBy; @@ -64,6 +66,19 @@ public void updateQueryProblemInfo(final Long sectorId, final String sectorName, .execute(); } + public void updateHoldInfoByHoldId(final UUID id, final Long holdId) { + Hold holdData = queryFactory.selectFrom(hold) + .where(hold.id.eq(holdId)) + .fetchOne(); + + queryFactory.update(queryProblem) + .set(queryProblem.holdId, holdId) + .set(queryProblem.holdColorName, holdData.getColorName()) + .set(queryProblem.holdColorCode, holdData.getColorCode()) + .where(queryProblem.id.eq(id)) + .execute(); + } + private BooleanExpression inGym(final Long gymId) { return queryProblem.gymId.eq(gymId); } diff --git a/src/main/java/com/first/flash/climbing/problem/infrastructure/QueryProblemRepositoryImpl.java b/src/main/java/com/first/flash/climbing/problem/infrastructure/QueryProblemRepositoryImpl.java index 33be9dca..7976dcd8 100644 --- a/src/main/java/com/first/flash/climbing/problem/infrastructure/QueryProblemRepositoryImpl.java +++ b/src/main/java/com/first/flash/climbing/problem/infrastructure/QueryProblemRepositoryImpl.java @@ -59,6 +59,11 @@ public void updateSectorNameBySectorIds(final List sectorIds, final String queryProblemQueryDslRepository.updateSectorNameBySectorIds(sectorIds, sectorName); } + @Override + public void updateHoldInfoByHoldId(UUID id, Long holdId) { + queryProblemQueryDslRepository.updateHoldInfoByHoldId(id, holdId); + } + @Override public void deleteByProblemId(UUID problemId) { jpaRepository.deleteById(problemId); diff --git a/src/main/java/com/first/flash/climbing/problem/ui/ProblemController.java b/src/main/java/com/first/flash/climbing/problem/ui/ProblemController.java index 90c76305..9564c2f7 100644 --- a/src/main/java/com/first/flash/climbing/problem/ui/ProblemController.java +++ b/src/main/java/com/first/flash/climbing/problem/ui/ProblemController.java @@ -6,6 +6,7 @@ import com.first.flash.climbing.problem.application.dto.DuplicateProblemsResponseDto; import com.first.flash.climbing.problem.application.dto.ProblemCreateResponseDto; import com.first.flash.climbing.problem.application.dto.ProblemDetailResponseDto; +import com.first.flash.climbing.problem.application.dto.ProblemHoldRequestDto; import com.first.flash.climbing.problem.application.dto.ProblemPerceivedDifficultyRequestDto; import com.first.flash.climbing.problem.application.dto.ProblemsResponseDto; import com.first.flash.climbing.problem.domain.dto.ProblemCreateRequestDto; @@ -125,6 +126,26 @@ public ResponseEntity changePerceivedDifficulty( return ResponseEntity.ok(problemsService.setPerceivedDifficulty(problemId, requestDto.perceivedDifficulty())); } + @Operation(summary = "문제 홀드색 수정", description = "특정 문제의 홀드색 수정") + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "성공적으로 문제 정보 수정함", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ProblemDetailResponseDto.class))), + @ApiResponse(responseCode = "400", description = "유효하지 않은 요청 형식", + content = @Content(mediaType = "application/json", examples = { + @ExampleObject(name = "요청값 누락", value = "{\"perceivedDifficulty\": \"변경할 홀드 id는 필수입니다.\"}") + })), + @ApiResponse(responseCode = "404", description = "리소스를 찾을 수 없음", + content = @Content(mediaType = "application/json", examples = { + @ExampleObject(name = "문제 없음", value = "{\"error\": \"아이디가 0190c558-9063-7050-b4fc-eb421e3236b3인 문제를 찾을 수 없습니다.\"}") + })) + }) + @PatchMapping("/admin/problems/{problemId}/hold") + public ResponseEntity changeHold( + @PathVariable final UUID problemId, + @Valid @RequestBody final ProblemHoldRequestDto requestDto) { + return ResponseEntity.ok(problemsService.updateHold(problemId, requestDto.holdId())); + } + @Operation(summary = "중복된 문제 조회", description = "sectorId, holdColorId, difficulty로 중복된 문제를 조회") @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "성공적으로 중복된 문제 조회", From 95561ab17cb0b518248506808ec51d44fefab838 Mon Sep 17 00:00:00 2001 From: wonyangs Date: Fri, 13 Dec 2024 16:57:50 +0900 Subject: [PATCH 2/6] =?UTF-8?q?chore:=20final=20=ED=82=A4=EC=9B=8C?= =?UTF-8?q?=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flash/climbing/problem/domain/QueryProblemRepository.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/first/flash/climbing/problem/domain/QueryProblemRepository.java b/src/main/java/com/first/flash/climbing/problem/domain/QueryProblemRepository.java index 223d7a62..9f1e95ea 100644 --- a/src/main/java/com/first/flash/climbing/problem/domain/QueryProblemRepository.java +++ b/src/main/java/com/first/flash/climbing/problem/domain/QueryProblemRepository.java @@ -26,7 +26,7 @@ void updateQueryProblemInfo(final Long sectorId, final String sectorName, void updateSectorNameBySectorIds(final List sectorIds, final String sectorName); - void updateHoldInfoByHoldId(UUID id, final Long holdId); + void updateHoldInfoByHoldId(final UUID id, final Long holdId); void deleteByProblemId(final UUID problemId); From 41908e98a4ab47f3263e22c22dfe316e2ef7cb45 Mon Sep 17 00:00:00 2001 From: wonyangs Date: Fri, 13 Dec 2024 16:58:54 +0900 Subject: [PATCH 3/6] =?UTF-8?q?chore:=20setter=20=EC=A0=9C=EA=B1=B0=20?= =?UTF-8?q?=EB=B0=8F=20=EB=A9=94=EC=84=9C=EB=93=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/first/flash/climbing/problem/domain/Problem.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/first/flash/climbing/problem/domain/Problem.java b/src/main/java/com/first/flash/climbing/problem/domain/Problem.java index 308a668a..92bb8998 100644 --- a/src/main/java/com/first/flash/climbing/problem/domain/Problem.java +++ b/src/main/java/com/first/flash/climbing/problem/domain/Problem.java @@ -37,7 +37,6 @@ public class Problem { private Long sectorId; private String imageSource; private Long thumbnailSolutionId; - @Setter private Long holdId; public static Problem createDefault(final UUID id, final String imageUrl, @@ -73,4 +72,8 @@ public void setThumbnailInfo(final Long thumbnailSolutionId, final String imageU this.imageSource = imageSource; } + public void setHoldInfo(final Long holdId) { + this.holdId = holdId; + } + } From c14f045fbeef54d511ca8de6ab9bb1e2188b5865 Mon Sep 17 00:00:00 2001 From: wonyangs Date: Fri, 13 Dec 2024 16:59:20 +0900 Subject: [PATCH 4/6] =?UTF-8?q?chore:=20url=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/first/flash/climbing/problem/ui/ProblemController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/first/flash/climbing/problem/ui/ProblemController.java b/src/main/java/com/first/flash/climbing/problem/ui/ProblemController.java index 9564c2f7..4f1957be 100644 --- a/src/main/java/com/first/flash/climbing/problem/ui/ProblemController.java +++ b/src/main/java/com/first/flash/climbing/problem/ui/ProblemController.java @@ -139,7 +139,7 @@ public ResponseEntity changePerceivedDifficulty( @ExampleObject(name = "문제 없음", value = "{\"error\": \"아이디가 0190c558-9063-7050-b4fc-eb421e3236b3인 문제를 찾을 수 없습니다.\"}") })) }) - @PatchMapping("/admin/problems/{problemId}/hold") + @PatchMapping("/admin/problems/{problemId}/holds") public ResponseEntity changeHold( @PathVariable final UUID problemId, @Valid @RequestBody final ProblemHoldRequestDto requestDto) { From acd35a4e1d56147ad193417ee64f33adc5ef83d5 Mon Sep 17 00:00:00 2001 From: wonyangs Date: Fri, 13 Dec 2024 17:06:35 +0900 Subject: [PATCH 5/6] =?UTF-8?q?refactor:=20problem=20=EC=95=A0=EA=B7=B8?= =?UTF-8?q?=EB=A6=AC=EA=B1=B0=ED=8A=B8=EC=97=90=EC=84=9C=20hold=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=EC=9E=91=EC=97=85=EC=9D=84=20=EB=8B=B4?= =?UTF-8?q?=EB=8B=B9=ED=95=98=EB=8A=94=20service=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=EB=B0=8F=20=EB=A1=9C=EC=A7=81=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/ProblemsHoldService.java | 35 +++++++++++++++++++ .../problem/application/ProblemsService.java | 12 ------- .../climbing/problem/domain/QueryProblem.java | 6 ++++ .../domain/QueryProblemRepository.java | 2 -- .../QueryProblemQueryDslRepository.java | 13 ------- .../QueryProblemRepositoryImpl.java | 5 --- .../problem/ui/ProblemController.java | 4 ++- 7 files changed, 44 insertions(+), 33 deletions(-) create mode 100644 src/main/java/com/first/flash/climbing/problem/application/ProblemsHoldService.java diff --git a/src/main/java/com/first/flash/climbing/problem/application/ProblemsHoldService.java b/src/main/java/com/first/flash/climbing/problem/application/ProblemsHoldService.java new file mode 100644 index 00000000..f64303d2 --- /dev/null +++ b/src/main/java/com/first/flash/climbing/problem/application/ProblemsHoldService.java @@ -0,0 +1,35 @@ +package com.first.flash.climbing.problem.application; + +import com.first.flash.climbing.hold.application.HoldService; +import com.first.flash.climbing.hold.domain.Hold; +import com.first.flash.climbing.problem.application.dto.ProblemDetailResponseDto; +import com.first.flash.climbing.problem.domain.Problem; +import com.first.flash.climbing.problem.domain.QueryProblem; +import java.util.UUID; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +@RequiredArgsConstructor +@Transactional(readOnly = true) +public class ProblemsHoldService { + + private final ProblemReadService problemReadService; + private final HoldService holdService; + + @Transactional + public ProblemDetailResponseDto updateHold(final UUID problemId, + final Long holdId) { + Hold hold = holdService.findById(holdId); + + Problem problem = problemReadService.findProblemById(problemId); + QueryProblem queryProblem = problemReadService.findQueryProblemById(problemId); + + problem.setHoldInfo(hold.getId()); + queryProblem.setHoldInfo(hold.getId(), hold.getColorName(), hold.getColorCode()); + + return ProblemDetailResponseDto.of(queryProblem); + } + +} diff --git a/src/main/java/com/first/flash/climbing/problem/application/ProblemsService.java b/src/main/java/com/first/flash/climbing/problem/application/ProblemsService.java index ca4bdfa0..f6b92015 100644 --- a/src/main/java/com/first/flash/climbing/problem/application/ProblemsService.java +++ b/src/main/java/com/first/flash/climbing/problem/application/ProblemsService.java @@ -105,18 +105,6 @@ public ProblemDetailResponseDto setPerceivedDifficulty(final UUID problemId, return ProblemDetailResponseDto.of(queryProblem); } - @Transactional - public ProblemDetailResponseDto updateHold(final UUID problemId, - final Long holdId) { - Problem problem = problemReadService.findProblemById(problemId); - - problem.setHoldId(holdId); - queryProblemRepository.updateHoldInfoByHoldId(problemId, holdId); - - QueryProblem queryProblem = problemReadService.findQueryProblemById(problemId); - return ProblemDetailResponseDto.of(queryProblem); - } - public void updateQueryProblemFixedInfo(final List sectorIds, final String sectorName) { queryProblemRepository.updateSectorNameBySectorIds(sectorIds, sectorName); } diff --git a/src/main/java/com/first/flash/climbing/problem/domain/QueryProblem.java b/src/main/java/com/first/flash/climbing/problem/domain/QueryProblem.java index 177515f0..82b94c82 100644 --- a/src/main/java/com/first/flash/climbing/problem/domain/QueryProblem.java +++ b/src/main/java/com/first/flash/climbing/problem/domain/QueryProblem.java @@ -105,6 +105,12 @@ public void setThumbnailInfo(final Long thumbnailSolutionId, final String imageU this.imageSource = imageSource; } + public void setHoldInfo(final Long holdId, final String holdColorName, final String holdColorCode) { + this.holdId = holdId; + this.holdColorName = holdColorName; + this.holdColorCode = holdColorCode; + } + private void enableSolution() { if (!hasSolution) { hasSolution = true; diff --git a/src/main/java/com/first/flash/climbing/problem/domain/QueryProblemRepository.java b/src/main/java/com/first/flash/climbing/problem/domain/QueryProblemRepository.java index 9f1e95ea..e4782f2b 100644 --- a/src/main/java/com/first/flash/climbing/problem/domain/QueryProblemRepository.java +++ b/src/main/java/com/first/flash/climbing/problem/domain/QueryProblemRepository.java @@ -26,8 +26,6 @@ void updateQueryProblemInfo(final Long sectorId, final String sectorName, void updateSectorNameBySectorIds(final List sectorIds, final String sectorName); - void updateHoldInfoByHoldId(final UUID id, final Long holdId); - void deleteByProblemId(final UUID problemId); List findBySectorIdAndHoldIdAndDifficulty(Long sectorId, Long holdId, String difficulty); diff --git a/src/main/java/com/first/flash/climbing/problem/infrastructure/QueryProblemQueryDslRepository.java b/src/main/java/com/first/flash/climbing/problem/infrastructure/QueryProblemQueryDslRepository.java index e7eda580..e40ec488 100644 --- a/src/main/java/com/first/flash/climbing/problem/infrastructure/QueryProblemQueryDslRepository.java +++ b/src/main/java/com/first/flash/climbing/problem/infrastructure/QueryProblemQueryDslRepository.java @@ -66,19 +66,6 @@ public void updateQueryProblemInfo(final Long sectorId, final String sectorName, .execute(); } - public void updateHoldInfoByHoldId(final UUID id, final Long holdId) { - Hold holdData = queryFactory.selectFrom(hold) - .where(hold.id.eq(holdId)) - .fetchOne(); - - queryFactory.update(queryProblem) - .set(queryProblem.holdId, holdId) - .set(queryProblem.holdColorName, holdData.getColorName()) - .set(queryProblem.holdColorCode, holdData.getColorCode()) - .where(queryProblem.id.eq(id)) - .execute(); - } - private BooleanExpression inGym(final Long gymId) { return queryProblem.gymId.eq(gymId); } diff --git a/src/main/java/com/first/flash/climbing/problem/infrastructure/QueryProblemRepositoryImpl.java b/src/main/java/com/first/flash/climbing/problem/infrastructure/QueryProblemRepositoryImpl.java index 7976dcd8..33be9dca 100644 --- a/src/main/java/com/first/flash/climbing/problem/infrastructure/QueryProblemRepositoryImpl.java +++ b/src/main/java/com/first/flash/climbing/problem/infrastructure/QueryProblemRepositoryImpl.java @@ -59,11 +59,6 @@ public void updateSectorNameBySectorIds(final List sectorIds, final String queryProblemQueryDslRepository.updateSectorNameBySectorIds(sectorIds, sectorName); } - @Override - public void updateHoldInfoByHoldId(UUID id, Long holdId) { - queryProblemQueryDslRepository.updateHoldInfoByHoldId(id, holdId); - } - @Override public void deleteByProblemId(UUID problemId) { jpaRepository.deleteById(problemId); diff --git a/src/main/java/com/first/flash/climbing/problem/ui/ProblemController.java b/src/main/java/com/first/flash/climbing/problem/ui/ProblemController.java index 4f1957be..0e63598c 100644 --- a/src/main/java/com/first/flash/climbing/problem/ui/ProblemController.java +++ b/src/main/java/com/first/flash/climbing/problem/ui/ProblemController.java @@ -1,6 +1,7 @@ package com.first.flash.climbing.problem.ui; import com.first.flash.climbing.problem.application.ProblemReadService; +import com.first.flash.climbing.problem.application.ProblemsHoldService; import com.first.flash.climbing.problem.application.ProblemsSaveService; import com.first.flash.climbing.problem.application.ProblemsService; import com.first.flash.climbing.problem.application.dto.DuplicateProblemsResponseDto; @@ -42,6 +43,7 @@ public class ProblemController { private final ProblemsSaveService problemsSaveService; private final ProblemReadService problemReadService; private final ProblemsService problemsService; + private final ProblemsHoldService problemsHoldService; @Operation(summary = "문제 생성", description = "특정 섹터에 문제 생성") @ApiResponses(value = { @@ -143,7 +145,7 @@ public ResponseEntity changePerceivedDifficulty( public ResponseEntity changeHold( @PathVariable final UUID problemId, @Valid @RequestBody final ProblemHoldRequestDto requestDto) { - return ResponseEntity.ok(problemsService.updateHold(problemId, requestDto.holdId())); + return ResponseEntity.ok(problemsHoldService.updateHold(problemId, requestDto.holdId())); } @Operation(summary = "중복된 문제 조회", description = "sectorId, holdColorId, difficulty로 중복된 문제를 조회") From 1e12e7e8bc35ddee9431ab27777044eed2553028 Mon Sep 17 00:00:00 2001 From: wonyangs Date: Mon, 16 Dec 2024 10:58:51 +0900 Subject: [PATCH 6/6] =?UTF-8?q?refactor:=20=EB=A9=94=EC=84=9C=EB=93=9C?= =?UTF-8?q?=EB=AA=85=EC=9D=84=20updateXXX=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../climbing/problem/application/ProblemsHoldService.java | 4 ++-- .../java/com/first/flash/climbing/problem/domain/Problem.java | 2 +- .../com/first/flash/climbing/problem/domain/QueryProblem.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/first/flash/climbing/problem/application/ProblemsHoldService.java b/src/main/java/com/first/flash/climbing/problem/application/ProblemsHoldService.java index f64303d2..9abb42d3 100644 --- a/src/main/java/com/first/flash/climbing/problem/application/ProblemsHoldService.java +++ b/src/main/java/com/first/flash/climbing/problem/application/ProblemsHoldService.java @@ -26,8 +26,8 @@ public ProblemDetailResponseDto updateHold(final UUID problemId, Problem problem = problemReadService.findProblemById(problemId); QueryProblem queryProblem = problemReadService.findQueryProblemById(problemId); - problem.setHoldInfo(hold.getId()); - queryProblem.setHoldInfo(hold.getId(), hold.getColorName(), hold.getColorCode()); + problem.updateHoldInfo(hold.getId()); + queryProblem.updateHoldInfo(hold.getId(), hold.getColorName(), hold.getColorCode()); return ProblemDetailResponseDto.of(queryProblem); } diff --git a/src/main/java/com/first/flash/climbing/problem/domain/Problem.java b/src/main/java/com/first/flash/climbing/problem/domain/Problem.java index 92bb8998..b5d24701 100644 --- a/src/main/java/com/first/flash/climbing/problem/domain/Problem.java +++ b/src/main/java/com/first/flash/climbing/problem/domain/Problem.java @@ -72,7 +72,7 @@ public void setThumbnailInfo(final Long thumbnailSolutionId, final String imageU this.imageSource = imageSource; } - public void setHoldInfo(final Long holdId) { + public void updateHoldInfo(final Long holdId) { this.holdId = holdId; } diff --git a/src/main/java/com/first/flash/climbing/problem/domain/QueryProblem.java b/src/main/java/com/first/flash/climbing/problem/domain/QueryProblem.java index 82b94c82..51b39fb7 100644 --- a/src/main/java/com/first/flash/climbing/problem/domain/QueryProblem.java +++ b/src/main/java/com/first/flash/climbing/problem/domain/QueryProblem.java @@ -105,7 +105,7 @@ public void setThumbnailInfo(final Long thumbnailSolutionId, final String imageU this.imageSource = imageSource; } - public void setHoldInfo(final Long holdId, final String holdColorName, final String holdColorCode) { + public void updateHoldInfo(final Long holdId, final String holdColorName, final String holdColorCode) { this.holdId = holdId; this.holdColorName = holdColorName; this.holdColorCode = holdColorCode;