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 : 엔티티 세팅 #22

Merged
merged 21 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
22a6041
feat : show, image 도메인 엔티티 추가
GaBaljaintheroom Jun 15, 2024
3766c80
refactor : show 엔티티 수정
GaBaljaintheroom Jun 15, 2024
6268274
feat : artist 도메인 엔티티 추가
GaBaljaintheroom Jun 15, 2024
451b57b
feat : SubscribeArtist 도메인 엔티티 추가
GaBaljaintheroom Jun 15, 2024
a4e235a
feat : Genre 도메인 엔티티 추가
GaBaljaintheroom Jun 15, 2024
5b8b500
feat : SubscribeGenre 도메인 엔티티 추가
GaBaljaintheroom Jun 15, 2024
d44cd99
feat : InterestShow 도메인 엔티티 추가
GaBaljaintheroom Jun 15, 2024
31232e8
feat : TicketingAlert 도메인 엔티티 추가
GaBaljaintheroom Jun 15, 2024
4cd88fc
refactor : User, Show 도메인으로 분리
GaBaljaintheroom Jun 18, 2024
1dc7d44
refactor : TicketingAlert 알림 예약 시간 필드명 수정
GaBaljaintheroom Jun 18, 2024
236cfe0
refactor : 좌석 별 가격 필드명 수정
GaBaljaintheroom Jun 18, 2024
4ae22f3
refactor : 검색용 테이블 name 필드명으로 수정
GaBaljaintheroom Jun 18, 2024
a15f35f
refactor : ShowGenre, ShowArtist 중간 테이블 생성
GaBaljaintheroom Jun 18, 2024
ebdf4e4
refactor : showImage 테이블 생성
GaBaljaintheroom Jun 18, 2024
8e0cf3a
refactor : show 모듈 도메인 패키지 분리
GaBaljaintheroom Jun 18, 2024
ac1ec4d
refactor : User 엔티티 필드 수정
GaBaljaintheroom Jun 18, 2024
cd535cd
refactor : 사용하지 않는 멤버변수 삭제
GaBaljaintheroom Jun 18, 2024
f059b15
refactor : Artist, Genre 의미 없는 관계 삭제
GaBaljaintheroom Jun 20, 2024
8b84aef
refactor : 알림 시간 필드명 수정
GaBaljaintheroom Jun 20, 2024
c78a7f6
refactor : Show image 타입 수정
GaBaljaintheroom Jun 20, 2024
8491094
refactor : Ticketing Map 키 타입 수정
GaBaljaintheroom Jun 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/domain/artist-domain/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bootJar.enabled = false
jar.enabled = true

dependencies {
implementation project(":app:domain:common-domain")
implementation project(":app:domain:show-domain")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package org.example.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Table(name = "app_artist")
public class Artist extends BaseEntity {

@Column(name = "english_name", nullable = false)
private String englishName;

@Column(name = "korean_name", nullable = false)
private String koreanName;

@Column(name = "country", nullable = false)
private String country;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "show_id")
private Show show;
devmizz marked this conversation as resolved.
Show resolved Hide resolved

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.example.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Table(name = "app_artist_search")
public class ArtistSearch extends BaseEntity {

@Column(name = "artist_name", nullable = false)
private String artistName;
devmizz marked this conversation as resolved.
Show resolved Hide resolved

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "artist_id")
private Artist artist;
}
7 changes: 7 additions & 0 deletions app/domain/genre-domain/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bootJar.enabled = false
jar.enabled = true

dependencies {
implementation project(":app:domain:common-domain")
implementation project(":app:domain:show-domain")
devmizz marked this conversation as resolved.
Show resolved Hide resolved
}
GaBaljaintheroom marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.example.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Table(name = "app_genre")
public class Genre extends BaseEntity {

@Column(name = "name", nullable = false)
private String name;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "show_id")
private Show show;
devmizz marked this conversation as resolved.
Show resolved Hide resolved

}
6 changes: 6 additions & 0 deletions app/domain/image-domain/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bootJar.enabled = false
jar.enabled = true

dependencies {
implementation project(":app:domain:common-domain")
}
devmizz marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.example.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import java.util.UUID;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Table(name = "app_image")
public class Image extends BaseEntity {

@Column(name = "url", nullable = false)
private String url;

@Column(name = "show_id", nullable = false)
private UUID showId;

}
6 changes: 6 additions & 0 deletions app/domain/interest-show-domain/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bootJar.enabled = false
jar.enabled = true

dependencies {
implementation project(":app:domain:common-domain")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.example.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import java.util.UUID;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Table(name = "app_interest_show")
public class InterestShow extends BaseEntity {

@Column(name = "user_id", nullable = false)
private UUID userId;

@Column(name = "show_id", nullable = false)
private UUID showId;

}
10 changes: 10 additions & 0 deletions app/domain/show-domain/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
bootJar.enabled = false
jar.enabled = true

dependencies {
implementation project(":app:domain:common-domain")
implementation project(":app:domain:image-domain")

// hypersistence utils
implementation 'io.hypersistence:hypersistence-utils-hibernate-63:3.7.6'
devmizz marked this conversation as resolved.
Show resolved Hide resolved
}
45 changes: 45 additions & 0 deletions app/domain/show-domain/src/main/java/org/example/entity/Show.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package org.example.entity;

import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Enumerated;
import jakarta.persistence.OneToMany;
import jakarta.persistence.Table;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.example.entity.info.Price;
import org.example.entity.info.Ticketing;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Table(name = "app_show")
public class Show extends BaseEntity {

@Column(name = "title", nullable = false)
private String title;

@Column(name = "content", nullable = false)
private String content;

@Column(name = "date", nullable = false)
private LocalDate date;

@Column(name = "location", nullable = false)
private String location;

@Enumerated
private Price price;

@Enumerated
private Ticketing ticketing;

@OneToMany(mappedBy = "app_show", cascade = CascadeType.ALL, orphanRemoval = true)
private List<Image> images = new ArrayList<>();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.example.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Table(name = "app_show_search")
public class ShowSearch extends BaseEntity {

@Column(name = "show_name", nullable = false)
private String showName;
devmizz marked this conversation as resolved.
Show resolved Hide resolved

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "show_id")
private Show show;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.example.entity.info;

import io.hypersistence.utils.hibernate.type.json.JsonType;
import jakarta.persistence.Column;
import jakarta.persistence.Embeddable;
import java.util.HashMap;
import java.util.Map;
import org.hibernate.annotations.Type;

@Embeddable
public class Price {
devmizz marked this conversation as resolved.
Show resolved Hide resolved

@Type(JsonType.class)
@Column(name = "price", columnDefinition = "jsonb", nullable = false)
private Map<String, Integer> priceInformation = new HashMap<>();

public void savePriceInformation(String seatType, Integer won) {
priceInformation.put(seatType, won);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.example.entity.info;

import io.hypersistence.utils.hibernate.type.json.JsonType;
import jakarta.persistence.Column;
import jakarta.persistence.Embeddable;
import java.util.HashMap;
import java.util.Map;
import org.example.vo.TicketBookingSite;
import org.hibernate.annotations.Type;

@Embeddable
public class Ticketing {

@Type(JsonType.class)
@Column(name = "ticketing", columnDefinition = "jsonb", nullable = false)
private Map<TicketBookingSite, String> ticketingInformation = new HashMap<>();

public void saveTicketingInformation(TicketBookingSite ticketBookingSite, String ticketingSiteUrl) {
ticketingInformation.put(ticketBookingSite, ticketingSiteUrl);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.example.vo;

public enum TicketBookingSite {
devmizz marked this conversation as resolved.
Show resolved Hide resolved
YES24, INTERPARK
}
6 changes: 6 additions & 0 deletions app/domain/subscribe-artist-domain/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bootJar.enabled = false
jar.enabled = true

dependencies {
implementation project(":app:domain:common-domain")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.example.entity;


import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import java.util.UUID;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Table(name = "app_subscribe_artist")
public class SubscribeArtist extends BaseEntity {

@Column(name = "user_id", nullable = false)
private UUID userId;

@Column(name = "artist_id", nullable = false)
private UUID artistId;

}
6 changes: 6 additions & 0 deletions app/domain/subscribe-genre-domain/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bootJar.enabled = false
jar.enabled = true

dependencies {
implementation project(":app:domain:common-domain")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.example.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import java.util.UUID;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Table(name = "app_subscribe_genre")
public class SubscribeGenre extends BaseEntity {


@Column(name = "user_id", nullable = false)
private UUID userId;

@Column(name = "genre_id", nullable = false)
private UUID genreId;
}
6 changes: 6 additions & 0 deletions app/domain/ticket-alert-domain/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bootJar.enabled = false
jar.enabled = true

dependencies {
implementation project(":app:domain:common-domain")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package org.example.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import java.time.LocalDateTime;
import java.util.UUID;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Table(name = "app_ticketing_alert")
public class TicketingAlert extends BaseEntity {

@Column(name = "name", nullable = false)
private String name;

@Column(name = "date", nullable = false)
private LocalDateTime localDateTime;
devmizz marked this conversation as resolved.
Show resolved Hide resolved

@Column(name = "user_id", nullable = false)
private UUID userId;

@Column(name = "show_id", nullable = false)
private UUID showId;
}
Loading