Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/#43 도메인 작성 #44

Merged
merged 13 commits into from
Jan 8, 2024
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.moddy.server.common.domain;
package com.moddy.server.domain;

import jakarta.persistence.EntityListeners;
import jakarta.persistence.MappedSuperclass;
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/com/moddy/server/domain/day_off/DayOfWeek.java
Original file line number Diff line number Diff line change
@@ -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;
}
24 changes: 24 additions & 0 deletions src/main/java/com/moddy/server/domain/day_off/DayOff.java
Original file line number Diff line number Diff line change
@@ -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;

}
23 changes: 23 additions & 0 deletions src/main/java/com/moddy/server/domain/designer/Designer.java
Original file line number Diff line number Diff line change
@@ -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;

}
20 changes: 20 additions & 0 deletions src/main/java/com/moddy/server/domain/designer/HairShop.java
Original file line number Diff line number Diff line change
@@ -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;
}
14 changes: 14 additions & 0 deletions src/main/java/com/moddy/server/domain/designer/Portfolio.java
Original file line number Diff line number Diff line change
@@ -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;

}
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;

}
Original file line number Diff line number Diff line change
@@ -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;


}
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;

}
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.moddy.server.domain.prefer_offer_condition;

public enum OfferCondition {
CAMERA, MASK, SNS, PHOTOSHOP, FREE, SMALL_PAY
}
Original file line number Diff line number Diff line change
@@ -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;

}
Original file line number Diff line number Diff line change
@@ -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;

}
19 changes: 19 additions & 0 deletions src/main/java/com/moddy/server/domain/region/Region.java
Original file line number Diff line number Diff line change
@@ -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;

}
11 changes: 11 additions & 0 deletions src/main/java/com/moddy/server/domain/user/Gender.java
Original file line number Diff line number Diff line change
@@ -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;
}
Loading