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 all 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
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.example.security.dto.AuthenticatedUser;
import org.example.security.dto.TokenParam;
import org.example.security.dto.UserParam;
import org.example.security.token.JWTGenerator;
import org.example.security.token.JWTHandler;
import org.example.security.token.RefreshTokenProcessor;
import org.example.security.vo.TokenError;
Expand All @@ -28,7 +27,6 @@
public class JWTFilter extends OncePerRequestFilter {

private final JWTHandler jwtHandler;
private final JWTGenerator jwtGenerator;
private final RefreshTokenProcessor refreshTokenProcessor;
private final TokenRepository tokenRepository;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.example.entity.credential.GoogleSocialCredential;
import org.example.entity.credential.KakaoSocialCredential;
import org.example.entity.credential.SocialCredential;
import org.example.entity.credential.SocialCredentials;
import org.example.entity.credential.SocialLoginCredential;
import org.example.service.dto.request.LoginServiceRequest;
import org.example.vo.SocialLoginType;

Expand All @@ -19,14 +19,14 @@ public record LoginApiRequest(

public LoginServiceRequest toLoginServiceRequest() {
return LoginServiceRequest.builder()
.socialCredentials(socialCredentials())
.socialLoginCredential(socialLoginCredential())
.build();
}

private SocialCredentials socialCredentials() {
SocialCredentials socialCredentials = new SocialCredentials();
socialCredentials.saveCredentials(socialLoginType, socialCredential());
return socialCredentials;
private SocialLoginCredential socialLoginCredential() {
SocialLoginCredential socialLoginCredential = new SocialLoginCredential();
socialLoginCredential.saveCredentials(socialLoginType, socialCredential());
return socialLoginCredential;
}

private SocialCredential socialCredential() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

import lombok.Builder;
import org.example.entity.User;
import org.example.entity.credential.SocialCredentials;
import org.example.entity.credential.SocialLoginCredential;

@Builder
public record LoginServiceRequest(
SocialCredentials socialCredentials
SocialLoginCredential socialLoginCredential
) {

public User toUser() {
return User.builder()
.socialCredentials(socialCredentials)
.socialLoginCredential(socialLoginCredential)
.build();
}
}
9 changes: 9 additions & 0 deletions app/domain/show-domain/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
bootJar.enabled = false
jar.enabled = true

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

// hypersistence utils
implementation 'io.hypersistence:hypersistence-utils-hibernate-63:3.7.6'
devmizz 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.artist;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.example.entity.BaseEntity;

@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;

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

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;
import org.example.entity.BaseEntity;

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

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

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "artist_id")
private Artist artist;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.example.entity.genre;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.example.entity.BaseEntity;

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

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

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

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Enumerated;
import jakarta.persistence.Table;
import java.time.LocalDate;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.example.entity.BaseEntity;
import org.example.entity.show.info.SeatPrice;
import org.example.entity.show.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;

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

@Enumerated
private SeatPrice seatPrice;

@Enumerated
private Ticketing ticketing;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.example.entity.show;

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;
import org.example.entity.BaseEntity;

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

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

@Column(name = "artist_id", nullable = false)
private UUID artistId;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.example.entity.show;

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;
import org.example.entity.BaseEntity;

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

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

@Column(name = "genre_id", nullable = false)
private UUID genreId;

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

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;
import org.example.entity.BaseEntity;

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

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

@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.show.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 SeatPrice {

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

public void savePriceInformation(String seatType, Integer price) {
priceInformation.put(seatType, price);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.example.entity.show.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 Ticketing {

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

public void saveTicketingInformation(
String ticketBookingSite,
String ticketingSiteUrl
) {
ticketingInformation.put(ticketBookingSite, ticketingSiteUrl);
}
}
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;

}
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;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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;
}
Loading