-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Chore] 관심 포트폴리오, 관심 아티스트 설정 여부 리턴
- Loading branch information
Showing
10 changed files
with
175 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/java/umc/meme/shop/domain/artist/dto/request/ArtistProfileDetailDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package umc.meme.shop.domain.artist.dto.request; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ArtistProfileDetailDto{ | ||
@NotNull | ||
private Long userId; | ||
@NotNull | ||
private Long artistId; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/java/umc/meme/shop/domain/portfolio/dto/request/PortfolioDetailRequestDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package umc.meme.shop.domain.portfolio.dto.request; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class PortfolioDetailRequestDto { | ||
@NotNull | ||
private Long userId; | ||
@NotNull | ||
private Long portfolioId; | ||
} |
74 changes: 74 additions & 0 deletions
74
src/main/java/umc/meme/shop/domain/portfolio/dto/response/PortfolioDetailDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package umc.meme.shop.domain.portfolio.dto.response; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import umc.meme.shop.domain.artist.entity.Artist; | ||
import umc.meme.shop.domain.portfolio.entity.Portfolio; | ||
import umc.meme.shop.global.enums.Category; | ||
import umc.meme.shop.global.enums.MakeupLocation; | ||
import umc.meme.shop.global.enums.Region; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class PortfolioDetailDto { | ||
private Long portfolioId; | ||
|
||
private Boolean isFavorite; | ||
|
||
private Category category; | ||
|
||
private String artistNickName; | ||
|
||
private String makeupName; | ||
|
||
private int price; | ||
|
||
private String info; | ||
|
||
private MakeupLocation makeupLocation; //샵 재직 여부 | ||
|
||
private String shopLocation; //샵 위치 | ||
|
||
private List<Region> region; //활동 가능 지역 | ||
|
||
private Boolean isBlock; | ||
|
||
private String averageStars; | ||
|
||
private int reviewCount; //리뷰 개수 | ||
|
||
private List<PortfolioImgDto> portfolioImgDtoList; | ||
|
||
public static PortfolioDetailDto from(Portfolio portfolio, boolean isFavorite) { | ||
Artist artist = portfolio.getArtist(); | ||
|
||
// PortfolioImg 리스트를 PortfolioImgDto 리스트로 변환 | ||
List<PortfolioImgDto> portfolioImgDtoList = portfolio.getPortfolioImgList() | ||
.stream() | ||
.map(PortfolioImgDto::from) | ||
.toList(); | ||
|
||
return PortfolioDetailDto.builder() | ||
.portfolioId(portfolio.getPortfolioId()) | ||
.isFavorite(isFavorite) | ||
.category(portfolio.getCategory()) | ||
.artistNickName(artist.getNickname()) | ||
.makeupName(portfolio.getMakeupName()) | ||
.price(portfolio.getPrice()) | ||
.info(portfolio.getInfo()) | ||
.makeupLocation(artist.getMakeupLocation()) | ||
.shopLocation(artist.getShopLocation()) | ||
.region(artist.getRegion()) | ||
.isBlock(portfolio.isBlock()) | ||
.portfolioImgDtoList(portfolioImgDtoList) | ||
.averageStars(portfolio.getAverageStars()) | ||
.reviewCount(portfolio.getReviewList().size()) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters