-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # backend/src/test/java/com/festago/festival/application/integration/query/PopularFestivalV1QueryServiceIntegrationTest.java
- Loading branch information
Showing
83 changed files
with
1,846 additions
and
681 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
backend/src/main/java/com/festago/admin/application/AdminQueryInfoRenewalService.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,38 @@ | ||
package com.festago.admin.application; | ||
|
||
import com.festago.admin.repository.AdminFestivalIdResolverQueryDslRepository; | ||
import com.festago.admin.repository.AdminStageIdResolverQueryDslRepository; | ||
import com.festago.festival.application.FestivalQueryInfoArtistRenewService; | ||
import com.festago.stage.application.StageQueryInfoService; | ||
import java.time.LocalDate; | ||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Slf4j | ||
@Service | ||
@Transactional | ||
@RequiredArgsConstructor | ||
public class AdminQueryInfoRenewalService { | ||
|
||
private final FestivalQueryInfoArtistRenewService festivalQueryInfoArtistRenewService; | ||
private final StageQueryInfoService stageQueryInfoService; | ||
private final AdminStageIdResolverQueryDslRepository adminStageIdResolverQueryDslRepository; | ||
private final AdminFestivalIdResolverQueryDslRepository adminFestivalIdResolverQueryDslRepository; | ||
|
||
public void renewalByFestivalId(Long festivalId) { | ||
festivalQueryInfoArtistRenewService.renewArtistInfo(festivalId); | ||
adminStageIdResolverQueryDslRepository.findStageIdsByFestivalId(festivalId) | ||
.forEach(stageQueryInfoService::renewalStageQueryInfo); | ||
} | ||
|
||
public void renewalByFestivalStartDatePeriod(LocalDate to, LocalDate end) { | ||
List<Long> festivalIds = adminFestivalIdResolverQueryDslRepository.findFestivalIdsByStartDatePeriod(to, end); | ||
log.info("{}개의 축제에 대해 QueryInfo를 새로 갱신합니다.", festivalIds.size()); | ||
festivalIds.forEach(festivalQueryInfoArtistRenewService::renewArtistInfo); | ||
adminStageIdResolverQueryDslRepository.findStageIdsByFestivalIdIn(festivalIds) | ||
.forEach(stageQueryInfoService::renewalStageQueryInfo); | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
...rc/main/java/com/festago/admin/dto/queryinfo/QueryInfoRenewalFestivalPeriodV1Request.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,11 @@ | ||
package com.festago.admin.dto.queryinfo; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import java.time.LocalDate; | ||
|
||
public record QueryInfoRenewalFestivalPeriodV1Request( | ||
@NotNull LocalDate to, | ||
@NotNull LocalDate end | ||
) { | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
backend/src/main/java/com/festago/admin/dto/school/SchoolV1CreateRequest.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
2 changes: 1 addition & 1 deletion
2
backend/src/main/java/com/festago/admin/dto/school/SchoolV1UpdateRequest.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
11 changes: 11 additions & 0 deletions
11
...main/java/com/festago/admin/dto/upload/AdminDeleteAbandonedPeriodUploadFileV1Request.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,11 @@ | ||
package com.festago.admin.dto.upload; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import java.time.LocalDateTime; | ||
|
||
public record AdminDeleteAbandonedPeriodUploadFileV1Request( | ||
@NotNull LocalDateTime startTime, | ||
@NotNull LocalDateTime endTime | ||
) { | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
...nd/src/main/java/com/festago/admin/presentation/v1/AdminQueryInfoRenewalV1Controller.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,38 @@ | ||
package com.festago.admin.presentation.v1; | ||
|
||
import com.festago.admin.application.AdminQueryInfoRenewalService; | ||
import com.festago.admin.dto.queryinfo.QueryInfoRenewalFestivalPeriodV1Request; | ||
import io.swagger.v3.oas.annotations.Hidden; | ||
import jakarta.validation.Valid; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequestMapping("/admin/api/v1/query-info/renewal") | ||
@RequiredArgsConstructor | ||
@Hidden | ||
public class AdminQueryInfoRenewalV1Controller { | ||
|
||
private final AdminQueryInfoRenewalService queryInfoRenewalService; | ||
|
||
@PostMapping("/festival-id/{festivalId}") | ||
public ResponseEntity<Void> renewalByFestivalId( | ||
@PathVariable Long festivalId | ||
) { | ||
queryInfoRenewalService.renewalByFestivalId(festivalId); | ||
return ResponseEntity.ok().build(); | ||
} | ||
|
||
@PostMapping("/festival-period") | ||
public ResponseEntity<Void> renewalByFestivalStartDatePeriod( | ||
@RequestBody @Valid QueryInfoRenewalFestivalPeriodV1Request request | ||
) { | ||
queryInfoRenewalService.renewalByFestivalStartDatePeriod(request.to(), request.end()); | ||
return ResponseEntity.ok().build(); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...nd/src/main/java/com/festago/admin/presentation/v1/AdminUploadFileDeleteV1Controller.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,37 @@ | ||
package com.festago.admin.presentation.v1; | ||
|
||
import com.festago.admin.dto.upload.AdminDeleteAbandonedPeriodUploadFileV1Request; | ||
import com.festago.upload.application.UploadFileDeleteService; | ||
import io.swagger.v3.oas.annotations.Hidden; | ||
import jakarta.validation.Valid; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.DeleteMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequestMapping("/admin/api/v1/upload/delete") | ||
@RequiredArgsConstructor | ||
@Hidden | ||
public class AdminUploadFileDeleteV1Controller { | ||
|
||
private final UploadFileDeleteService uploadFileDeleteService; | ||
|
||
@DeleteMapping("/abandoned-period") | ||
public ResponseEntity<Void> deleteAbandonedWithPeriod( | ||
@RequestBody @Valid AdminDeleteAbandonedPeriodUploadFileV1Request request | ||
) { | ||
uploadFileDeleteService.deleteAbandonedStatusWithPeriod(request.startTime(), request.endTime()); | ||
return ResponseEntity.ok() | ||
.build(); | ||
} | ||
|
||
@DeleteMapping("/old-uploaded") | ||
public ResponseEntity<Void> deleteOldUploaded() { | ||
uploadFileDeleteService.deleteOldUploadedStatus(); | ||
return ResponseEntity.ok() | ||
.build(); | ||
} | ||
} |
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
25 changes: 25 additions & 0 deletions
25
...src/main/java/com/festago/admin/repository/AdminFestivalIdResolverQueryDslRepository.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,25 @@ | ||
package com.festago.admin.repository; | ||
|
||
import static com.festago.festival.domain.QFestival.festival; | ||
|
||
import com.festago.common.querydsl.QueryDslRepositorySupport; | ||
import com.festago.festival.domain.Festival; | ||
import java.time.LocalDate; | ||
import java.util.List; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public class AdminFestivalIdResolverQueryDslRepository extends QueryDslRepositorySupport { | ||
|
||
public AdminFestivalIdResolverQueryDslRepository() { | ||
super(Festival.class); | ||
} | ||
|
||
public List<Long> findFestivalIdsByStartDatePeriod(LocalDate to, LocalDate end) { | ||
return select(festival.id) | ||
.from(festival) | ||
.where(festival.festivalDuration.startDate.goe(to) | ||
.and(festival.festivalDuration.startDate.loe(end))) | ||
.fetch(); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...nd/src/main/java/com/festago/admin/repository/AdminStageIdResolverQueryDslRepository.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,33 @@ | ||
package com.festago.admin.repository; | ||
|
||
import static com.festago.festival.domain.QFestival.festival; | ||
import static com.festago.stage.domain.QStage.stage; | ||
|
||
import com.festago.common.querydsl.QueryDslRepositorySupport; | ||
import com.festago.stage.domain.Stage; | ||
import java.util.List; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public class AdminStageIdResolverQueryDslRepository extends QueryDslRepositorySupport { | ||
|
||
public AdminStageIdResolverQueryDslRepository() { | ||
super(Stage.class); | ||
} | ||
|
||
public List<Long> findStageIdsByFestivalId(Long festivalId) { | ||
return select(stage.id) | ||
.from(stage) | ||
.innerJoin(festival).on(festival.id.eq(stage.festival.id)) | ||
.where(festival.id.eq(festivalId)) | ||
.fetch(); | ||
} | ||
|
||
public List<Long> findStageIdsByFestivalIdIn(List<Long> festivalIds) { | ||
return select(stage.id) | ||
.from(stage) | ||
.innerJoin(festival).on(festival.id.eq(stage.festival.id)) | ||
.where(festival.id.in(festivalIds)) | ||
.fetch(); | ||
} | ||
} |
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
3 changes: 3 additions & 0 deletions
3
backend/src/main/java/com/festago/artist/dto/command/ArtistCreateCommand.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
3 changes: 3 additions & 0 deletions
3
backend/src/main/java/com/festago/artist/dto/command/ArtistUpdateCommand.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
6 changes: 0 additions & 6 deletions
6
backend/src/main/java/com/festago/auth/domain/OpenIdUserInfoProvider.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.