From 899cd73878d591b77ca4e42346e92f30acb781ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98yj-leez=E2=80=99?= Date: Thu, 28 Dec 2023 20:23:28 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=88=98=EC=9A=94=EC=A1=B0=EC=82=AC?= =?UTF-8?q?=ED=8F=BC=20=EB=A6=AC=ED=8C=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wow_server/domain/DemandItem.java | 3 ++ .../wow_server/domain/DemandProject.java | 27 +++++++-------- .../wowmarket/wow_server/domain/Item.java | 3 ++ .../dto/RegisterDemandProjectDto.java | 33 ++++++++++++++----- .../register/dto/RegisterItemDto.java | 3 ++ 5 files changed, 44 insertions(+), 25 deletions(-) diff --git a/src/main/java/wowmarket/wow_server/domain/DemandItem.java b/src/main/java/wowmarket/wow_server/domain/DemandItem.java index 48a56b0..d736ffb 100644 --- a/src/main/java/wowmarket/wow_server/domain/DemandItem.java +++ b/src/main/java/wowmarket/wow_server/domain/DemandItem.java @@ -28,6 +28,9 @@ public class DemandItem extends BaseEntity{ @ColumnDefault("0") private int goal; + @ColumnDefault("0") + private int limit; + public void setDemandProject(DemandProject demandProject){ this.demandProject=demandProject; } diff --git a/src/main/java/wowmarket/wow_server/domain/DemandProject.java b/src/main/java/wowmarket/wow_server/domain/DemandProject.java index 1b11250..cfe3e8b 100644 --- a/src/main/java/wowmarket/wow_server/domain/DemandProject.java +++ b/src/main/java/wowmarket/wow_server/domain/DemandProject.java @@ -4,6 +4,7 @@ import lombok.*; import java.time.LocalDate; +import java.time.LocalDateTime; import java.util.List; @AllArgsConstructor @@ -21,7 +22,12 @@ public class DemandProject extends BaseEntity{ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "seller_id", referencedColumnName = "user_id") private User user; - private String nickname; + + /* 등록 */ + private String sellerName; // 판매자명 + private String phoneNumber; // 전화번호 + private String email; // 이메일 + private String sellerEtc; // 기타 연락 수단 @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "category_id", referencedColumnName = "category_id") @@ -32,10 +38,11 @@ public class DemandProject extends BaseEntity{ private String image2; private String image3; - private String name; + private String projectName; private String description; - private LocalDate startDate; - private LocalDate endDate; + + private LocalDateTime startDate; + private LocalDateTime endDate; private int participant_number; private Long final_achievement_rate; @@ -53,16 +60,4 @@ public void setCategory(Category category){ this.category = category; } - public void setImage(List uploaded){ - switch (uploaded.size()){ - case 4: - image3 = uploaded.get(3); - case 3: - image2 = uploaded.get(2); - case 2: - image1 = uploaded.get(1); - case 1: - thumbnail = uploaded.get(0); - } - } } diff --git a/src/main/java/wowmarket/wow_server/domain/Item.java b/src/main/java/wowmarket/wow_server/domain/Item.java index 929ab32..fa21fc1 100644 --- a/src/main/java/wowmarket/wow_server/domain/Item.java +++ b/src/main/java/wowmarket/wow_server/domain/Item.java @@ -24,6 +24,9 @@ public class Item { @ColumnDefault("0") private int goal; + @ColumnDefault("0") + private int limit; // 구매제한 + public void setProject(Project project){ this.project = project; } diff --git a/src/main/java/wowmarket/wow_server/register/dto/RegisterDemandProjectDto.java b/src/main/java/wowmarket/wow_server/register/dto/RegisterDemandProjectDto.java index 998f75e..627a402 100644 --- a/src/main/java/wowmarket/wow_server/register/dto/RegisterDemandProjectDto.java +++ b/src/main/java/wowmarket/wow_server/register/dto/RegisterDemandProjectDto.java @@ -8,6 +8,7 @@ import wowmarket.wow_server.domain.DemandProject; import java.time.LocalDate; +import java.time.LocalDateTime; import java.util.List; @Getter @@ -16,39 +17,53 @@ @Builder public class RegisterDemandProjectDto { @NotNull - private String project_name; + private String projectName; @NotNull private String description; @NotNull private Long category_id; + @NotNull + private String sellerName; // 판매자명 + + private String phoneNumber; // 전화번호 + private String email; // 이메일 + private String sellerEtc; // 기타 연락 수단 + @NotNull private String thumbnail; @NotNull private String image1; private String image2; private String image3; + @NotNull private List item; @NotNull - private LocalDate start_date; - @NotNull - private LocalDate end_date; + private LocalDateTime startDate; @NotNull - private String nickname; + private LocalDateTime endDate; + @Builder public DemandProject toEntity(){ return DemandProject.builder() - .name(project_name) + .projectName(projectName) .description(description) + .sellerName(sellerName) + .phoneNumber(phoneNumber) + .email(email) + .sellerEtc(sellerEtc) .thumbnail(thumbnail) .image1(image1) .image2(image2) .image3(image3) - .startDate(start_date) - .endDate(end_date) - .nickname(nickname) + .startDate(startDate) + .endDate(endDate) + .participant_number(0) + .final_achievement_rate(0L) + .isEnd(Boolean.FALSE) + .view(0) .build(); } diff --git a/src/main/java/wowmarket/wow_server/register/dto/RegisterItemDto.java b/src/main/java/wowmarket/wow_server/register/dto/RegisterItemDto.java index d1f8d25..760029b 100644 --- a/src/main/java/wowmarket/wow_server/register/dto/RegisterItemDto.java +++ b/src/main/java/wowmarket/wow_server/register/dto/RegisterItemDto.java @@ -15,6 +15,7 @@ public class RegisterItemDto { private String item_name; private Long price; private int goal; + private int limit; @Builder public Item toItemEntity(){ @@ -22,6 +23,7 @@ public Item toItemEntity(){ .name(item_name) .price(price) .goal(goal) + .limit(limit) .build(); } @@ -31,6 +33,7 @@ public DemandItem toDemandItemEntity(){ .name(item_name) .price(price) .goal(goal) + .limit(limit) .build(); } }