-
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 #152 from UMC-WOWMARKET/feat/MyOrderManage-137
[feat] 판매 등록폼 수정 #137
- Loading branch information
Showing
12 changed files
with
190 additions
and
17 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
src/main/java/wowmarket/wow_server/converter/ReceiveTypeConverter.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,21 @@ | ||
package wowmarket.wow_server.converter; | ||
|
||
import jakarta.persistence.AttributeConverter; | ||
import jakarta.persistence.Converter; | ||
import wowmarket.wow_server.domain.ReceiveType; | ||
|
||
@Converter | ||
public class ReceiveTypeConverter implements AttributeConverter<ReceiveType, Long> { | ||
|
||
@Override | ||
public Long convertToDatabaseColumn(ReceiveType receiveType) { | ||
if (receiveType == null) | ||
return null; | ||
return receiveType.getCode(); | ||
} | ||
|
||
@Override | ||
public ReceiveType convertToEntityAttribute(Long dbData) { | ||
return ReceiveType.ofReceiveType(dbData); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -15,4 +15,5 @@ public class Category { | |
private Long id; | ||
|
||
private String name; | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,25 @@ | ||
package wowmarket.wow_server.domain; | ||
|
||
import com.fasterxml.jackson.databind.annotation.EnumNaming; | ||
import lombok.Getter; | ||
|
||
import java.util.Arrays; | ||
|
||
|
||
@Getter | ||
public enum ReceiveType { | ||
DELIVERY, PICKUP, ALL; | ||
DELIVERY(1L), PICKUP(2L), ALL(3L); | ||
|
||
private Long code; | ||
|
||
private ReceiveType(Long code) { | ||
this.code = code; | ||
} | ||
|
||
public static ReceiveType ofReceiveType(Long code){ | ||
return Arrays.stream(ReceiveType.values()) | ||
.filter(v -> v.getCode().equals(code)) | ||
.findAny() | ||
.orElseThrow(() -> new IllegalArgumentException("존재하지 않는 수령방법입니다.")); | ||
} | ||
} |
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
62 changes: 62 additions & 0 deletions
62
...market/wow_server/mypage/myproject/MySalesProject/dto/MySalesProjectModifyRequestDto.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,62 @@ | ||
package wowmarket.wow_server.mypage.myproject.MySalesProject.dto; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import wowmarket.wow_server.domain.Category; | ||
import wowmarket.wow_server.domain.ReceiveType; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class MySalesProjectModifyRequestDto { | ||
private String projectName; | ||
private String description; | ||
private String thumbnail; | ||
private Long categoryId; | ||
private String image1; | ||
private String image2; | ||
private String image3; | ||
private List<MySalesItemDto> itemList; | ||
private LocalDateTime startDate; | ||
private LocalDateTime endDate; | ||
private Long receiveType; | ||
private String receiveAddress; | ||
private String sellerBank; | ||
private String sellerAccount; | ||
private String sellerAccountName; | ||
private String sellerName; | ||
private Long deliveryFee; | ||
private String sellerPhoneNumber; | ||
private String sellerEmail; | ||
private String sellerEtc; | ||
|
||
@Builder | ||
public MySalesProjectModifyRequestDto(String projectName, String description, String sellerName, String phoneNumber, String email, String sellerEtc, | ||
Long categoryId, String thumbnail, String image1, String image2, String image3, LocalDateTime startDate, | ||
LocalDateTime endDate, Long receiveType, String receiveAddress, Long deliveryFee, String bank, String account, | ||
String accountHolderName, List<MySalesItemDto> itemList){ | ||
this.projectName = projectName; | ||
this.description = description; | ||
this.sellerName = sellerName; | ||
this.sellerPhoneNumber = phoneNumber; | ||
this.sellerEmail = email; | ||
this.sellerEtc = sellerEtc; | ||
this.categoryId = categoryId; | ||
this.thumbnail = thumbnail; | ||
this.image1 = image1; | ||
this.image2 = image2; | ||
this.image3 = image3; | ||
this.startDate = startDate; | ||
this.endDate = endDate; | ||
this.receiveType = receiveType; | ||
this.receiveAddress = receiveAddress; | ||
this.deliveryFee = deliveryFee; | ||
this.sellerBank = bank; | ||
this.sellerAccount = account; | ||
this.sellerAccountName = accountHolderName; | ||
this.itemList = itemList; | ||
} | ||
} |
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