diff --git a/src/main/java/umc/meme/shop/domain/artist/converter/ArtistConverter.java b/src/main/java/umc/meme/shop/domain/artist/converter/ArtistConverter.java deleted file mode 100644 index 8548da5..0000000 --- a/src/main/java/umc/meme/shop/domain/artist/converter/ArtistConverter.java +++ /dev/null @@ -1,21 +0,0 @@ -package umc.meme.shop.domain.artist.converter; - -import org.springframework.data.domain.Page; -import umc.meme.shop.domain.artist.dto.response.SimpleArtistDto; -import umc.meme.shop.domain.favorite.dto.response.FavoriteArtistPageResponseDto; -import umc.meme.shop.domain.favorite.entity.FavoriteArtist; - -import java.util.List; - -public class ArtistConverter { - public static FavoriteArtistPageResponseDto favoriteArtistPageConverter(Page page, List content) { - - return FavoriteArtistPageResponseDto.builder() - .content(content) - .pageSize(page.getSize()) - .currentPage(page.getNumber()) - .totalNumber(page.getNumberOfElements()) - .totalPage(page.getTotalPages()) - .build(); - } -} diff --git a/src/main/java/umc/meme/shop/domain/artist/dto/request/ArtistProfileDto.java b/src/main/java/umc/meme/shop/domain/artist/dto/request/ArtistProfileDto.java index eb858a8..25e94b1 100644 --- a/src/main/java/umc/meme/shop/domain/artist/dto/request/ArtistProfileDto.java +++ b/src/main/java/umc/meme/shop/domain/artist/dto/request/ArtistProfileDto.java @@ -12,7 +12,7 @@ @NoArgsConstructor @AllArgsConstructor public class ArtistProfileDto { - private Long artistId; + private Long userId; private String profileImg; private String nickname; private Gender gender; diff --git a/src/main/java/umc/meme/shop/domain/artist/dto/response/ArtistDto.java b/src/main/java/umc/meme/shop/domain/artist/dto/response/ArtistDto.java index 7e4639a..021107a 100644 --- a/src/main/java/umc/meme/shop/domain/artist/dto/response/ArtistDto.java +++ b/src/main/java/umc/meme/shop/domain/artist/dto/response/ArtistDto.java @@ -29,9 +29,9 @@ public class ArtistDto { private WorkExperience workExperience; - private List region; + private List region; - private List specialization; + private List specialization; private MakeupLocation makeupLocation; diff --git a/src/main/java/umc/meme/shop/domain/artist/entity/Artist.java b/src/main/java/umc/meme/shop/domain/artist/entity/Artist.java index 9a16939..cd45b53 100644 --- a/src/main/java/umc/meme/shop/domain/artist/entity/Artist.java +++ b/src/main/java/umc/meme/shop/domain/artist/entity/Artist.java @@ -10,8 +10,6 @@ import umc.meme.shop.domain.portfolio.entity.Portfolio; import umc.meme.shop.global.enums.*; -import java.util.ArrayList; -import java.util.Date; import java.util.List; import java.util.Map; @@ -22,33 +20,35 @@ @Entity public class Artist extends User { - @Column(nullable = false, length = 500) + @Column(length = 500, nullable = true) private String introduction; @Enumerated(EnumType.STRING) - @Column(nullable = false) + @Column(nullable = true) private WorkExperience workExperience; @ElementCollection(fetch = FetchType.LAZY) - private List region; + @Enumerated(EnumType.STRING) + @Column(nullable = true) + private List region; @ElementCollection(fetch = FetchType.LAZY) - private List specialization; + @Enumerated(EnumType.STRING) + @Column(nullable = true) + private List specialization; @Enumerated(EnumType.STRING) - @Column(nullable = false) + @Column(nullable = true) private MakeupLocation makeupLocation; @Column(nullable = true) private String shopLocation; //샵의 위치 - @Column(nullable = true) - private Date inactiveDate; - @ElementCollection @CollectionTable(name = "available_time_mapping", joinColumns = {@JoinColumn(name = "user_id", referencedColumnName = "user_id")}) @MapKeyColumn(name = "day_of_week") + @MapKeyEnumerated(EnumType.STRING) @Enumerated(EnumType.STRING) @Column(nullable = true) private Map availableDayOfWeekAndTime; @@ -68,22 +68,10 @@ public void updateArtist(ArtistProfileDto request) { this.introduction = request.getIntroduction(); if (request.getWorkExperience() != null) this.workExperience = request.getWorkExperience(); - - //region mapping - if (request.getRegion() != null){ - List regionList = new ArrayList<>(); - for(Region region : request.getRegion()) - regionList.add(region.getValue()); - this.region = regionList; - } - - //specialization mapping - if (request.getSpecialization() != null){ - List specialization = new ArrayList<>(); - for(Category category : request.getSpecialization()) - specialization.add(category.getValue()); - this.specialization = specialization; - } + if (request.getRegion() != null) + this.region = request.getRegion(); + if (request.getSpecialization() != null) + this.specialization = request.getSpecialization(); if (request.getMakeupLocation() != null) this.makeupLocation = request.getMakeupLocation(); if (request.getShopLocation() != null) @@ -96,9 +84,12 @@ public void updatePortfolioList(Portfolio portfolio){ this.portfolioList.add(portfolio); } - public void tempMethod(String email, String name, Provider provider){ - this.email = email; - this.userName = name; - this.provider = provider; + public void tempMethod(){ + this.username = "name"; + this.email=""; + this.password=""; + this.role="ARTIST"; + this.userStatus = UserStatus.ACTIVE; + this.provider = Provider.KAKAO; } } 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 750540b..78d1fff 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 @@ -8,11 +8,8 @@ import umc.meme.shop.domain.artist.entity.Artist; import umc.meme.shop.domain.artist.repository.ArtistRepository; import umc.meme.shop.global.ErrorStatus; -import umc.meme.shop.global.enums.Provider; import umc.meme.shop.global.exception.GlobalException; -import java.util.List; - @Service @RequiredArgsConstructor @@ -22,7 +19,7 @@ public class ArtistService { //아티스트 프로필 관리/수정 @Transactional public void updateArtistProfile(ArtistProfileDto profileDto){ - Artist artist = artistRepository.findById(profileDto.getArtistId()) + Artist artist = artistRepository.findById(profileDto.getUserId()) .orElseThrow(() -> new GlobalException(ErrorStatus.NOT_EXIST_ARTIST)); artist.updateArtist(profileDto); } @@ -39,7 +36,7 @@ public ArtistDto getArtistProfile(Long artistId){ public void createArtist(ArtistProfileDto dto){ Artist artist = new Artist(); artist.updateArtist(dto); - artist.tempMethod("", "testName", Provider.KAKAO); + artist.tempMethod(); artistRepository.save(artist); } diff --git a/src/main/java/umc/meme/shop/domain/favorite/dto/response/FavoriteArtistPageResponseDto.java b/src/main/java/umc/meme/shop/domain/favorite/dto/response/FavoriteArtistPageResponseDto.java index a9a0360..6d7c431 100644 --- a/src/main/java/umc/meme/shop/domain/favorite/dto/response/FavoriteArtistPageResponseDto.java +++ b/src/main/java/umc/meme/shop/domain/favorite/dto/response/FavoriteArtistPageResponseDto.java @@ -4,7 +4,9 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import org.springframework.data.domain.Page; import umc.meme.shop.domain.artist.dto.response.SimpleArtistDto; +import umc.meme.shop.domain.favorite.entity.FavoriteArtist; import java.util.List; @@ -18,4 +20,14 @@ public class FavoriteArtistPageResponseDto { private int pageSize; //페이지 크기 private int totalNumber; //전체 메이크업 개수 private int totalPage; //전체 페이지 개수 + + public static FavoriteArtistPageResponseDto from(Page page, List content){ + return FavoriteArtistPageResponseDto.builder() + .content(content) + .pageSize(page.getSize()) + .currentPage(page.getNumber()) + .totalNumber(page.getNumberOfElements()) + .totalPage(page.getTotalPages()) + .build(); + } } diff --git a/src/main/java/umc/meme/shop/domain/favorite/dto/response/FavoritePortfolioResponsePageDto.java b/src/main/java/umc/meme/shop/domain/favorite/dto/response/FavoritePortfolioResponsePageDto.java index b3b72cb..6b239e7 100644 --- a/src/main/java/umc/meme/shop/domain/favorite/dto/response/FavoritePortfolioResponsePageDto.java +++ b/src/main/java/umc/meme/shop/domain/favorite/dto/response/FavoritePortfolioResponsePageDto.java @@ -4,6 +4,8 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import org.springframework.data.domain.Page; +import umc.meme.shop.domain.favorite.entity.FavoritePortfolio; import umc.meme.shop.domain.portfolio.dto.response.SimplePortfolioDto; import java.util.List; @@ -18,4 +20,18 @@ public class FavoritePortfolioResponsePageDto { private int pageSize; //페이지 크기 private int totalNumber; //전체 메이크업 개수 private int totalPage; //전체 페이지 개수 + + public static FavoritePortfolioResponsePageDto from(Page page){ + List content = page.stream() + .map(SimplePortfolioDto::from) + .toList(); + + return FavoritePortfolioResponsePageDto.builder() + .content(content) + .pageSize(page.getSize()) + .currentPage(page.getNumber()) + .totalNumber(page.getNumberOfElements()) + .totalPage(page.getTotalPages()) + .build(); + } } diff --git a/src/main/java/umc/meme/shop/domain/model/dto/request/ModelProfileDto.java b/src/main/java/umc/meme/shop/domain/model/dto/request/ModelProfileDto.java index 0a0f166..af8d9ff 100644 --- a/src/main/java/umc/meme/shop/domain/model/dto/request/ModelProfileDto.java +++ b/src/main/java/umc/meme/shop/domain/model/dto/request/ModelProfileDto.java @@ -7,7 +7,7 @@ @Data public class ModelProfileDto { - private Long modelId; + private Long userId; private String profileImg; private String nickname; private Gender gender; diff --git a/src/main/java/umc/meme/shop/domain/model/entity/Model.java b/src/main/java/umc/meme/shop/domain/model/entity/Model.java index ed70093..d9cdf08 100644 --- a/src/main/java/umc/meme/shop/domain/model/entity/Model.java +++ b/src/main/java/umc/meme/shop/domain/model/entity/Model.java @@ -9,10 +9,12 @@ import umc.meme.shop.domain.favorite.entity.FavoritePortfolio; import umc.meme.shop.domain.model.dto.request.ModelProfileDto; import umc.meme.shop.global.enums.PersonalColor; +import umc.meme.shop.global.enums.Provider; import umc.meme.shop.global.enums.SkinType; import umc.meme.shop.domain.reservation.entity.Reservation; import umc.meme.shop.domain.review.entity.Review; import umc.meme.shop.domain.user.User; +import umc.meme.shop.global.enums.UserStatus; import java.util.Date; import java.util.List; @@ -24,9 +26,6 @@ @Entity public class Model extends User { - @Column(nullable = true, length = 500) - private String introduction; - @Enumerated(EnumType.STRING) @Column(nullable = false) private SkinType skinType; @@ -35,8 +34,6 @@ public class Model extends User { @Column(nullable = false) private PersonalColor personalColor; - private Date inactive; - @OneToMany(cascade = CascadeType.ALL, mappedBy = "model") private List favoritePortfolioList; @@ -81,4 +78,25 @@ public void updateReservationList(Reservation reservation){ public void updateReviewList(Review review){ this.reviewList.add(review); } + + + //temp create model builder + public static Model from(ModelProfileDto dto){ + return Model.builder() + .profileImg(dto.getProfileImg()) + .nickname(dto.getNickname()) + .gender(dto.getGender()) + .skinType(dto.getSkinType()) + .personalColor(dto.getPersonalColor()) + .build(); + } + + public void tempMethod(){ + this.username = "name"; + this.email=""; + this.password=""; + this.role="ARTIST"; + this.userStatus = UserStatus.ACTIVE; + this.provider = Provider.KAKAO; + } } diff --git a/src/main/java/umc/meme/shop/domain/model/service/ModelService.java b/src/main/java/umc/meme/shop/domain/model/service/ModelService.java index 4ae3e79..b2403ba 100644 --- a/src/main/java/umc/meme/shop/domain/model/service/ModelService.java +++ b/src/main/java/umc/meme/shop/domain/model/service/ModelService.java @@ -4,7 +4,6 @@ import lombok.RequiredArgsConstructor; import org.springframework.data.domain.*; import org.springframework.stereotype.Service; -import umc.meme.shop.domain.artist.converter.ArtistConverter; import umc.meme.shop.domain.artist.dto.response.SimpleArtistDto; import umc.meme.shop.domain.artist.entity.Artist; import umc.meme.shop.domain.artist.repository.ArtistRepository; @@ -19,18 +18,16 @@ import umc.meme.shop.domain.model.dto.request.ModelProfileDto; import umc.meme.shop.domain.model.entity.Model; import umc.meme.shop.domain.model.repository.ModelRepository; -import umc.meme.shop.domain.portfolio.converter.PortfolioConverter; import umc.meme.shop.domain.portfolio.dto.response.PortfolioPageDto; import umc.meme.shop.domain.portfolio.dto.response.SimplePortfolioDto; import umc.meme.shop.domain.portfolio.entity.Portfolio; import umc.meme.shop.global.enums.Category; import umc.meme.shop.domain.portfolio.repository.PortfolioRepository; import umc.meme.shop.global.ErrorStatus; -import umc.meme.shop.global.enums.Provider; import umc.meme.shop.global.exception.GlobalException; -import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; @Service @RequiredArgsConstructor @@ -44,24 +41,15 @@ public class ModelService { /**temp model create method**/ @Transactional public void createModel(ModelProfileDto dto){ - Model model = Model.builder() - .profileImg(dto.getProfileImg()) - .nickname(dto.getNickname()) - .introduction("") - .email("") - .userName("") - .gender(dto.getGender()) - .skinType(dto.getSkinType()) - .personalColor(dto.getPersonalColor()) - .provider(Provider.KAKAO) - .build(); + Model model = Model.from(dto); + model.tempMethod(); modelRepository.save(model); } //모델 프로필 관리 @Transactional public void updateModelProfile(ModelProfileDto request){ - Model model = modelRepository.findById(request.getModelId()) + Model model = modelRepository.findById(request.getUserId()) .orElseThrow(() -> new GlobalException(ErrorStatus.NOT_EXIST_MODEL)); model.updateModel(request); @@ -76,23 +64,16 @@ public FavoriteArtistPageResponseDto getFavoriteArtist(Long modelId, int page){ //paging List favoriteArtistList = model.getFavoriteArtistList(); - Pageable pageable = PageRequest.of(page, 30); - int start = (int) pageable.getOffset(); - int end = Math.min((start + pageable.getPageSize()), favoriteArtistList.size()); - - Page favoriteArtistPage = new PageImpl<>(favoriteArtistList.subList(start, end), - pageable, favoriteArtistList.size()); - - List content = new ArrayList<>(); - for(int i=0; i new GlobalException(ErrorStatus.NOT_EXIST_ARTIST)); - SimpleArtistDto dto = SimpleArtistDto.from(artist); - content.add(dto); - } + Page favoriteArtistPage = getPage(page, favoriteArtistList); + + //관심 아티스트 리스트 + List content = favoriteArtistPage.getContent().stream() + .map(favoriteArtist -> artistRepository.findById(favoriteArtist.getArtistId()) + .orElseThrow(() -> new GlobalException(ErrorStatus.NOT_EXIST_ARTIST))) + .map(SimpleArtistDto::from) + .collect(Collectors.toList()); - return ArtistConverter.favoriteArtistPageConverter(favoriteArtistPage, content); + return FavoriteArtistPageResponseDto.from(favoriteArtistPage, content); } //관심 메이크업 조회 @@ -101,17 +82,11 @@ public FavoritePortfolioResponsePageDto getFavoritePortfolio(Long modelId, int p Model model = modelRepository.findById(modelId) .orElseThrow(() -> new GlobalException(ErrorStatus.NOT_EXIST_MODEL)); - //page - List favoritePortfolioList = model.getFavoritePortfolioList(); - Pageable pageable = PageRequest.of(page, 30); - int start = (int) pageable.getOffset(); - int end = Math.min((start + pageable.getPageSize()), favoritePortfolioList.size()); - //list를 page로 변환 - Page favoritePortfolioPage = new PageImpl<>(favoritePortfolioList.subList(start, end), - pageable, favoritePortfolioList.size()); + List favoritePortfolioList = model.getFavoritePortfolioList(); + Page favoritePortfolioPage = getPage(page, favoritePortfolioList); - return PortfolioConverter.favoritePortfolioPageConverter(favoritePortfolioPage); + return FavoritePortfolioResponsePageDto.from(favoritePortfolioPage); } //관심 아티스트 추가 @@ -188,18 +163,14 @@ public PortfolioPageDto search(String query, int page, String sortBy){ //query 검색 Page portfolioPage = portfolioRepository.search(query, pageable); - - if(portfolioPage.getContent().isEmpty()) - throw new GlobalException(ErrorStatus.SEARCH_NOT_FOUNT); - - return PortfolioConverter.portfolioPageConverter(portfolioPage); + return PortfolioPageDto.from(portfolioPage); } //카테고리 검색 public PortfolioPageDto searchCategory(Category category, int page, String sortBy){ Pageable pageable = setPageRequest(page, sortBy); Page portfolioPage = portfolioRepository.findByCategory(category, pageable); - return PortfolioConverter.portfolioPageConverter(portfolioPage); + return PortfolioPageDto.from(portfolioPage); } //관심 아티스트 검색 @@ -209,16 +180,36 @@ public PortfolioPageDto searchArtist(Long artistId, int page, String sortBy){ Pageable pageable = setPageRequest(page, sortBy); Page portfolioPage = portfolioRepository.findByArtist(artist, pageable); - return PortfolioConverter.portfolioPageConverter(portfolioPage); + return PortfolioPageDto.from(portfolioPage); } //전체 조회 public PortfolioPageDto searchAll(int page, String sortBy){ Pageable pageable = setPageRequest(page, sortBy); Page portfolioPage = portfolioRepository.findAllNotBlocked(pageable); - return PortfolioConverter.portfolioPageConverter(portfolioPage); + return PortfolioPageDto.from(portfolioPage); } + /**recommend**/ + //리뷰 많은 순 포트폴리오 추천 + public List recommendReview(){ + Pageable pageable = setPageRequest(0, "review"); + Page portfolioList = portfolioRepository.findAllNotBlocked(pageable); + + return portfolioList.getContent().stream() + .map(SimplePortfolioDto::from) + .toList(); + } + + //최신 등록 순 포트폴리오 추천 + public List recommendRecent(){ + Pageable pageable = setPageRequest(0, "recent"); + Page portfolioList = portfolioRepository.findAllNotBlocked(pageable); + + return portfolioList.getContent().stream() + .map(SimplePortfolioDto::from) + .toList(); + } //검색하기 정렬 기준 설정 private Pageable setPageRequest(int page, String sortBy){ @@ -234,26 +225,22 @@ else if(sortBy.equals("recent")) sort = Sort.by("createdAt").descending(); else throw new GlobalException(ErrorStatus.INVALID_SORT_CRITERIA); - Sort finalSort = sort.and(Sort.by("averageStars").descending()); + //별점 높은 순 정렬 추가 + Sort finalSort = sort.and(Sort.by("averageStars").descending()); return PageRequest.of(page, 30, finalSort); } - /**recommend**/ - public List recommendReview(){ - Pageable pageable = setPageRequest(0, "review"); - Page portfolioList = portfolioRepository.findAllNotBlocked(pageable); - return portfolioList.getContent().stream() - .map(SimplePortfolioDto::from) - .toList(); - } + //TODO: change List -> Page + private Page getPage(int page, List list){ + Pageable pageable = PageRequest.of(page, 30); - public List recommendRecent(){ - Pageable pageable = setPageRequest(0, "recent"); - Page portfolioList = portfolioRepository.findAllNotBlocked(pageable); - return portfolioList.getContent().stream() - .map(SimplePortfolioDto::from) - .toList(); + int start = (int) pageable.getOffset(); + int end = Math.min((start + pageable.getPageSize()), list.size()); + + //list를 page로 변환 + return new PageImpl<>(list.subList(start, end), + pageable, list.size()); } } diff --git a/src/main/java/umc/meme/shop/domain/mypage/dto/response/MypageDetailDto.java b/src/main/java/umc/meme/shop/domain/mypage/dto/response/MypageDetailDto.java index 64bf084..53466d2 100644 --- a/src/main/java/umc/meme/shop/domain/mypage/dto/response/MypageDetailDto.java +++ b/src/main/java/umc/meme/shop/domain/mypage/dto/response/MypageDetailDto.java @@ -23,7 +23,7 @@ public static MypageDetailDto from(User user){ return MypageDetailDto.builder() .profileImg(user.getProfileImg()) .nickname(user.getNickname()) - .name(user.getUserName()) + .name(user.getUsername()) .gender(user.getGender()) .email(user.getEmail()) .build(); diff --git a/src/main/java/umc/meme/shop/domain/mypage/dto/response/MypageTosDto.java b/src/main/java/umc/meme/shop/domain/mypage/dto/response/MypageTosDto.java deleted file mode 100644 index 10d45e6..0000000 --- a/src/main/java/umc/meme/shop/domain/mypage/dto/response/MypageTosDto.java +++ /dev/null @@ -1,10 +0,0 @@ -package umc.meme.shop.domain.mypage.dto.response; - -import lombok.Builder; -import lombok.Data; - -@Builder -@Data -public class MypageTosDto { - private String tos; -} diff --git a/src/main/java/umc/meme/shop/domain/mypage/service/MypageService.java b/src/main/java/umc/meme/shop/domain/mypage/service/MypageService.java index c44088a..63705f3 100644 --- a/src/main/java/umc/meme/shop/domain/mypage/service/MypageService.java +++ b/src/main/java/umc/meme/shop/domain/mypage/service/MypageService.java @@ -45,7 +45,6 @@ public List getInquiry(Long userId) { .orElseThrow(() -> new GlobalException(ErrorStatus.NOT_EXIST_USER)); List inquiryList = user.getInquiryList(); - return inquiryList.stream() .map(MypageInquiryResponseDto::from) .toList(); diff --git a/src/main/java/umc/meme/shop/domain/portfolio/converter/PortfolioConverter.java b/src/main/java/umc/meme/shop/domain/portfolio/converter/PortfolioConverter.java deleted file mode 100644 index 94b4c5e..0000000 --- a/src/main/java/umc/meme/shop/domain/portfolio/converter/PortfolioConverter.java +++ /dev/null @@ -1,46 +0,0 @@ -package umc.meme.shop.domain.portfolio.converter; - -import org.springframework.data.domain.Page; -import umc.meme.shop.domain.favorite.dto.response.FavoritePortfolioResponsePageDto; -import umc.meme.shop.domain.favorite.entity.FavoritePortfolio; -import umc.meme.shop.domain.portfolio.dto.response.PortfolioDto; -import umc.meme.shop.domain.portfolio.dto.response.PortfolioPageDto; -import umc.meme.shop.domain.portfolio.dto.response.SimplePortfolioDto; -import umc.meme.shop.domain.portfolio.entity.Portfolio; - -import java.util.List; - -public class PortfolioConverter { - - public static FavoritePortfolioResponsePageDto favoritePortfolioPageConverter(Page page){ - - List content = page.stream() - .map(SimplePortfolioDto::from) - .toList(); - - return FavoritePortfolioResponsePageDto.builder() - .content(content) - .pageSize(page.getSize()) - .currentPage(page.getNumber()) - .totalNumber(page.getNumberOfElements()) - .totalPage(page.getTotalPages()) - .build(); - } - - public static PortfolioPageDto portfolioPageConverter(Page page){ - - List content = page.stream() - .map(PortfolioDto::from) - .toList(); - - return PortfolioPageDto.builder() - .content(content) - .pageSize(page.getSize()) - .currentPage(page.getNumber()) - .totalNumber(page.getNumberOfElements()) - .totalPage(page.getTotalPages()) - .build(); - } -} - - diff --git a/src/main/java/umc/meme/shop/domain/portfolio/dto/response/PortfolioDto.java b/src/main/java/umc/meme/shop/domain/portfolio/dto/response/PortfolioDto.java index ae17eef..a34a8c6 100644 --- a/src/main/java/umc/meme/shop/domain/portfolio/dto/response/PortfolioDto.java +++ b/src/main/java/umc/meme/shop/domain/portfolio/dto/response/PortfolioDto.java @@ -9,6 +9,7 @@ import umc.meme.shop.domain.favorite.entity.FavoritePortfolio; import umc.meme.shop.domain.portfolio.entity.Portfolio; import umc.meme.shop.global.enums.Category; +import umc.meme.shop.global.enums.Region; import java.util.List; @@ -33,7 +34,7 @@ public class PortfolioDto { private String shopLocation; //샵 위치 - private List region; //활동 가능 지역 + private List region; //활동 가능 지역 private Boolean isBlock; @@ -50,7 +51,7 @@ public static PortfolioDto from(Portfolio portfolio) { // PortfolioImg 리스트를 PortfolioImgDto 리스트로 변환 List portfolioImgDtoList = portfolio.getPortfolioImgList() .stream() - .map(portfolioImg -> new PortfolioImgDto(portfolioImg.getPortfolioImgId(), portfolioImg.getSrc(), false)) + .map(PortfolioImgDto::from) .toList(); return PortfolioDto.builder() diff --git a/src/main/java/umc/meme/shop/domain/portfolio/dto/response/PortfolioImgDto.java b/src/main/java/umc/meme/shop/domain/portfolio/dto/response/PortfolioImgDto.java index fb3e515..f887ed5 100644 --- a/src/main/java/umc/meme/shop/domain/portfolio/dto/response/PortfolioImgDto.java +++ b/src/main/java/umc/meme/shop/domain/portfolio/dto/response/PortfolioImgDto.java @@ -1,14 +1,16 @@ package umc.meme.shop.domain.portfolio.dto.response; import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import umc.meme.shop.domain.portfolio.entity.PortfolioImg; -import java.util.List; @Data @NoArgsConstructor @AllArgsConstructor +@Builder public class PortfolioImgDto { private Long portfolioImgId; @@ -16,6 +18,13 @@ public class PortfolioImgDto { private String portfolioImgSrc; //삭제 여부 - private boolean isDelete = false; + + public static PortfolioImgDto from(PortfolioImg img){ + return PortfolioImgDto.builder() + .portfolioImgId(img.getPortfolioImgId()) + .portfolioImgSrc(img.getSrc()) + .isDelete(false) + .build(); + } } diff --git a/src/main/java/umc/meme/shop/domain/portfolio/dto/response/PortfolioPageDto.java b/src/main/java/umc/meme/shop/domain/portfolio/dto/response/PortfolioPageDto.java index 16d6cad..be6d876 100644 --- a/src/main/java/umc/meme/shop/domain/portfolio/dto/response/PortfolioPageDto.java +++ b/src/main/java/umc/meme/shop/domain/portfolio/dto/response/PortfolioPageDto.java @@ -4,6 +4,10 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import org.springframework.data.domain.Page; +import umc.meme.shop.domain.portfolio.entity.Portfolio; +import umc.meme.shop.global.ErrorStatus; +import umc.meme.shop.global.exception.GlobalException; import java.util.List; @@ -17,4 +21,22 @@ public class PortfolioPageDto { private int pageSize; //페이지 크기 private int totalNumber; //전체 메이크업 개수 private int totalPage; //전체 페이지 개수 + + public static PortfolioPageDto from(Page page){ + //검색 결과가 없을 시 + if(page.getContent().isEmpty()) + throw new GlobalException(ErrorStatus.SEARCH_NOT_FOUNT); + + List content = page.stream() + .map(PortfolioDto::from) + .toList(); + + return PortfolioPageDto.builder() + .content(content) + .pageSize(page.getSize()) + .currentPage(page.getNumber()) + .totalNumber(page.getNumberOfElements()) + .totalPage(page.getTotalPages()) + .build(); + } } diff --git a/src/main/java/umc/meme/shop/domain/portfolio/entity/Portfolio.java b/src/main/java/umc/meme/shop/domain/portfolio/entity/Portfolio.java index a6d2238..d2df89e 100644 --- a/src/main/java/umc/meme/shop/domain/portfolio/entity/Portfolio.java +++ b/src/main/java/umc/meme/shop/domain/portfolio/entity/Portfolio.java @@ -79,9 +79,11 @@ public void updatePortfolio(UpdatePortfolioDto request) { public void updateReviewList(Review review){ this.reviewList.add(review); + //별점 업데이트 + updateAverageStars(); } - public void updateAverageStars(){ + private void updateAverageStars(){ int count = this.reviewList.size(); if(count == 0) { this.averageStars = "0.00"; 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 a8bcefb..befa7de 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 @@ -9,7 +9,6 @@ import org.springframework.stereotype.Service; import umc.meme.shop.domain.artist.entity.Artist; import umc.meme.shop.domain.artist.repository.ArtistRepository; -import umc.meme.shop.domain.portfolio.converter.PortfolioConverter; import umc.meme.shop.domain.portfolio.dto.request.CreatePortfolioDto; import umc.meme.shop.domain.portfolio.dto.request.UpdatePortfolioDto; import umc.meme.shop.domain.portfolio.dto.response.PortfolioDto; @@ -71,16 +70,10 @@ public PortfolioPageDto getPortfolio(Long artistId, int page) { //isblock이면 리스트에서 제거 portfolioList.removeIf(Portfolio::isBlock); - //page로 mapping - Pageable pageable = PageRequest.of(page, 30); - int start = (int) pageable.getOffset(); - int end = Math.min((start + pageable.getPageSize()), portfolioList.size()); - //list를 page로 변환 - Page portfolioPage = new PageImpl<>(portfolioList.subList(start, end), - pageable, portfolioList.size()); + Page portfolioPage = getPage(page, portfolioList); - return PortfolioConverter.portfolioPageConverter(portfolioPage); + return PortfolioPageDto.from(portfolioPage); } // 포트폴리오 하나만 조회 @@ -134,5 +127,16 @@ public void updatePortfolio(UpdatePortfolioDto request) { portfolio.updatePortfolio(request); } + //TODO: change List -> Page + private Page getPage(int page, List list){ + Pageable pageable = PageRequest.of(page, 30); + + int start = (int) pageable.getOffset(); + int end = Math.min((start + pageable.getPageSize()), list.size()); + + //list를 page로 변환 + return new PageImpl<>(list.subList(start, end), + pageable, list.size()); + } } diff --git a/src/main/java/umc/meme/shop/domain/reservation/dto/response/ArtistLocationDto.java b/src/main/java/umc/meme/shop/domain/reservation/dto/response/ArtistLocationDto.java index fce59e4..15eddb2 100644 --- a/src/main/java/umc/meme/shop/domain/reservation/dto/response/ArtistLocationDto.java +++ b/src/main/java/umc/meme/shop/domain/reservation/dto/response/ArtistLocationDto.java @@ -6,6 +6,7 @@ import lombok.NoArgsConstructor; import umc.meme.shop.domain.artist.entity.Artist; import umc.meme.shop.global.enums.MakeupLocation; +import umc.meme.shop.global.enums.Region; import java.util.List; @@ -16,7 +17,7 @@ public class ArtistLocationDto { private MakeupLocation makeupLocation; //샵 재직 여부 private String shopLocation; //샵 위치 - private List region; //활동 가능 지역 + private List region; //활동 가능 지역 public static ArtistLocationDto from(Artist artist){ return ArtistLocationDto.builder() diff --git a/src/main/java/umc/meme/shop/domain/reservation/dto/response/ArtistTimeDto.java b/src/main/java/umc/meme/shop/domain/reservation/dto/response/ArtistTimeDto.java index 9e93835..4027354 100644 --- a/src/main/java/umc/meme/shop/domain/reservation/dto/response/ArtistTimeDto.java +++ b/src/main/java/umc/meme/shop/domain/reservation/dto/response/ArtistTimeDto.java @@ -14,4 +14,11 @@ public class ArtistTimeDto { private DayOfWeek availableDayOfWeek; private Times availableTime; + + public static ArtistTimeDto from(DayOfWeek dayOfWeek, Times availableTime){ + return ArtistTimeDto.builder() + .availableDayOfWeek(dayOfWeek) + .availableTime(availableTime) + .build(); + } } diff --git a/src/main/java/umc/meme/shop/domain/reservation/service/ReservationService.java b/src/main/java/umc/meme/shop/domain/reservation/service/ReservationService.java index 23bab8c..5954695 100644 --- a/src/main/java/umc/meme/shop/domain/reservation/service/ReservationService.java +++ b/src/main/java/umc/meme/shop/domain/reservation/service/ReservationService.java @@ -51,21 +51,9 @@ public List getArtistTime(Long artistId) { Map availableDayOfWeekAndTime = artist.getAvailableDayOfWeekAndTime(); - List artistTimeList = new ArrayList<>(); - - for (Map.Entry entry : availableDayOfWeekAndTime.entrySet()) { - DayOfWeek dayOfWeek = entry.getKey(); - Times availableTime = entry.getValue(); - - ArtistTimeDto artistTimeDto = ArtistTimeDto.builder() - .availableDayOfWeek(dayOfWeek) - .availableTime(availableTime) - .build(); - - artistTimeList.add(artistTimeDto); - } - - return artistTimeList; + return availableDayOfWeekAndTime.entrySet().stream() + .map(entry -> ArtistTimeDto.from(entry.getKey(), entry.getValue())) + .collect(Collectors.toList()); } //예약하기 diff --git a/src/main/java/umc/meme/shop/domain/review/converter/ReviewConverter.java b/src/main/java/umc/meme/shop/domain/review/converter/ReviewConverter.java deleted file mode 100644 index a018fb8..0000000 --- a/src/main/java/umc/meme/shop/domain/review/converter/ReviewConverter.java +++ /dev/null @@ -1,27 +0,0 @@ -package umc.meme.shop.domain.review.converter; - -import org.springframework.data.domain.Page; -import umc.meme.shop.domain.review.dto.request.ReviewDto; -import umc.meme.shop.domain.review.dto.response.ReviewListPageDto; -import umc.meme.shop.domain.review.dto.response.ReviewResponseDto; -import umc.meme.shop.domain.review.entity.Review; - -import java.util.List; - -public class ReviewConverter { - - public static ReviewListPageDto reviewPageConverter(Page page) { - - List content = page.stream() - .map(ReviewResponseDto::from) - .toList(); - - return ReviewListPageDto.builder() - .content(content) - .pageSize(page.getSize()) - .currentPage(page.getNumber()) - .totalNumber(page.getNumberOfElements()) - .totalPage(page.getTotalPages()) - .build(); - } -} diff --git a/src/main/java/umc/meme/shop/domain/review/dto/response/ReviewImgDto.java b/src/main/java/umc/meme/shop/domain/review/dto/response/ReviewImgDto.java index 114c4c7..9d2edae 100644 --- a/src/main/java/umc/meme/shop/domain/review/dto/response/ReviewImgDto.java +++ b/src/main/java/umc/meme/shop/domain/review/dto/response/ReviewImgDto.java @@ -1,14 +1,26 @@ package umc.meme.shop.domain.review.dto.response; import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import umc.meme.shop.domain.review.entity.ReviewImg; @Data @NoArgsConstructor @AllArgsConstructor +@Builder public class ReviewImgDto { private Long ReviewImgId; private String reviewImgSrc; private boolean isDelete = false; + + public static ReviewImgDto from(ReviewImg img){ + return ReviewImgDto.builder() + .ReviewImgId(img.getReviewImgId()) + .reviewImgSrc(img.getSrc()) + .isDelete(false) + .build(); + } + } diff --git a/src/main/java/umc/meme/shop/domain/review/dto/response/ReviewListPageDto.java b/src/main/java/umc/meme/shop/domain/review/dto/response/ReviewListPageDto.java index f96790c..c808b69 100644 --- a/src/main/java/umc/meme/shop/domain/review/dto/response/ReviewListPageDto.java +++ b/src/main/java/umc/meme/shop/domain/review/dto/response/ReviewListPageDto.java @@ -4,7 +4,10 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import org.springframework.data.domain.Page; +import umc.meme.shop.domain.review.entity.Review; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -19,4 +22,29 @@ public class ReviewListPageDto { private int pageSize; //페이지 크기 private int totalNumber; //전체 메이크업 개수 private int totalPage; //전체 페이지 개수 + + public static ReviewListPageDto from(Page page){ + List content = page.stream() + .map(ReviewResponseDto::from) + .toList(); + + return ReviewListPageDto.builder() + .content(content) + .starStatus(setStarStatus(page.getContent())) //별점 현황 + .pageSize(page.getSize()) + .currentPage(page.getNumber()) + .totalNumber(page.getNumberOfElements()) + .totalPage(page.getTotalPages()) + .build(); + } + + private static Map setStarStatus(List list){ + + Map starStatus = new HashMap<>(Map.of(5, 0, 4, 0, 3, 0, 2, 0, 1, 0)); + for (Review review : list) { + int star = review.getStar(); + starStatus.put(star, starStatus.get(star) + 1); + } + return starStatus; + } } diff --git a/src/main/java/umc/meme/shop/domain/review/dto/response/ReviewListResponseDto.java b/src/main/java/umc/meme/shop/domain/review/dto/response/ReviewListResponseDto.java deleted file mode 100644 index e5fd828..0000000 --- a/src/main/java/umc/meme/shop/domain/review/dto/response/ReviewListResponseDto.java +++ /dev/null @@ -1,27 +0,0 @@ -package umc.meme.shop.domain.review.dto.response; - - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import umc.meme.shop.domain.review.entity.Review; - -import java.util.List; -import java.util.Map; - -@Getter -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class ReviewListResponseDto { - private List reviewResponseDtoList; - private Map starStatus; - - public static ReviewListResponseDto from(List reviewResponseDtoList, Map starStatus) { - return ReviewListResponseDto.builder() - .reviewResponseDtoList(reviewResponseDtoList) - .starStatus(starStatus) - .build(); - } -} diff --git a/src/main/java/umc/meme/shop/domain/review/dto/response/ReviewResponseDto.java b/src/main/java/umc/meme/shop/domain/review/dto/response/ReviewResponseDto.java index a9aba9d..6b78b51 100644 --- a/src/main/java/umc/meme/shop/domain/review/dto/response/ReviewResponseDto.java +++ b/src/main/java/umc/meme/shop/domain/review/dto/response/ReviewResponseDto.java @@ -21,7 +21,7 @@ public class ReviewResponseDto { public static ReviewResponseDto from(Review review){ List reviewImgDtoList = review.getReviewImgList() .stream() - .map(reviewImg -> new ReviewImgDto(reviewImg.getReviewImgId(), reviewImg.getSrc(), false)) + .map(ReviewImgDto::from) .toList(); return ReviewResponseDto.builder() diff --git a/src/main/java/umc/meme/shop/domain/review/service/ReviewService.java b/src/main/java/umc/meme/shop/domain/review/service/ReviewService.java index e36e099..1eb9ce3 100644 --- a/src/main/java/umc/meme/shop/domain/review/service/ReviewService.java +++ b/src/main/java/umc/meme/shop/domain/review/service/ReviewService.java @@ -14,7 +14,6 @@ import umc.meme.shop.domain.reservation.entity.Reservation; import umc.meme.shop.global.enums.Status; import umc.meme.shop.domain.reservation.repository.ReservationRepository; -import umc.meme.shop.domain.review.converter.ReviewConverter; import umc.meme.shop.domain.review.dto.request.DeleteReviewDto; import umc.meme.shop.domain.review.dto.request.ReviewDto; import umc.meme.shop.domain.review.dto.response.ReviewListPageDto; @@ -27,10 +26,7 @@ import umc.meme.shop.global.exception.GlobalException; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; @Service @RequiredArgsConstructor @@ -39,7 +35,6 @@ public class ReviewService { private final ReviewRepository reviewRepository; private final ReservationRepository reservationRepository; private final PortfolioRepository portfolioRepository; - private final ReviewImgRepository reviewImgRepository; //리뷰 작성 @Transactional @@ -74,7 +69,6 @@ public void createReview(ReviewDto reviewDto){ } portfolio.updateReviewList(review); - portfolio.updateAverageStars(); model.updateReviewList(review); reviewRepository.save(review); @@ -85,6 +79,7 @@ public void createReview(ReviewDto reviewDto){ public List getMyReview(Long modelId){ Model model = modelRepository.findById(modelId) .orElseThrow(() -> new GlobalException(ErrorStatus.NOT_EXIST_MODEL)); + //리뷰 리스트 조회 List reviewList = reviewRepository.findByModel(model); return reviewList.stream() @@ -97,31 +92,11 @@ public ReviewListPageDto getReviewList(Long portfolioId, int page) { Portfolio portfolio = portfolioRepository.findById(portfolioId) .orElseThrow(() -> new GlobalException(ErrorStatus.NOT_EXIST_PORTFOLIO)); - List reviewList = portfolio.getReviewList(); - - // page로 mapping - Pageable pageable = PageRequest.of(page, 30); - int start = (int) pageable.getOffset(); - int end = Math.min((start + pageable.getPageSize()), reviewList.size()); - // list를 page로 변환 - List pagedReviewList = reviewList.subList(start, end); - Page reviewPage = new PageImpl<>(pagedReviewList, pageable, reviewList.size()); - - // 별점 현황 - Map starStatus = new HashMap<>(Map.of(5, 0, 4, 0, 3, 0, 2, 0, 1, 0)); - for (Review review : pagedReviewList) { - int star = review.getStar(); - starStatus.put(star, starStatus.get(star) + 1); - } - - // ReviewConverter를 사용하여 ReviewListPageDto 생성 - ReviewListPageDto pageDto = ReviewConverter.reviewPageConverter(reviewPage); - - // 별점 현황 추가 - pageDto.setStarStatus(starStatus); + List reviewList = portfolio.getReviewList(); + Page reviewPage = getPage(page, reviewList); - return pageDto; + return ReviewListPageDto.from(reviewPage); } //리뷰 삭제 @@ -136,4 +111,16 @@ public void deleteReview(DeleteReviewDto reviewDto){ reviewRepository.delete(review); } + + //TODO: change List -> Page + private Page getPage(int page, List list){ + Pageable pageable = PageRequest.of(page, 30); + + int start = (int) pageable.getOffset(); + int end = Math.min((start + pageable.getPageSize()), list.size()); + + //list를 page로 변환 + return new PageImpl<>(list.subList(start, end), + pageable, list.size()); + } } diff --git a/src/main/java/umc/meme/shop/domain/user/User.java b/src/main/java/umc/meme/shop/domain/user/User.java index b8ae4e6..97ccb0d 100644 --- a/src/main/java/umc/meme/shop/domain/user/User.java +++ b/src/main/java/umc/meme/shop/domain/user/User.java @@ -1,19 +1,21 @@ package umc.meme.shop.domain.user; import jakarta.persistence.*; +import jakarta.validation.constraints.NotNull; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.annotation.LastModifiedDate; -import umc.meme.shop.domain.common.BaseEntity; import umc.meme.shop.global.enums.Gender; import umc.meme.shop.domain.mypage.entity.Inquiry; +import java.time.LocalDate; import java.time.LocalDateTime; import java.util.List; import umc.meme.shop.global.enums.Provider; +import umc.meme.shop.global.enums.UserStatus; @SuperBuilder @Getter @@ -25,30 +27,50 @@ public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "user_id") - protected Long userId; + private Long userId; - @Column(nullable = false) + @NotNull protected String profileImg; - @Column(nullable = false, length = 40) + @NotNull + @Column(length = 40) protected String nickname; - @Column(nullable = false, length = 20) - protected String userName; + @NotNull + @Column(length = 20) + protected String username; @Enumerated(EnumType.STRING) - @Column(nullable = false) + @Column(nullable = true) protected Gender gender; - @Column(nullable = false, length = 40) + @NotNull + @Column(length = 40) protected String email; + @NotNull + protected String password; + + @NotNull + protected String role; + @CreatedDate private LocalDateTime createdAt; @LastModifiedDate private LocalDateTime updatedAt; + @Column(nullable = true) + private LocalDate inactiveDate; + + @Enumerated(EnumType.STRING) + @NotNull + protected UserStatus userStatus; + + @Enumerated(EnumType.STRING) + @NotNull + protected Provider provider; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "user") protected List inquiryList; @@ -56,7 +78,4 @@ public void updateInquiryList(Inquiry inquiry) { this.inquiryList.add(inquiry); } - @Enumerated(EnumType.STRING) - @Column(nullable = false) - protected Provider provider; } diff --git a/src/main/java/umc/meme/shop/global/enums/PersonalColor.java b/src/main/java/umc/meme/shop/global/enums/PersonalColor.java index fe27ae8..5ea30ad 100644 --- a/src/main/java/umc/meme/shop/global/enums/PersonalColor.java +++ b/src/main/java/umc/meme/shop/global/enums/PersonalColor.java @@ -1,5 +1,5 @@ package umc.meme.shop.global.enums; public enum PersonalColor { - SPRING, SUMMER, AUTUMN, WINTER + SPRING, SUMMER, AUTUMN, WINTER, UNKNOWN } diff --git a/src/main/java/umc/meme/shop/global/enums/SkinType.java b/src/main/java/umc/meme/shop/global/enums/SkinType.java index 942d594..8e32aa9 100644 --- a/src/main/java/umc/meme/shop/global/enums/SkinType.java +++ b/src/main/java/umc/meme/shop/global/enums/SkinType.java @@ -1,5 +1,5 @@ package umc.meme.shop.global.enums; public enum SkinType { - DRY, COMMON, OILY, COMBINATIONAL + DRY, COMMON, OILY, COMBINATIONAL, UNKNOWN } diff --git a/src/main/java/umc/meme/shop/global/enums/UserStatus.java b/src/main/java/umc/meme/shop/global/enums/UserStatus.java new file mode 100644 index 0000000..778aa03 --- /dev/null +++ b/src/main/java/umc/meme/shop/global/enums/UserStatus.java @@ -0,0 +1,5 @@ +package umc.meme.shop.global.enums; + +public enum UserStatus { + ACTIVE, INACTIVE, OUT +} diff --git a/src/test/java/umc/meme/shop/ArtistTest.java b/src/test/java/umc/meme/shop/ArtistTest.java index 860e6da..18935ed 100644 --- a/src/test/java/umc/meme/shop/ArtistTest.java +++ b/src/test/java/umc/meme/shop/ArtistTest.java @@ -16,14 +16,14 @@ public class ArtistTest { @Test void createArtist(){ - List categories = List.of(new String[]{Category.DAILY.getValue(), Category.PARTY.getValue()}); - List regions = List.of(new String[]{Region.DONGJAK.getValue(), Region.GANGNAM.getValue()}); + List categories = List.of(new Category[]{Category.DAILY, Category.PARTY}); + List regions = List.of(new Region[]{Region.DONGJAK, Region.GANGNAM}); Artist artist1 = Artist.builder() .availableDayOfWeekAndTime(null) .gender(Gender.FEMALE) .specialization(categories) .email("") - .userName("testName") + .username("testName") .nickname("testNickName") .makeupLocation(MakeupLocation.SHOP) .region(regions) @@ -41,7 +41,7 @@ void createArtist(){ .profileImg("") .specialization(categories) .email("") - .userName("test2Name") + .username("test2Name") .nickname("test2NickName") .makeupLocation(MakeupLocation.SHOP) .region(regions) @@ -58,7 +58,7 @@ void createArtist(){ .gender(Gender.FEMALE) .specialization(categories) .email("") - .userName("test3Name") + .username("test3Name") .nickname("test3NickName") .makeupLocation(MakeupLocation.SHOP) .region(regions)