-
Notifications
You must be signed in to change notification settings - Fork 0
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 #33 from 9oormthon-univ/feature/GOORM-3-product
[GOORM-3] - 상품 등록 API 구현
- Loading branch information
Showing
8 changed files
with
135 additions
and
11 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
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
40 changes: 40 additions & 0 deletions
40
src/main/java/com/goormthon3/team49/domain/product/presentation/dto/AddProductDto.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,40 @@ | ||
package com.goormthon3.team49.domain.product.presentation.dto; | ||
|
||
import com.goormthon3.team49.domain.product.domain.entity.Product; | ||
|
||
import com.goormthon3.team49.domain.product.domain.entity.ProductReservation; | ||
import jakarta.transaction.Transactional; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class AddProductDto { | ||
private Long productId; | ||
private String title; | ||
private Integer totalNum; | ||
private Integer quantity; | ||
private Integer price; | ||
private Integer savePrice; | ||
private String link; | ||
private String pickupLocation; | ||
private String img; // 이미지 주소 | ||
|
||
|
||
|
||
@Transactional | ||
public static AddProductDto fromEntity(Product product, ProductReservation reservation) { | ||
AddProductDto dto = new AddProductDto(); | ||
dto.setProductId(product.getProductId()); | ||
dto.setTitle(product.getTitle()); | ||
dto.setTotalNum(product.getTotalNum()); | ||
dto.setQuantity(reservation.getQuantity()); | ||
dto.setPrice(product.getPrice()); | ||
dto.setSavePrice(product.getSavePrice()); | ||
dto.setLink(product.getLink()); | ||
dto.setPickupLocation(product.getPickupLocation()); | ||
// dto.setImg(product.getProductImgId()); // 이미지 주소 | ||
return dto; | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
...main/java/com/goormthon3/team49/domain/product/presentation/dto/AddProductRequestDto.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 com.goormthon3.team49.domain.product.presentation.dto; | ||
|
||
import com.goormthon3.team49.domain.product.domain.entity.ProductReservation; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class AddProductRequestDto { | ||
private String title; | ||
private Integer totalNum; | ||
private Integer quantity; | ||
private Integer price; | ||
private Integer savePrice; | ||
private String link; | ||
private String pickupLocation; | ||
private String img; // 이미지 주소 | ||
|
||
private ProductReservation reservation; | ||
|
||
} |
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