From da4b4e671fc80aaa28ee09b1c41870434c665999 Mon Sep 17 00:00:00 2001 From: daeun084 <030804jk@naver.com> Date: Sat, 17 Feb 2024 19:46:16 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EC=95=84=ED=8B=B0=EC=8A=A4=ED=8A=B8,?= =?UTF-8?q?=20=ED=8F=AC=ED=8A=B8=ED=8F=B4=EB=A6=AC=EC=98=A4=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20request=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shop/domain/artist/controller/ArtistController.java | 6 +++--- .../umc/meme/shop/domain/artist/service/ArtistService.java | 5 +---- .../domain/portfolio/controller/PortfolioController.java | 6 +++--- .../shop/domain/portfolio/service/PortfolioService.java | 5 +---- 4 files changed, 8 insertions(+), 14 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 4e09a48..e6086f6 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 @@ -23,9 +23,9 @@ public ApiResponse updateProfile(@RequestBody ArtistProfileDto profileDto){ } @Operation(summary = "아티스트 프로필 조회") - @GetMapping("/profile") - public ApiResponse getArtistProfile(@RequestBody ArtistProfileDetailDto profileDetailDto){ - return ApiResponse.SuccessResponse(SuccessStatus.ARTIST_PROFILE_GET, artistService.getArtistProfile(profileDetailDto)); + @GetMapping("/profile/{userId}/{artistId}") + public ApiResponse getArtistProfile(@PathVariable Long userId, @PathVariable Long artistId){ + return ApiResponse.SuccessResponse(SuccessStatus.ARTIST_PROFILE_GET, artistService.getArtistProfile(userId, artistId)); } //temp method for Artist create 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 33ffc46..be928b8 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 @@ -34,10 +34,7 @@ public void updateArtistProfile(ArtistProfileDto profileDto){ } //아티스트 프로필 조회 - public ArtistDto getArtistProfile(ArtistProfileDetailDto profileDetailDto){ - Long userId = profileDetailDto.getUserId(); - Long artistId = profileDetailDto.getArtistId(); - + public ArtistDto getArtistProfile(Long userId, Long artistId){ Model model = modelRepository.findById(userId) .orElseThrow(() -> new GlobalException(ErrorStatus.NOT_EXIST_MODEL)); Artist artist = artistRepository.findById(artistId) diff --git a/src/main/java/umc/meme/shop/domain/portfolio/controller/PortfolioController.java b/src/main/java/umc/meme/shop/domain/portfolio/controller/PortfolioController.java index 81b729f..dd133b3 100644 --- a/src/main/java/umc/meme/shop/domain/portfolio/controller/PortfolioController.java +++ b/src/main/java/umc/meme/shop/domain/portfolio/controller/PortfolioController.java @@ -31,9 +31,9 @@ public ApiResponse getPortfolio(@PathVariable Long artistId, } @Operation(summary = "포트폴리오 조회", description = "특정 포트폴리오를 조회하는 API입니다.") - @GetMapping("/details") - public ApiResponse getPortfolioDetails(@RequestBody PortfolioDetailRequestDto detailDto) { - return ApiResponse.SuccessResponse(SuccessStatus.PORTFOLIO_GET, portfolioService.getPortfolioDetails(detailDto)); + @GetMapping("/details/{userId}/{portfolioId}") + public ApiResponse getPortfolioDetails(@PathVariable Long userId, @PathVariable Long portfolioId) { + return ApiResponse.SuccessResponse(SuccessStatus.PORTFOLIO_GET, portfolioService.getPortfolioDetails(userId, portfolioId)); } @Operation(summary = "포트폴리오 수정/삭제", description = "포트폴리오를 수정/삭제하는 API입니다.") diff --git a/src/main/java/umc/meme/shop/domain/portfolio/service/PortfolioService.java b/src/main/java/umc/meme/shop/domain/portfolio/service/PortfolioService.java index 423d802..4e41a4d 100644 --- a/src/main/java/umc/meme/shop/domain/portfolio/service/PortfolioService.java +++ b/src/main/java/umc/meme/shop/domain/portfolio/service/PortfolioService.java @@ -79,10 +79,7 @@ public PortfolioPageDto getPortfolio(Long artistId, int page) { } // 포트폴리오 하나만 조회 - public PortfolioDetailDto getPortfolioDetails(PortfolioDetailRequestDto dto) { - Long userId = dto.getUserId(); - Long portfolioId = dto.getPortfolioId(); - + public PortfolioDetailDto getPortfolioDetails(Long userId, Long portfolioId) { Model model = modelRepository.findById(userId) .orElseThrow(() -> new GlobalException(ErrorStatus.NOT_EXIST_MODEL)); Portfolio portfolio = portfolioRepository.findById(portfolioId)