Skip to content

Commit

Permalink
[#17]Feat : Create DTO
Browse files Browse the repository at this point in the history
- DishDTO, BestResponseDTO 생성
  • Loading branch information
choitree committed Apr 21, 2021
1 parent 1c04275 commit e9e8524
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 0 deletions.
34 changes: 34 additions & 0 deletions backend/src/main/java/com/team15/sidedish/dto/BestResponseDTO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.team15.sidedish.dto;

import com.team15.sidedish.domain.Dish;

import java.util.Set;

public class BestResponseDTO {

private Integer categoryId;
private String name;
private Set<DishDTO> dishes;

public BestResponseDTO(Integer categoryId, String name, Set<DishDTO> dishes){
this.categoryId = categoryId;
this.name = name;
this.dishes = dishes;
}


public Integer getCategoryId() {
return categoryId;
}

public String getName() {
return name;
}

public Set<DishDTO> getDishes() {
return dishes;
}



}
77 changes: 77 additions & 0 deletions backend/src/main/java/com/team15/sidedish/dto/DishDTO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package com.team15.sidedish.dto;

public class DishDTO {
/*
{"detail_hash":"H9881",
"image":"https://cdn.bmf.kr/_data/product/H9881/f2a7b4df359c850b1a9eb57e17ddf6fc.jpg",
"alt":"[소중한식사] 경상도 한상차림",
"delivery_type":["새벽배송","전국택배"],
"title":"[소중한식사] 경상도 한상차림",
"description":"경상도 명물 요리 세 가지를 한 상에!",
"n_price":"39,000",
"s_price":"31,200원",
"badge":["이벤트특가"]
*/

private String detailHash;
private String image;
private String alt;
private String deliveryType;
private String title;
private String description;
private Integer nPrice;
private Integer sPrice;
private String[] badge;

public DishDTO(String detailHash, String image, String alt, String deliveryType, String title, String description, Integer nPrice, Integer sPrice, String[] badge) {
this.detailHash = detailHash;
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 String getDetailHash() {
return detailHash;
}

public String getImage() {
return image;
}

public String getAlt() {
return alt;
}

public String getDeliveryType() {
return deliveryType;
}

public String getTitle() {
return title;
}

public String getDescription() {
return description;
}

public Integer getnPrice() {
return nPrice;
}

public Integer getsPrice() {
return sPrice;
}

public String[] getBadge() {
return badge;
}



}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.team15.sidedish.dto;

public class SectionResponseDTO {
}

0 comments on commit e9e8524

Please sign in to comment.