-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
154 additions
and
2 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
29 changes: 29 additions & 0 deletions
29
src/main/java/org/store/clothstar/productLine/domain/GoodsOption.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,29 @@ | ||
package org.store.clothstar.productLine.domain; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
@Entity(name = "goods_option") | ||
public class GoodsOption { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
private List<String> optionNames; | ||
private int originalPrice; | ||
private int price; | ||
private int stock; | ||
private String deliveryType; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "product_option_id") | ||
private Option option; | ||
} |
52 changes: 52 additions & 0 deletions
52
src/main/java/org/store/clothstar/productLine/domain/Option.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,52 @@ | ||
package org.store.clothstar.productLine.domain; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* 옵션 그룹 내의 개별 옵션을 관리한. | ||
* ex) 색상의 경우 “연청”, “중청” | ||
* | ||
* { | ||
* "id": 1, | ||
* "productOptionGroup": 1, | ||
* "name": "연청", | ||
* "depth": 1, | ||
* "goodsOptionSno": 157877069 | ||
* }, | ||
* { | ||
* "id": 2, | ||
* "productOptionGroup": 1, | ||
* "name": "중청", | ||
* "depth": 1, | ||
* "goodsOptionSno": 157877085 | ||
* } | ||
* | ||
*/ | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
@Entity(name = "option_group") | ||
public class Option { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long optionId; | ||
private String name; | ||
private int depth; | ||
private Long goodsOptionSno; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "option_group_id") | ||
private OptionGroup optionGroup; | ||
|
||
@OneToMany(mappedBy = "productOption", cascade = CascadeType.ALL) | ||
private List<GoodsOption> goodsOptions; | ||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/org/store/clothstar/productLine/domain/OptionGroup.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,48 @@ | ||
package org.store.clothstar.productLine.domain; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* 제품의 옵션 그룹을 관리한다. | ||
* ex) 색상, 기장, 사이즈 | ||
* | ||
* { | ||
* "id": 1, | ||
* "productLine": 1, | ||
* "name": "색상", | ||
* "depth": 1 | ||
* }, | ||
* { | ||
* "id": 2, | ||
* "productLine": 1, | ||
* "name": "기장", | ||
* "depth": 2 | ||
* } | ||
*/ | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
@Entity(name = "option_group") | ||
public class OptionGroup { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long optionGroupId; | ||
private String name; | ||
private int depth; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "product_line_id") | ||
private ProductLine productLine; | ||
|
||
@OneToMany(mappedBy = "OptionGroup", cascade = CascadeType.ALL) | ||
private List<Option> options; | ||
} |
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
6 changes: 6 additions & 0 deletions
6
src/main/java/org/store/clothstar/productLine/domain/type/Color.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,6 @@ | ||
package org.store.clothstar.productLine.domain.type; | ||
|
||
public enum Color { | ||
BLACK, WHITE, GREY, BLUE, BROWN, BEIGE, IVORY, PINK, GREEN, SKY_BLUE, NAVY, | ||
YELLOW, PURPLE, DARK_GREY, DARK_GREEN, ORANGE, MINT, LIGHT_PINK, RED | ||
} |