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("도자기, 머그컵"))