Skip to content

Commit

Permalink
#16 - Feat: Product 에 getSalePrice(), getWholesalePrice() 메서드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ahah525 committed Oct 26, 2022
1 parent fff5efe commit 525c953
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ public class Product extends BaseEntity {
@OneToMany(mappedBy = "product", cascade = {CascadeType.ALL})
private List<ProductHashTag> productHashTags = new ArrayList<>(); // 도서 해시태그 리스트

// 실제 판매가
public int getSalePrice() {
return getPrice();
}

// 도매가
public int getWholesalePrice() {
return (int) Math.ceil(getPrice() * 0.7);
}

// 해당 도서의 해시태그들을 한 문장으로 반환
public String getHashTagString() {
if(productHashTags.isEmpty()) {
Expand Down

0 comments on commit 525c953

Please sign in to comment.