-
Notifications
You must be signed in to change notification settings - Fork 50
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 #18 from ghis22130/dto
[BE] DTO 설계 closes issue #8
- Loading branch information
Showing
17 changed files
with
478 additions
and
137 deletions.
There are no files selected for viewing
104 changes: 104 additions & 0 deletions
104
BE/src/main/java/com/team10/banchan/dto/ItemDetail.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,104 @@ | ||
package com.team10.banchan.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.util.List; | ||
|
||
public class ItemDetail { | ||
|
||
private final String topImage; | ||
private final List<String> thumbImages; | ||
|
||
private final String title; | ||
private final String productDescription; | ||
|
||
private final String point; | ||
private final String deliveryInfo; | ||
|
||
private final String deliveryFee; | ||
private final String nPrices; | ||
private final String sPrices; | ||
|
||
private final List<String> detailSection; | ||
private final List<String> badges; | ||
|
||
private ItemDetail(String topImage, List<String> thumbImages, String title, String productDescription, String point, String deliveryInfo, String deliveryFee, String nPrices, String sPrices, List<String> detailSection, List<String> badges) { | ||
this.topImage = topImage; | ||
this.thumbImages = thumbImages; | ||
this.title = title; | ||
this.productDescription = productDescription; | ||
this.point = point; | ||
this.deliveryInfo = deliveryInfo; | ||
this.deliveryFee = deliveryFee; | ||
this.nPrices = nPrices; | ||
this.sPrices = sPrices; | ||
this.detailSection = detailSection; | ||
this.badges = badges; | ||
} | ||
|
||
public static ItemDetail of(String topImage, List<String> thumbImages, | ||
String title, String productDescription, | ||
String point, String deliveryInfo, | ||
String deliveryFee, String nPrices, String sPrices, | ||
List<String> detailSection, List<String> badges) { | ||
return new ItemDetail(topImage, thumbImages, title, productDescription, point, deliveryInfo, deliveryFee, nPrices, sPrices, detailSection, badges); | ||
} | ||
|
||
@JsonProperty("top_image") | ||
public String getTopImage() { | ||
return topImage; | ||
} | ||
|
||
@JsonProperty("thumb_image") | ||
public List<String> getThumbImages() { | ||
return thumbImages; | ||
} | ||
|
||
@JsonProperty("product_description") | ||
public String getTitle() { | ||
return title; | ||
} | ||
|
||
@JsonProperty("product_description") | ||
public String getProductDescription() { | ||
return productDescription; | ||
} | ||
|
||
@JsonProperty("point") | ||
public String getPoint() { | ||
return point; | ||
} | ||
|
||
@JsonProperty("devliery_info") | ||
public String getDeliveryInfo() { | ||
return deliveryInfo; | ||
} | ||
|
||
@JsonProperty("devliery_fee") | ||
public String getDeliveryFee() { | ||
return deliveryFee; | ||
} | ||
|
||
@JsonProperty("n_prices") | ||
public String getnPrices() { | ||
return nPrices; | ||
} | ||
|
||
|
||
@JsonProperty("s_prices") | ||
public String getsPrices() { | ||
return sPrices; | ||
} | ||
|
||
@JsonProperty("detail_section") | ||
public List<String> getDetailSection() { | ||
return detailSection; | ||
} | ||
|
||
@JsonProperty("badge") | ||
public List<String> getBadges() { | ||
return badges; | ||
} | ||
} | ||
|
||
|
28 changes: 28 additions & 0 deletions
28
BE/src/main/java/com/team10/banchan/dto/ItemDetailResponse.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,28 @@ | ||
package com.team10.banchan.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public class ItemDetailResponse { | ||
|
||
private final Long id; | ||
private final ItemDetail itemDetail; | ||
|
||
private ItemDetailResponse(Long id, ItemDetail itemDetail) { | ||
this.id = id; | ||
this.itemDetail = itemDetail; | ||
} | ||
|
||
public static ItemDetailResponse of(Long id, ItemDetail itemDetail) { | ||
return new ItemDetailResponse(id, itemDetail); | ||
} | ||
|
||
@JsonProperty("hash") | ||
public Long getId() { | ||
return id; | ||
} | ||
|
||
@JsonProperty("data") | ||
public ItemDetail getItemDetail() { | ||
return itemDetail; | ||
} | ||
} |
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,95 @@ | ||
package com.team10.banchan.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.util.List; | ||
|
||
public class ItemSummary { | ||
|
||
private final Long id; | ||
|
||
private final String image; | ||
private final String alt; | ||
|
||
private final List<String> deliveryType; | ||
|
||
private final String title; | ||
private final String description; | ||
|
||
private final String nPrice; | ||
private final String sPrice; | ||
|
||
private final List<String> badge; | ||
|
||
private ItemSummary(Long id, | ||
String image, String alt, | ||
List<String> deliveryType, | ||
String title, String description, | ||
String nPrice, String sPrice, | ||
List<String> badge) { | ||
this.id = id; | ||
this.image = image; | ||
this.alt = alt; | ||
this.deliveryType = deliveryType; | ||
this.title = title; | ||
this.description = description; | ||
this.nPrice = nPrice; | ||
this.sPrice = sPrice; | ||
this.badge = badge; | ||
} | ||
|
||
public static ItemSummary of(Long id, | ||
String image, String alt, | ||
List<String> deliveryType, | ||
String title, String description, | ||
String nPrice, String sPrice, | ||
List<String> badge) { | ||
return new ItemSummary(id, image, alt, deliveryType, title, description, nPrice, sPrice, badge); | ||
} | ||
|
||
@JsonProperty("detail_hash") | ||
public Long getId() { | ||
return id; | ||
} | ||
|
||
@JsonProperty("image") | ||
public String getImage() { | ||
return image; | ||
} | ||
|
||
@JsonProperty("alt") | ||
public String getAlt() { | ||
return alt; | ||
} | ||
|
||
@JsonProperty("delivery_type") | ||
public List<String> getDeliveryType() { | ||
return deliveryType; | ||
} | ||
|
||
@JsonProperty("title") | ||
public String getTitle() { | ||
return title; | ||
} | ||
|
||
@JsonProperty("description") | ||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
@JsonProperty("n_price") | ||
public String getnPrice() { | ||
return nPrice; | ||
} | ||
|
||
@JsonProperty("s_price") | ||
public String getsPrice() { | ||
return sPrice; | ||
} | ||
|
||
@JsonProperty("badge") | ||
public List<String> getBadge() { | ||
return badge; | ||
} | ||
|
||
} |
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
24 changes: 24 additions & 0 deletions
24
BE/src/main/java/com/team10/banchan/model/Description.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,24 @@ | ||
package com.team10.banchan.model; | ||
|
||
public class Description { | ||
|
||
private final String title; | ||
private final String description; | ||
|
||
Description(String title, String description) { | ||
this.title = title; | ||
this.description = description; | ||
} | ||
|
||
public static Description of(String title, String description) { | ||
return new Description(title, description); | ||
} | ||
|
||
public String getTitle() { | ||
return title; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
} |
Oops, something went wrong.