-
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.
[SETTING] 도메인 세팅 - #7
- Loading branch information
Showing
14 changed files
with
413 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
cakey-domain/src/main/java/com/cakey/cake/domain/Cake.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 com.cakey.cake.domain; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) //JPA에서만 사용가능하도록 | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) // 외부에서 직접 모든 필드 받는 생성자 호출X | ||
@Builder(access = AccessLevel.PRIVATE) //외부에서 builder 사용 X | ||
@Table(name = "cakes") | ||
@Entity | ||
@Getter | ||
public class Cake { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "cake_id") | ||
private Long id; | ||
|
||
@Column(name = "store_name", nullable = false) | ||
private long storeId; | ||
|
||
@Column(name = "for_day_category", nullable = false) | ||
private DayCategory dayCategory; | ||
|
||
public static Cake createCake(final long storeId, final DayCategory dayCategory) { | ||
return Cake.builder() | ||
.storeId(storeId) | ||
.dayCategory(dayCategory) | ||
.build(); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
cakey-domain/src/main/java/com/cakey/cake/domain/DayCategory.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,8 @@ | ||
package com.cakey.cake.domain; | ||
|
||
public enum DayCategory { | ||
BIRTH, //생일 | ||
CHEER, //응원 | ||
ANNIV, //기념일 | ||
SEASON //시즌 | ||
} |
41 changes: 41 additions & 0 deletions
41
cakey-domain/src/main/java/com/cakey/cakeimage/domain/CakeImages.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,41 @@ | ||
package com.cakey.cakeimage.domain; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PROTECTED) //JPA에서만 사용가능하도록 | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) // 외부에서 직접 모든 필드 받는 생성자 호출X | ||
@Builder(access = AccessLevel.PRIVATE) //외부에서 builder 사용 X | ||
@Table(name = "cake_images") | ||
@Entity | ||
@Getter | ||
public class CakeImages { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "cake_image_id") | ||
private Long id; | ||
|
||
@Column(name = "cake_id", nullable = false) | ||
private long cakeId; | ||
|
||
@Column(name = "store_id", nullable = false) | ||
private long storeId; | ||
|
||
@Column(name = "image_url", nullable = false) | ||
private String imageUrl; | ||
|
||
@Column(name = "is_main_image", nullable = false) | ||
private boolean isMainImage; | ||
|
||
public static CakeImages createCakeImages(final long cakeId, | ||
final long storeId, | ||
final String imageUrl, | ||
final boolean isMainImage) { | ||
return CakeImages.builder() | ||
.cakeId(cakeId) | ||
.storeId(storeId) | ||
.imageUrl(imageUrl) | ||
.isMainImage(isMainImage) | ||
.build(); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
cakey-domain/src/main/java/com/cakey/cakelike/domain/CakeLikes.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,30 @@ | ||
package com.cakey.cakelike.domain; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PROTECTED) //JPA에서만 사용가능하도록 | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) // 외부에서 직접 모든 필드 받는 생성자 호출X | ||
@Builder(access = AccessLevel.PRIVATE) //외부에서 builder 사용 X | ||
@Getter | ||
@Table(name = "cake_likes") | ||
@Entity | ||
public class CakeLikes { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "cake_like_id") | ||
private Long id; | ||
|
||
@Column(name = "çake_id", nullable = false) | ||
private long cakeId; | ||
|
||
@Column(name = "user_id", nullable = false) | ||
private long userId; | ||
|
||
public static CakeLikes createCakeLikes(final long cakeId, final long userId) { | ||
return CakeLikes.builder(). | ||
cakeId(cakeId) | ||
.userId(userId) | ||
.build(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
cakey-domain/src/main/java/com/cakey/caketheme/domain/CakeTheme.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,31 @@ | ||
package com.cakey.caketheme.domain; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PROTECTED) //JPA에서만 사용가능하도록 | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) // 외부에서 직접 모든 필드 받는 생성자 호출X | ||
@Builder(access = AccessLevel.PRIVATE) //외부에서 builder 사용 X | ||
@Table(name = "cake_theme") | ||
@Entity | ||
@Getter | ||
public class CakeTheme { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "cake_theme_id") | ||
private Long id; | ||
|
||
@Column(name = "cake_id") | ||
private long cakeId; | ||
|
||
@Column(name = "theme_name") | ||
@Enumerated(EnumType.STRING) | ||
private ThemeName themeName; | ||
|
||
public static CakeTheme createCakeThem(final long cakeId, final ThemeName themeName) { | ||
return CakeTheme.builder() | ||
.cakeId(cakeId) | ||
.themeName(themeName) | ||
.build(); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
cakey-domain/src/main/java/com/cakey/caketheme/domain/ThemeName.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,13 @@ | ||
package com.cakey.caketheme.domain; | ||
|
||
public enum ThemeName { | ||
ALL, //전체 | ||
THEME, //테마 | ||
CUTE, //귀여움 | ||
MINIMAL, //미니멀 | ||
CHARAC, //캐릭터 | ||
LUXURY, //럭셔리 | ||
HUMOR, //유머 | ||
FANTASY, //판타지 | ||
ELSE, //기타 | ||
} |
100 changes: 100 additions & 0 deletions
100
cakey-domain/src/main/java/com/cakey/operationtime/domain/StoreOperationTime.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,100 @@ | ||
package com.cakey.operationtime.domain; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PROTECTED) //JPA에서만 사용가능하도록 | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) // 외부에서 직접 모든 필드 받는 생성자 호출X | ||
@Builder(access = AccessLevel.PRIVATE) //외부에서 builder 사용 X | ||
@Table(name = "store_operation_time") | ||
@Entity | ||
@Getter | ||
public class StoreOperationTime { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "store_operation_time_id") | ||
private Long id; | ||
|
||
@Column(name = "store_id", nullable = false) | ||
private long storeId; | ||
|
||
@Column(name = "mon_open", nullable = true) | ||
private LocalDateTime monOpen; | ||
|
||
@Column(name = "mon_close", nullable = true) | ||
private LocalDateTime monClose; | ||
|
||
@Column(name = "tue_open", nullable = true) | ||
private LocalDateTime tueOpen; | ||
|
||
@Column(name = "tue_close", nullable = true) | ||
private LocalDateTime tueClose; | ||
|
||
@Column(name = "wed_open", nullable = true) | ||
private LocalDateTime wedOpen; | ||
|
||
@Column(name = "wed_close", nullable = true) | ||
private LocalDateTime wedClose; | ||
|
||
@Column(name = "thu_open", nullable = true) | ||
private LocalDateTime thuOpen; | ||
|
||
@Column(name = "thu_close", nullable = true) | ||
private LocalDateTime thuClose; | ||
|
||
@Column(name = "fri_open", nullable = true) | ||
private LocalDateTime friOpen; | ||
|
||
@Column(name = "fri_close", nullable = true) | ||
private LocalDateTime friClose; | ||
|
||
@Column(name = "sat_open", nullable = true) | ||
private LocalDateTime satOpen; | ||
|
||
@Column(name = "sat_close", nullable = true) | ||
private LocalDateTime satClose; | ||
|
||
@Column(name = "sun_open", nullable = true) | ||
private LocalDateTime sunOpen; | ||
|
||
@Column(name = "sun_close", nullable = true) | ||
private LocalDateTime sunClose; | ||
|
||
public static StoreOperationTime createStoreOperationTime( | ||
final long storeId, | ||
final LocalDateTime monOpen, | ||
final LocalDateTime monClose, | ||
final LocalDateTime tueOpen, | ||
final LocalDateTime tueClose, | ||
final LocalDateTime wedOpen, | ||
final LocalDateTime wedClose, | ||
final LocalDateTime thuOpen, | ||
final LocalDateTime thuClose, | ||
final LocalDateTime friOpen, | ||
final LocalDateTime friClose, | ||
final LocalDateTime satOpen, | ||
final LocalDateTime satClose, | ||
final LocalDateTime sunOpen, | ||
final LocalDateTime sunClose | ||
) { | ||
return StoreOperationTime.builder() | ||
.storeId(storeId) | ||
.monOpen(monOpen) | ||
.monClose(monClose) | ||
.tueOpen(tueOpen) | ||
.tueClose(tueClose) | ||
.wedOpen(wedOpen) | ||
.wedClose(wedClose) | ||
.thuOpen(thuOpen) | ||
.thuClose(thuClose) | ||
.friOpen(friOpen) | ||
.friClose(friClose) | ||
.satOpen(satOpen) | ||
.satClose(satClose) | ||
.sunOpen(sunOpen) | ||
.sunClose(sunClose) | ||
.build(); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
cakey-domain/src/main/java/com/cakey/size/domain/Size.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,36 @@ | ||
package com.cakey.size.domain; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PROTECTED) //JPA에서만 사용가능하도록 | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) // 외부에서 직접 모든 필드 받는 생성자 호출X | ||
@Builder(access = AccessLevel.PRIVATE) //외부에서 builder 사용 X | ||
@Table(name = "sizes") | ||
@Entity | ||
@Getter | ||
public class Size { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "size_id") | ||
private Long id; | ||
|
||
@Column(name = "store_id") | ||
private long storeId; | ||
|
||
@Column(name = "size_name") | ||
private String sizeName; | ||
|
||
@Column(name = "price") | ||
private int price; | ||
|
||
public static Size createSize(final long storeId, | ||
final String sizeName, | ||
final int price) { | ||
return Size.builder() | ||
.storeId(storeId) | ||
.sizeName(sizeName) | ||
.price(price) | ||
.build(); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
cakey-domain/src/main/java/com/cakey/store/domain/Station.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 com.cakey.store.domain; | ||
|
||
public enum Station { | ||
HONGDAE, | ||
|
||
} |
62 changes: 62 additions & 0 deletions
62
cakey-domain/src/main/java/com/cakey/store/domain/Store.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,62 @@ | ||
package com.cakey.store.domain; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PROTECTED) //JPA에서만 사용가능하도록 | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) // 외부에서 직접 모든 필드 받는 생성자 호출X | ||
@Builder(access = AccessLevel.PRIVATE) //외부에서 builder 사용 X | ||
@Getter | ||
@Table(name = "stores") | ||
@Entity | ||
public class Store { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "store_id") | ||
private Long id; | ||
|
||
@Column(name = "store_name", nullable = false) | ||
private String name; | ||
|
||
@Column(name = "address", nullable = false) | ||
private String address; | ||
|
||
@Column(name = "phone", nullable = false) | ||
private String phone; | ||
|
||
@Column(name = "latitude", nullable = false) | ||
private Double latitude; | ||
|
||
@Column(name = "longitude", nullable = false) | ||
private Double longitude; | ||
|
||
@Column(name = "taste", nullable = false) | ||
private String taste; | ||
|
||
@Column(name = "open_kakao_url", nullable = true) | ||
private String openKakaoUrl; | ||
|
||
@Column(name = "station", nullable = false) | ||
@Enumerated(EnumType.STRING) | ||
private Station station; | ||
|
||
public static Store createStroe(final String name, | ||
final String address, | ||
final String phone, | ||
final double latitude, | ||
final double longititude, | ||
final String taste, | ||
final String openKakaoUrl, | ||
final Station station) { | ||
return Store.builder() | ||
.name(name) | ||
.address(address) | ||
.phone(phone) | ||
.latitude(latitude) | ||
.longitude(longititude) | ||
.taste(taste) | ||
.openKakaoUrl(openKakaoUrl) | ||
.station(station) | ||
.build(); | ||
} | ||
} |
Empty file.
6 changes: 6 additions & 0 deletions
6
cakey-domain/src/main/java/com/cakey/user/domain/SocialType.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 com.cakey.user.domain; | ||
|
||
public enum SocialType { | ||
KAKAO, | ||
|
||
} |
Oops, something went wrong.