diff --git a/src/main/java/com/helpmeCookies/user/dto/UserTypeDto.java b/src/main/java/com/helpmeCookies/user/dto/UserTypeDto.java index 627a88c..99ed470 100644 --- a/src/main/java/com/helpmeCookies/user/dto/UserTypeDto.java +++ b/src/main/java/com/helpmeCookies/user/dto/UserTypeDto.java @@ -1,10 +1,12 @@ package com.helpmeCookies.user.dto; +import com.helpmeCookies.user.entity.ArtistType; + import lombok.Builder; @Builder public record UserTypeDto( String role, - String userType + ArtistType userType ) { } diff --git a/src/main/java/com/helpmeCookies/user/entity/ArtistType.java b/src/main/java/com/helpmeCookies/user/entity/ArtistType.java index daefeda..307e5d7 100644 --- a/src/main/java/com/helpmeCookies/user/entity/ArtistType.java +++ b/src/main/java/com/helpmeCookies/user/entity/ArtistType.java @@ -1,7 +1,7 @@ package com.helpmeCookies.user.entity; public enum ArtistType { - BUSINESS("BusinessArtist"), STUDENT("StudentArtist"); + USER("User"), BUSINESS("BusinessArtist"), STUDENT("StudentArtist"); private final String type; diff --git a/src/main/java/com/helpmeCookies/user/service/UserService.java b/src/main/java/com/helpmeCookies/user/service/UserService.java index 5577c2a..2da5c31 100644 --- a/src/main/java/com/helpmeCookies/user/service/UserService.java +++ b/src/main/java/com/helpmeCookies/user/service/UserService.java @@ -14,6 +14,7 @@ import com.helpmeCookies.user.dto.UserTypeDto; import com.helpmeCookies.user.dto.response.UserFollowingRes; import com.helpmeCookies.user.entity.ArtistInfo; +import com.helpmeCookies.user.entity.ArtistType; import com.helpmeCookies.user.entity.Social; import com.helpmeCookies.user.entity.User; import com.helpmeCookies.user.entity.UserInfo; @@ -63,9 +64,9 @@ public UserDto updateUser(UserCommonInfoDto userCommonInfoDto, UserInfoDto userI @Transactional public UserTypeDto getUserType(Long userId) { - String usertype = artistInfoRepository.findByUserId(userId) - .map(artistInfo -> artistInfo.getArtistType().getType()) // 값이 있을 때 처리 - .orElse("User"); // 값이 없을 때 기본값 + ArtistType usertype = artistInfoRepository.findByUserId(userId) + .map(artistInfo -> artistInfo.getArtistType()) // 값이 있을 때 처리 + .orElse(ArtistType.USER); // 값이 없을 때 기본값 return UserTypeDto.builder() .userType(usertype)