diff --git a/src/main/java/com/moddy/server/common/domain/BaseTimeEntity.java b/src/main/java/com/moddy/server/domain/BaseTimeEntity.java similarity index 93% rename from src/main/java/com/moddy/server/common/domain/BaseTimeEntity.java rename to src/main/java/com/moddy/server/domain/BaseTimeEntity.java index d53221d5..b18d316a 100644 --- a/src/main/java/com/moddy/server/common/domain/BaseTimeEntity.java +++ b/src/main/java/com/moddy/server/domain/BaseTimeEntity.java @@ -1,4 +1,4 @@ -package com.moddy.server.common.domain; +package com.moddy.server.domain; import jakarta.persistence.EntityListeners; import jakarta.persistence.MappedSuperclass; diff --git a/src/main/java/com/moddy/server/domain/day_off/DayOfWeek.java b/src/main/java/com/moddy/server/domain/day_off/DayOfWeek.java new file mode 100644 index 00000000..f909e033 --- /dev/null +++ b/src/main/java/com/moddy/server/domain/day_off/DayOfWeek.java @@ -0,0 +1,12 @@ +package com.moddy.server.domain.day_off; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum DayOfWeek { + NOTHING("없음"), MON("월"), TUE("화"), WED("수"), THU("목"), FRI("금"), SAT("토"), SUN("일"); + + private final String value; +} diff --git a/src/main/java/com/moddy/server/domain/day_off/DayOff.java b/src/main/java/com/moddy/server/domain/day_off/DayOff.java new file mode 100644 index 00000000..50a7281e --- /dev/null +++ b/src/main/java/com/moddy/server/domain/day_off/DayOff.java @@ -0,0 +1,24 @@ +package com.moddy.server.domain.day_off; + +import com.moddy.server.domain.BaseTimeEntity; +import com.moddy.server.domain.user.User; +import jakarta.persistence.*; +import jakarta.validation.constraints.NotNull; + +@Entity +public class DayOff extends BaseTimeEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "user_id") + @NotNull + private User user; + + @Enumerated(EnumType.STRING) + @NotNull + private DayOfWeek dayOfWeek; + +} diff --git a/src/main/java/com/moddy/server/domain/designer/Designer.java b/src/main/java/com/moddy/server/domain/designer/Designer.java new file mode 100644 index 00000000..368f750f --- /dev/null +++ b/src/main/java/com/moddy/server/domain/designer/Designer.java @@ -0,0 +1,23 @@ +package com.moddy.server.domain.designer; + +import com.moddy.server.domain.user.User; +import jakarta.persistence.Embedded; +import jakarta.persistence.Entity; +import jakarta.validation.constraints.NotNull; + +@Entity +public class Designer extends User { + + @Embedded + private HairShop hairShop; + + @Embedded + private Portfolio portfolio; + + @NotNull + private String introduction; + + @NotNull + private String kakaoOpenChatUrl; + +} diff --git a/src/main/java/com/moddy/server/domain/designer/HairShop.java b/src/main/java/com/moddy/server/domain/designer/HairShop.java new file mode 100644 index 00000000..3d979cdb --- /dev/null +++ b/src/main/java/com/moddy/server/domain/designer/HairShop.java @@ -0,0 +1,20 @@ +package com.moddy.server.domain.designer; + +import jakarta.persistence.Column; +import jakarta.persistence.Embeddable; +import jakarta.validation.constraints.NotNull; + +@Embeddable +public class HairShop { + @NotNull + @Column(name = "hair_shop_name") + private String name; + + @NotNull + @Column(name = "hair_shop_address") + private String address; + + @NotNull + @Column(name = "hair_shop_detail_address") + private String detailAddress; +} diff --git a/src/main/java/com/moddy/server/domain/designer/Portfolio.java b/src/main/java/com/moddy/server/domain/designer/Portfolio.java new file mode 100644 index 00000000..158dd4ce --- /dev/null +++ b/src/main/java/com/moddy/server/domain/designer/Portfolio.java @@ -0,0 +1,14 @@ +package com.moddy.server.domain.designer; + +import jakarta.persistence.Embeddable; +import jakarta.validation.constraints.NotNull; + +@Embeddable +public class Portfolio { + @NotNull + private String instagramUrl; + + @NotNull + private String naverPlaceUrl; + +} diff --git a/src/main/java/com/moddy/server/domain/hair_model_application/HairLength.java b/src/main/java/com/moddy/server/domain/hair_model_application/HairLength.java new file mode 100644 index 00000000..57dca38c --- /dev/null +++ b/src/main/java/com/moddy/server/domain/hair_model_application/HairLength.java @@ -0,0 +1,12 @@ +package com.moddy.server.domain.hair_model_application; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +@Getter +public enum HairLength { + SHORT("숏"), ABOVE_SHOULDER("단발"), UNDER_SHOULDER("어깨 아래"), UNDER_WAIST("허리 아래"); + + private final String value; +} diff --git a/src/main/java/com/moddy/server/domain/hair_model_application/HairModelApplication.java b/src/main/java/com/moddy/server/domain/hair_model_application/HairModelApplication.java new file mode 100644 index 00000000..6713a5d4 --- /dev/null +++ b/src/main/java/com/moddy/server/domain/hair_model_application/HairModelApplication.java @@ -0,0 +1,44 @@ +package com.moddy.server.domain.hair_model_application; + +import com.moddy.server.domain.BaseTimeEntity; +import com.moddy.server.domain.designer.Designer; +import com.moddy.server.domain.user.User; +import jakarta.persistence.*; +import jakarta.validation.constraints.NotNull; + +@Entity +public class HairModelApplication extends BaseTimeEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "user_id") + @NotNull + private User user; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "designer_id_") + @NotNull + private Designer designer; + + @Enumerated(value = EnumType.STRING) + @NotNull + private HairLength hairLength; + + @NotNull + private String hairDetail; + + @NotNull + private String modelImgUrl; + + @NotNull + private String instagramId; + + @NotNull + private String applicationCaptureUrl; + + @NotNull + private Boolean isSend; + +} diff --git a/src/main/java/com/moddy/server/domain/hair_service_record/HairServiceRecord.java b/src/main/java/com/moddy/server/domain/hair_service_record/HairServiceRecord.java new file mode 100644 index 00000000..48ecf98e --- /dev/null +++ b/src/main/java/com/moddy/server/domain/hair_service_record/HairServiceRecord.java @@ -0,0 +1,27 @@ +package com.moddy.server.domain.hair_service_record; + +import com.moddy.server.domain.BaseTimeEntity; +import com.moddy.server.domain.hair_model_application.HairModelApplication; +import jakarta.persistence.*; +import jakarta.validation.constraints.NotNull; + +@Entity +public class HairServiceRecord extends BaseTimeEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @NotNull + private HairModelApplication hairModelApplication; + + @Enumerated(value = EnumType.STRING) + @NotNull + private ServiceRecord serviceRecord; + + @Enumerated(value = EnumType.STRING) + @NotNull + private ServiceRecordTerm serviceRecordTerm; + + +} diff --git a/src/main/java/com/moddy/server/domain/hair_service_record/ServiceRecord.java b/src/main/java/com/moddy/server/domain/hair_service_record/ServiceRecord.java new file mode 100644 index 00000000..84c6bb0a --- /dev/null +++ b/src/main/java/com/moddy/server/domain/hair_service_record/ServiceRecord.java @@ -0,0 +1,12 @@ +package com.moddy.server.domain.hair_service_record; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum ServiceRecord { + PERM("펌"), DECOLOR("탈색"), BLACK("블랙 염색"), COLOR("컬러 염색"); + + private final String value; +} diff --git a/src/main/java/com/moddy/server/domain/hair_service_record/ServiceRecordTerm.java b/src/main/java/com/moddy/server/domain/hair_service_record/ServiceRecordTerm.java new file mode 100644 index 00000000..8e359eae --- /dev/null +++ b/src/main/java/com/moddy/server/domain/hair_service_record/ServiceRecordTerm.java @@ -0,0 +1,11 @@ +package com.moddy.server.domain.hair_service_record; + +import lombok.AllArgsConstructor; +import lombok.Getter; +@Getter +@AllArgsConstructor +public enum ServiceRecordTerm { + UNDER_ONE("1 개월 미만"), ONE_THREE("1 - 3 개월"), FOUR_SIX("4 - 6 개월"), SEVEN_TWELVE("7 - 12 개월"), ABOVE_TWELVE("12 개월 초과"); + + private final String value; +} diff --git a/src/main/java/com/moddy/server/domain/har_service_offer/HairServiceOffer.java b/src/main/java/com/moddy/server/domain/har_service_offer/HairServiceOffer.java new file mode 100644 index 00000000..f824f421 --- /dev/null +++ b/src/main/java/com/moddy/server/domain/har_service_offer/HairServiceOffer.java @@ -0,0 +1,36 @@ +package com.moddy.server.domain.har_service_offer; + +import com.moddy.server.domain.BaseTimeEntity; +import com.moddy.server.domain.designer.Designer; +import com.moddy.server.domain.hair_model_application.HairModelApplication; +import com.moddy.server.domain.user.User; +import jakarta.persistence.*; +import jakarta.validation.constraints.NotNull; + +@Entity +public class HairServiceOffer extends BaseTimeEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @NotNull + private HairModelApplication hairModelApplication; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "user_id") + @NotNull + private User user; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "designer_id_") + @NotNull + private Designer designer; + + @NotNull + private String offerDetail; + + @NotNull + private Boolean isModelAgree; + +} diff --git a/src/main/java/com/moddy/server/domain/prefer_hair_style/HairStyle.java b/src/main/java/com/moddy/server/domain/prefer_hair_style/HairStyle.java new file mode 100644 index 00000000..64eaf398 --- /dev/null +++ b/src/main/java/com/moddy/server/domain/prefer_hair_style/HairStyle.java @@ -0,0 +1,12 @@ +package com.moddy.server.domain.prefer_hair_style; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +@Getter +public enum HairStyle { + NORMAL_CUT("일반 커트"), ALL_COLOR("전체 염색"), ALL_DECOLOR("전체 탈색"), SETTING_PERM("셋팅펌"), NORMAL_PERM("일반펌"), STRAIGHTENING("매직"); + + private final String value; +} diff --git a/src/main/java/com/moddy/server/domain/prefer_hair_style/PreferHairStyle.java b/src/main/java/com/moddy/server/domain/prefer_hair_style/PreferHairStyle.java new file mode 100644 index 00000000..010dfb55 --- /dev/null +++ b/src/main/java/com/moddy/server/domain/prefer_hair_style/PreferHairStyle.java @@ -0,0 +1,22 @@ +package com.moddy.server.domain.prefer_hair_style; + +import com.moddy.server.domain.BaseTimeEntity; +import com.moddy.server.domain.hair_model_application.HairModelApplication; +import jakarta.persistence.*; +import jakarta.validation.constraints.NotNull; + +@Entity +public class PreferHairStyle extends BaseTimeEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @NotNull + private HairModelApplication hairModelApplication; + + @Enumerated(value = EnumType.STRING) + @NotNull + private HairStyle hairStyle; + +} diff --git a/src/main/java/com/moddy/server/domain/prefer_offer_condition/OfferCondition.java b/src/main/java/com/moddy/server/domain/prefer_offer_condition/OfferCondition.java new file mode 100644 index 00000000..b05c7530 --- /dev/null +++ b/src/main/java/com/moddy/server/domain/prefer_offer_condition/OfferCondition.java @@ -0,0 +1,5 @@ +package com.moddy.server.domain.prefer_offer_condition; + +public enum OfferCondition { + CAMERA, MASK, SNS, PHOTOSHOP, FREE, SMALL_PAY +} diff --git a/src/main/java/com/moddy/server/domain/prefer_offer_condition/PreferOfferCondition.java b/src/main/java/com/moddy/server/domain/prefer_offer_condition/PreferOfferCondition.java new file mode 100644 index 00000000..6ca60d22 --- /dev/null +++ b/src/main/java/com/moddy/server/domain/prefer_offer_condition/PreferOfferCondition.java @@ -0,0 +1,23 @@ +package com.moddy.server.domain.prefer_offer_condition; + +import com.moddy.server.domain.BaseTimeEntity; +import com.moddy.server.domain.har_service_offer.HairServiceOffer; +import jakarta.persistence.*; +import jakarta.validation.constraints.NotNull; + +@Entity +public class PreferOfferCondition extends BaseTimeEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "hair_service_offer_id_") + @NotNull + private HairServiceOffer hairServiceOffer; + + @Enumerated(value=EnumType.STRING) + @NotNull + private OfferCondition offerCondition; + +} diff --git a/src/main/java/com/moddy/server/domain/prefer_region/PreferRegion.java b/src/main/java/com/moddy/server/domain/prefer_region/PreferRegion.java new file mode 100644 index 00000000..0a3eee76 --- /dev/null +++ b/src/main/java/com/moddy/server/domain/prefer_region/PreferRegion.java @@ -0,0 +1,31 @@ +package com.moddy.server.domain.prefer_region; + +import com.moddy.server.domain.BaseTimeEntity; +import com.moddy.server.domain.region.Region; +import com.moddy.server.domain.user.User; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.validation.constraints.NotNull; + +@Entity +public class PreferRegion extends BaseTimeEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "user_id") + @NotNull + private User user; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "region_id") + @NotNull + private Region region; + +} diff --git a/src/main/java/com/moddy/server/domain/region/Region.java b/src/main/java/com/moddy/server/domain/region/Region.java new file mode 100644 index 00000000..b7cc9873 --- /dev/null +++ b/src/main/java/com/moddy/server/domain/region/Region.java @@ -0,0 +1,19 @@ +package com.moddy.server.domain.region; + +import com.moddy.server.domain.BaseTimeEntity; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.validation.constraints.NotNull; + +@Entity +public class Region extends BaseTimeEntity{ + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @NotNull + private String name; + +} diff --git a/src/main/java/com/moddy/server/domain/user/Gender.java b/src/main/java/com/moddy/server/domain/user/Gender.java new file mode 100644 index 00000000..817413b2 --- /dev/null +++ b/src/main/java/com/moddy/server/domain/user/Gender.java @@ -0,0 +1,11 @@ +package com.moddy.server.domain.user; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum Gender { + MALE("남성"), FEMALE("여성"); + private final String value; +} diff --git a/src/main/java/com/moddy/server/domain/user/User.java b/src/main/java/com/moddy/server/domain/user/User.java new file mode 100644 index 00000000..790e9a9a --- /dev/null +++ b/src/main/java/com/moddy/server/domain/user/User.java @@ -0,0 +1,45 @@ +package com.moddy.server.domain.user; + +import com.moddy.server.domain.BaseTimeEntity; +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.validation.constraints.NotNull; + +@Entity +public class User extends BaseTimeEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @NotNull + private String kakaoId; + + @NotNull + private String name; + + @NotNull + private String year; + + @Enumerated(value = EnumType.STRING) + @NotNull + private Gender gender; + + @NotNull + private String phoneNumber; + + @NotNull + private String isMarketingAgree; + + @NotNull + private String profileImgUrl; + + @NotNull + @Enumerated(EnumType.STRING) + private Role role; + +}