-
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.
Merge pull request #98 from Att-ies/feature/84-artwork-more-info
Feature/84 artwork more info
- Loading branch information
Showing
14 changed files
with
232 additions
and
14 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
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
24 changes: 24 additions & 0 deletions
24
src/main/java/com/sptp/backend/art_work/repository/ArtWorkSize.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,24 @@ | ||
package com.sptp.backend.art_work.repository; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.persistence.Embeddable; | ||
|
||
@Embeddable | ||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Builder | ||
public class ArtWorkSize { | ||
|
||
private Integer width; | ||
|
||
private Integer length; | ||
|
||
private Integer height; | ||
|
||
private Integer size; | ||
} |
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
78 changes: 78 additions & 0 deletions
78
src/main/java/com/sptp/backend/art_work/web/dto/response/ArtWorkInfoResponseDto.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,78 @@ | ||
package com.sptp.backend.art_work.web.dto.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.sptp.backend.art_work.repository.ArtWork; | ||
import com.sptp.backend.art_work.repository.ArtWorkSize; | ||
import com.sptp.backend.art_work_image.repository.ArtWorkImage; | ||
import com.sptp.backend.art_work_keyword.repository.ArtWorkKeyword; | ||
import com.sptp.backend.common.KeywordMap; | ||
import com.sptp.backend.member.repository.Member; | ||
import lombok.*; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
public class ArtWorkInfoResponseDto { | ||
|
||
private ArtistDto artist; | ||
private ArtWorkDto artWork; | ||
|
||
@Data | ||
@Builder | ||
public static class ArtistDto { | ||
private String artistEducation; | ||
private String artistName; | ||
private String artistImage; | ||
|
||
public static ArtistDto from(Member member) { | ||
return ArtistDto.builder() | ||
.artistName(member.getNickname()) | ||
.artistEducation(member.getEducation()) | ||
.artistImage(member.getImage()) | ||
.build(); | ||
} | ||
|
||
} | ||
|
||
@Data | ||
@Builder | ||
public static class ArtWorkDto { | ||
|
||
private String title; | ||
private Integer productionYear; | ||
private String material; | ||
private String genre; | ||
private boolean frame; | ||
// private Integer width; | ||
// private Integer length; | ||
// private Integer height; | ||
// private Integer size; | ||
private String description; | ||
private ArtWorkSize artWorkSize; | ||
private String guaranteeImage; | ||
private String mainImage; | ||
private List<String> keywords; | ||
private List<String> images; | ||
|
||
public static ArtWorkDto from(ArtWork artWork, List<ArtWorkImage> artWorkImages, List<ArtWorkKeyword> artWorkKeywords) { | ||
return ArtWorkDto.builder() | ||
.title(artWork.getTitle()) | ||
.productionYear(artWork.getProductionYear()) | ||
.material(artWork.getMaterial()) | ||
.genre(artWork.getGenre()) | ||
.frame(artWork.isFrame()) | ||
.artWorkSize(artWork.getArtWorkSize()) | ||
.guaranteeImage(artWork.getGuaranteeImage()) | ||
.mainImage(artWork.getMainImage()) | ||
.images(artWorkImages.stream().map(m -> m.getImage()).collect(Collectors.toList())) | ||
.keywords(artWorkKeywords.stream().map(m-> KeywordMap.getKeywordName(m.getKeywordId())).collect(Collectors.toList())) | ||
.build(); | ||
} | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/com/sptp/backend/art_work/web/dto/response/ArtWorkMyListResponseDto.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,20 @@ | ||
package com.sptp.backend.art_work.web.dto.response; | ||
|
||
import lombok.*; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
public class ArtWorkMyListResponseDto { | ||
|
||
private Long id; | ||
private String title; | ||
private String artistName; | ||
|
||
// 경매 명과 입찰 현황, 등록 현황은 추후 경매 기능 이후에 적용 | ||
// private String auctionName; | ||
// private String biddingStatus; | ||
// private String status; | ||
} |
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
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
Oops, something went wrong.