From b8ce9d48cc53b273efda8c90135efc43d4f16a18 Mon Sep 17 00:00:00 2001 From: daeun084 <030804jk@naver.com> Date: Sun, 31 Mar 2024 15:23:36 +0900 Subject: [PATCH] =?UTF-8?q?hotfix:=20Artist=20ver.=20get=20artist=20profil?= =?UTF-8?q?e=20API=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/artist/controller/ArtistController.java | 10 ++++++++-- .../meme/shop/domain/artist/service/ArtistService.java | 9 ++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/main/java/umc/meme/shop/domain/artist/controller/ArtistController.java b/src/main/java/umc/meme/shop/domain/artist/controller/ArtistController.java index 7ae310c..1934f1a 100644 --- a/src/main/java/umc/meme/shop/domain/artist/controller/ArtistController.java +++ b/src/main/java/umc/meme/shop/domain/artist/controller/ArtistController.java @@ -27,12 +27,18 @@ public ApiResponse getProfile (@PathVariable(name = "userId") Long userId){ return ApiResponse.SuccessResponse(SuccessStatus.ARTIST_PROFILE_GET, artistService.getProfile(userId)); } - @Operation(summary = "아티스트 프로필 조회") + @Operation(summary = "아티스트 프로필 조회(Model Ver.") @GetMapping("/profile/{userId}/{artistId}") - public ApiResponse getArtistProfile(@PathVariable(name = "userId") Long userId, @PathVariable Long artistId){ + public ApiResponse getArtistProfile(@PathVariable(name = "userId") Long userId, @PathVariable(name = "artistId") Long artistId){ return ApiResponse.SuccessResponse(SuccessStatus.ARTIST_PROFILE_GET, artistService.getArtistProfile(userId, artistId)); } + @Operation(summary = "아티스트 프로필 조회 (Artist Ver.)") + @GetMapping("/profile/{artistId}") + public ApiResponse getArtistProfile(@PathVariable(name = "artistId") Long artistId){ + return ApiResponse.SuccessResponse(SuccessStatus.ARTIST_PROFILE_GET, artistService.getArtistProfileFromArtist(artistId)); + } + //temp method for Artist create @Operation(summary = "temp 아티스트 생성(프론트랑 상관X)") @PostMapping("/artist") diff --git a/src/main/java/umc/meme/shop/domain/artist/service/ArtistService.java b/src/main/java/umc/meme/shop/domain/artist/service/ArtistService.java index 0d56eaf..8458571 100644 --- a/src/main/java/umc/meme/shop/domain/artist/service/ArtistService.java +++ b/src/main/java/umc/meme/shop/domain/artist/service/ArtistService.java @@ -39,7 +39,7 @@ public ArtistProfileDto getProfile(Long userId){ return ArtistProfileDto.from(artist); } - //아티스트 프로필 조회 + //아티스트 프로필 조회 (Model Ver.) public ArtistDto getArtistProfile(Long userId, Long artistId){ Model model = modelRepository.findById(userId) .orElseThrow(() -> new GlobalException(ErrorStatus.NOT_EXIST_MODEL)); @@ -54,6 +54,13 @@ public ArtistDto getArtistProfile(Long userId, Long artistId){ return ArtistDto.from(artist, isFavorite); } + //아티스트 프로필 조회 (Artist Ver.) + public ArtistDto getArtistProfileFromArtist(Long artistId){ + Artist artist = artistRepository.findById(artistId) + .orElseThrow(() -> new GlobalException(ErrorStatus.NOT_EXIST_ARTIST)); + return ArtistDto.from(artist, true); + } + //temp method for create Artist @Transactional public void createArtist(ArtistProfileDto dto){