-
Notifications
You must be signed in to change notification settings - Fork 37
[1주차] 멀티 모듈 설계 및 요구사항 구현 #19
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
Open
somin-jeong
wants to merge
61
commits into
hanghae-skillup:main
Choose a base branch
from
somin-jeong:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 14 commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
c7ce33c
multi module project setting
somin-jeong e9a661b
build.gradle 상위 모듈 내용 제거 하위 모듈에서 제거
somin-jeong b2b4579
docker compose 활용하여 mysql 서버 띄우기
somin-jeong a0d309d
feat: BaseEntity 생성
somin-jeong c97914e
feat: Movie 엔티티 생성
somin-jeong 400b2d1
feat: ScreenRoom 엔티티 생성
somin-jeong c283b54
feat: ScreenSchedule 엔티티 생성
somin-jeong fcabb31
feat: 상영 중인 영화 조회 api 구현
somin-jeong 506c91b
fix: 등급 이름 변경
somin-jeong cd93c60
fix: 상영 시간 타입 변경
somin-jeong 68db7e8
fix: Dto에 @Getter 추가
somin-jeong 227aac3
feat: ddl.sql 추가
somin-jeong 106ab77
feat: IntelliJ Http Client 테스트 추가
somin-jeong c555564
docs: README.md 작성
somin-jeong b4b0df6
chore: api 모듈 이외 모듈에 jar.enable=true 설정
somin-jeong 626f07d
fix: 상영 중인 영화 조회 api 수정
somin-jeong c73f5a7
refactor: infra 모듈 제거
somin-jeong 37e080f
fix: ScreenSchedule 테이블 FK 제거
somin-jeong 961cadf
fix: FK 제거에 따른 쿼리문 수정
somin-jeong 58d53e4
rename: core 모듈 이름을 common으로 변경
somin-jeong 0b1a7c3
test: MovieController 테스트
somin-jeong 8b5ce69
feat: 검색 기능 추가
somin-jeong f17e144
feat: 장르 필터 validation 추가
somin-jeong f6fbebe
feat: 더미데이터 추가
somin-jeong a7ab822
feat: 인덱스 추가
somin-jeong ad31c2b
feat: Caffeine로컬 캐싱 추가
somin-jeong bb2b63d
docs: 2주차 README.md 추가
somin-jeong 960f1f8
feat: redis 활용한 분산 캐싱 적용
somin-jeong 4d0fb45
docs: 성능 테스트 보고서 작성
somin-jeong a7f3473
fix: 도커 컴포즈로 띄운 redis에 접근 안되는 문제 해결
somin-jeong ffc7b37
fix: redis 직렬화 역직렬화 문제 해결
somin-jeong 085d5e0
fix: redisson 적용하여 캐싱
somin-jeong 297c5cc
fix: test api 제거
somin-jeong 5d3b7ca
feat: 영화 예매 API 구현
somin-jeong a0cabfa
feat: 영화 예매 API 검증 추가
somin-jeong 794d020
feat: pessimistic lock 구현
somin-jeong 9796153
feat: BaseErrorResponse 구현
somin-jeong 3fdbf1b
fix: title 캐시 키에서 제거
somin-jeong 77c5b05
fix: ScreenSchedule 테이블에 단일 인덱스 추가
somin-jeong 6c77ded
fix: 캐싱 데이터 수정
somin-jeong a743a66
feat: pessimistic lock 구현 (테스트 성공)
somin-jeong f26fd2b
fix: Seat 테이블의 pessimistic lock 제거
somin-jeong a4bbba4
rename: 파일명 수정
somin-jeong 7d1be8a
refactor: 필요없는 쿼리 제거
somin-jeong 8f5db33
feat: 함수형 분산락 적용
somin-jeong c03a112
feat: guava ratelimiter 적용
somin-jeong 97fe8ec
feat: 조회 API에 Redisson RateLimit 적용
somin-jeong 9f15018
fix: 분산락 키 screenRoomId -> screenScheduleId
somin-jeong 088608f
fix: @Transactional 적용 내부 호출 메서드 별도의 클래스로 분리
somin-jeong 13796c8
fix: 분산락 범위 축소
somin-jeong 55965a8
test: 예약 API 통합 테스트 코드 작성
somin-jeong 00a3e41
fix: 예약 API 통합테스트 수정
somin-jeong 8968d8c
rename: RateLimiterTest 파일 이름 변경
somin-jeong 86f2725
test: 영화 조회 API 통합 테스트 코드 작성
somin-jeong 1123d61
test: reservation 단위 테스트
somin-jeong 3c26b1c
test: Seat 단위 테스트
somin-jeong 85e907c
test: ReservationSeat 단위 테스트
somin-jeong 0398645
fix: playing 필드 삭제
somin-jeong 7f2ff77
fix: leaseTime, waitTime 변경
somin-jeong 8395af7
test: jacoco 테스트 커버리지 확인
somin-jeong 2140a7f
docs: README.md 작성
somin-jeong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| /gradlew text eol=lf | ||
| *.bat text eol=crlf | ||
| *.jar binary |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| HELP.md | ||
| .gradle | ||
| build/ | ||
| !gradle/wrapper/gradle-wrapper.jar | ||
| !**/src/main/**/build/ | ||
| !**/src/test/**/build/ | ||
|
|
||
| ### STS ### | ||
| .apt_generated | ||
| .classpath | ||
| .factorypath | ||
| .project | ||
| .settings | ||
| .springBeans | ||
| .sts4-cache | ||
| bin/ | ||
| !**/src/main/**/bin/ | ||
| !**/src/test/**/bin/ | ||
|
|
||
| ### IntelliJ IDEA ### | ||
| .idea | ||
| *.iws | ||
| *.iml | ||
| *.ipr | ||
| out/ | ||
| !**/src/main/**/out/ | ||
| !**/src/test/**/out/ | ||
|
|
||
| ### NetBeans ### | ||
| /nbproject/private/ | ||
| /nbbuild/ | ||
| /dist/ | ||
| /nbdist/ | ||
| /.nb-gradle/ | ||
|
|
||
| ### VS Code ### | ||
| .vscode/ | ||
|
|
||
| .env |
This file contains hidden or 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,3 +1,59 @@ | ||
| ## [본 과정] 이커머스 핵심 프로세스 구현 | ||
| [단기 스킬업 Redis 교육 과정](https://hh-skillup.oopy.io/) 을 통해 상품 조회 및 주문 과정을 구현하며 현업에서 발생하는 문제를 Redis의 핵심 기술을 통해 해결합니다. | ||
| > Indexing, Caching을 통한 성능 개선 / 단계별 락 구현을 통한 동시성 이슈 해결 (낙관적/비관적 락, 분산락 등) | ||
|
|
||
| # Architecture | ||
| Layered Architecture를 적용했습니다. | ||
|
|
||
| # Multi-Module | ||
| ### module-api | ||
| 클라이언트의 요청 및 응답을 처리해줍니다. | ||
| 처리 결과를 반환하기 위한 비즈니스 로직을 처리합니다. | ||
|
|
||
| ### module-domain | ||
| 테이블과 매핑된 도메인을 관리하고 도메인 관련 핵심 비즈니스 로직을 처리합니다. | ||
| 데이터 접근을 위한 인터페이스를 관리합니다. | ||
|
|
||
| ### module-infra | ||
| domain 모듈에서 관리하는 인터페이스를 구현한 클래스를 관리합니다. | ||
|
|
||
| ### module-core | ||
| 다른 모듈들에서 공통으로 사용되는 클래스들을 모아두기 위한 모듈입니다. | ||
|
|
||
| # Table Design | ||
|  | ||
|
|
||
| ### Movie 테이블 | ||
| 제목, 썸네일, 장르, 등급, 개봉일, 러닝타임 등 영화 정보를 담고 있는 테이블입니다. | ||
|
|
||
| ### ScreenSchedule 테이블 | ||
| 영화가 시작하는 시간과 끝나는 시간 정보를 담고 있는 테이블입니다. | ||
|
|
||
| ### ScreenRoom 테이블 | ||
| 상영관 이름을 담고 있는 테이블입니다. | ||
|
|
||
| ### Users 테이블 | ||
| 사용자 정보를 담고 있는 테이블입니다. | ||
|
|
||
| ### Reservation 테이블 | ||
| 사용자가 예매한 시간과 좌석 정보를 담고 있는 테이블입니다. | ||
|
|
||
| ### 관계 | ||
| - 영화와 상영시간표 (1:N) | ||
| - 하나의 영화는 여러 개의 상영 시간표를 가질 수 있습니다. | ||
|
|
||
| - 상영관과 상영시간표 (1:N) | ||
| - 하나의 상영관은 여러 개의 상영 시간표에 배정될 수 있습니다. | ||
|
|
||
| - 상영관과 예매내역 (1:N) | ||
| - 하나의 상영관은 여러 개의 예매 내역에 포함될 수 있습니다. | ||
|
|
||
| - 사용자과 예매내역 (1:N) | ||
| - 하나의 사용자는 여러 개의 예매 내역을 가질 수 있습니다. | ||
|
|
||
| ### 생각해본 것 | ||
| 구현하다 보니까 상영관 테이블이 없어도 될 것 같다는 생각이 들었습니다. | ||
| 현재 상영관에 관한 요구사항이 없기 때문에 상영관 테이블에는 이름 속성 하나만 있습니다. | ||
| 하나의 속성만 갖고, 상영시간표 테이블과 비슷한 목적으로 만들어진 테이블을 하나 더 만드는 것이 성능 측면에서 안좋을 것이라고 생각하였습니다. | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 요구사항에 대해 많이 고민하신 부분이 보이네요. 고생 많으셨습니다. 👍 |
||
|
|
||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| plugins { | ||
| id 'java' | ||
| id 'org.springframework.boot' version '3.1.5' | ||
| id 'io.spring.dependency-management' version '1.1.3' | ||
| } | ||
|
|
||
| bootJar.enabled = false // 빌드시 현재 모듈(multi-module)의 .jar를 생성하지 않습니다. | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| } | ||
|
|
||
| subprojects { // 모든 하위 모듈들에 이 설정을 적용합니다. | ||
| group 'org.example' | ||
| version '0.0.1-SNAPSHOT' | ||
| sourceCompatibility = '17' | ||
|
|
||
| apply plugin: 'java' | ||
| apply plugin: 'java-library' | ||
| apply plugin: 'org.springframework.boot' | ||
| apply plugin: 'io.spring.dependency-management' | ||
|
|
||
| configurations { | ||
| compileOnly { | ||
| extendsFrom annotationProcessor | ||
| } | ||
| } | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| } | ||
|
|
||
| dependencies { // 모든 하위 모듈에 추가 될 의존성 목록입니다. | ||
| // Test | ||
| testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
|
|
||
| // JPA | ||
| implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
|
|
||
| // Web | ||
| implementation 'org.springframework.boot:spring-boot-starter-web' | ||
|
|
||
| // MySql | ||
| runtimeOnly 'mysql:mysql-connector-java:8.0.28' // mysql8 | ||
|
|
||
| // Lombok | ||
| compileOnly 'org.projectlombok:lombok' | ||
| annotationProcessor 'org.projectlombok:lombok' | ||
| } | ||
|
|
||
| test { | ||
| useJUnitPlatform() | ||
| } | ||
| } |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| services: | ||
| db: | ||
| image: mysql | ||
| restart: unless-stopped | ||
| env_file: | ||
| - .env | ||
| ports: | ||
| - "3305:3306" | ||
| volumes: | ||
| - ./mysql/conf.d:/etc/mysql/conf.d # MySQL 설정 파일 위치 | ||
| command: | ||
| - --character-set-server=utf8mb4 | ||
| - --collation-server=utf8mb4_general_ci | ||
| networks: | ||
| - test_network | ||
|
|
||
| networks: | ||
| test_network: |
Binary file not shown.
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip | ||
| networkTimeout=10000 | ||
| validateDistributionUrl=true | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 모듈의 이름을 common으로 변경하는 것도 고려해보시면 좋을 것 같습니다.
현재 이름인 core는 비즈니스 로직 중심의 역할로 오해될 가능성이 있으니, 공통 모듈임을 더 명확히 나타내는 common이라는 이름이 적합해 보입니다.