Skip to content

Commit

Permalink
feat: 아티스트 프로필 조회 API
Browse files Browse the repository at this point in the history
  • Loading branch information
daeun084 committed Feb 17, 2024
1 parent 14973d7 commit 372e7fd
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import umc.meme.shop.domain.artist.dto.request.ArtistProfileDetailDto;
import umc.meme.shop.domain.artist.dto.request.ArtistProfileDto;
import umc.meme.shop.domain.artist.service.ArtistService;
import umc.meme.shop.global.SuccessStatus;
Expand All @@ -22,6 +21,12 @@ public ApiResponse updateProfile(@RequestBody ArtistProfileDto profileDto){
return ApiResponse.SuccessResponse(SuccessStatus.ARTIST_PROFILE_UPDATE);
}

@Operation(summary = "아티스트 프로필 관리 조회(수정 전 정보 불러오기 용)")
@GetMapping("/mypage/profile/artist/{userId}")
public ApiResponse getProfile (@PathVariable Long userId){
return ApiResponse.SuccessResponse(SuccessStatus.ARTIST_PROFILE_GET, artistService.getProfile(userId));
}

@Operation(summary = "아티스트 프로필 조회")
@GetMapping("/profile/{userId}/{artistId}")
public ApiResponse getArtistProfile(@PathVariable Long userId, @PathVariable Long artistId){
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package umc.meme.shop.domain.artist.dto.request;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import umc.meme.shop.domain.artist.entity.Artist;
import umc.meme.shop.global.enums.*;

import java.util.List;
Expand All @@ -11,6 +13,7 @@
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ArtistProfileDto {
private Long userId;
private String profileImg;
Expand All @@ -23,4 +26,20 @@ public class ArtistProfileDto {
private MakeupLocation makeupLocation;
private String shopLocation;
private Map<DayOfWeek, Times> availableDayOfWeek;

public static ArtistProfileDto from(Artist artist){
return ArtistProfileDto.builder()
.userId(artist.getUserId())
.profileImg(artist.getProfileImg())
.nickname(artist.getNickname())
.gender(artist.getGender())
.introduction(artist.getIntroduction())
.workExperience(artist.getWorkExperience())
.region(artist.getRegion())
.specialization(artist.getSpecialization())
.makeupLocation(artist.getMakeupLocation())
.shopLocation(artist.getShopLocation())
.availableDayOfWeek(artist.getAvailableDayOfWeekAndTime())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ public void updateArtistProfile(ArtistProfileDto profileDto){
artist.updateArtist(profileDto);
}

//아티스트 프로필 조회 (관리 조회 용)
public ArtistProfileDto getProfile(Long userId){
Artist artist = artistRepository.findById(userId)
.orElseThrow(() -> new GlobalException(ErrorStatus.NOT_EXIST_ARTIST));
return ArtistProfileDto.from(artist);
}

//아티스트 프로필 조회
public ArtistDto getArtistProfile(Long userId, Long artistId){
Model model = modelRepository.findById(userId)
Expand Down

0 comments on commit 372e7fd

Please sign in to comment.