-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into booking/230
- Loading branch information
Showing
14 changed files
with
190 additions
and
119 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,32 +1,46 @@ | ||
## Bingterpark | ||
|
||
[노션 페이지](https://www.notion.so/backend-devcourse/2-BingterPark-4ecfb3943d9c4a8f9bb83f72876b6a80) | ||
[ERD](https://www.erdcloud.com/d/ZadArGCaQXFcxZuu8) | ||
|
||
### 모듈 구조 | ||
|
||
![img.png](img.png) | ||
|
||
#### api | ||
|
||
- api-member | ||
회원 도메인 | ||
회원 도메인 | ||
- api-event | ||
공연 도메인 | ||
공연 도메인 | ||
- api-booking | ||
예매 도메인 | ||
예매 도메인 | ||
|
||
#### batch | ||
|
||
스프링 배치 모듈 | ||
|
||
#### core | ||
|
||
- core-domain | ||
JPA 엔티티, 리포지토리 | ||
JPA 엔티티, 리포지토리 | ||
- core-infra | ||
queryDsl, RDB 설정 파일 | ||
queryDsl, RDB 설정 파일 | ||
- core-infra-es | ||
elastic search 설정 파일, document, searchRepository | ||
elastic search 설정 파일, document, searchRepository | ||
- core-security | ||
spring security 설정 파일 | ||
spring security 설정 파일 | ||
|
||
## 실행 방법 | ||
|
||
1. git clone | ||
2. RDB, 레디스 실행 ```docker-compose up -d``` | ||
3. api-event 모듈로 이동 ```cd /api/api-event``` | ||
4. 엘라스틱 서치 도커 이미지 빌드 ```docker build -t el:0.1 -f ./Dockerfile .``` | ||
5. ELK 스택 실행 ```docker-compose up -d``` | ||
6. api-booking, api-event, api-member 각 모듈에서 스프링 어플리케이션 실행 | ||
|
||
## 테스트 방법 | ||
|
||
- 통합 http 테스트는 /http/bingterpark.http에 있습니다. | ||
- 어드민 플로우, 유저 플로우 http 코드를 위에서부터 하나씩 실행하시면 됩니다. |
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
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
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
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
85 changes: 49 additions & 36 deletions
85
core/core-domain/src/main/java/com/pgms/coredomain/domain/event/EventHall.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 |
---|---|---|
@@ -1,49 +1,62 @@ | ||
package com.pgms.coredomain.domain.event; | ||
|
||
import com.pgms.coredomain.domain.common.BaseEntity; | ||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import com.pgms.coredomain.domain.common.BaseEntity; | ||
|
||
import jakarta.persistence.CascadeType; | ||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.OneToMany; | ||
import jakarta.persistence.Table; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Table(name = "event_hall") | ||
public class EventHall extends BaseEntity { | ||
|
||
@Id | ||
@Column(name = "id") | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Column(name = "event_name") | ||
private String name; | ||
|
||
@Column(name = "address") | ||
private String address; | ||
|
||
@OneToMany(mappedBy = "eventHall", cascade = CascadeType.ALL, orphanRemoval = true) | ||
private List<EventHallSeat> eventHallSeats = new ArrayList<>(); | ||
|
||
@Builder | ||
public EventHall(String name, String address, List<EventHallSeat> eventHallSeats) { | ||
this.name = name; | ||
this.address = address; | ||
this.eventHallSeats = eventHallSeats; | ||
setEventHallSeatsEventHall(); | ||
} | ||
|
||
public void setEventHallSeatsEventHall(){ | ||
if(this.eventHallSeats == null) return; | ||
this.eventHallSeats.forEach(eventHallSeat -> eventHallSeat.setEventHall(this)); | ||
} | ||
|
||
public void updateEventHall(EventHallEdit eventHallEdit){ | ||
this.name = eventHallEdit.getName(); | ||
this.address = eventHallEdit.getAddress(); | ||
this.eventHallSeats = eventHallEdit.getEventHallSeats(); | ||
} | ||
@Id | ||
@Column(name = "id") | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Column(name = "name") | ||
private String name; | ||
|
||
@Column(name = "address") | ||
private String address; | ||
|
||
@OneToMany(mappedBy = "eventHall", cascade = CascadeType.ALL, orphanRemoval = true) | ||
private List<EventHallSeat> eventHallSeats = new ArrayList<>(); | ||
|
||
@Builder | ||
public EventHall(String name, String address, List<EventHallSeat> eventHallSeats) { | ||
this.name = name; | ||
this.address = address; | ||
this.eventHallSeats = eventHallSeats; | ||
setEventHallSeatsEventHall(); | ||
} | ||
|
||
public void setEventHallSeatsEventHall() { | ||
if (this.eventHallSeats == null) | ||
return; | ||
this.eventHallSeats.forEach(eventHallSeat -> eventHallSeat.setEventHall(this)); | ||
} | ||
|
||
public void updateEventHall(EventHallEdit eventHallEdit) { | ||
this.name = eventHallEdit.getName(); | ||
this.address = eventHallEdit.getAddress(); | ||
this.eventHallSeats = eventHallEdit.getEventHallSeats(); | ||
} | ||
} |
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
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
Oops, something went wrong.