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 31ddeae commit ba6df71
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ public ApiResponse updateModelProfile (@RequestBody ModelProfileDto modelProfile
return ApiResponse.SuccessResponse(SuccessStatus.MODEL_PROFILE_UPDATE);
}

@Operation(summary = "모델 프로필 관리 조회(수정 전 정보 불러오기 용)")
@GetMapping("/mypage/profile/model/{userId}")
public ApiResponse getModelProfile (@PathVariable Long userId){
modelService.getModelProfile(userId);
return ApiResponse.SuccessResponse(SuccessStatus.MODEL_PROFILE_UPDATE);
}

/**favorite**/

@Operation(summary = "관심 아티스트 조회", description = "관심 아티스트를 조회하는 API입니다.")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
package umc.meme.shop.domain.model.dto.request;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import umc.meme.shop.domain.model.entity.Model;
import umc.meme.shop.global.enums.Gender;
import umc.meme.shop.global.enums.PersonalColor;
import umc.meme.shop.global.enums.SkinType;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ModelProfileDto {
private Long userId;
private String profileImg;
private String nickname;
private Gender gender;
private SkinType skinType;
private PersonalColor personalColor;

public static ModelProfileDto from(Model model){
return ModelProfileDto.builder()
.userId(model.getUserId())
.profileImg(model.getProfileImg())
.nickname(model.getNickname())
.gender(model.getGender())
.skinType(model.getSkinType())
.personalColor(model.getPersonalColor())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ public void updateModelProfile(ModelProfileDto request){
model.updateModel(request);
}

//모델 프로필 관리 조회
public ModelProfileDto getModelProfile(Long userId){
Model model = modelRepository.findById(userId)
.orElseThrow(() -> new GlobalException(ErrorStatus.NOT_EXIST_MODEL));
return ModelProfileDto.from(model);
}


//관심 아티스트 조회
@Transactional
Expand Down
1 change: 1 addition & 0 deletions src/main/java/umc/meme/shop/global/SuccessStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public enum SuccessStatus {

/**model**/
MODEL_PROFILE_UPDATE(200, "모델 프로필 수정이 완료되었습니다"),
MODEL_PROFILE_GET(200, "모델 프로필 조회가 완료되었습니다."),

FAVORITE_ARTIST_GET(200, "관심 아티스트 조회가 완료되었습니다"),
FAVORITE_PORTFOLIO_GET(200, "관심 메이크업 조회가 완료되었습니다"),
Expand Down

0 comments on commit ba6df71

Please sign in to comment.