-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: 스케줄링 서버 분리를 위한 모듈 생성 - core build.gradle JPA, MySQL 추가 및 api-server build.gradle에서 삭제 - settings.gradle schedule-server 모듈 추가 - schedule-server 모듈 생성 * refactor: 공통 사용 엔티티 core 모듈로 이동 - Ticket, Member, Purchase, Festival 엔티티 api 모듈 -> core 모듈로 이동 - Auditing config core 모듈로 이동 * refactor: 스케쥴링 모듈 분리 및 모듈 분리에 따른 api 모듈 리팩터링 - 테스트 및 비즈니스 로직 코드 이동 - JPA Repository 생성 및 테스트용 JPA Repository 생성 - FestivalService 스케쥴링 코드 주석 처리 - FestivalsApplication @EnableScheduling 삭제 * config: Jacoco 설정 변경 * test: 테스트를 위한 임베디드 레디스 설정
- Loading branch information
1 parent
582b48c
commit 4bb4d50
Showing
49 changed files
with
511 additions
and
99 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
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
1 change: 1 addition & 0 deletions
1
...api-server/src/main/java/com/wootecam/festivals/domain/ticket/dto/TicketListResponse.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
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
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
2 changes: 1 addition & 1 deletion
2
...als/domain/ticket/dto/TicketResponse.java → ...s/domain/festival/dto/TicketResponse.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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dependencies { | ||
} |
15 changes: 15 additions & 0 deletions
15
backend/schedule-server/src/main/java/com/wootecam/festivals/ScheduleServerApplication.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.wootecam.festivals; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.autoconfigure.domain.EntityScan; | ||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories; | ||
|
||
@SpringBootApplication | ||
public class ScheduleServerApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(ScheduleServerApplication.class, args); | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
...r/src/main/java/com/wootecam/festivals/domain/festival/repository/FestivalRepository.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.wootecam.festivals.domain.festival.repository; | ||
|
||
import com.wootecam.festivals.domain.festival.entity.Festival; | ||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Modifying; | ||
import org.springframework.data.jpa.repository.Query; | ||
|
||
public interface FestivalRepository extends JpaRepository<Festival, Long> { | ||
|
||
@Modifying | ||
@Query("UPDATE Festival f SET f.festivalProgressStatus = 'COMPLETED' WHERE f.festivalProgressStatus != 'COMPLETED' AND f.endTime <= :now") | ||
void bulkUpdateCOMPLETEDFestivals(LocalDateTime now); | ||
|
||
@Modifying | ||
@Query("UPDATE Festival f SET f.festivalProgressStatus = 'ONGOING' WHERE f.festivalProgressStatus = 'UPCOMING' AND f.startTime <= :now") | ||
void bulkUpdateONGOINGFestivals(LocalDateTime now); | ||
|
||
@Query("SELECT f FROM Festival f WHERE f.festivalProgressStatus != 'COMPLETED' AND f.isDeleted = false") | ||
List<Festival> findFestivalsWithRestartScheduler(); | ||
} |
File renamed without changes.
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
23 changes: 23 additions & 0 deletions
23
...erver/src/main/java/com/wootecam/festivals/domain/ticket/repository/TicketRepository.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.wootecam.festivals.domain.ticket.repository; | ||
|
||
import com.wootecam.festivals.domain.festival.dto.TicketResponse; | ||
import com.wootecam.festivals.domain.ticket.entity.Ticket; | ||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
|
||
public interface TicketRepository extends JpaRepository<Ticket, Long> { | ||
|
||
@Query(""" | ||
SELECT new com.wootecam.festivals.domain.festival.dto.TicketResponse( | ||
t.id, t.name, t.detail, t.price, t.quantity, | ||
(SELECT count(ts.id) FROM TicketStock ts WHERE ts.ticket.id = t.id AND ts.memberId IS NULL), | ||
t.startSaleTime, t.endSaleTime, t.refundEndTime, t.createdAt, t.updatedAt | ||
) | ||
FROM Ticket t | ||
WHERE t.startSaleTime >= :now OR (t.startSaleTime <= :now AND t.endSaleTime >= :now) | ||
AND t.isDeleted = false | ||
""") | ||
List<TicketResponse> findUpcomingAndOngoingSaleTickets(LocalDateTime now); | ||
} |
2 changes: 1 addition & 1 deletion
2
...ticket/service/TicketScheduleService.java → ...ticket/service/TicketScheduleService.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
File renamed without changes.
Oops, something went wrong.