From 3a8a5b4b2dd6bcf35540659d4d3e728e777f6627 Mon Sep 17 00:00:00 2001 From: ahdeka Date: Thu, 16 Oct 2025 00:07:33 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20=EC=9E=91=EA=B0=80=20=EA=B3=B5=EA=B0=9C?= =?UTF-8?q?=20=ED=94=84=EB=A1=9C=ED=95=84=20=EC=83=81=EC=84=B8=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20ID=20=EB=B6=88=EC=9D=BC=EC=B9=98=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../artist/dto/response/ArtistPublicProfileResponse.java | 2 +- .../com/back/domain/artist/service/ArtistPublicService.java | 2 +- .../back/domain/artist/controller/ArtistControllerTest.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/back/domain/artist/dto/response/ArtistPublicProfileResponse.java b/src/main/java/com/back/domain/artist/dto/response/ArtistPublicProfileResponse.java index 183ac132..59945caa 100644 --- a/src/main/java/com/back/domain/artist/dto/response/ArtistPublicProfileResponse.java +++ b/src/main/java/com/back/domain/artist/dto/response/ArtistPublicProfileResponse.java @@ -41,7 +41,7 @@ public record ArtistPublicProfileResponse( ) { public static ArtistPublicProfileResponse from(ArtistProfile artistProfile) { return new ArtistPublicProfileResponse( - artistProfile.getUser().getId(), + artistProfile.getId(), artistProfile.getArtistName(), artistProfile.getProfileImageUrl(), artistProfile.getDescription(), diff --git a/src/main/java/com/back/domain/artist/service/ArtistPublicService.java b/src/main/java/com/back/domain/artist/service/ArtistPublicService.java index d2166d3a..a9ff7631 100644 --- a/src/main/java/com/back/domain/artist/service/ArtistPublicService.java +++ b/src/main/java/com/back/domain/artist/service/ArtistPublicService.java @@ -53,7 +53,7 @@ public ArtistPublicProfileResponse getPublicProfile(Long artistId) { log.info("작가 공개 프로필 조회 시작 - artistId: {}", artistId); // 작가 프로필 조회 - ArtistProfile artistProfile = artistProfileRepository.findByUserId(artistId) + ArtistProfile artistProfile = artistProfileRepository.findById(artistId) .orElseThrow(() -> new ServiceException("404", "존재하지 않는 작가입니다.")); log.info("작가 공개 프로필 조회 완료 - artistId: {}, artistName: {}", diff --git a/src/test/java/com/back/domain/artist/controller/ArtistControllerTest.java b/src/test/java/com/back/domain/artist/controller/ArtistControllerTest.java index afe4ed4f..083c4f48 100644 --- a/src/test/java/com/back/domain/artist/controller/ArtistControllerTest.java +++ b/src/test/java/com/back/domain/artist/controller/ArtistControllerTest.java @@ -584,7 +584,7 @@ void t18() throws Exception { artistProfileRepository.save(profile); // when - ResultActions resultActions = mvc.perform(get("/api/artist/profile/" + user1.getId()) + ResultActions resultActions = mvc.perform(get("/api/artist/profile/" + profile.getId()) .contentType(MediaType.APPLICATION_JSON)) .andDo(print()); @@ -592,7 +592,7 @@ void t18() throws Exception { resultActions.andExpect(status().isOk()) .andExpect(jsonPath("$.resultCode").value("200")) .andExpect(jsonPath("$.msg").value("작가 프로필 조회 성공")) - .andExpect(jsonPath("$.data.artistId").value(user1.getId())) + .andExpect(jsonPath("$.data.artistId").value(profile.getId())) .andExpect(jsonPath("$.data.artistName").value("유저1작가")) .andExpect(jsonPath("$.data.description").value("전통 도자기를 현대적으로 재해석하는 작가입니다.")) .andExpect(jsonPath("$.data.mainProducts").value("도자기, 머그컵"))