Skip to content

Commit

Permalink
chore: 아티스트, 포트폴리오 조회 request 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
daeun084 committed Feb 17, 2024
1 parent 45bc213 commit da4b4e6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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입니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit da4b4e6

Please sign in to comment.