Skip to content

Commit

Permalink
feat: add imgUrl field
Browse files Browse the repository at this point in the history
  • Loading branch information
Kang1221 committed Sep 2, 2024
1 parent 65a828b commit 69311a8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@Builder
public class ItemResponseDto {
private String itemId;
private String imgUrl;
private String status;
private String productName;
private Integer originPrice;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
public class SaveItemResponseDto {
private String itemId;
private String productName;
private String imgUrl;
private Integer salePrice;

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
public class ProductItemResponseDto {
private String productId;
private String productName;
private String imageUrl;
private String imgUrl;
private Integer originPrice;
private Integer salePrice;
private Boolean isAccountExist;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/co/orange/ddanzi/service/ItemService.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public ApiResponse<?> saveItem(SaveItemRequestDto requestDto){
SaveItemResponseDto responseDto = SaveItemResponseDto.builder()
.itemId(newItem.getId())
.productName(product.getName())
.imgUrl(product.getImgUrl())
.salePrice(product.getOriginPrice()-discount.getDiscountPrice())
.build();
return ApiResponse.onSuccess(Success.CREATE_ITEM_SUCCESS, responseDto);
Expand All @@ -106,6 +107,7 @@ public ApiResponse<?> getItem(String itemId){

ItemResponseDto responseDto = ItemResponseDto.builder()
.itemId(itemId)
.imgUrl(product.getImgUrl())
.status(order != null ? order.getStatus().toString() : item.getStatus().toString())
.productName(product.getName())
.originPrice(product.getOriginPrice())
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/co/orange/ddanzi/service/ProductService.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public ApiResponse<?> getProductForItem(String productId){
ProductItemResponseDto responseDto = ProductItemResponseDto.builder()
.productId(product.getId())
.productName(product.getName())
.imageUrl(product.getImgUrl())
.imgUrl(product.getImgUrl())
.originPrice(product.getOriginPrice())
.salePrice(product.getOriginPrice() - discount.getDiscountPrice())
.isAccountExist(account != null)
Expand Down

0 comments on commit 69311a8

Please sign in to comment.