-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/84 artwork more info #98
Changes from all commits
01dfeca
b309938
26fa25c
18a75bd
8def7cf
1ec5f16
1ec953c
109c7d9
3cc2c8d
3bf6b8d
7916681
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package com.sptp.backend.art_work.web.dto.request; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.*; | ||
import org.springframework.web.multipart.MultipartFile; | ||
|
||
|
@@ -14,10 +15,17 @@ public class ArtWorkSaveRequestDto { | |
private MultipartFile guaranteeImage; | ||
private String title; | ||
private String[] keywords; | ||
private String productionYear; | ||
private Integer productionYear; | ||
private String material; | ||
private String size; | ||
private Integer price; | ||
private String status; | ||
private String statusDescription; | ||
private Integer width; | ||
private Integer length; | ||
private Integer height; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. μμ§λ λμ νλλ€μ κ°μ²΄λ‘ λ¬Άκ³ , @Embeddedλ₯Ό νμ©νλ©΄ μ’μ κ² κ°μμ! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. λ΅ ν΅ν©λ κ°μ²΄λ‘ κ΄λ¦¬νλκ² λ§λκ² κ°λ€μ© |
||
private Integer size; | ||
private boolean frame; | ||
private String genre; | ||
private Integer price; | ||
private String description; | ||
|
||
} |
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(); | ||
} | ||
} | ||
|
||
} |
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; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ | |
@Builder | ||
public class PreferredArtWorkResponse { | ||
|
||
private Long id; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. λͺ©λ‘ μ‘°νμμ idλ₯Ό μΆκ°νμ μ΄μ κ° κΆκΈν©λλΉ μ κ²λ λ£μ΄μΌ νλ ν΄μμ©,, |
||
|
||
private String title; | ||
|
||
private Integer price; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
λ³κ²½λ νλλ erdμ λ°μν΄μ£ΌμΈμ!!