-
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.
refactor: 꿀조합에 사용된 상품 정보에 상품 이미지 URL 추가 (#27)
* feat: 레시피 안에 있는 상품들의 상품 이미지 링크 추가 * refactor: 레시피에 사용된 상품 정보를 새로운 DTO로 사용하면서 검증할 DTO 수정 * refactor: 최신순으로 리뷰 목록 조회 저장 로직 수정 * temp * refactor: 빈줄 제거, import문 와일드카드 제거 * refactor: 최신순으로 정렬해서 리뷰 목록을 확인하는 테스트를 롤백 * refactor: import문 와일드카드 제거
- Loading branch information
Showing
8 changed files
with
100 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.funeat.product.dto; | ||
|
||
import com.funeat.product.domain.Category; | ||
|
||
public class CategoryDto { | ||
|
||
private final Long id; | ||
private final String name; | ||
private final String image; | ||
|
||
private CategoryDto(final Long id, final String name, final String image) { | ||
this.id = id; | ||
this.name = name; | ||
this.image = image; | ||
} | ||
|
||
public static CategoryDto toDto(final Category category) { | ||
return new CategoryDto(category.getId(), category.getName(), category.getImage()); | ||
} | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public String getImage() { | ||
return image; | ||
} | ||
} |
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
38 changes: 38 additions & 0 deletions
38
src/main/java/com/funeat/recipe/dto/DetailProductRecipeDto.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,38 @@ | ||
package com.funeat.recipe.dto; | ||
|
||
import com.funeat.product.domain.Product; | ||
|
||
public class DetailProductRecipeDto { | ||
|
||
private final Long id; | ||
private final String name; | ||
private final Long price; | ||
private final String image; | ||
|
||
private DetailProductRecipeDto(final Long id, final String name, final Long price, final String image) { | ||
this.id = id; | ||
this.name = name; | ||
this.price = price; | ||
this.image = image; | ||
} | ||
|
||
public static DetailProductRecipeDto toDto(final Product product) { | ||
return new DetailProductRecipeDto(product.getId(), product.getName(), product.getPrice(), product.getImage()); | ||
} | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public Long getPrice() { | ||
return price; | ||
} | ||
|
||
public String getImage() { | ||
return image; | ||
} | ||
} |
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