From e480d3e66a68cd1871e1d4a58ab36e6511cf7ee2 Mon Sep 17 00:00:00 2001 From: GaBaljaintheroom Date: Sun, 22 Sep 2024 01:02:00 +0900 Subject: [PATCH 01/16] =?UTF-8?q?fix:=20=EC=95=84=ED=8B=B0=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20doamin=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ArtistAdminController.java | 58 -- .../artist/controller/ArtistController.java | 17 - .../ArtistSubscriptionPaginationApiParam.java | 13 +- ...rtistUnsubscriptionPaginationApiParam.java | 13 +- .../dto/request/ArtistCreateApiForm.java | 48 - .../ArtistFilterTotalCountApiRequest.java | 40 - ...rtistSubscriptionPaginationApiRequest.java | 10 - ...istUnsubscriptionPaginationApiRequest.java | 34 +- .../dto/request/ArtistUpdateApiForm.java | 48 - .../response/ArtistDetailApiFormResponse.java | 14 +- .../ArtistFilterTotalCountApiResponse.java | 14 - .../response/ArtistKoreanNameApiResponse.java | 21 - .../dto/response/ArtistNameApiResponse.java | 21 + .../artist/service/ArtistAdminService.java | 43 +- .../example/artist/service/ArtistService.java | 24 +- ...istSubscriptionPaginationServiceParam.java | 10 +- ...tUnsubscriptionPaginationServiceParam.java | 10 +- .../request/ArtistCreateServiceRequest.java | 34 - .../ArtistFilterTotalCountServiceRequest.java | 33 - ...tSubscriptionPaginationServiceRequest.java | 5 - ...nsubscriptionPaginationServiceRequest.java | 23 - .../request/ArtistUpdateServiceRequest.java | 34 - .../response/ArtistDetailServiceResponse.java | 14 +- ...ArtistFilterTotalCountServiceResponse.java | 19 - .../ArtistKoreanNameServiceResponse.java | 18 - .../response/ArtistNameServiceResponse.java | 18 + .../com/example/artist/vo/ArtistApiType.java | 14 - .../artist/vo/ArtistGenderApiType.java | 15 - .../example/artist/vo/ArtistSortApiType.java | 19 - .../publish/message/ArtistServiceMessage.java | 2 +- .../show/controller/ShowAdminController.java | 10 +- .../dto/response/ShowArtistApiResponse.java | 10 +- .../dto/response/ShowInfoApiResponse.java | 6 +- .../response/ShowArtistServiceResponse.java | 6 +- .../ShowArtistSimpleServiceResponse.java | 23 - .../dto/response/ShowInfoServiceResponse.java | 22 +- .../fixture/dto/ArtistRequestDtoFixture.java | 53 -- .../fixture/dto/ArtistResponseDtoFixture.java | 10 +- .../service/ArtistAdminServiceTest.java | 69 -- .../artist/service/ArtistServiceTest.java | 68 -- .../common-domain/src/main/resources/data.sql | 830 ------------------ .../src/main/resources/schema.sql | 8 +- .../artist/request/ArtistFilterDomain.java | 23 - .../ArtistFilterTotalCountDomainRequest.java | 17 - .../ArtistPaginationDomainRequest.java | 5 +- .../response/ArtistDetailDomainResponse.java | 8 +- .../artist/response/ArtistDomainResponse.java | 10 +- ...stKoreanNamesWithShowIdDomainResponse.java | 11 - ...nse.java => ArtistNameDomainResponse.java} | 4 +- .../ArtistNamesWithShowIdDomainResponse.java | 11 + .../response/ArtistSimpleDomainResponse.java | 3 +- .../show/response/ShowInfoDomainResponse.java | 4 +- .../org/example/entity/artist/Artist.java | 47 +- .../artist/ArtistQuerydslRepository.java | 13 +- .../artist/ArtistQuerydslRepositoryImpl.java | 95 +- .../show/ShowQuerydslRepositoryImpl.java | 14 +- .../ShowArtistQuerydslRepository.java | 4 +- .../ShowArtistQuerydslRepositoryImpl.java | 12 +- .../org/example/usecase/ArtistUseCase.java | 69 +- .../java/org/example/vo/ArtistGender.java | 5 - .../java/org/example/vo/ArtistSortType.java | 8 - .../main/java/org/example/vo/ArtistType.java | 5 - .../artist/ArtistRepositoryTest.java | 67 +- .../example/fixture/domain/ArtistFixture.java | 16 +- .../fixture/dto/ArtistRequestDtoFixture.java | 25 +- 65 files changed, 167 insertions(+), 2110 deletions(-) delete mode 100644 app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistCreateApiForm.java delete mode 100644 app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistFilterTotalCountApiRequest.java delete mode 100644 app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistUpdateApiForm.java delete mode 100644 app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistFilterTotalCountApiResponse.java delete mode 100644 app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistKoreanNameApiResponse.java create mode 100644 app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistNameApiResponse.java delete mode 100644 app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistCreateServiceRequest.java delete mode 100644 app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistFilterTotalCountServiceRequest.java delete mode 100644 app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistUpdateServiceRequest.java delete mode 100644 app/api/show-api/src/main/java/com/example/artist/service/dto/response/ArtistFilterTotalCountServiceResponse.java delete mode 100644 app/api/show-api/src/main/java/com/example/artist/service/dto/response/ArtistKoreanNameServiceResponse.java create mode 100644 app/api/show-api/src/main/java/com/example/artist/service/dto/response/ArtistNameServiceResponse.java delete mode 100644 app/api/show-api/src/main/java/com/example/artist/vo/ArtistApiType.java delete mode 100644 app/api/show-api/src/main/java/com/example/artist/vo/ArtistGenderApiType.java delete mode 100644 app/api/show-api/src/main/java/com/example/artist/vo/ArtistSortApiType.java delete mode 100644 app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowArtistSimpleServiceResponse.java delete mode 100644 app/api/show-api/src/test/java/artist/service/ArtistAdminServiceTest.java delete mode 100644 app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistFilterDomain.java delete mode 100644 app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistFilterTotalCountDomainRequest.java delete mode 100644 app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistKoreanNamesWithShowIdDomainResponse.java rename app/domain/show-domain/src/main/java/org/example/dto/artist/response/{ArtistKoreanNameDomainResponse.java => ArtistNameDomainResponse.java} (55%) create mode 100644 app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistNamesWithShowIdDomainResponse.java delete mode 100644 app/domain/show-domain/src/main/java/org/example/vo/ArtistGender.java delete mode 100644 app/domain/show-domain/src/main/java/org/example/vo/ArtistSortType.java delete mode 100644 app/domain/show-domain/src/main/java/org/example/vo/ArtistType.java diff --git a/app/api/show-api/src/main/java/com/example/artist/controller/ArtistAdminController.java b/app/api/show-api/src/main/java/com/example/artist/controller/ArtistAdminController.java index 91ea1c76..59119f95 100644 --- a/app/api/show-api/src/main/java/com/example/artist/controller/ArtistAdminController.java +++ b/app/api/show-api/src/main/java/com/example/artist/controller/ArtistAdminController.java @@ -1,23 +1,12 @@ package com.example.artist.controller; -import com.example.artist.controller.dto.request.ArtistCreateApiForm; -import com.example.artist.controller.dto.request.ArtistUpdateApiForm; import com.example.artist.controller.dto.response.ArtistDetailApiFormResponse; import com.example.artist.service.ArtistAdminService; -import com.example.artist.service.dto.response.ArtistDetailServiceResponse; -import com.example.genre.controller.dto.response.GenreNameApiResponse; -import com.example.genre.service.GenreAdminService; -import jakarta.validation.Valid; import java.util.List; -import java.util.UUID; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestMapping; @Controller @@ -26,22 +15,7 @@ public class ArtistAdminController { private final ArtistAdminService artistAdminService; - private final GenreAdminService genreAdminService; - @GetMapping - public String createArtist(Model model) { - List genres = genreAdminService.findAllGenres().stream() - .map(GenreNameApiResponse::new) - .toList(); - model.addAttribute("genres", genres); - return "artist_create_form"; - } - - @PostMapping - public String createArtist(@Valid ArtistCreateApiForm artistCreateApiForm) { - artistAdminService.save(artistCreateApiForm.toArtistCreateServiceRequest()); - return "redirect:/admin/artists/list"; - } @GetMapping("/list") public String findAllArtist(Model model) { @@ -53,36 +27,4 @@ public String findAllArtist(Model model) { model.addAttribute("artists", artistDetailApiFormResponses); return "artist_list_form"; } - - @GetMapping("/{id}") - public String findArtist(@PathVariable("id") UUID id, Model model) { - List genres = genreAdminService.findAllGenres().stream() - .map(GenreNameApiResponse::new) - .toList(); - model.addAttribute("genres", genres); - - ArtistDetailServiceResponse artistDetailServiceResponse = artistAdminService.findArtistById( - id); - ArtistDetailApiFormResponse artistDetailApiFormResponse = new ArtistDetailApiFormResponse( - artistDetailServiceResponse); - model.addAttribute("artist", artistDetailApiFormResponse); - - return "artist_form"; - } - - @PutMapping("/{id}") - public String updateArtist( - @PathVariable("id") UUID id, - @Valid ArtistUpdateApiForm artistUpdateApiForm - ) { - artistAdminService.updateArtist(id, artistUpdateApiForm.toArtistUpdateServiceRequest()); - return "redirect:/admin/artists/list"; - } - - @DeleteMapping("/{id}") - public String deleteGenre(@PathVariable("id") UUID id) { - artistAdminService.deleteArtist(id); - return "redirect:/admin/artists/list"; - } - } \ No newline at end of file diff --git a/app/api/show-api/src/main/java/com/example/artist/controller/ArtistController.java b/app/api/show-api/src/main/java/com/example/artist/controller/ArtistController.java index d714d2c1..d185cab7 100644 --- a/app/api/show-api/src/main/java/com/example/artist/controller/ArtistController.java +++ b/app/api/show-api/src/main/java/com/example/artist/controller/ArtistController.java @@ -3,13 +3,11 @@ import com.example.artist.controller.dto.param.ArtistSearchPaginationApiParam; import com.example.artist.controller.dto.param.ArtistSubscriptionPaginationApiParam; import com.example.artist.controller.dto.param.ArtistUnsubscriptionPaginationApiParam; -import com.example.artist.controller.dto.request.ArtistFilterTotalCountApiRequest; import com.example.artist.controller.dto.request.ArtistSearchPaginationApiRequest; import com.example.artist.controller.dto.request.ArtistSubscriptionApiRequest; import com.example.artist.controller.dto.request.ArtistSubscriptionPaginationApiRequest; import com.example.artist.controller.dto.request.ArtistUnsubscriptionApiRequest; import com.example.artist.controller.dto.request.ArtistUnsubscriptionPaginationApiRequest; -import com.example.artist.controller.dto.response.ArtistFilterTotalCountApiResponse; import com.example.artist.controller.dto.response.ArtistSubscriptionApiResponse; import com.example.artist.controller.dto.response.ArtistUnsubscriptionApiResponse; import com.example.artist.controller.dto.response.NumberOfSubscribedArtistApiResponse; @@ -151,19 +149,4 @@ public ResponseEntity> sea .build() ); } - - @GetMapping("/filter-total-count") - @Operation(summary = "필터링한 데이터의 총 개수 가져오기") - public ResponseEntity filterTotalCount( - @AuthenticationPrincipal AuthenticatedInfo info, - @Valid @RequestBody ArtistFilterTotalCountApiRequest request - ) { - var response = artistService.filterArtistTotalCount( - request.toServiceRequest(info.userId()) - ); - - return ResponseEntity.ok( - ArtistFilterTotalCountApiResponse.from(response.totalCount()) - ); - } } diff --git a/app/api/show-api/src/main/java/com/example/artist/controller/dto/param/ArtistSubscriptionPaginationApiParam.java b/app/api/show-api/src/main/java/com/example/artist/controller/dto/param/ArtistSubscriptionPaginationApiParam.java index 348d90a8..c396fd19 100644 --- a/app/api/show-api/src/main/java/com/example/artist/controller/dto/param/ArtistSubscriptionPaginationApiParam.java +++ b/app/api/show-api/src/main/java/com/example/artist/controller/dto/param/ArtistSubscriptionPaginationApiParam.java @@ -9,18 +9,15 @@ public record ArtistSubscriptionPaginationApiParam( UUID id, @Schema(description = "아티스트 이미지 URL") String imageURL, - @Schema(description = "아티스트 한글 이름") - String koreanName, - @Schema(description = "아티스트 영문 이름") - String englishName + @Schema(description = "아티스트 이름") + String name ) { public static ArtistSubscriptionPaginationApiParam from(ArtistSubscriptionPaginationServiceParam param) { return new ArtistSubscriptionPaginationApiParam( - param.artistId(), - param.artistImageUrl(), - param.artistKoreanName(), - param.artistEnglishName() + param.id(), + param.image(), + param.name() ); } } diff --git a/app/api/show-api/src/main/java/com/example/artist/controller/dto/param/ArtistUnsubscriptionPaginationApiParam.java b/app/api/show-api/src/main/java/com/example/artist/controller/dto/param/ArtistUnsubscriptionPaginationApiParam.java index 84644e0d..5a610b4e 100644 --- a/app/api/show-api/src/main/java/com/example/artist/controller/dto/param/ArtistUnsubscriptionPaginationApiParam.java +++ b/app/api/show-api/src/main/java/com/example/artist/controller/dto/param/ArtistUnsubscriptionPaginationApiParam.java @@ -9,20 +9,17 @@ public record ArtistUnsubscriptionPaginationApiParam( UUID id, @Schema(description = "아티스트 이미지 URL") String imageURL, - @Schema(description = "아티스트 한글 이름") - String koreanName, - @Schema(description = "아티스트 영문 이름") - String englishName + @Schema(description = "아티스트 이름") + String name ) { public static ArtistUnsubscriptionPaginationApiParam from( ArtistUnsubscriptionPaginationServiceParam param ) { return new ArtistUnsubscriptionPaginationApiParam( - param.artistId(), - param.artistImageUrl(), - param.artistKoreanName(), - param.artistEnglishName() + param.id(), + param.image(), + param.name() ); } } diff --git a/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistCreateApiForm.java b/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistCreateApiForm.java deleted file mode 100644 index 0f777afc..00000000 --- a/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistCreateApiForm.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.example.artist.controller.dto.request; - -import com.example.artist.service.dto.request.ArtistCreateServiceRequest; -import com.example.artist.vo.ArtistApiType; -import com.example.artist.vo.ArtistGenderApiType; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import java.util.List; -import java.util.UUID; -import org.springframework.web.multipart.MultipartFile; - -public record ArtistCreateApiForm( - @NotBlank(message = "아티스트의 한국 이름은 필수 요청값 입니다.") - String koreanName, - - @NotBlank(message = "아티스트의 영어 이름은 필수 요청값 입니다.") - String englishName, - - @NotNull(message = "아티스트의 이미지는 필수 요청값 입니다.") - MultipartFile image, - - @NotBlank(message = "아티스트의 국적은 필수 요청값 입니다.") - String country, - - @NotNull(message = "아티스트의 성별은 필수 요청값 입니다.") - ArtistGenderApiType artistGenderApiType, - - @NotNull(message = "아티스트의 타입은 필수 요청값 입니다.") - ArtistApiType artistApiType, - - @NotNull(message = "아티스트의 장르Id는 필수 요청값 입니다.") - List genreIds -) { - - public ArtistCreateServiceRequest toArtistCreateServiceRequest() { - return ArtistCreateServiceRequest.builder() - .koreanName(koreanName) - .englishName(englishName) - .image(image) - .country(country) - .artistGenderApiType(artistGenderApiType) - .artistApiType(artistApiType) - .genreIds(genreIds) - .build(); - - } - -} diff --git a/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistFilterTotalCountApiRequest.java b/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistFilterTotalCountApiRequest.java deleted file mode 100644 index ce28658d..00000000 --- a/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistFilterTotalCountApiRequest.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.example.artist.controller.dto.request; - -import com.example.artist.service.dto.request.ArtistFilterTotalCountServiceRequest; -import com.example.artist.vo.ArtistApiType; -import com.example.artist.vo.ArtistGenderApiType; -import io.swagger.v3.oas.annotations.media.Schema; -import java.util.List; -import java.util.UUID; -import org.example.util.ValidateStatus; - -public record ArtistFilterTotalCountApiRequest( - @Schema(description = "아티스트 성별") - List artistGenderApiTypes, - - @Schema(description = "아티스트 타입") - List artistApiTypes, - - @Schema(description = "장르 ID 목록") - List genreIds -) { - - public ArtistFilterTotalCountApiRequest( - List artistGenderApiTypes, - List artistApiTypes, - List genreIds - ) { - this.artistGenderApiTypes = ValidateStatus.checkNullOrEmpty(artistGenderApiTypes); - this.artistApiTypes = ValidateStatus.checkNullOrEmpty(artistApiTypes); - this.genreIds = ValidateStatus.checkNullOrEmpty(genreIds); - } - - public ArtistFilterTotalCountServiceRequest toServiceRequest(UUID userId) { - return ArtistFilterTotalCountServiceRequest.builder() - .artistGenderApiTypes(artistGenderApiTypes) - .artistApiTypes(artistApiTypes) - .genreIds(genreIds) - .userId(userId) - .build(); - } -} diff --git a/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistSubscriptionPaginationApiRequest.java b/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistSubscriptionPaginationApiRequest.java index 23e72561..9b85a110 100644 --- a/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistSubscriptionPaginationApiRequest.java +++ b/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistSubscriptionPaginationApiRequest.java @@ -1,7 +1,6 @@ package com.example.artist.controller.dto.request; import com.example.artist.service.dto.request.ArtistSubscriptionPaginationServiceRequest; -import com.example.artist.vo.ArtistSortApiType; import com.example.vo.SubscriptionStatusApiType; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Schema; @@ -11,12 +10,6 @@ @Schema public record ArtistSubscriptionPaginationApiRequest( - @Parameter( - description = "정렬 기준, default: ENGLISH_NAME_ASC", - schema = @Schema(implementation = ArtistSortApiType.class) - ) - ArtistSortApiType sort, - @Parameter(description = "이전 페이지네이션 마지막 데이터의 cursorId / 최초 조회라면 null") UUID cursorId, @@ -26,11 +19,9 @@ public record ArtistSubscriptionPaginationApiRequest( ) { public ArtistSubscriptionPaginationApiRequest( - ArtistSortApiType sort, UUID cursorId, Integer size ) { - this.sort = sort == null ? ArtistSortApiType.ENGLISH_NAME_ASC : sort; this.cursorId = cursorId; this.size = size == null ? 30 : size; } @@ -39,7 +30,6 @@ public ArtistSubscriptionPaginationServiceRequest toServiceRequest(UUID userId) return ArtistSubscriptionPaginationServiceRequest.builder() .subscriptionStatusApiType(SubscriptionStatusApiType.SUBSCRIBED) .size(size) - .sortStandard(sort) .cursor(cursorId) .userId(userId) .build(); diff --git a/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistUnsubscriptionPaginationApiRequest.java b/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistUnsubscriptionPaginationApiRequest.java index 81f7145d..b9476eb2 100644 --- a/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistUnsubscriptionPaginationApiRequest.java +++ b/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistUnsubscriptionPaginationApiRequest.java @@ -1,33 +1,12 @@ package com.example.artist.controller.dto.request; import com.example.artist.service.dto.request.ArtistUnsubscriptionPaginationServiceRequest; -import com.example.artist.vo.ArtistApiType; -import com.example.artist.vo.ArtistGenderApiType; -import com.example.artist.vo.ArtistSortApiType; import com.example.vo.SubscriptionStatusApiType; import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.Max; -import java.util.List; import java.util.UUID; -import org.example.util.ValidateStatus; public record ArtistUnsubscriptionPaginationApiRequest( - @Parameter( - description = "정렬 기준, default: ENGLISH_NAME_ASC", - schema = @Schema(implementation = ArtistSortApiType.class) - ) - ArtistSortApiType sortStandard, - - @Parameter(description = "아티스트 성별 목록") - List artistGenderApiTypes, - - @Parameter(description = "아티스트 타입 목록") - List artistApiTypes, - - @Parameter(description = "장르 ID 목록") - List genreIds, - @Parameter(description = "이전 페이지네이션 마지막 데이터의 cursorId / 최초 조회라면 null") UUID cursorId, @@ -35,18 +14,11 @@ public record ArtistUnsubscriptionPaginationApiRequest( @Max(value = 30, message = "조회하는 데이터의 최대 개수는 30입니다.") Integer size ) { + public ArtistUnsubscriptionPaginationApiRequest( - ArtistSortApiType sortStandard, - List artistGenderApiTypes, - List artistApiTypes, - List genreIds, UUID cursorId, Integer size ) { - this.sortStandard = sortStandard == null ? ArtistSortApiType.ENGLISH_NAME_ASC : sortStandard; - this.artistGenderApiTypes = ValidateStatus.checkNullOrEmpty(artistGenderApiTypes); - this.artistApiTypes = ValidateStatus.checkNullOrEmpty(artistApiTypes); - this.genreIds = ValidateStatus.checkNullOrEmpty(genreIds); this.cursorId = cursorId; this.size = size == null ? 30 : size; } @@ -54,10 +26,6 @@ public ArtistUnsubscriptionPaginationApiRequest( public ArtistUnsubscriptionPaginationServiceRequest toServiceRequest(UUID userId) { return ArtistUnsubscriptionPaginationServiceRequest.builder() .subscriptionStatusApiType(SubscriptionStatusApiType.UNSUBSCRIBED) - .sortStandard(sortStandard) - .artistGenderApiTypes(artistGenderApiTypes) - .artistApiTypes(artistApiTypes) - .genreIds(genreIds) .userId(userId) .cursor(cursorId) .size(size) diff --git a/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistUpdateApiForm.java b/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistUpdateApiForm.java deleted file mode 100644 index 5bb08920..00000000 --- a/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistUpdateApiForm.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.example.artist.controller.dto.request; - -import com.example.artist.service.dto.request.ArtistUpdateServiceRequest; -import com.example.artist.vo.ArtistApiType; -import com.example.artist.vo.ArtistGenderApiType; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import java.util.List; -import java.util.UUID; -import org.springframework.web.multipart.MultipartFile; - -public record ArtistUpdateApiForm( - @NotBlank(message = "아티스트의 한국 이름은 필수 요청값 입니다.") - String koreanName, - - @NotBlank(message = "아티스트의 영어 이름은 필수 요청값 입니다.") - String englishName, - - @NotNull(message = "아티스트의 이미지는 필수 요청값 입니다.") - MultipartFile image, - - @NotBlank(message = "아티스트의 국적은 필수 요청값 입니다.") - String country, - - @NotNull(message = "아티스트의 성별은 필수 요청값 입니다.") - ArtistGenderApiType artistGenderApiType, - - @NotNull(message = "아티스트의 타입은 필수 요청값 입니다.") - ArtistApiType artistApiType, - - @NotNull(message = "아티스트의 장르Id는 필수 요청값 입니다.") - List genreIds -) { - - public ArtistUpdateServiceRequest toArtistUpdateServiceRequest() { - return ArtistUpdateServiceRequest.builder() - .koreanName(koreanName) - .englishName(englishName) - .image(image) - .country(country) - .artistGenderApiType(artistGenderApiType) - .artistApiType(artistApiType) - .genreIds(genreIds) - .build(); - - } - -} diff --git a/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistDetailApiFormResponse.java b/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistDetailApiFormResponse.java index 9e6c516c..91fd9356 100644 --- a/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistDetailApiFormResponse.java +++ b/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistDetailApiFormResponse.java @@ -1,8 +1,6 @@ package com.example.artist.controller.dto.response; import com.example.artist.service.dto.response.ArtistDetailServiceResponse; -import com.example.artist.vo.ArtistApiType; -import com.example.artist.vo.ArtistGenderApiType; import java.util.List; import java.util.UUID; import lombok.Builder; @@ -10,12 +8,8 @@ @Builder public record ArtistDetailApiFormResponse( UUID id, - String koreanName, - String englishName, + String name, String image, - String country, - ArtistGenderApiType artistGenderApiType, - ArtistApiType artistApiType, List genreNames ) { @@ -24,12 +18,8 @@ public ArtistDetailApiFormResponse( ) { this( artistDetailServiceResponse.id(), - artistDetailServiceResponse.koreanName(), - artistDetailServiceResponse.englishName(), + artistDetailServiceResponse.name(), artistDetailServiceResponse.image(), - artistDetailServiceResponse.country(), - artistDetailServiceResponse.artistGenderApiType(), - artistDetailServiceResponse.artistApiType(), artistDetailServiceResponse.genreNames() ); } diff --git a/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistFilterTotalCountApiResponse.java b/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistFilterTotalCountApiResponse.java deleted file mode 100644 index 2a8e544e..00000000 --- a/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistFilterTotalCountApiResponse.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.example.artist.controller.dto.response; - -import io.swagger.v3.oas.annotations.media.Schema; - -public record ArtistFilterTotalCountApiResponse( - @Schema(description = "필터링한 아티스트 총 개수") - int totalCount -) { - - public static ArtistFilterTotalCountApiResponse from(int totalCount) { - return new ArtistFilterTotalCountApiResponse(totalCount); - } - -} diff --git a/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistKoreanNameApiResponse.java b/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistKoreanNameApiResponse.java deleted file mode 100644 index ceb44aaf..00000000 --- a/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistKoreanNameApiResponse.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.example.artist.controller.dto.response; - -import com.example.artist.service.dto.response.ArtistKoreanNameServiceResponse; -import java.util.UUID; - -public record ArtistKoreanNameApiResponse( - UUID id, - String koreanName -) { - - public ArtistKoreanNameApiResponse( - ArtistKoreanNameServiceResponse artistKoreanNameServiceResponse - ) { - this( - artistKoreanNameServiceResponse.id(), - artistKoreanNameServiceResponse.koreanName() - ); - } - - -} diff --git a/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistNameApiResponse.java b/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistNameApiResponse.java new file mode 100644 index 00000000..c4c0d6c7 --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistNameApiResponse.java @@ -0,0 +1,21 @@ +package com.example.artist.controller.dto.response; + +import com.example.artist.service.dto.response.ArtistNameServiceResponse; +import java.util.UUID; + +public record ArtistNameApiResponse( + UUID id, + String name +) { + + public ArtistNameApiResponse( + ArtistNameServiceResponse artistKoreanNameServiceResponse + ) { + this( + artistKoreanNameServiceResponse.id(), + artistKoreanNameServiceResponse.name() + ); + } + + +} diff --git a/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java b/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java index cde84048..da025654 100644 --- a/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java +++ b/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java @@ -1,15 +1,9 @@ package com.example.artist.service; -import com.example.artist.service.dto.request.ArtistCreateServiceRequest; -import com.example.artist.service.dto.request.ArtistUpdateServiceRequest; import com.example.artist.service.dto.response.ArtistDetailServiceResponse; -import com.example.artist.service.dto.response.ArtistKoreanNameServiceResponse; -import com.example.component.FileUploadComponent; +import com.example.artist.service.dto.response.ArtistNameServiceResponse; import java.util.List; -import java.util.UUID; import lombok.RequiredArgsConstructor; -import org.example.dto.artist.response.ArtistDetailDomainResponse; -import org.example.entity.artist.Artist; import org.example.usecase.ArtistUseCase; import org.springframework.stereotype.Service; @@ -18,13 +12,11 @@ public class ArtistAdminService { private final ArtistUseCase artistUseCase; - private final FileUploadComponent fileUploadComponent; - public void save(ArtistCreateServiceRequest artistCreateServiceRequest) { - String imageUrl = fileUploadComponent.uploadFile("artists", artistCreateServiceRequest.image()); - Artist artist = artistCreateServiceRequest.toArtistWithImageUrl(imageUrl); - - artistUseCase.save(artist, artistCreateServiceRequest.genreIds()); + public List findAllArtistName() { + return artistUseCase.findAllArtistKoreanName().stream() + .map(ArtistNameServiceResponse::new) + .toList(); } public List findAllWithGenreNames() { @@ -32,29 +24,4 @@ public List findAllWithGenreNames() { .map(ArtistDetailServiceResponse::new) .toList(); } - - public List findAllArtistKoreanName() { - return artistUseCase.findAllArtistKoreanName().stream() - .map(ArtistKoreanNameServiceResponse::new) - .toList(); - } - - public ArtistDetailServiceResponse findArtistById(UUID id) { - ArtistDetailDomainResponse response; - response = artistUseCase.findArtistDetailById(id); - - return new ArtistDetailServiceResponse(response); - } - - public void updateArtist(UUID id, ArtistUpdateServiceRequest artistUpdateServiceRequest) { - String imageUrl = fileUploadComponent.uploadFile("artist", - artistUpdateServiceRequest.image()); - Artist artist = artistUpdateServiceRequest.toArtist(imageUrl); - - artistUseCase.updateArtist(id, artist, artistUpdateServiceRequest.genreIds()); - } - - public void deleteArtist(UUID id) { - artistUseCase.deleteArtist(id); - } } diff --git a/app/api/show-api/src/main/java/com/example/artist/service/ArtistService.java b/app/api/show-api/src/main/java/com/example/artist/service/ArtistService.java index bfd440b6..8ec6aea2 100644 --- a/app/api/show-api/src/main/java/com/example/artist/service/ArtistService.java +++ b/app/api/show-api/src/main/java/com/example/artist/service/ArtistService.java @@ -3,13 +3,11 @@ import com.example.artist.service.dto.param.ArtistSearchPaginationServiceParam; import com.example.artist.service.dto.param.ArtistSubscriptionPaginationServiceParam; import com.example.artist.service.dto.param.ArtistUnsubscriptionPaginationServiceParam; -import com.example.artist.service.dto.request.ArtistFilterTotalCountServiceRequest; import com.example.artist.service.dto.request.ArtistSearchPaginationServiceRequest; import com.example.artist.service.dto.request.ArtistSubscriptionPaginationServiceRequest; import com.example.artist.service.dto.request.ArtistSubscriptionServiceRequest; import com.example.artist.service.dto.request.ArtistUnsubscriptionPaginationServiceRequest; import com.example.artist.service.dto.request.ArtistUnsubscriptionServiceRequest; -import com.example.artist.service.dto.response.ArtistFilterTotalCountServiceResponse; import com.example.artist.service.dto.response.ArtistSubscriptionServiceResponse; import com.example.artist.service.dto.response.ArtistUnsubscriptionServiceResponse; import com.example.artist.service.dto.response.NumberOfSubscribedArtistServiceResponse; @@ -17,7 +15,6 @@ import com.example.publish.message.ArtistServiceMessage; import com.example.publish.message.ArtistSubscriptionServiceMessage; import java.util.List; -import java.util.NoSuchElementException; import java.util.UUID; import lombok.RequiredArgsConstructor; import org.example.dto.response.PaginationServiceResponse; @@ -61,23 +58,9 @@ public PaginationServiceResponse searchArtis return PaginationServiceResponse.of(data, response.hasNext()); } - public ArtistFilterTotalCountServiceResponse filterArtistTotalCount( - ArtistFilterTotalCountServiceRequest request - ) { - List subscriptionArtistIds = getSubscriptionArtistIds(request.userId()); - - try { - return new ArtistFilterTotalCountServiceResponse( - artistUseCase.findFilterArtistTotalCount( - request.toDomainRequest(subscriptionArtistIds) - ) - ); - } catch (NoSuchElementException e) { - return ArtistFilterTotalCountServiceResponse.noneTotalCount(); - } - } - public ArtistSubscriptionServiceResponse subscribe(ArtistSubscriptionServiceRequest request) { + // TODO : spotifyArtsit ID로 존재하는지 확인 + // var existArtistsInRequest = artistUseCase.findAllArtistInIds(request.artistIds()); var existArtistIdsInRequest = existArtistsInRequest.stream() .map(Artist::getId) @@ -187,7 +170,8 @@ public NumberOfSubscribedArtistServiceResponse countSubscribedArtists(UUID userI } private List getSubscriptionArtistIds(UUID userId) { - List subscriptions = artistSubscriptionUseCase.findSubscriptionList(userId); + List subscriptions = artistSubscriptionUseCase.findSubscriptionList( + userId); return subscriptions.stream() .map(ArtistSubscription::getArtistId) diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/param/ArtistSubscriptionPaginationServiceParam.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/param/ArtistSubscriptionPaginationServiceParam.java index b5c8ef66..ec844a11 100644 --- a/app/api/show-api/src/main/java/com/example/artist/service/dto/param/ArtistSubscriptionPaginationServiceParam.java +++ b/app/api/show-api/src/main/java/com/example/artist/service/dto/param/ArtistSubscriptionPaginationServiceParam.java @@ -4,18 +4,16 @@ import org.example.dto.artist.response.ArtistSimpleDomainResponse; public record ArtistSubscriptionPaginationServiceParam( - UUID artistId, - String artistImageUrl, - String artistKoreanName, - String artistEnglishName + UUID id, + String image, + String name ) { public ArtistSubscriptionPaginationServiceParam(ArtistSimpleDomainResponse response) { this( response.id(), response.image(), - response.koreanName(), - response.englishName() + response.name() ); } } diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/param/ArtistUnsubscriptionPaginationServiceParam.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/param/ArtistUnsubscriptionPaginationServiceParam.java index 017ac06c..8ad79a24 100644 --- a/app/api/show-api/src/main/java/com/example/artist/service/dto/param/ArtistUnsubscriptionPaginationServiceParam.java +++ b/app/api/show-api/src/main/java/com/example/artist/service/dto/param/ArtistUnsubscriptionPaginationServiceParam.java @@ -4,18 +4,16 @@ import org.example.dto.artist.response.ArtistSimpleDomainResponse; public record ArtistUnsubscriptionPaginationServiceParam( - UUID artistId, - String artistImageUrl, - String artistKoreanName, - String artistEnglishName + UUID id, + String image, + String name ) { public ArtistUnsubscriptionPaginationServiceParam(ArtistSimpleDomainResponse response) { this( response.id(), response.image(), - response.koreanName(), - response.englishName() + response.name() ); } } diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistCreateServiceRequest.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistCreateServiceRequest.java deleted file mode 100644 index c6307c54..00000000 --- a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistCreateServiceRequest.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.example.artist.service.dto.request; - -import com.example.artist.vo.ArtistApiType; -import com.example.artist.vo.ArtistGenderApiType; -import java.util.List; -import java.util.UUID; -import lombok.Builder; -import org.example.entity.artist.Artist; -import org.example.vo.ArtistGender; -import org.example.vo.ArtistType; -import org.springframework.web.multipart.MultipartFile; - -@Builder -public record ArtistCreateServiceRequest( - String koreanName, - String englishName, - MultipartFile image, - String country, - ArtistGenderApiType artistGenderApiType, - ArtistApiType artistApiType, - List genreIds -) { - - public Artist toArtistWithImageUrl(String imageUrl) { - return Artist.builder() - .koreanName(koreanName) - .englishName(englishName) - .image(imageUrl) - .country(country) - .artistGender(ArtistGender.valueOf(artistGenderApiType.name())) - .artistType(ArtistType.valueOf(artistApiType.name())) - .build(); - } -} diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistFilterTotalCountServiceRequest.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistFilterTotalCountServiceRequest.java deleted file mode 100644 index f6d96f5c..00000000 --- a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistFilterTotalCountServiceRequest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.example.artist.service.dto.request; - -import com.example.artist.vo.ArtistApiType; -import com.example.artist.vo.ArtistGenderApiType; -import java.util.List; -import java.util.UUID; -import lombok.Builder; -import org.example.dto.artist.request.ArtistFilterTotalCountDomainRequest; - -@Builder -public record ArtistFilterTotalCountServiceRequest( - List artistGenderApiTypes, - List artistApiTypes, - List genreIds, - UUID userId -) { - - public ArtistFilterTotalCountDomainRequest toDomainRequest(List artistIds) { - var artistGenders = artistGenderApiTypes.stream() - .map(ArtistGenderApiType::toDomainType) - .toList(); - var artistTypes = artistApiTypes.stream() - .map(ArtistApiType::toDomainType) - .toList(); - - return ArtistFilterTotalCountDomainRequest.builder() - .artistGenders(artistGenders) - .artistTypes(artistTypes) - .genreIds(genreIds) - .artistIds(artistIds) - .build(); - } -} diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistSubscriptionPaginationServiceRequest.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistSubscriptionPaginationServiceRequest.java index d838ae86..f18ce308 100644 --- a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistSubscriptionPaginationServiceRequest.java +++ b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistSubscriptionPaginationServiceRequest.java @@ -1,18 +1,15 @@ package com.example.artist.service.dto.request; -import com.example.artist.vo.ArtistSortApiType; import com.example.vo.SubscriptionStatusApiType; import java.util.List; import java.util.UUID; import lombok.Builder; -import org.example.dto.artist.request.ArtistFilterDomain; import org.example.dto.artist.request.ArtistPaginationDomainRequest; @Builder public record ArtistSubscriptionPaginationServiceRequest( SubscriptionStatusApiType subscriptionStatusApiType, int size, - ArtistSortApiType sortStandard, UUID cursor, UUID userId ) { @@ -21,10 +18,8 @@ public ArtistPaginationDomainRequest toDomainRequest(List artistIds) { return ArtistPaginationDomainRequest.builder() .subscriptionStatus(subscriptionStatusApiType.toDomainType()) .size(size) - .sortStandard(sortStandard.toDomainType()) .artistIds(artistIds) .cursor(cursor) - .artistFilterDomain(ArtistFilterDomain.defaultArtistFilterDomain()) .build(); } } diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistUnsubscriptionPaginationServiceRequest.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistUnsubscriptionPaginationServiceRequest.java index 4ce9bed9..9cba1d7b 100644 --- a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistUnsubscriptionPaginationServiceRequest.java +++ b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistUnsubscriptionPaginationServiceRequest.java @@ -1,48 +1,25 @@ package com.example.artist.service.dto.request; -import com.example.artist.vo.ArtistApiType; -import com.example.artist.vo.ArtistGenderApiType; -import com.example.artist.vo.ArtistSortApiType; import com.example.vo.SubscriptionStatusApiType; import java.util.List; import java.util.UUID; import lombok.Builder; -import org.example.dto.artist.request.ArtistFilterDomain; import org.example.dto.artist.request.ArtistPaginationDomainRequest; @Builder public record ArtistUnsubscriptionPaginationServiceRequest( SubscriptionStatusApiType subscriptionStatusApiType, - ArtistSortApiType sortStandard, - List artistGenderApiTypes, - List artistApiTypes, - List genreIds, UUID userId, UUID cursor, int size ) { public ArtistPaginationDomainRequest toDomainRequest(List artistIds) { - var artistGenders = artistGenderApiTypes.stream() - .map(ArtistGenderApiType::toDomainType) - .toList(); - var artistTypes = artistApiTypes.stream() - .map(ArtistApiType::toDomainType) - .toList(); - - ArtistFilterDomain artistFilterDomain = ArtistFilterDomain.builder() - .artistGenders(artistGenders) - .artistTypes(artistTypes) - .genreIds(genreIds) - .build(); - return ArtistPaginationDomainRequest.builder() .subscriptionStatus(subscriptionStatusApiType.toDomainType()) - .sortStandard(sortStandard.toDomainType()) .artistIds(artistIds) .cursor(cursor) .size(size) - .artistFilterDomain(artistFilterDomain) .build(); } } diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistUpdateServiceRequest.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistUpdateServiceRequest.java deleted file mode 100644 index c35e17a2..00000000 --- a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistUpdateServiceRequest.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.example.artist.service.dto.request; - -import com.example.artist.vo.ArtistApiType; -import com.example.artist.vo.ArtistGenderApiType; -import java.util.List; -import java.util.UUID; -import lombok.Builder; -import org.example.entity.artist.Artist; -import org.example.vo.ArtistGender; -import org.example.vo.ArtistType; -import org.springframework.web.multipart.MultipartFile; - -@Builder -public record ArtistUpdateServiceRequest( - String koreanName, - String englishName, - MultipartFile image, - String country, - ArtistGenderApiType artistGenderApiType, - ArtistApiType artistApiType, - List genreIds -) { - - public Artist toArtist(String imageUrl) { - return Artist.builder() - .koreanName(koreanName) - .englishName(englishName) - .image(imageUrl) - .country(country) - .artistGender(ArtistGender.valueOf(artistGenderApiType.name())) - .artistType(ArtistType.valueOf(artistApiType.name())) - .build(); - } -} diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/response/ArtistDetailServiceResponse.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/response/ArtistDetailServiceResponse.java index adaa4e1d..0232ecc7 100644 --- a/app/api/show-api/src/main/java/com/example/artist/service/dto/response/ArtistDetailServiceResponse.java +++ b/app/api/show-api/src/main/java/com/example/artist/service/dto/response/ArtistDetailServiceResponse.java @@ -1,31 +1,21 @@ package com.example.artist.service.dto.response; -import com.example.artist.vo.ArtistApiType; -import com.example.artist.vo.ArtistGenderApiType; import java.util.List; import java.util.UUID; import org.example.dto.artist.response.ArtistDetailDomainResponse; public record ArtistDetailServiceResponse( UUID id, - String koreanName, - String englishName, + String name, String image, - String country, - ArtistGenderApiType artistGenderApiType, - ArtistApiType artistApiType, List genreNames ) { public ArtistDetailServiceResponse(ArtistDetailDomainResponse artistDetailResponse) { this( artistDetailResponse.id(), - artistDetailResponse.koreanName(), - artistDetailResponse.englishName(), + artistDetailResponse.name(), artistDetailResponse.image(), - artistDetailResponse.country(), - ArtistGenderApiType.valueOf(artistDetailResponse.artistGender().name()), - ArtistApiType.valueOf(artistDetailResponse.artistType().name()), artistDetailResponse.genreNames() ); } diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/response/ArtistFilterTotalCountServiceResponse.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/response/ArtistFilterTotalCountServiceResponse.java deleted file mode 100644 index 6e0b52f2..00000000 --- a/app/api/show-api/src/main/java/com/example/artist/service/dto/response/ArtistFilterTotalCountServiceResponse.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.example.artist.service.dto.response; - -import org.example.dto.artist.response.ArtistFilterTotalCountDomainResponse; - -public record ArtistFilterTotalCountServiceResponse( - int totalCount -) { - - public static ArtistFilterTotalCountServiceResponse noneTotalCount() { - return new ArtistFilterTotalCountServiceResponse(0); - } - - public ArtistFilterTotalCountServiceResponse(ArtistFilterTotalCountDomainResponse response) { - this( - response.totalCount() - ); - } - -} diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/response/ArtistKoreanNameServiceResponse.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/response/ArtistKoreanNameServiceResponse.java deleted file mode 100644 index b66619c2..00000000 --- a/app/api/show-api/src/main/java/com/example/artist/service/dto/response/ArtistKoreanNameServiceResponse.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.example.artist.service.dto.response; - -import java.util.UUID; -import org.example.dto.artist.response.ArtistKoreanNameDomainResponse; - -public record ArtistKoreanNameServiceResponse( - UUID id, - String koreanName -) { - public ArtistKoreanNameServiceResponse(ArtistKoreanNameDomainResponse artistKoreanNameResponse) { - this( - artistKoreanNameResponse.id(), - artistKoreanNameResponse.koreanName() - ); - } - - -} diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/response/ArtistNameServiceResponse.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/response/ArtistNameServiceResponse.java new file mode 100644 index 00000000..e50be448 --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/artist/service/dto/response/ArtistNameServiceResponse.java @@ -0,0 +1,18 @@ +package com.example.artist.service.dto.response; + +import java.util.UUID; +import org.example.dto.artist.response.ArtistNameDomainResponse; + +public record ArtistNameServiceResponse( + UUID id, + String name +) { + public ArtistNameServiceResponse(ArtistNameDomainResponse artistKoreanNameResponse) { + this( + artistKoreanNameResponse.id(), + artistKoreanNameResponse.name() + ); + } + + +} diff --git a/app/api/show-api/src/main/java/com/example/artist/vo/ArtistApiType.java b/app/api/show-api/src/main/java/com/example/artist/vo/ArtistApiType.java deleted file mode 100644 index 282db0c5..00000000 --- a/app/api/show-api/src/main/java/com/example/artist/vo/ArtistApiType.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.example.artist.vo; - -import org.example.vo.ArtistType; - -public enum ArtistApiType { - SOLO, GROUP; - - public ArtistType toDomainType() { - return switch (this) { - case SOLO -> ArtistType.SOLO; - case GROUP -> ArtistType.GROUP; - }; - } -} diff --git a/app/api/show-api/src/main/java/com/example/artist/vo/ArtistGenderApiType.java b/app/api/show-api/src/main/java/com/example/artist/vo/ArtistGenderApiType.java deleted file mode 100644 index f563d765..00000000 --- a/app/api/show-api/src/main/java/com/example/artist/vo/ArtistGenderApiType.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.example.artist.vo; - -import org.example.vo.ArtistGender; - -public enum ArtistGenderApiType { - MAN, WOMAN, MIXED; - - public ArtistGender toDomainType() { - return switch (this) { - case MAN -> ArtistGender.MAN; - case WOMAN -> ArtistGender.WOMAN; - case MIXED -> ArtistGender.MIXED; - }; - } -} diff --git a/app/api/show-api/src/main/java/com/example/artist/vo/ArtistSortApiType.java b/app/api/show-api/src/main/java/com/example/artist/vo/ArtistSortApiType.java deleted file mode 100644 index fcebc71d..00000000 --- a/app/api/show-api/src/main/java/com/example/artist/vo/ArtistSortApiType.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.example.artist.vo; - -import org.example.vo.ArtistSortType; - -public enum ArtistSortApiType { - KOREAN_NAME_ASC, - KOREAN_NAME_DESC, - ENGLISH_NAME_ASC, - ENGLISH_NAME_DESC; - - public ArtistSortType toDomainType() { - return switch (this) { - case KOREAN_NAME_ASC -> ArtistSortType.KOREAN_NAME_ASC; - case KOREAN_NAME_DESC -> ArtistSortType.KOREAN_NAME_DESC; - case ENGLISH_NAME_ASC -> ArtistSortType.ENGLISH_NAME_ASC; - case ENGLISH_NAME_DESC -> ArtistSortType.ENGLISH_NAME_DESC; - }; - } -} diff --git a/app/api/show-api/src/main/java/com/example/publish/message/ArtistServiceMessage.java b/app/api/show-api/src/main/java/com/example/publish/message/ArtistServiceMessage.java index 8b8c45cf..79410e70 100644 --- a/app/api/show-api/src/main/java/com/example/publish/message/ArtistServiceMessage.java +++ b/app/api/show-api/src/main/java/com/example/publish/message/ArtistServiceMessage.java @@ -14,7 +14,7 @@ public record ArtistServiceMessage( public static ArtistServiceMessage from(Artist artist) { return ArtistServiceMessage.builder() .id(artist.getId()) - .name(artist.getEnglishName()) + .name(artist.getName()) .build(); } diff --git a/app/api/show-api/src/main/java/com/example/show/controller/ShowAdminController.java b/app/api/show-api/src/main/java/com/example/show/controller/ShowAdminController.java index 9a097c3d..9bc35d87 100644 --- a/app/api/show-api/src/main/java/com/example/show/controller/ShowAdminController.java +++ b/app/api/show-api/src/main/java/com/example/show/controller/ShowAdminController.java @@ -1,6 +1,6 @@ package com.example.show.controller; -import com.example.artist.controller.dto.response.ArtistKoreanNameApiResponse; +import com.example.artist.controller.dto.response.ArtistNameApiResponse; import com.example.artist.service.ArtistAdminService; import com.example.genre.controller.dto.response.GenreNameApiResponse; import com.example.genre.service.GenreAdminService; @@ -33,9 +33,9 @@ public class ShowAdminController { @GetMapping public String createShow(Model model) { - List artists = artistAdminService.findAllArtistKoreanName() + List artists = artistAdminService.findAllArtistName() .stream() - .map(ArtistKoreanNameApiResponse::new) + .map(ArtistNameApiResponse::new) .toList(); List genres = genreAdminService.findAllGenres() @@ -68,9 +68,9 @@ public String findAllShow(Model model) { @GetMapping("/{id}") public String findShow(@PathVariable("id") UUID id, Model model) { - List artists = artistAdminService.findAllArtistKoreanName() + List artists = artistAdminService.findAllArtistName() .stream() - .map(ArtistKoreanNameApiResponse::new) + .map(ArtistNameApiResponse::new) .toList(); List genres = genreAdminService.findAllGenres() diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowArtistApiResponse.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowArtistApiResponse.java index 7083ca51..6a3ac3bb 100644 --- a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowArtistApiResponse.java +++ b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowArtistApiResponse.java @@ -11,11 +11,8 @@ public record ShowArtistApiResponse( @Schema(description = "아티스트 ID") UUID id, - @Schema(description = "아티스트 한국어 이름") - String koreanName, - - @Schema(description = "아티스트 영어 이름") - String englishName, + @Schema(description = "아티스트 이름") + String name, @Schema(description = "아티스트 이미지 URL") String imageURL @@ -24,8 +21,7 @@ public record ShowArtistApiResponse( public static ShowArtistApiResponse from(ShowArtistServiceResponse artists) { return ShowArtistApiResponse.builder() .id(artists.id()) - .koreanName(artists.koreanName()) - .englishName(artists.englishName()) + .name(artists.name()) .imageURL(artists.image()) .build(); } diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowInfoApiResponse.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowInfoApiResponse.java index b609a366..d3883706 100644 --- a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowInfoApiResponse.java +++ b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowInfoApiResponse.java @@ -1,6 +1,6 @@ package com.example.show.controller.dto.response; -import com.example.artist.controller.dto.response.ArtistKoreanNameApiResponse; +import com.example.artist.controller.dto.response.ArtistNameApiResponse; import com.example.genre.controller.dto.response.GenreNameApiResponse; import com.example.show.service.dto.response.ShowInfoServiceResponse; import java.time.LocalDate; @@ -20,7 +20,7 @@ public record ShowInfoApiResponse( ShowSeatApiResponse seatInfoApiResponse, ShowTicketingSiteApiResponse ticketingSiteApiResponse, List ticketingTimes, - List artistKoreanNameResponses, + List artistKoreanNameResponses, List genreNameResponses ) { @@ -40,7 +40,7 @@ public ShowInfoApiResponse(ShowInfoServiceResponse showInfoServiceResponse) { .map(ShowTicketingTimeApiResponse::from) .toList(), showInfoServiceResponse.artistKoreanNameResponses().stream() - .map(ArtistKoreanNameApiResponse::new) + .map(ArtistNameApiResponse::new) .toList(), showInfoServiceResponse.genreNameResponses().stream() .map(GenreNameApiResponse::new) diff --git a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowArtistServiceResponse.java b/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowArtistServiceResponse.java index 2c6426b2..882b01da 100644 --- a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowArtistServiceResponse.java +++ b/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowArtistServiceResponse.java @@ -7,16 +7,14 @@ @Builder public record ShowArtistServiceResponse( UUID id, - String koreanName, - String englishName, + String name, String image ) { public static ShowArtistServiceResponse from(ArtistDomainResponse artist) { return ShowArtistServiceResponse.builder() .id(artist.id()) - .koreanName(artist.koreanName()) - .englishName(artist.englishName()) + .name(artist.name()) .image(artist.image()) .build(); } diff --git a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowArtistSimpleServiceResponse.java b/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowArtistSimpleServiceResponse.java deleted file mode 100644 index 15b6ba39..00000000 --- a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowArtistSimpleServiceResponse.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.example.show.service.dto.response; - -import java.util.UUID; -import lombok.Builder; -import org.example.dto.artist.response.ArtistDomainResponse; - -@Builder -public record ShowArtistSimpleServiceResponse( - UUID id, - String koreanName, - String englishName, - String image -) { - - public static ShowArtistSimpleServiceResponse from(ArtistDomainResponse response) { - return ShowArtistSimpleServiceResponse.builder() - .id(response.id()) - .koreanName(response.koreanName()) - .englishName(response.englishName()) - .image(response.image()) - .build(); - } -} diff --git a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowInfoServiceResponse.java b/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowInfoServiceResponse.java index c786bc30..15950976 100644 --- a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowInfoServiceResponse.java +++ b/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowInfoServiceResponse.java @@ -1,14 +1,14 @@ package com.example.show.service.dto.response; -import com.example.artist.service.dto.response.ArtistKoreanNameServiceResponse; +import com.example.artist.service.dto.response.ArtistNameServiceResponse; import com.example.genre.service.dto.response.GenreNameServiceResponse; import java.time.LocalDate; import java.util.List; import java.util.Set; import java.util.UUID; import lombok.Builder; -import org.example.dto.artist.response.ArtistKoreanNameDomainResponse; -import org.example.dto.artist.response.ArtistKoreanNamesWithShowIdDomainResponse; +import org.example.dto.artist.response.ArtistNameDomainResponse; +import org.example.dto.artist.response.ArtistNamesWithShowIdDomainResponse; import org.example.dto.genre.response.GenreNameDomainResponse; import org.example.dto.genre.response.GenreNamesWithShowIdDomainResponse; import org.example.dto.show.response.ShowInfoDomainResponse; @@ -28,7 +28,7 @@ public record ShowInfoServiceResponse( ShowSeatServiceResponse seats, ShowTicketingSiteServiceResponse ticketingSiteInfos, List ticketingSites, - List artistKoreanNameResponses, + List artistKoreanNameResponses, List genreNameResponses ) { @@ -52,7 +52,7 @@ public ShowInfoServiceResponse(ShowInfoDomainResponse showInfo) { public static List as( List showWithTicketingTimes, - List artistNamesWithShowId, + List artistNamesWithShowId, List genreNamesWithShowId ) { return showWithTicketingTimes.stream() @@ -96,11 +96,11 @@ private static List toShowTicketingTimeService .toList(); } - private static List toArtistKoreanNameServiceResponses( - Set artistKoreanNameResponses) { + private static List toArtistKoreanNameServiceResponses( + Set artistKoreanNameResponses) { return artistKoreanNameResponses .stream() - .map(ArtistKoreanNameServiceResponse::new) + .map(ArtistNameServiceResponse::new) .toList(); } @@ -112,15 +112,15 @@ private static List toGenreNameServiceResponses( .toList(); } - private static List getArtistKoreanNameResponses( - List artistNamesWithShowId, + private static List getArtistKoreanNameResponses( + List artistNamesWithShowId, ShowWithTicketingTimesDomainResponse showWitTicketingTimes ) { return artistNamesWithShowId.stream() .filter( artistResponse -> artistResponse.showId().equals(showWitTicketingTimes.show().id())) .flatMap(artistResponse -> artistResponse.koreanNameDomainResponses().stream()) - .map(ArtistKoreanNameServiceResponse::new) + .map(ArtistNameServiceResponse::new) .toList(); } diff --git a/app/api/show-api/src/test/java/artist/fixture/dto/ArtistRequestDtoFixture.java b/app/api/show-api/src/test/java/artist/fixture/dto/ArtistRequestDtoFixture.java index 4b44c60a..d9a2c3c7 100644 --- a/app/api/show-api/src/test/java/artist/fixture/dto/ArtistRequestDtoFixture.java +++ b/app/api/show-api/src/test/java/artist/fixture/dto/ArtistRequestDtoFixture.java @@ -1,16 +1,9 @@ package artist.fixture.dto; -import com.example.artist.service.dto.request.ArtistCreateServiceRequest; -import com.example.artist.service.dto.request.ArtistFilterTotalCountServiceRequest; import com.example.artist.service.dto.request.ArtistSearchPaginationServiceRequest; import com.example.artist.service.dto.request.ArtistSubscriptionPaginationServiceRequest; import com.example.artist.service.dto.request.ArtistUnsubscriptionPaginationServiceRequest; -import com.example.artist.service.dto.request.ArtistUpdateServiceRequest; -import com.example.artist.vo.ArtistApiType; -import com.example.artist.vo.ArtistGenderApiType; -import com.example.artist.vo.ArtistSortApiType; import com.example.vo.SubscriptionStatusApiType; -import java.util.List; import java.util.UUID; import org.springframework.mock.web.MockMultipartFile; @@ -24,30 +17,6 @@ public class ArtistRequestDtoFixture { ); - public static ArtistCreateServiceRequest artistCreateServiceRequest() { - return ArtistCreateServiceRequest.builder() - .koreanName("test_koreanName") - .englishName("test_englishName") - .image(image) - .country("test_country") - .artistGenderApiType(ArtistGenderApiType.MAN) - .artistApiType(ArtistApiType.SOLO) - .genreIds(List.of(UUID.randomUUID())) - .build(); - } - - public static ArtistUpdateServiceRequest artistUpdateServiceRequest() { - return ArtistUpdateServiceRequest.builder() - .koreanName("test_koreanName") - .englishName("test_englishName") - .image(image) - .country("test_country") - .artistGenderApiType(ArtistGenderApiType.MAN) - .artistApiType(ArtistApiType.SOLO) - .genreIds(List.of(UUID.randomUUID())) - .build(); - } - public static ArtistSearchPaginationServiceRequest artistSearchPaginationServiceRequest( int size, String search @@ -59,22 +28,12 @@ public static ArtistSearchPaginationServiceRequest artistSearchPaginationService .build(); } - public static ArtistFilterTotalCountServiceRequest artistFilterTotalCountServiceRequest() { - return ArtistFilterTotalCountServiceRequest.builder() - .artistGenderApiTypes(getArtistGenderApiTypes()) - .artistApiTypes(getArtistApiTypes()) - .genreIds(List.of(UUID.randomUUID())) - .userId(UUID.randomUUID()) - .build(); - } - public static ArtistSubscriptionPaginationServiceRequest artistSubscriptionPaginationServiceRequest( int size ) { return ArtistSubscriptionPaginationServiceRequest.builder() .subscriptionStatusApiType(SubscriptionStatusApiType.SUBSCRIBED) .size(size) - .sortStandard(ArtistSortApiType.ENGLISH_NAME_ASC) .cursor(UUID.randomUUID()) .userId(UUID.randomUUID()) .build(); @@ -85,21 +44,9 @@ public static ArtistUnsubscriptionPaginationServiceRequest artistUnsubscriptionP ) { return ArtistUnsubscriptionPaginationServiceRequest.builder() .subscriptionStatusApiType(SubscriptionStatusApiType.UNSUBSCRIBED) - .sortStandard(ArtistSortApiType.ENGLISH_NAME_ASC) - .artistGenderApiTypes(getArtistGenderApiTypes()) - .artistApiTypes(getArtistApiTypes()) - .genreIds(List.of(UUID.randomUUID())) .userId(UUID.randomUUID()) .cursor(UUID.randomUUID()) .size(size) .build(); } - - private static List getArtistApiTypes() { - return List.of(ArtistApiType.GROUP, ArtistApiType.SOLO); - } - - private static List getArtistGenderApiTypes() { - return List.of(ArtistGenderApiType.MAN, ArtistGenderApiType.WOMAN); - } } diff --git a/app/api/show-api/src/test/java/artist/fixture/dto/ArtistResponseDtoFixture.java b/app/api/show-api/src/test/java/artist/fixture/dto/ArtistResponseDtoFixture.java index 06e84278..b9a05645 100644 --- a/app/api/show-api/src/test/java/artist/fixture/dto/ArtistResponseDtoFixture.java +++ b/app/api/show-api/src/test/java/artist/fixture/dto/ArtistResponseDtoFixture.java @@ -3,18 +3,11 @@ import java.util.List; import java.util.UUID; import java.util.stream.IntStream; -import org.example.dto.artist.response.ArtistFilterTotalCountDomainResponse; import org.example.dto.artist.response.ArtistPaginationDomainResponse; import org.example.dto.artist.response.ArtistSimpleDomainResponse; public class ArtistResponseDtoFixture { - public static ArtistFilterTotalCountDomainResponse artistFilterTotalCountDomainResponse( - int totalCount - ) { - return new ArtistFilterTotalCountDomainResponse(totalCount); - } - public static ArtistPaginationDomainResponse artistPaginationDomainResponse( int size, boolean hasNext @@ -38,9 +31,8 @@ public static List artistSimpleDomainResponses( return IntStream.range(0, size) .mapToObj(i -> ArtistSimpleDomainResponse.builder() .id(UUID.randomUUID()) - .koreanName(i + "testKoreanName") + .name(i + "name") .image(i + "testImage") - .englishName(i + "testEnglishName") .build()) .toList(); } diff --git a/app/api/show-api/src/test/java/artist/service/ArtistAdminServiceTest.java b/app/api/show-api/src/test/java/artist/service/ArtistAdminServiceTest.java deleted file mode 100644 index 4327669a..00000000 --- a/app/api/show-api/src/test/java/artist/service/ArtistAdminServiceTest.java +++ /dev/null @@ -1,69 +0,0 @@ -package artist.service; - -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyList; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.BDDMockito.given; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - -import artist.fixture.dto.ArtistRequestDtoFixture; -import com.example.artist.service.ArtistAdminService; -import com.example.artist.service.dto.request.ArtistCreateServiceRequest; -import com.example.artist.service.dto.request.ArtistUpdateServiceRequest; -import com.example.component.FileUploadComponent; -import java.util.UUID; -import org.example.entity.artist.Artist; -import org.example.usecase.ArtistUseCase; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - -class ArtistAdminServiceTest { - - private final ArtistUseCase artistUseCase = mock(ArtistUseCase.class); - private final FileUploadComponent fileUploadComponent = mock(FileUploadComponent.class); - - private final ArtistAdminService artistAdminService = new ArtistAdminService( - artistUseCase, fileUploadComponent); - - @Test - @DisplayName("아티스트는 업로드된 이미지 URL과 함께 생성된다.") - void artistCreateWithUploadedImageUrl() { - //given - ArtistCreateServiceRequest artistCreateServiceRequest = ArtistRequestDtoFixture.artistCreateServiceRequest(); - given( - fileUploadComponent.uploadFile( - "artist", - artistCreateServiceRequest.image() - ) - ).willReturn("test_imageUrl"); - - //when - artistAdminService.save(artistCreateServiceRequest); - - //then - verify(artistUseCase, times(1)).save(any(Artist.class), anyList()); - } - - @Test - @DisplayName("아티스트는 업로드된 이미지 URL과 함께 업데이트 된다.") - void artistUpdateWithUploadedImageUrl() { - //given - ArtistUpdateServiceRequest artistUpdateServiceRequest = ArtistRequestDtoFixture.artistUpdateServiceRequest(); - UUID artistId = UUID.randomUUID(); - given( - fileUploadComponent.uploadFile( - "artist", - artistUpdateServiceRequest.image() - ) - ).willReturn("test_imageUrl"); - - //when - artistAdminService.updateArtist(artistId, artistUpdateServiceRequest); - - //then - verify(artistUseCase, times(1)).updateArtist(eq(artistId), any(Artist.class), anyList()); - } - -} diff --git a/app/api/show-api/src/test/java/artist/service/ArtistServiceTest.java b/app/api/show-api/src/test/java/artist/service/ArtistServiceTest.java index eb27a4c2..b32c0906 100644 --- a/app/api/show-api/src/test/java/artist/service/ArtistServiceTest.java +++ b/app/api/show-api/src/test/java/artist/service/ArtistServiceTest.java @@ -16,7 +16,6 @@ import com.example.publish.MessagePublisher; import com.example.publish.message.ArtistSubscriptionServiceMessage; import java.util.List; -import java.util.NoSuchElementException; import java.util.UUID; import org.assertj.core.api.SoftAssertions; import org.example.entity.artist.Artist; @@ -55,11 +54,6 @@ void artistSearchWithPagination() { int size = 3; boolean hasNext = true; var request = ArtistRequestDtoFixture.artistSearchPaginationServiceRequest(size, search); - // given( - // artistUseCase.searchArtist(request.toDomainRequest()) - // ).willReturn( - // ArtistResponseDtoFixture.artistPaginationDomainResponse(size, hasNext) - // ); //when var result = artistService.searchArtist(request); @@ -81,11 +75,6 @@ void artistSearchEmptyResultWithPagination() { String search = "testArtistName"; int size = 3; var request = ArtistRequestDtoFixture.artistSearchPaginationServiceRequest(size, search); - // given( - // artistUseCase.searchArtist(request.toDomainRequest()) - // ).willReturn( - // ArtistResponseDtoFixture.emptyDataArtistPaginationDomainResponse() - // ); //when var result = artistService.searchArtist(request); @@ -172,63 +161,6 @@ void artistFilterEmptyResultWithPagination() { ); } - @Test - @DisplayName("아티스트 필터링한 총 개수를 반환한다.") - void artistFilterToTalCount() { - //given - var request = ArtistRequestDtoFixture.artistFilterTotalCountServiceRequest(); - var subscriptions = ArtistSubscriptionFixture.artistSubscriptions(2); - given( - artistSubscriptionUseCase.findSubscriptionList(request.userId()) - ).willReturn( - subscriptions - ); - - var subscriptionArtistIds = subscriptions.stream() - .map(ArtistSubscription::getArtistId) - .toList(); - int totalCount = 3; - given( - artistUseCase.findFilterArtistTotalCount(request.toDomainRequest(subscriptionArtistIds)) - ).willReturn( - ArtistResponseDtoFixture.artistFilterTotalCountDomainResponse(totalCount) - ); - - //when - var result = artistService.filterArtistTotalCount(request); - - //then - assertThat(result.totalCount()).isEqualTo(totalCount); - } - - @Test - @DisplayName("아티스트 필터링 후 결과가 없다면 0을 반환한다.") - void artistFilterTotalCountZero() { - //given - var request = ArtistRequestDtoFixture.artistFilterTotalCountServiceRequest(); - var subscriptions = ArtistSubscriptionFixture.artistSubscriptions(2); - given( - artistSubscriptionUseCase.findSubscriptionList(request.userId()) - ).willReturn( - subscriptions - ); - - var subscriptionArtistIds = subscriptions.stream() - .map(ArtistSubscription::getArtistId) - .toList(); - given( - artistUseCase.findFilterArtistTotalCount(request.toDomainRequest(subscriptionArtistIds)) - ).willThrow( - NoSuchElementException.class - ); - - //when - var result = artistService.filterArtistTotalCount(request); - - //then - assertThat(result.totalCount()).isZero(); - } - @Test @DisplayName("아티스트를 구독하면 구독 성공한 아티스트 ID들을 반환한다.") void artistSubscribe() { diff --git a/app/domain/common-domain/src/main/resources/data.sql b/app/domain/common-domain/src/main/resources/data.sql index 2802b20b..87bd54c4 100644 --- a/app/domain/common-domain/src/main/resources/data.sql +++ b/app/domain/common-domain/src/main/resources/data.sql @@ -26,833 +26,3 @@ VALUES ('017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1', '2024-08-04 00:00:00', '2024-08- 'classic'), ('017f20d0-4f3c-8f4d-9e15-7ff0c3a876dd', '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, 'jazz'); - --- 아티스트 데이터 -insert into public.artist (id, created_at, updated_at, is_deleted, korean_name, english_name, gender, type, country, image) -values ('2ab7eba4-98f9-4936-ac1b-716bc2f04a1c', '2024-08-04 00:00:00.000', '2024-08-27 23:25:28.383', false, '스파이에어', 'Spyair', 'MAN', 'GROUP', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/Spyair_1724768728012.jpg'), - ('d3fc15e6-172f-4448-928b-7fdd7a6a9ab6', '2024-08-04 00:00:00.000', '2024-08-27 23:26:32.865', false, '킹누', 'King Gnu', 'MAN', 'GROUP', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/kingnu_1724768792711.webp'), - ('f56b52c1-72c2-450c-ad59-e88db1530dcb', '2024-08-04 00:00:00.000', '2024-08-27 23:27:01.420', false, '브루노 마스', 'Bruno Mars', 'MAN', 'SOLO', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/bruno_1724768820768.webp'), - ('a94dc17e-4b77-4959-bb1d-a3bd9735cf01', '2024-08-04 00:00:00.000', '2024-08-27 23:27:26.441', false, '찰리 푸스', 'Charlie Puth', 'MAN', 'SOLO', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/chalie_1724768846279.jpg'), - ('0b60cd2a-5312-41a2-ba1d-db1acb72460b', '2024-08-04 00:00:00.000', '2024-08-27 23:28:06.001', false, '테일러 스위프트', 'Taylor Swift', 'WOMAN', 'SOLO', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/tailer_1724768885797.jpg'), - ('02c9aedf-9ea2-4720-83c5-eeacd79a2e6e', '2024-08-04 00:00:00.000', '2024-08-27 23:28:32.443', false, '위켄드', 'The Weeknd', 'MAN', 'SOLO', 'Canada', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/weekend_1724768912290.jpg'), - ('c3df1fe2-0795-4204-92d6-68d3d6f4bc05', '2024-08-04 00:00:00.000', '2024-08-27 23:28:58.454', false, '저스틴 비버', 'Justin Bieber', 'MAN', 'SOLO', 'Canada', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/justin_1724768938125.webp'), - ('7a97697e-2fa0-4d5b-851f-dd8864b5b49a', '2024-08-04 00:00:00.000', '2024-08-27 23:29:25.163', false, '올리비아 딘', 'Olivia Dean', 'WOMAN', 'SOLO', 'UK', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/olivia_1724768965040.jpeg'), - ('fdf9929d-9001-489a-9d7f-a345581ca6bd', '2024-08-04 00:00:00.000', '2024-08-27 23:30:18.118', false, '새미 비르지', 'Sammy Virji', 'MAN', 'SOLO', 'UK', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/sammy_1724769017908.jpeg'), - ('1535086f-99ff-493e-bfb4-254f15d87e5d', '2024-08-04 00:00:00.000', '2024-08-27 23:31:13.574', false, '디스클로저', 'Disclosure', 'MAN', 'GROUP', 'UK', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/disclosure_1724769073426.avif'), - ('f5d0d77a-e5f2-42ff-8478-5a70b3d7ba50', '2024-08-04 00:00:00.000', '2024-08-27 23:31:38.363', false, '라디오헤드', 'Radiohead', 'MAN', 'GROUP', 'UK', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/radio_1724769097990.webp'), - ('e7bf557b-8591-418f-8422-d1f08c26df2f', '2024-08-04 00:00:00.000', '2024-08-27 23:32:05.516', false, '에이제이알', 'AJR', 'MAN', 'GROUP', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/ajr_1724769125314.webp'), - ('e7f28490-8e4c-426b-92fc-fbcb226ea7f7', '2024-08-04 00:00:00.000', '2024-08-27 23:32:33.585', false, '크리스토퍼', 'Christopher', 'MAN', 'SOLO', 'Denmark', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/Christopher_1724769153407.jpg'), - ('b50a931a-d4f3-4c32-8636-253e4fff45ab', '2024-08-04 00:00:00.000', '2024-08-27 23:33:10.179', false, '스트록스', 'The Strokes', 'MAN', 'GROUP', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/stroke_1724769189974.jpg'), - ('72cdcdb7-1fed-460d-a316-3988ffa1a6c8', '2024-08-04 00:00:00.000', '2024-08-27 23:33:35.371', false, '벤슨 분', 'Benson Boone', 'MAN', 'SOLO', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/benson_1724769215187.jpg'), - ('e86ca40e-29f3-48d3-921f-c51d5e8c05e0', '2024-08-04 00:00:00.000', '2024-08-27 23:34:01.277', false, '아리아나 그란데', 'Ariana Grande', 'WOMAN', 'SOLO', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/ariana_1724769241119.webp'), - ('6d7fee98-4719-4afc-9113-42177e417cb8', '2024-08-04 00:00:00.000', '2024-08-27 23:34:36.105', false, '코난 그레이', 'Conan Gray', 'MAN', 'SOLO', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/connan_1724769275864.jpeg'), - ('ac400fd9-d188-4dfa-81a9-80d092317855', '2024-08-04 00:00:00.000', '2024-08-27 23:35:06.166', false, '마룬 5', 'Maroon 5', 'MAN', 'GROUP', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/marron_1724769305988.jpg'), - ('8c85815e-cd89-44cf-912d-d8c92a0ace60', '2024-08-04 00:00:00.000', '2024-08-27 23:35:39.227', false, '이메진 드래곤스', 'Imagine Dragons', 'MAN', 'GROUP', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/imagine_1724769339017.jpg'), - ('1d6bd071-dd58-4411-988b-4a6146f59c80', '2024-08-04 00:00:00.000', '2024-08-27 23:36:26.412', false, '요아소비', 'Yoasobi', 'MIXED', 'GROUP', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/yoasobi_1724769386223.jpg'), - ('f5fc86ee-0519-409c-9bed-ae0dbead3bea', '2024-08-04 00:00:00.000', '2024-08-27 23:36:49.897', false, '라우브', 'Lauv', 'MAN', 'SOLO', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/lauv_1724769409619.jpeg'), - ('db8e5dbb-fc91-48d6-ba0f-0100004a64af', '2024-08-04 00:00:00.000', '2024-08-27 23:37:20.852', false, '레이니', 'Lany', 'MAN', 'GROUP', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/lany_1724769440725.webp'), - ('de7b5c97-16d4-4d0b-bf52-b58f28b5475c', '2024-08-04 00:00:00.000', '2024-08-27 23:37:41.800', false, '혼네', 'Honne', 'MAN', 'GROUP', 'UK', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/honne_1724769461626.webp'), - ('059f8de8-e3f7-4e3b-a1da-89a8c4b73f70', '2024-08-04 00:00:00.000', '2024-08-27 23:38:15.813', false, '노엘 갤러거 하이플라잉버즈', 'Noel Gallagher`s High Flying Birds', 'MAN', 'GROUP', 'UK', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/noel_1724769495678.jpeg'), - ('2c8afe0e-1c1b-4226-b20e-726faa1fc48c', '2024-08-04 00:00:00.000', '2024-08-27 23:38:38.828', false, '그린데이', 'Green Day', 'MAN', 'GROUP', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/green_1724769518692.jpeg'), - ('b4e388ca-5a54-4e2e-8624-ddd363b32a75', '2024-08-04 00:00:00.000', '2024-08-27 23:39:03.800', false, '모네스킨', 'Måneskin', 'MIXED', 'GROUP', 'Italy', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/maneskin_1724769543598.jpeg'), - ('e22c3c45-b88b-4278-b20d-270aac64229e', '2024-08-04 00:00:00.000', '2024-08-27 23:39:36.774', false, '유우리', 'Yuuri', 'MAN', 'SOLO', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/yuuri_1724769576549.webp'), - ('b6f220ab-34ad-40ee-b797-ec5c24459aa9', '2024-08-04 00:00:00.000', '2024-08-27 23:40:15.307', false, '트래비스', 'Travis', 'MAN', 'GROUP', 'UK', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/travis_1724769615152.webp'), - ('eb93b4ca-be7c-409f-b48d-5301ee0b02fe', '2024-08-04 00:00:00.000', '2024-08-27 23:40:45.149', false, '머라이어 캐리', 'Mariah Carey', 'WOMAN', 'GROUP', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/mariah_1724769644975.jpg'), - ('43e17c11-c3b7-4dd9-a92e-fdadb8783bca', '2024-08-04 00:00:00.000', '2024-08-27 23:41:20.178', false, '계속 한밤중이면 좋을텐데', 'ZUTOMAYO', 'MIXED', 'GROUP', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/zutomayo_1724769679969.jpg'), - ('fdc16095-1bb1-4cc6-8e2f-75495a6f3a13', '2024-08-04 00:00:00.000', '2024-08-27 23:41:43.231', false, '원오크락', 'ONE OK ROCK', 'MAN', 'GROUP', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/oneokrock_1724769703056.jpg'), - ('2f8c8f6c-842a-48cd-9ed7-f84710d3fef2', '2024-08-04 00:00:00.000', '2024-08-27 23:42:17.031', false, '뉴 호프 클럽', 'New Hope Club', 'MAN', 'GROUP', 'UK', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/new_1724769736830.jpg'), - ('6b1aeec8-ac19-4a6a-92b5-5e71733ef204', '2024-08-04 00:00:00.000', '2024-08-27 23:43:09.597', false, '마이클 부불레', 'Michael Bublé', 'MAN', 'SOLO', 'Canada', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/buble_1724769789357.jpg'), - ('2e277ef0-c3f1-4f80-9ed0-4db0a3350e12', '2024-08-04 00:00:00.000', '2024-08-27 23:43:46.668', false, '저스틴 팀버레이크', 'Justin Timberlake', 'MAN', 'SOLO', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/justin_1724769826408.png'), - ('e0fc0ab6-19ee-47ef-a50d-45ab7efe3bba', '2024-08-04 00:00:00.000', '2024-08-27 23:44:15.233', false, '와니마', 'Wanima', 'MAN', 'GROUP', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/wanima_1724769854792.png'), - ('772efb86-0af8-4dc6-b73b-bd226fb86944', '2024-08-04 00:00:00.000', '2024-08-27 23:44:38.306', false, '후지이 카제', 'Fujii Kaze', 'MAN', 'SOLO', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/fujii_1724769878117.jpeg'), - ('268ad7b1-7550-4cab-bb04-273b1649e682', '2024-08-04 00:00:00.000', '2024-08-27 23:44:59.151', false, '레오루', 'Reol', 'WOMAN', 'SOLO', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/reol_1724769899019.webp'), - ('e3753ac5-a079-417a-b75a-7593d9b802ad', '2024-08-04 00:00:00.000', '2024-08-27 23:45:33.511', false, '정글', 'Jungle', 'MAN', 'GROUP', 'UK', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/jungle_1724769933371.jpeg'), - ('5aeb15be-b150-4915-a242-d35cdee8aeb4', '2024-08-04 00:00:00.000', '2024-08-27 23:45:59.153', false, '나씽 벗 띠브스', 'Nothing But Thieves', 'MAN', 'GROUP', 'UK', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/nothing_1724769958966.jpg'), - ('01681324-678a-4e9a-a80b-e93d038bf75f', '2024-08-04 00:00:00.000', '2024-08-27 23:46:27.159', false, '제이콥 콜리어', 'Jacob Collier', 'MAN', 'SOLO', 'UK', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/jacob_1724769986891.jpg'), - ('9ab800fa-158c-4577-b4a0-15f7df9d641a', '2024-08-04 00:00:00.000', '2024-08-04 00:00:00.000', false, '이매진 드래곤스', 'Imagine Dragons', 'MAN', 'GROUP', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/images_1724739402299.jpeg'), - ('b9f79017-f97d-44b1-82ce-645e92856c0b', '2024-08-04 00:00:00.000', '2024-08-27 23:19:11.253', false, '콜드플레이', 'Coldplay', 'MAN', 'GROUP', 'UK', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/%E1%84%8F%E1%85%A9%E1%86%AF%E1%84%83%E1%85%B3_1724768351050.webp'), - ('88ade2ad-96ac-4ed4-8dce-72aec8d8545d', '2024-08-04 00:00:00.000', '2024-08-27 23:48:17.537', false, '원오트릭스 포인트 네버', 'OPN (Oneohtrix Point Never)', 'MAN', 'SOLO', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/opn_1724770097381.webp'), - ('c440d4e0-3f52-4225-9bc2-f1183a4b9f22', '2024-08-04 00:00:00.000', '2024-08-27 23:48:44.750', false, '코코 앤 클레어 클레어', 'Coco & Clair Clair', 'WOMAN', 'GROUP', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/coco_1724770123547.jpeg'), - ('036854c0-9d22-4660-89f9-0abd16dd3ec1', '2024-08-04 00:00:00.000', '2024-08-27 23:49:12.096', false, '쿠키 카와이', 'Cookiee Kawaii', 'WOMAN', 'SOLO', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/cookiee_1724770151991.jpeg'), - ('e139192f-ba01-4a15-b0b1-86005aee3c1d', '2024-08-04 00:00:00.000', '2024-08-27 23:49:41.936', false, '킹크룰', 'King Krule', 'MAN', 'SOLO', 'UK', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/king_1724770181258.jpg'), - ('d63490e9-0eaf-4914-be90-8d34381b5b05', '2024-08-04 00:00:00.000', '2024-08-27 23:50:10.349', false, '켄드릭 라마', 'Kendrick Lamar', 'MAN', 'SOLO', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/kendric_1724770210212.jpeg'), - ('56a4a4af-dc3f-4f9f-9316-6bcd20d99455', '2024-08-04 00:00:00.000', '2024-08-27 23:50:40.608', false, '오피셜히게단디즘', 'Official Hige Dandism', 'MAN', 'GROUP', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/official_1724770240501.jpeg'), - ('687f2125-f72e-45c9-84cc-3181fa5af912', '2024-08-04 00:00:00.000', '2024-08-27 23:51:07.598', false, '바운디', 'Vaundy', 'MAN', 'SOLO', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/vaundy_1724770267470.webp'), - ('909593a3-d067-4dae-9b4a-e14c8accb1aa', '2024-08-04 00:00:00.000', '2024-08-27 23:51:36.354', false, '나토리', 'Natori', 'MAN', 'SOLO', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/natori_1724770296144.jpg'), - ('10c0c327-8053-4792-ae0b-413d337ec413', '2024-08-04 00:00:00.000', '2024-08-27 23:52:00.472', false, '아도', 'Ado', 'WOMAN', 'SOLO', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/ado_1724770320291.jpeg'), - ('e19d1403-c4b3-4a6f-b5b8-8e935cb645c4', '2024-08-04 00:00:00.000', '2024-08-27 23:52:37.894', false, '와누카', 'Wanuka', 'WOMAN', 'SOLO', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/wanuka_1724770357742.webp'), - ('80154f71-f7b6-4d06-be39-2e4e00b281a1', '2024-08-04 00:00:00.000', '2024-08-27 23:53:08.584', false, '요네즈 켄시', 'Kenshi Yonezu', 'MAN', 'SOLO', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/kenshi-yonezu-album_1724770388385.jpg'), - ('4fd6cc98-3e3a-42bf-b04d-1563335397ad', '2024-08-04 00:00:00.000', '2024-08-27 23:53:30.731', false, '이마세', 'Imase', 'MAN', 'SOLO', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/imase_1724770410488.webp'), - ('c89e680f-1f9a-41a0-bc35-b835e67dcace', '2024-08-04 00:00:00.000', '2024-08-27 23:54:01.842', false, '리사', 'LiSA', 'WOMAN', 'SOLO', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/lisa_1724770439260.jpg'), - ('2f3532d6-f6f6-4b34-950f-7e4fc701e009', '2024-08-04 00:00:00.000', '2024-08-27 23:54:38.360', false, '아이묭', 'Aimyon', 'WOMAN', 'SOLO', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/aimyon_1724770477849.webp'), - ('f636f96a-7a42-416b-bab8-1cb8e1d2c314', '2024-08-04 00:00:00.000', '2024-08-27 23:55:30.235', false, '에메', 'Aimer', 'WOMAN', 'SOLO', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/aimer_1724770530046.webp'), - ('c62a2a56-1723-44f2-abb2-7a344db06afe', '2024-08-04 00:00:00.000', '2024-08-27 23:57:07.330', false, '츠키', 'Tuki.', 'WOMAN', 'SOLO', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/tuki_1724770627159.jpg'), - ('6342db02-e3ee-494b-91f0-15ba144b906c', '2024-08-04 00:00:00.000', '2024-08-27 23:57:37.254', false, '히즈치분가쿠', 'Hitsujibungaku', 'WOMAN', 'GROUP', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/Hitsujibungaku_1724770657102.webp'), - ('ec82d1dd-7eb7-4801-bd44-86d6096e4dea', '2024-08-04 00:00:00.000', '2024-08-27 23:58:20.611', false, '밀레니엄 퍼레이드', 'Millennium Parade', 'MAN', 'GROUP', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/mille_1724770700428.webp'), - ('5adeac70-0723-4869-831c-aace7691412c', '2024-08-04 00:00:00.000', '2024-08-27 23:58:50.153', false, '야마', 'Yama', 'MAN', 'SOLO', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/yama_1724770729949.jpeg'), - ('0dcf43ed-2a0c-4a54-af53-40eaa5c33776', '2024-08-04 00:00:00.000', '2024-08-27 23:59:11.689', false, '래드윔프스', 'RADWIMPS', 'MAN', 'GROUP', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/rad_1724770751447.jpeg'), - ('340cb74f-c770-43ce-91af-88cd2eff23d9', '2024-08-04 00:00:00.000', '2024-08-28 00:00:34.707', false, '요루시카', 'Yorushika', 'MIXED', 'GROUP', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/yoru_1724770834339.jpg'), - ('45c6e260-0ac1-4786-831f-7b077d8192e5', '2024-08-04 00:00:00.000', '2024-08-28 00:01:02.295', false, '미세스 그린 애플', 'Mrs. Green Apple', 'MAN', 'GROUP', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/mrs_1724770862070.webp'), - ('d187b6a2-4923-4611-bfff-f9c4c986566e', '2024-08-04 00:00:00.000', '2024-08-28 00:01:25.987', false, '빌리 아일리시', 'Billie Eilish', 'WOMAN', 'SOLO', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/bille_1724770885854.jpeg'), - ('5a4db81d-16e8-4033-8198-09bc92f57ca4', '2024-08-04 00:00:00.000', '2024-08-28 00:01:53.941', false, '마이클 볼튼', 'Michael Bolton', 'MAN', 'SOLO', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/bolton_1724770913666.jpg'), - ('3a2d52b1-b39f-4389-b1ee-a0fc0c38bc62', '2024-08-04 00:00:00.000', '2024-08-28 00:02:20.783', false, '두아리파', 'Dua Lipa', 'WOMAN', 'SOLO', 'UK', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/dua_1724770939506.jpg'), - ('9431dc41-7ce6-4d81-b680-a322595fe43d', '2024-08-04 00:00:00.000', '2024-08-28 00:02:44.027', false, '레드 핫 칠리 페퍼스', 'Red Hot Chili Peppers', 'MAN', 'GROUP', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/re_1724770963768.webp'), - ('0d38c2cd-0be8-49b5-a719-b17db10afe84', '2024-08-04 00:00:00.000', '2024-08-28 00:03:10.591', false, '아델', 'Adele', 'WOMAN', 'SOLO', 'UK', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/adele_1724770990394.jpeg'), - ('8996c8dc-b8a2-449b-9c19-09cd49e2924d', '2024-08-04 00:00:00.000', '2024-08-28 00:03:34.616', false, '에드 시런', 'Ed Sheeran', 'MAN', 'SOLO', 'UK', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/ed_1724771014309.jpg'), - ('2204c6fa-c78d-420f-b689-b8932aaf50a7', '2024-08-04 00:00:00.000', '2024-08-28 00:04:00.548', false, '레이디가가', 'Lady Gaga', 'WOMAN', 'SOLO', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/lady_1724771040382.jpg'), - ('82311401-6764-44bd-9fb4-a2bb37a89cfd', '2024-08-04 00:00:00.000', '2024-08-28 00:04:23.188', false, '데프 레퍼드', 'Def Leppard', 'MAN', 'GROUP', 'UK', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/def_1724771063040.webp'), - ('7b3acbb2-6d90-4bc0-a510-95688ffbdbc7', '2024-08-04 00:00:00.000', '2024-08-28 00:04:45.129', false, '에이씨디씨', 'AC/DC', 'MAN', 'GROUP', 'Australia', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/acdc_1724771083568.webp'), - ('aa4e4067-11cc-46f5-9548-5ebdc40b91a3', '2024-08-04 00:00:00.000', '2024-08-28 00:05:15.566', false, '요니지', 'Yonige', 'WOMAN', 'GROUP', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/Yonige_1724771115274.webp'), - ('3d367630-37a4-41be-8d09-4434e4c24d09', '2024-08-04 00:00:00.000', '2024-08-28 00:06:04.944', false, '스티비 원더', 'Stevie Wonder', 'MAN', 'SOLO', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/stevie_1724771164729.jpg'), - ('967573c3-fcee-453a-b9ee-177359ff7dba', '2024-08-04 00:00:00.000', '2024-08-28 00:06:24.071', false, '호시노 겐', 'Gen Hoshino', 'MAN', 'SOLO', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/Gen%20Hoshino_1724771183773.jpg'), - ('b71a2ee4-a110-4e6c-a49c-e135a8311b6b', '2024-08-04 00:00:00.000', '2024-08-28 00:07:08.746', false, '마일리 사이러스', 'Miley Cyrus', 'WOMAN', 'SOLO', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/Miley%20Cyrus_1724771228212.jpg'), - ('525c7aec-3c72-45c9-9e53-f904869b1306', '2024-08-04 00:00:00.000', '2024-08-28 00:06:48.240', false, '크리피 넛츠', 'Creepy Nuts', 'MAN', 'SOLO', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/Creepy%20Nuts_1724771203464.jpeg'), - ('1aab6fed-7d20-42ed-9f59-67713671f813', '2024-08-04 00:00:00.000', '2024-08-28 00:07:36.693', false, '베케이션스', 'Vacations', 'MAN', 'GROUP', 'Australia', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/vacations_1724771256358.jpeg'), - ('129fb608-eeb9-42ec-87f6-e1515bdf2696', '2024-08-04 00:00:00.000', '2024-08-28 00:07:57.832', false, '사카낙션', 'Sakanaction', 'MAN', 'GROUP', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/Sakanaction_1724771277698.jpeg'), - ('ec304557-e9f1-4bf3-8abf-62c83dec099f', '2024-08-04 00:00:00.000', '2024-08-27 23:19:40.011', false, '포스트 말론', 'Post Malone', 'MAN', 'SOLO', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/%E1%84%91%E1%85%A9%E1%84%89%E1%85%B3%E1%84%90%E1%85%B3%E1%84%86%E1%85%A1%E1%86%AF%E1%84%85%E1%85%A9%E1%86%AB_1724768379768.webp'), - ('977452b5-db8e-48b9-abe6-d06b44a1b4ad', '2024-08-04 00:00:00.000', '2024-08-27 23:24:53.214', false, '이브', 'Eve', 'WOMAN', 'SOLO', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/eve_1724768692720.jpg'), - ('dac4fda7-1746-4eb3-8b87-cab78ae86c75', '2024-08-04 00:00:00.000', '2024-08-27 23:26:04.511', false, '엘르가든', 'Ellegarden', 'MAN', 'GROUP', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/elle_1724768764249.jpg'), - ('17790b8d-4e2c-4ec5-a524-d00d80a9868e', '2024-08-04 00:00:00.000', '2024-08-27 23:47:48.276', false, '라나 델 레이', 'Lana Del Rey', 'WOMAN', 'SOLO', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/lana_1724770067708.webp'), - ('87228380-e581-46d9-b524-869360451d02', '2024-08-04 00:00:00.000', '2024-08-28 00:05:35.377', false, '녹황색사회', 'Ryokuoushoku Shakai', 'MIXED', 'GROUP', 'Japan', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artist/Ryokuoushoku%20Shakai_1724771135189.jpg'), - ('01919929-4987-34c0-0f5d-57dc5479f08a', '2024-08-28 22:25:05.576', '2024-08-28 22:25:05.576', false, '올리비아 로드리고', 'Olivia Rodrigo', 'WOMAN', 'SOLO', 'USA', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/artists/olivia_1724851504951.jpg'); - --- Coldplay -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'b9f79017-f97d-44b1-82ce-645e92856c0b', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'b9f79017-f97d-44b1-82ce-645e92856c0b', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'b9f79017-f97d-44b1-82ce-645e92856c0b', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- Post Malone -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'ec304557-e9f1-4bf3-8abf-62c83dec099f', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d2'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'ec304557-e9f1-4bf3-8abf-62c83dec099f', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'ec304557-e9f1-4bf3-8abf-62c83dec099f', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'ec304557-e9f1-4bf3-8abf-62c83dec099f', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'); - --- Eve -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '977452b5-db8e-48b9-abe6-d06b44a1b4ad', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d2'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '977452b5-db8e-48b9-abe6-d06b44a1b4ad', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9'); - --- Spyair -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '2ab7eba4-98f9-4936-ac1b-716bc2f04a1c', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '2ab7eba4-98f9-4936-ac1b-716bc2f04a1c', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '2ab7eba4-98f9-4936-ac1b-716bc2f04a1c', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- Ellegarden -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'dac4fda7-1746-4eb3-8b87-cab78ae86c75', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'dac4fda7-1746-4eb3-8b87-cab78ae86c75', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'dac4fda7-1746-4eb3-8b87-cab78ae86c75', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- King Gnu -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'd3fc15e6-172f-4448-928b-7fdd7a6a9ab6', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'd3fc15e6-172f-4448-928b-7fdd7a6a9ab6', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'd3fc15e6-172f-4448-928b-7fdd7a6a9ab6', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'd3fc15e6-172f-4448-928b-7fdd7a6a9ab6', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- Bruno Mars -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'f56b52c1-72c2-450c-ad59-e88db1530dcb', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'f56b52c1-72c2-450c-ad59-e88db1530dcb', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'f56b52c1-72c2-450c-ad59-e88db1530dcb', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'); - --- Charlie Puth -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'a94dc17e-4b77-4959-bb1d-a3bd9735cf01', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'a94dc17e-4b77-4959-bb1d-a3bd9735cf01', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9'); - --- Taylor Swift -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '0b60cd2a-5312-41a2-ba1d-db1acb72460b', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '0b60cd2a-5312-41a2-ba1d-db1acb72460b', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'); - --- The Weeknd -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '02c9aedf-9ea2-4720-83c5-eeacd79a2e6e', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9'); - --- Justin Bieber -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'c3df1fe2-0795-4204-92d6-68d3d6f4bc05', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'c3df1fe2-0795-4204-92d6-68d3d6f4bc05', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9'); - --- Olivia Dean -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '7a97697e-2fa0-4d5b-851f-dd8864b5b49a', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'); - --- Sammy Virji -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'fdf9929d-9001-489a-9d7f-a345581ca6bd', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'); - --- Disclosure -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '1535086f-99ff-493e-bfb4-254f15d87e5d', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d6'); - --- Radiohead -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'f5d0d77a-e5f2-42ff-8478-5a70b3d7ba50', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'f5d0d77a-e5f2-42ff-8478-5a70b3d7ba50', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- AJR -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'e7bf557b-8591-418f-8422-d1f08c26df2f', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'e7bf557b-8591-418f-8422-d1f08c26df2f', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- Christopher -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'e7f28490-8e4c-426b-92fc-fbcb226ea7f7', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'); - --- The Strokes -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'b50a931a-d4f3-4c32-8636-253e4fff45ab', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'b50a931a-d4f3-4c32-8636-253e4fff45ab', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- Benson Boone -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '72cdcdb7-1fed-460d-a316-3988ffa1a6c8', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'); - --- Ariana Grande -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'e86ca40e-29f3-48d3-921f-c51d5e8c05e0', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'e86ca40e-29f3-48d3-921f-c51d5e8c05e0', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9'); - --- Conan Gray -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '6d7fee98-4719-4afc-9113-42177e417cb8', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'); - --- Maroon 5 -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'ac400fd9-d188-4dfa-81a9-80d092317855', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'ac400fd9-d188-4dfa-81a9-80d092317855', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'ac400fd9-d188-4dfa-81a9-80d092317855', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- Imagine Dragons -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '8c85815e-cd89-44cf-912d-d8c92a0ace60', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '8c85815e-cd89-44cf-912d-d8c92a0ace60', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '8c85815e-cd89-44cf-912d-d8c92a0ace60', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- Yoasobi -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '1d6bd071-dd58-4411-988b-4a6146f59c80', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'); - --- Lauv -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'f5fc86ee-0519-409c-9bed-ae0dbead3bea', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'f5fc86ee-0519-409c-9bed-ae0dbead3bea', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9'); - --- Lany -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'db8e5dbb-fc91-48d6-ba0f-0100004a64af', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'db8e5dbb-fc91-48d6-ba0f-0100004a64af', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- Honne -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'de7b5c97-16d4-4d0b-bf52-b58f28b5475c', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'de7b5c97-16d4-4d0b-bf52-b58f28b5475c', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'); - --- Noel Gallagher's High Flying Birds -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '059f8de8-e3f7-4e3b-a1da-89a8c4b73f70', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '059f8de8-e3f7-4e3b-a1da-89a8c4b73f70', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- Green Day -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '2c8afe0e-1c1b-4226-b20e-726faa1fc48c', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '2c8afe0e-1c1b-4226-b20e-726faa1fc48c', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- Måneskin -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'b4e388ca-5a54-4e2e-8624-ddd363b32a75', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'b4e388ca-5a54-4e2e-8624-ddd363b32a75', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- Yuuri -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'e22c3c45-b88b-4278-b20d-270aac64229e', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'e22c3c45-b88b-4278-b20d-270aac64229e', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'); - --- Travis -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'b6f220ab-34ad-40ee-b797-ec5c24459aa9', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'b6f220ab-34ad-40ee-b797-ec5c24459aa9', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- Mariah Carey -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'eb93b4ca-be7c-409f-b48d-5301ee0b02fe', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'eb93b4ca-be7c-409f-b48d-5301ee0b02fe', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'eb93b4ca-be7c-409f-b48d-5301ee0b02fe', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d2'); - --- ZUTOMAYO -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '43e17c11-c3b7-4dd9-a92e-fdadb8783bca', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '43e17c11-c3b7-4dd9-a92e-fdadb8783bca', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '43e17c11-c3b7-4dd9-a92e-fdadb8783bca', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d2'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '43e17c11-c3b7-4dd9-a92e-fdadb8783bca', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '43e17c11-c3b7-4dd9-a92e-fdadb8783bca', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- ONE OK ROCK -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'fdc16095-1bb1-4cc6-8e2f-75495a6f3a13', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'fdc16095-1bb1-4cc6-8e2f-75495a6f3a13', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'); - --- New Hope Club -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '2f8c8f6c-842a-48cd-9ed7-f84710d3fef2', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '2f8c8f6c-842a-48cd-9ed7-f84710d3fef2', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '2f8c8f6c-842a-48cd-9ed7-f84710d3fef2', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- Michael Bublé -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '6b1aeec8-ac19-4a6a-92b5-5e71733ef204', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '6b1aeec8-ac19-4a6a-92b5-5e71733ef204', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876dd'); - --- Justin Timberlake -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '2e277ef0-c3f1-4f80-9ed0-4db0a3350e12', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '2e277ef0-c3f1-4f80-9ed0-4db0a3350e12', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'); - --- Wanima -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'e0fc0ab6-19ee-47ef-a50d-45ab7efe3bba', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'e0fc0ab6-19ee-47ef-a50d-45ab7efe3bba', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'e0fc0ab6-19ee-47ef-a50d-45ab7efe3bba', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- Fujii Kaze -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '772efb86-0af8-4dc6-b73b-bd226fb86944', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '772efb86-0af8-4dc6-b73b-bd226fb86944', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '772efb86-0af8-4dc6-b73b-bd226fb86944', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'); - --- Reol -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '268ad7b1-7550-4cab-bb04-273b1649e682', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d7'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '268ad7b1-7550-4cab-bb04-273b1649e682', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'); - --- Jungle -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'e3753ac5-a079-417a-b75a-7593d9b802ad', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- Nothing But Thieves -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '5aeb15be-b150-4915-a242-d35cdee8aeb4', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '5aeb15be-b150-4915-a242-d35cdee8aeb4', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'); - --- Jacob Collier -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '01681324-678a-4e9a-a80b-e93d038bf75f', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876dd'); - --- Lana Del Rey -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '17790b8d-4e2c-4ec5-a524-d00d80a9868e', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '17790b8d-4e2c-4ec5-a524-d00d80a9868e', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'); - --- Oneohtrix Point Never -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '88ade2ad-96ac-4ed4-8dce-72aec8d8545d', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'); - --- Coco & Clair Clair -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'c440d4e0-3f52-4225-9bc2-f1183a4b9f22', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'); - --- Cookiee Kawaii -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '036854c0-9d22-4660-89f9-0abd16dd3ec1', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9'); - --- King Krule -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'e139192f-ba01-4a15-b0b1-86005aee3c1d', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'e139192f-ba01-4a15-b0b1-86005aee3c1d', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876dd'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'e139192f-ba01-4a15-b0b1-86005aee3c1d', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d2'); - --- Kendrick Lamar -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'd63490e9-0eaf-4914-be90-8d34381b5b05', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d2'); - --- Official Hige Dandism -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '56a4a4af-dc3f-4f9f-9316-6bcd20d99455', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '56a4a4af-dc3f-4f9f-9316-6bcd20d99455', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '56a4a4af-dc3f-4f9f-9316-6bcd20d99455', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- Vaundy -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '687f2125-f72e-45c9-84cc-3181fa5af912', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '687f2125-f72e-45c9-84cc-3181fa5af912', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d2'); - --- Natori -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '909593a3-d067-4dae-9b4a-e14c8accb1aa', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'); - --- Ado -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '10c0c327-8053-4792-ae0b-413d337ec413', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'); - --- Wanuka -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'e19d1403-c4b3-4a6f-b5b8-8e935cb645c4', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'); - --- Kenshi Yonezu -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '80154f71-f7b6-4d06-be39-2e4e00b281a1', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'); - --- Imase -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '4fd6cc98-3e3a-42bf-b04d-1563335397ad', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'); - --- LiSA -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'c89e680f-1f9a-41a0-bc35-b835e67dcace', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'c89e680f-1f9a-41a0-bc35-b835e67dcace', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'); - --- Aimyon -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '2f3532d6-f6f6-4b34-950f-7e4fc701e009', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '2f3532d6-f6f6-4b34-950f-7e4fc701e009', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'); - --- Aimer -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'f636f96a-7a42-416b-bab8-1cb8e1d2c314', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'); - --- Tuki. -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'c62a2a56-1723-44f2-abb2-7a344db06afe', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'); - --- Hitsujibungaku -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '6342db02-e3ee-494b-91f0-15ba144b906c', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '6342db02-e3ee-494b-91f0-15ba144b906c', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '6342db02-e3ee-494b-91f0-15ba144b906c', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'); - --- Millennium Parade -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'ec82d1dd-7eb7-4801-bd44-86d6096e4dea', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'ec82d1dd-7eb7-4801-bd44-86d6096e4dea', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'ec82d1dd-7eb7-4801-bd44-86d6096e4dea', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d2'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'ec82d1dd-7eb7-4801-bd44-86d6096e4dea', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'); - --- Yama -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '5adeac70-0723-4869-831c-aace7691412c', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'); - --- RADWIMPS -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '0dcf43ed-2a0c-4a54-af53-40eaa5c33776', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '0dcf43ed-2a0c-4a54-af53-40eaa5c33776', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '0dcf43ed-2a0c-4a54-af53-40eaa5c33776', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'); - --- Yorushika -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '340cb74f-c770-43ce-91af-88cd2eff23d9', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '340cb74f-c770-43ce-91af-88cd2eff23d9', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '340cb74f-c770-43ce-91af-88cd2eff23d9', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'); - --- Mrs. Green Apple -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '45c6e260-0ac1-4786-831f-7b077d8192e5', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '45c6e260-0ac1-4786-831f-7b077d8192e5', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '45c6e260-0ac1-4786-831f-7b077d8192e5', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'); - --- Billie Eilish -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'd187b6a2-4923-4611-bfff-f9c4c986566e', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'd187b6a2-4923-4611-bfff-f9c4c986566e', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'); - --- Michael Bolton -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '5a4db81d-16e8-4033-8198-09bc92f57ca4', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '5a4db81d-16e8-4033-8198-09bc92f57ca4', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'); - --- Dua Lipa -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '3a2d52b1-b39f-4389-b1ee-a0fc0c38bc62', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'); - --- Red Hot Chili Peppers -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '9431dc41-7ce6-4d81-b680-a322595fe43d', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '9431dc41-7ce6-4d81-b680-a322595fe43d', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'); - --- Adele -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '0d38c2cd-0be8-49b5-a719-b17db10afe84', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '0d38c2cd-0be8-49b5-a719-b17db10afe84', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9'); - --- Ed Sheeran -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '8996c8dc-b8a2-449b-9c19-09cd49e2924d', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'); - --- Lady Gaga -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '2204c6fa-c78d-420f-b689-b8932aaf50a7', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'); - --- Def Leppard -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '82311401-6764-44bd-9fb4-a2bb37a89cfd', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '82311401-6764-44bd-9fb4-a2bb37a89cfd', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876db'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '82311401-6764-44bd-9fb4-a2bb37a89cfd', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- AC/DC -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '7b3acbb2-6d90-4bc0-a510-95688ffbdbc7', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876db'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '7b3acbb2-6d90-4bc0-a510-95688ffbdbc7', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '7b3acbb2-6d90-4bc0-a510-95688ffbdbc7', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'); - --- Yonige -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'aa4e4067-11cc-46f5-9548-5ebdc40b91a3', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'aa4e4067-11cc-46f5-9548-5ebdc40b91a3', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'); - --- Ryokuoushoku Shakai -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '87228380-e581-46d9-b524-869360451d02', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '87228380-e581-46d9-b524-869360451d02', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3'); - --- Stevie Wonder -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '3d367630-37a4-41be-8d09-4434e4c24d09', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'); - --- Gen Hoshino -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '967573c3-fcee-453a-b9ee-177359ff7dba', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'); - --- Creepy Nuts -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '525c7aec-3c72-45c9-9e53-f904869b1306', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'); - --- Miley Cyrus -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - 'b71a2ee4-a110-4e6c-a49c-e135a8311b6b', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'); - --- Vacations -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '1aab6fed-7d20-42ed-9f59-67713671f813', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'), - (gen_random_uuid(), '2024-08-04 00:00:00', '2024-08-04 00:00:00', false, - '129fb608-eeb9-42ec-87f6-e1515bdf2696', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4'); - --- Olivia Lodorigo -INSERT INTO public.artist_genre (id, created_at, updated_at, is_deleted, artist_id, genre_id) -VALUES (gen_random_uuid(), '2024-08-28 22:25:05.605', '2024-08-28 22:25:05.605', false, - '01919929-4987-34c0-0f5d-57dc5479f08a', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1'), - (gen_random_uuid(), '2024-08-28 22:25:05.608', '2024-08-28 22:25:05.608', false, - '01919929-4987-34c0-0f5d-57dc5479f08a', '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5'); - --- SHOW -insert into public.show (id, created_at, updated_at, is_deleted, start_date, end_date, title, content, location, image, last_ticketing_at, view_count, seat_prices, ticketing_sites) -values ('019194ba-562b-a6bc-b7e9-42d21e566111', '2024-08-28 01:45:25.429', '2024-08-29 12:53:21.299', false, '2024-11-02', '2024-11-03', 'Benson Boon Live : 벤슨 분 내한공연', '.', '잠실 실내체육관', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/bessen_1724936000331.jpg', '2024-09-30 21:51:00.000', 0, '{"스탠딩석": 110000, "스탠딩 P석": 99000}', '{"YES24": "http://ticket.yes24.com/", "인터파크": "https://tickets.interpark.com/", "멜론티켓": "https://ticket.melon.com/main/index.htm"}'), - ('019194b5-d4a3-5186-2ae2-008109252b27', '2024-08-28 01:40:30.116', '2024-08-29 13:11:13.162', false, '2024-10-05', '2024-10-06', 'DISCLOSURE DJ SET : 디스클로저 내한공연', '.', '서울 잠실', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/disclosure_1724937072972.jpg', '2024-09-05 22:10:00.000', 0, '{"스탠딩석": 120000, "스탠딩 P석": 100000}', '{"YES24": "http://ticket.yes24.com/", "인터파크": "https://tickets.interpark.com/", "멜론티켓": "https://ticket.melon.com/main/index.htm"}'), - ('019194b8-79f5-e976-7be4-1a07018ad0ee', '2024-08-28 01:43:23.511', '2024-08-29 13:03:20.656', false, '2024-12-12', '2024-12-13', 'CHRISTOPHER LIVE IN SEOUL : 크리스토퍼 내한공연', '.', '링크아트센터드림 드림4관', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/christopher_1724936600566.jpg', '2024-09-07 22:02:00.000', 0, '{"스탠딩석": 130000, "스탠딩 P석": 110000}', '{"YES24": "http://ticket.yes24.com/", "인터파크": "https://tickets.interpark.com/", "멜론티켓": "https://ticket.melon.com/main/index.htm"}'), - ('01919901-105d-b5b2-cbaf-912f20281ce8', '2024-08-28 12:41:09.485', '2024-08-28 16:02:19.184', false, '2024-12-01', '2024-12-01', 'OFFICIAL HIGE DANDISM REJOICE ASIA TOUR 2024 : 2024 오피셜히게단디즘 내한공연', '.', '일산 킨텍스 제1전시장 5홀', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202024-08-28%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%209.37.40_1724848869198.png', '2024-08-28 21:40:00.000', 1, '{"스탠딩 R석": 132000, "스탠딩 S석": 121000}', '{"인퍼타크": "https://tickets.interpark.com/goods/24011642"}'), - ('0191948f-0ba0-2a3b-9b19-bd42694ecf58', '2024-08-28 00:58:08.315', '2024-08-29 11:28:18.871', false, '2024-09-06', '2024-09-07', 'Conan Gray - Found Heaven On Tour in Seoul : 코난 그레이 내한공연', '.', '명화 라이브홀', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202024-08-28%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%209.50.56_1724849732460.png', '2024-05-08 00:00:00.000', 2, '{"스탠딩석": 110000, "지정석 P석": 121000, "지정석 R석": 99000}', '{"인터파크": "https://tickets.interpark.com/goods/24006288"}'), - ('019194a9-c1b5-407a-fae8-324bc240db6d', '2024-08-28 01:27:18.840', '2024-08-29 12:55:22.078', false, '2025-01-17', '2025-01-17', 'Ultimate Coldplay : 콜드플레이 내한공연', '.', '여의도 KBS홀', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C_1724936121968.jfif', '2024-11-13 14:00:00.000', 2, '{"R석": 88000, "S석": 77000, "VIP석": 99000, "2층석": 55000}', '{"YES24": "http://ticket.yes24.com/", "인터파크": "https://tickets.interpark.com/goods/19018885?tab=2", "멜론티켓": "https://ticket.melon.com/main/index.htm"}'), - ('019194b9-a3c3-5cd7-b35d-2c133907812d', '2024-08-28 01:44:39.747', '2024-08-29 12:59:48.806', false, '2024-11-05', '2024-11-06', 'The Strokes : 스트록스 내한공연', '.', '서울 잠실', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/stroke_1724936388679.webp', '2024-12-22 21:59:00.000', 0, '{"스탠딩석": 120000, "스탠딩 P석": 100000}', '{"YES24": "http://ticket.yes24.com/", "인터파크": "https://tickets.interpark.com/"}'), - ('019194aa-d2fd-e29f-96c7-df9101dfd1b6', '2024-08-28 01:28:28.799', '2024-08-29 13:03:53.384', false, '2024-09-27', '2024-09-27', 'Post Malone If Y''all Weren''t Here I''d Be Crying : 포스트말론 내한공연', '.', '여의도 KBS홀', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C%20%281%29_1724936633293.jfif', '2024-09-01 14:00:00.000', 0, '{"스탠딩P석": 165000, "스탠딩R석": 143000, "스탠딩S석": 121000, "지정석P석": 176000, "지정석R석": 154000}', '{"YES24": "https://tickets.interpark.com/goods/19018885?tab=2", "인터파크": "https://tickets.interpark.com/", "멜론티켓": "https://ticket.melon.com/main/index.htm"}'), - ('019194b7-b2a8-33d0-6f93-dcdcfbd7fdea', '2024-08-28 01:42:32.490', '2024-08-29 13:06:41.236', false, '2024-11-02', '2024-11-03', 'AJR The Maybe Man Tour', '.', '무신사 개러지', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/ajr_1724936801101.png', '2024-10-03 22:05:00.000', 0, '{"스탠딩석": 140000, "스탠딩 P석": 120000, "스탠딩 R석": 100000}', '{"YES24": "http://ticket.yes24.com/", "인터파크": "https://tickets.interpark.com/", "멜론티켓": "https://ticket.melon.com/main/index.htm"}'), - ('019194b6-bf4a-3f6d-91d5-4de8ab1bf027', '2024-08-28 01:41:30.188', '2024-08-29 13:09:41.866', false, '2024-11-20', '2024-11-21', 'Radiohead The Stone Roses : 라디오헤드 내한공연', '.', '서울 잠실', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/radio_1724936981764.jpg', '2024-10-05 22:09:00.000', 0, '{"스탠딩석": 135000, "스탠딩 P석": 120000}', '{"YES24": "http://ticket.yes24.com/", "인터파크": "https://tickets.interpark.com/", "멜론티켓": "https://ticket.melon.com/main/index.htm"}'), - ('019194ac-757e-265a-a639-0f20626ad748', '2024-08-28 01:30:15.935', '2024-08-29 13:09:55.349', false, '2024-10-05', '2024-10-06', 'Eve Asia Tour 2024 ‘Culture’ in Seoul : 이브 내한공연', '.', '서울 잠실', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/20240807-50595_1724936995269.jpg', '2024-09-06 14:00:00.000', 1, '{"지정석": 121000, "스탠딩석": 121000}', '{"YES24": "http://ticket.yes24.com/Perf/50595", "인터파크": "https://tickets.interpark.com/", "멜론티켓": "https://ticket.melon.com/main/index.htm"}'), - ('019194ad-1663-4319-c525-12ece13f18ad', '2024-08-28 01:30:57.127', '2024-08-29 13:13:00.978', false, '2024-11-23', '2024-11-24', 'SPYAIR ASIA TOUR 2024 : 스파이에어 내한공연', '.', '무신사 개러지', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/24001773_p_1724937180835.gif', '2024-09-20 14:00:00.000', 0, '{"스탠딩석": 90000}', '{"YES24": "https://tickets.interpark.com/goods/24001773", "인터파크": "https://tickets.interpark.com/", "멜론티켓": "https://ticket.melon.com/main/index.htm"}'), - ('019194b4-e020-8a98-ae34-fc1a6f633c18', '2024-08-28 01:39:27.521', '2024-08-29 13:14:58.486', false, '2024-11-02', '2024-11-03', 'LAUV Live in Seoul : 라우브 내한공연', '.', '서울 잠실', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/lauv_1724937298375.jpg', '2024-09-21 22:14:00.000', 0, '{"스탠딩석": 120000, "스탠딩 P석": 110000}', '{"YES24": "http://ticket.yes24.com/", "인터파크": "https://tickets.interpark.com/", "멜론티켓": "https://ticket.melon.com/main/index.htm"}'), - ('019194b4-1d54-17c7-196b-8736d867649e', '2024-08-28 01:38:37.653', '2024-08-29 13:16:49.099', false, '2024-11-02', '2024-11-03', 'Dive Into Olivia Dean : 올리비아 딘 내한공연', '.', '서울 잠실', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/olivia_1724937409012.webp', '2024-09-18 22:16:00.000', 0, '{"스탠딩석": 130000, "스탠딩 P석": 110000}', '{"YES24": "http://ticket.yes24.com/", "인터파크": "https://tickets.interpark.com/", "멜론티켓": "https://ticket.melon.com/main/index.htm"}'), - ('019194ad-db9c-09fc-e0a6-ed4ec8888fb8', '2024-08-28 01:31:47.613', '2024-08-29 13:17:32.658', false, '2024-10-03', '2024-10-04', 'ELLEGARDEN ‘Boys are Back in the East Tour 2023’ : 엘르가든 내한공연', '.', 'YES24 라이브홀', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C%20%282%29_1724937452498.jfif', '2024-09-13 14:00:00.000', 0, '{"스탠딩석": 90000}', '{"YES24": "http://ticket.yes24.com/Perf/46905", "인터파크": "https://tickets.interpark.com/", "멜론티켓": "https://ticket.melon.com/main/index.htm"}'), - ('019194b3-7974-5f00-d9cf-7a8632b8e0e9', '2024-08-28 01:37:55.705', '2024-08-29 13:18:33.437', false, '2024-12-16', '2024-12-17', 'Justin Bieber BELEIVE TOUR : 저스틴 비버 내한공연', '.', '서울 잠실', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/justin_1724937513359.jpg', '2024-09-28 22:18:00.000', 0, '{"스탠딩석": 140000, "스탠딩 P석": 120000}', '{"YES24": "http://ticket.yes24.com/", "인터파크": "https://tickets.interpark.com/", "멜론티켓": "https://ticket.melon.com/main/index.htm"}'), - ('019194ae-9b20-8972-0c7c-81704c1dfc1a', '2024-08-28 01:32:36.641', '2024-08-29 13:20:38.684', false, '2024-10-19', '2024-10-20', 'King Gnu Asia Tour ‘THE GREATEST UNKNOWN’ in Seoul : 킹누 내한공연', '.', '올림픽공원 올림픽홀', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/20240321-48195_1724937638600.jpg', '2024-09-12 12:00:00.000', 0, '{"A석": 80000, "R석": 120000, "S석": 110000}', '{"YES24": "http://ticket.yes24.com/Perf/48195", "인터파크": "https://tickets.interpark.com/", "멜론티켓": "https://ticket.melon.com/main/index.htm"}'), - ('019194b2-748c-b8e2-e00b-59d3c98d02c1', '2024-08-28 01:36:48.910', '2024-08-29 13:20:49.866', false, '2024-11-19', '2024-11-20', 'THE WEEKAND : 위켄드 내한공연', '.', '서울 잠실', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/weekend_1724937649797.jpg', '2024-09-05 22:19:00.000', 0, '{"스탠딩석": 120000, "스탠딩 P석": 111000}', '{"YES24": "http://ticket.yes24.com/", "인터파크": "https://tickets.interpark.com/", "멜론티켓": "https://ticket.melon.com/main/index.htm"}'), - ('019194af-d678-94df-5fe1-83c3b0d85941', '2024-08-28 01:33:57.370', '2024-08-29 13:24:02.704', false, '2024-11-16', '2024-11-17', 'Bruno Mars SuperConcert : 브루노마스 공연', '.', '서울 잠실', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/23005708_p_1724937842603.gif', '2024-09-24 12:00:00.000', 0, '{"A석": 77000, "P석": 176000, "R석": 132000, "S석": 99000, "G1석": 250000, "G2석": 210000, "G3석": 165000}', '{"YES24": "http://ticket.yes24.com/", "인터파크": "https://tickets.interpark.com/goods/23005708?tab=2", "멜론티켓": "https://ticket.melon.com/main/index.htm"}'), - ('019194b0-cd60-a404-4151-ec9602666ea9', '2024-08-28 01:35:00.577', '2024-08-29 13:24:08.356', false, '2024-11-16', '2024-11-17', 'Charlie Puth Live in Seoul : 찰리 푸스 내한공연', '.', '서울 잠실', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/chalie_1724937848287.jpg', '2024-09-09 22:23:00.000', 0, '{"스탠딩석": 143000, "스탠딩 P석": 125000}', '{"YES24": "http://ticket.yes24.com/", "인터파크": "https://tickets.interpark.com/", "멜론티켓": "https://ticket.melon.com/main/index.htm"}'), - ('019194a4-e4ba-f2d1-79d6-23088c9c3112', '2024-08-28 01:22:00.130', '2024-08-28 16:02:01.733', false, '2024-12-04', '2024-12-05', 'Dua Lipa - Radical Optimism Tour : 두아리파 내한공연', '.', '고척 스카이돔', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202024-08-28%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%2010.01.45_1724850287739.png', '2024-06-20 00:00:00.000', 1, '{"스탠딩 P석": 154000, "스탠딩 R석": 143000, "지정석 A석": 132000, "지정석 B석": 121000, "지정석 P석": 176000, "지정석 R석": 165000, "지정석 S석": 143000}', '{"인터파크": "https://tickets.interpark.com/goods/24007623"}'), - ('01919906-7fb9-6552-3819-91a5295bb3e6', '2024-08-28 12:47:05.658', '2024-08-29 12:08:26.850', false, '2024-09-20', '2024-09-21', 'Olivia Rodrigo - GUTS world tour : 올리비아 로드리고 첫 내한공연', '.', '잠실 실내체육관', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202024-08-28%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%209.44.08_1724849225398.png', '2024-05-17 00:00:00.000', 3, '{"스탠딩 P석": 154000, "지정석 A석": 99000, "지정석 P석": 165000, "지정석 R석": 132000, "지정석 S석": 121000, "스탠딩 PIT 패키지": 262000}', '{"인터파크": "https://tickets.interpark.com/goods/24006714"}'), - ('019194b1-a2b0-6a29-9d33-d1a4c8fad5cf', '2024-08-28 01:35:55.185', '2024-08-29 13:22:34.020', false, '2024-12-21', '2024-12-22', 'Taylor Swift ERAS TOUR : 테일러 스위프트 공연', '.', '서울 잠실', 'https://showpot-s3.s3.ap-northeast-2.amazonaws.com/show/tailer_1724937753926.jpg', '2024-09-21 22:21:00.000', 0, '{"스탠딩석": 130000, "스탠딩 P석": 140000}', '{"YES24": "http://ticket.yes24.com/", "인터파크": "https://tickets.interpark.com/", "멜론티켓": "https://ticket.melon.com/main/index.htm"}'); - --- Show Artist -insert into public.show_artist (id, created_at, updated_at, is_deleted, artist_id, show_id) -values ('0191948f-0bde-cedc-3946-63dc1a821b7f', '2024-08-28 00:58:08.352', '2024-08-28 00:58:08.352', false, '6d7fee98-4719-4afc-9113-42177e417cb8', '0191948f-0ba0-2a3b-9b19-bd42694ecf58'), - ('019194a4-e4c9-ee22-ab43-376174cba357', '2024-08-28 01:22:00.138', '2024-08-28 01:22:00.138', false, '3a2d52b1-b39f-4389-b1ee-a0fc0c38bc62', '019194a4-e4ba-f2d1-79d6-23088c9c3112'), - ('019194a9-c1c3-4065-017b-988b20cef8d8', '2024-08-28 01:27:18.852', '2024-08-28 01:27:18.852', false, 'b9f79017-f97d-44b1-82ce-645e92856c0b', '019194a9-c1b5-407a-fae8-324bc240db6d'), - ('019194aa-d308-df64-250a-4cb4083fee85', '2024-08-28 01:28:28.809', '2024-08-28 01:28:28.809', false, 'ec304557-e9f1-4bf3-8abf-62c83dec099f', '019194aa-d2fd-e29f-96c7-df9101dfd1b6'), - ('019194ac-758b-1f3c-972d-7304fda5f8f3', '2024-08-28 01:30:15.949', '2024-08-28 01:30:15.949', false, '977452b5-db8e-48b9-abe6-d06b44a1b4ad', '019194ac-757e-265a-a639-0f20626ad748'), - ('019194ad-dba4-23fc-7cac-b51b98c2d6e0', '2024-08-28 01:31:47.620', '2024-08-28 01:31:47.620', false, 'dac4fda7-1746-4eb3-8b87-cab78ae86c75', '019194ad-db9c-09fc-e0a6-ed4ec8888fb8'), - ('019194ae-9b2b-14cb-f6fe-159991752024', '2024-08-28 01:32:36.652', '2024-08-28 01:32:36.652', false, 'd3fc15e6-172f-4448-928b-7fdd7a6a9ab6', '019194ae-9b20-8972-0c7c-81704c1dfc1a'), - ('019194af-d67c-fe62-0ea8-305c36e58032', '2024-08-28 01:33:57.372', '2024-08-28 01:33:57.372', false, 'f56b52c1-72c2-450c-ad59-e88db1530dcb', '019194af-d678-94df-5fe1-83c3b0d85941'), - ('019194b0-cd69-6bcb-4952-2fdb8ce612f4', '2024-08-28 01:35:00.586', '2024-08-28 01:35:00.586', false, 'a94dc17e-4b77-4959-bb1d-a3bd9735cf01', '019194b0-cd60-a404-4151-ec9602666ea9'), - ('019194b1-a2b7-832f-3b43-9f4f36310962', '2024-08-28 01:35:55.192', '2024-08-28 01:35:55.192', false, '0b60cd2a-5312-41a2-ba1d-db1acb72460b', '019194b1-a2b0-6a29-9d33-d1a4c8fad5cf'), - ('019194b2-7492-db73-e0b3-3d86f18159d3', '2024-08-28 01:36:48.915', '2024-08-28 01:36:48.915', false, '02c9aedf-9ea2-4720-83c5-eeacd79a2e6e', '019194b2-748c-b8e2-e00b-59d3c98d02c1'), - ('019194b3-797f-ef01-c343-aab7cb182e33', '2024-08-28 01:37:55.712', '2024-08-28 01:37:55.712', false, 'c3df1fe2-0795-4204-92d6-68d3d6f4bc05', '019194b3-7974-5f00-d9cf-7a8632b8e0e9'), - ('019194b4-1d57-4d59-268e-629918c78e1c', '2024-08-28 01:38:37.655', '2024-08-28 01:38:37.655', false, '7a97697e-2fa0-4d5b-851f-dd8864b5b49a', '019194b4-1d54-17c7-196b-8736d867649e'), - ('019194b5-d4a4-9322-7d90-834fabb0a7d1', '2024-08-28 01:40:30.117', '2024-08-28 01:40:30.117', false, '1535086f-99ff-493e-bfb4-254f15d87e5d', '019194b5-d4a3-5186-2ae2-008109252b27'), - ('019194b6-bf51-6488-37c0-30d7246cc16e', '2024-08-28 01:41:30.193', '2024-08-28 01:41:30.193', false, 'f5d0d77a-e5f2-42ff-8478-5a70b3d7ba50', '019194b6-bf4a-3f6d-91d5-4de8ab1bf027'), - ('019194b7-b2ae-f88d-90f1-91d8c70f88e7', '2024-08-28 01:42:32.494', '2024-08-28 01:42:32.494', false, 'e7bf557b-8591-418f-8422-d1f08c26df2f', '019194b7-b2a8-33d0-6f93-dcdcfbd7fdea'), - ('019194b8-79fa-f5df-11ba-d61dba7ac608', '2024-08-28 01:43:23.515', '2024-08-28 01:43:23.515', false, 'e7f28490-8e4c-426b-92fc-fbcb226ea7f7', '019194b8-79f5-e976-7be4-1a07018ad0ee'), - ('019194b9-a3ca-5eee-9681-390d201e1311', '2024-08-28 01:44:39.755', '2024-08-28 01:44:39.755', false, 'b50a931a-d4f3-4c32-8636-253e4fff45ab', '019194b9-a3c3-5cd7-b35d-2c133907812d'), - ('019194ba-5637-56d6-12da-083ed4334888', '2024-08-28 01:45:25.433', '2024-08-28 01:45:25.433', false, '72cdcdb7-1fed-460d-a316-3988ffa1a6c8', '019194ba-562b-a6bc-b7e9-42d21e566111'), - ('01919901-1098-08dd-28a7-d1262d860c5f', '2024-08-28 12:41:09.530', '2024-08-28 12:41:09.530', false, '56a4a4af-dc3f-4f9f-9316-6bcd20d99455', '01919901-105d-b5b2-cbaf-912f20281ce8'), - ('01919906-7fbb-681d-a67e-0180ad10e0e4', '2024-08-28 12:47:05.660', '2024-08-28 12:47:05.660', false, '01919929-4987-34c0-0f5d-57dc5479f08a', '01919906-7fb9-6552-3819-91a5295bb3e6'), - ('01919e44-973b-5851-2dd0-c0d6dc68e814', '2024-08-29 13:13:00.993', '2024-08-29 13:13:00.993', false, '2ab7eba4-98f9-4936-ac1b-716bc2f04a1c', '019194ad-1663-4319-c525-12ece13f18ad'), - ('01919e46-6248-1c68-290e-e58f26597f6f', '2024-08-29 13:14:58.504', '2024-08-29 13:14:58.504', false, 'f5fc86ee-0519-409c-9bed-ae0dbead3bea', '019194b4-e020-8a98-ae34-fc1a6f633c18'); - --- Show Genre -insert into public.show_genre (id, created_at, updated_at, is_deleted, genre_id, show_id) -values ('0191948f-0be2-dcb8-0356-46fa747d0316', '2024-08-28 00:58:08.355', '2024-08-28 00:58:08.355', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5', '0191948f-0ba0-2a3b-9b19-bd42694ecf58'), - ('019194a4-e4ca-1ce4-e484-47e7d9514a2c', '2024-08-28 01:22:00.139', '2024-08-28 01:22:00.139', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5', '019194a4-e4ba-f2d1-79d6-23088c9c3112'), - ('019194a9-c1c4-c763-a4d4-add1961f8ba0', '2024-08-28 01:27:18.853', '2024-08-28 01:27:18.853', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1', '019194a9-c1b5-407a-fae8-324bc240db6d'), - ('019194a9-c1c4-c763-a4d4-add1961f8ba1', '2024-08-28 01:27:18.854', '2024-08-28 01:27:18.854', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3', '019194a9-c1b5-407a-fae8-324bc240db6d'), - ('019194a9-c1c4-c763-a4d4-add1961f8ba2', '2024-08-28 01:27:18.856', '2024-08-28 01:27:18.856', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5', '019194a9-c1b5-407a-fae8-324bc240db6d'), - ('019194aa-d309-61e7-60a0-c8320633d378', '2024-08-28 01:28:28.810', '2024-08-28 01:28:28.810', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1', '019194aa-d2fd-e29f-96c7-df9101dfd1b6'), - ('019194aa-d309-61e7-60a0-c8320633d379', '2024-08-28 01:28:28.811', '2024-08-28 01:28:28.811', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d2', '019194aa-d2fd-e29f-96c7-df9101dfd1b6'), - ('019194aa-d309-61e7-60a0-c8320633d37a', '2024-08-28 01:28:28.811', '2024-08-28 01:28:28.811', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5', '019194aa-d2fd-e29f-96c7-df9101dfd1b6'), - ('019194aa-d309-61e7-60a0-c8320633d37b', '2024-08-28 01:28:28.821', '2024-08-28 01:28:28.821', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9', '019194aa-d2fd-e29f-96c7-df9101dfd1b6'), - ('019194ac-758d-1b94-01e1-095b53c93bb4', '2024-08-28 01:30:15.950', '2024-08-28 01:30:15.950', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d2', '019194ac-757e-265a-a639-0f20626ad748'), - ('019194ac-758d-1b94-01e1-095b53c93bb5', '2024-08-28 01:30:15.951', '2024-08-28 01:30:15.951', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9', '019194ac-757e-265a-a639-0f20626ad748'), - ('019194ad-dba5-9223-cc03-e6f63afbf6a1', '2024-08-28 01:31:47.621', '2024-08-28 01:31:47.621', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1', '019194ad-db9c-09fc-e0a6-ed4ec8888fb8'), - ('019194ad-dba5-9223-cc03-e6f63afbf6a2', '2024-08-28 01:31:47.621', '2024-08-28 01:31:47.621', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3', '019194ad-db9c-09fc-e0a6-ed4ec8888fb8'), - ('019194ad-dba5-9223-cc03-e6f63afbf6a3', '2024-08-28 01:31:47.621', '2024-08-28 01:31:47.621', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4', '019194ad-db9c-09fc-e0a6-ed4ec8888fb8'), - ('019194ae-9b2c-f391-a2ad-0144af4aa23e', '2024-08-28 01:32:36.653', '2024-08-28 01:32:36.653', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1', '019194ae-9b20-8972-0c7c-81704c1dfc1a'), - ('019194ae-9b2c-f391-a2ad-0144af4aa23f', '2024-08-28 01:32:36.653', '2024-08-28 01:32:36.653', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3', '019194ae-9b20-8972-0c7c-81704c1dfc1a'), - ('019194ae-9b2c-f391-a2ad-0144af4aa240', '2024-08-28 01:32:36.653', '2024-08-28 01:32:36.653', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4', '019194ae-9b20-8972-0c7c-81704c1dfc1a'), - ('019194ae-9b2c-f391-a2ad-0144af4aa241', '2024-08-28 01:32:36.653', '2024-08-28 01:32:36.653', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9', '019194ae-9b20-8972-0c7c-81704c1dfc1a'), - ('019194af-d67c-fe62-0ea8-305c36e58033', '2024-08-28 01:33:57.373', '2024-08-28 01:33:57.373', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1', '019194af-d678-94df-5fe1-83c3b0d85941'), - ('019194af-d67c-fe62-0ea8-305c36e58034', '2024-08-28 01:33:57.373', '2024-08-28 01:33:57.373', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5', '019194af-d678-94df-5fe1-83c3b0d85941'), - ('019194af-d67c-fe62-0ea8-305c36e58035', '2024-08-28 01:33:57.373', '2024-08-28 01:33:57.373', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9', '019194af-d678-94df-5fe1-83c3b0d85941'), - ('019194b0-cd69-6bcb-4952-2fdb8ce612f5', '2024-08-28 01:35:00.586', '2024-08-28 01:35:00.586', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5', '019194b0-cd60-a404-4151-ec9602666ea9'), - ('019194b0-cd69-6bcb-4952-2fdb8ce612f6', '2024-08-28 01:35:00.586', '2024-08-28 01:35:00.586', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9', '019194b0-cd60-a404-4151-ec9602666ea9'), - ('019194b1-a2b8-bc41-8aaf-cc0f2c020975', '2024-08-28 01:35:55.193', '2024-08-28 01:35:55.193', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1', '019194b1-a2b0-6a29-9d33-d1a4c8fad5cf'), - ('019194b1-a2b8-bc41-8aaf-cc0f2c020976', '2024-08-28 01:35:55.193', '2024-08-28 01:35:55.193', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5', '019194b1-a2b0-6a29-9d33-d1a4c8fad5cf'), - ('019194b2-7493-fdd5-8274-a4cff1111254', '2024-08-28 01:36:48.916', '2024-08-28 01:36:48.916', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9', '019194b2-748c-b8e2-e00b-59d3c98d02c1'), - ('019194b3-7980-b19c-6d18-43b30889ecfa', '2024-08-28 01:37:55.716', '2024-08-28 01:37:55.716', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5', '019194b3-7974-5f00-d9cf-7a8632b8e0e9'), - ('019194b3-7980-b19c-6d18-43b30889ecfb', '2024-08-28 01:37:55.717', '2024-08-28 01:37:55.717', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9', '019194b3-7974-5f00-d9cf-7a8632b8e0e9'), - ('019194b4-1d57-4d59-268e-629918c78e1d', '2024-08-28 01:38:37.655', '2024-08-28 01:38:37.655', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5', '019194b4-1d54-17c7-196b-8736d867649e'), - ('019194b4-e024-9aa8-3440-66c45a7c1dab', '2024-08-28 01:39:27.525', '2024-08-28 01:39:27.525', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5', '019194b4-e020-8a98-ae34-fc1a6f633c18'), - ('019194b5-d4a5-bdcc-9549-806264838ebc', '2024-08-28 01:40:30.117', '2024-08-28 01:40:30.117', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d6', '019194b5-d4a3-5186-2ae2-008109252b27'), - ('019194b6-bf51-6488-37c0-30d7246cc16f', '2024-08-28 01:41:30.194', '2024-08-28 01:41:30.194', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1', '019194b6-bf4a-3f6d-91d5-4de8ab1bf027'), - ('019194b6-bf51-6488-37c0-30d7246cc170', '2024-08-28 01:41:30.194', '2024-08-28 01:41:30.194', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3', '019194b6-bf4a-3f6d-91d5-4de8ab1bf027'), - ('019194b7-b2ae-f88d-90f1-91d8c70f88e8', '2024-08-28 01:42:32.495', '2024-08-28 01:42:32.495', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3', '019194b7-b2a8-33d0-6f93-dcdcfbd7fdea'), - ('019194b7-b2ae-f88d-90f1-91d8c70f88e9', '2024-08-28 01:42:32.495', '2024-08-28 01:42:32.495', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5', '019194b7-b2a8-33d0-6f93-dcdcfbd7fdea'), - ('019194b8-79fa-f5df-11ba-d61dba7ac609', '2024-08-28 01:43:23.515', '2024-08-28 01:43:23.515', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5', '019194b8-79f5-e976-7be4-1a07018ad0ee'), - ('019194b9-a3cb-d100-2b33-66a0e3d277db', '2024-08-28 01:44:39.755', '2024-08-28 01:44:39.755', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1', '019194b9-a3c3-5cd7-b35d-2c133907812d'), - ('019194b9-a3cb-d100-2b33-66a0e3d277dc', '2024-08-28 01:44:39.756', '2024-08-28 01:44:39.756', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3', '019194b9-a3c3-5cd7-b35d-2c133907812d'), - ('019194ba-5638-dbea-365d-5803a04890d0', '2024-08-28 01:45:25.433', '2024-08-28 01:45:25.433', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5', '019194ba-562b-a6bc-b7e9-42d21e566111'), - ('01919901-10a6-2c7c-4591-7b8fe17c8fb6', '2024-08-28 12:41:09.544', '2024-08-28 12:41:09.544', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1', '01919901-105d-b5b2-cbaf-912f20281ce8'), - ('01919901-10a6-2c7c-4591-7b8fe17c8fb7', '2024-08-28 12:41:09.547', '2024-08-28 12:41:09.547', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3', '01919901-105d-b5b2-cbaf-912f20281ce8'), - ('01919901-10a6-2c7c-4591-7b8fe17c8fb8', '2024-08-28 12:41:09.549', '2024-08-28 12:41:09.549', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4', '01919901-105d-b5b2-cbaf-912f20281ce8'), - ('01919906-7fbc-f2f0-2a5c-92bef16c2425', '2024-08-28 12:47:05.661', '2024-08-28 12:47:05.661', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1', '01919906-7fb9-6552-3819-91a5295bb3e6'), - ('01919906-7fbc-f2f0-2a5c-92bef16c2426', '2024-08-28 12:47:05.661', '2024-08-28 12:47:05.661', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d5', '01919906-7fb9-6552-3819-91a5295bb3e6'), - ('01919e44-9746-ad52-d2e1-acd7952dc83f', '2024-08-29 13:13:01.002', '2024-08-29 13:13:01.002', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d1', '019194ad-1663-4319-c525-12ece13f18ad'), - ('01919e44-9746-ad52-d2e1-acd7952dc840', '2024-08-29 13:13:01.002', '2024-08-29 13:13:01.002', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d3', '019194ad-1663-4319-c525-12ece13f18ad'), - ('01919e44-9746-ad52-d2e1-acd7952dc841', '2024-08-29 13:13:01.002', '2024-08-29 13:13:01.002', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d4', '019194ad-1663-4319-c525-12ece13f18ad'), - ('01919e46-624b-ef48-42b9-fd4596f5d7ed', '2024-08-29 13:14:58.508', '2024-08-29 13:14:58.508', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9', '019194b4-e020-8a98-ae34-fc1a6f633c18'), - ('01919e48-bc7e-c832-99f1-c965b1375833', '2024-08-29 13:17:32.670', '2024-08-29 13:17:32.670', false, '017f20d0-4f3c-8f4d-9e15-7ff0c3a876d9', '019194ad-db9c-09fc-e0a6-ed4ec8888fb8'); - --- Show Search -insert into public.show_search (id, created_at, updated_at, is_deleted, show_id, name) -values ('019194a9-c1c2-28f5-abb3-c029205ee7bf', '2024-08-28 01:27:18.851', '2024-08-28 01:27:18.851', false, '019194a9-c1b5-407a-fae8-324bc240db6d', 'ultimatecoldplay:콜드플레이내한공연'), - ('019194aa-d307-d47f-a08d-b91905345d16', '2024-08-28 01:28:28.808', '2024-08-28 01:28:28.808', false, '019194aa-d2fd-e29f-96c7-df9101dfd1b6', 'postmaloneifyallwerenthereidbecrying:포스트말론내한공연'), - ('019194af-d67b-d0f9-1253-c70e1a32f3d0', '2024-08-28 01:33:57.372', '2024-08-28 01:33:57.372', false, '019194af-d678-94df-5fe1-83c3b0d85941', 'brunomarsuperconcert:브루노마스공연'), - ('019194b1-a2b5-bd43-84b0-4209b901cd66', '2024-08-28 01:35:55.190', '2024-08-28 01:35:55.190', false, '019194b1-a2b0-6a29-9d33-d1a4c8fad5cf', 'taylorswifterastour:테일러스위프트공연'), - ('01919901-1092-dd7c-9687-1407ba5285cc', '2024-08-28 12:41:09.524', '2024-08-28 12:41:09.524', false, '01919901-105d-b5b2-cbaf-912f20281ce8', 'officialhigedandismrejoiceasiatour2024:2024오피셜히게단디즘내한공연'), - ('01919906-7fba-c50f-1e26-27caec7378c4', '2024-08-28 12:47:05.659', '2024-08-28 12:47:05.659', false, '01919906-7fb9-6552-3819-91a5295bb3e6', 'oliviarodrigo-gutsworldtour:올리비아로드리고첫내한공연'), - ('0191990b-dee6-3fe6-bd3d-2f7f7e6a761a', '2024-08-28 12:52:57.718', '2024-08-28 12:52:57.718', false, '0191948f-0ba0-2a3b-9b19-bd42694ecf58', 'conangray-foundheavenontourinseoul:코난그레이내한공연'), - ('01919916-b556-af78-d936-850cc3a9898d', '2024-08-28 13:04:47.979', '2024-08-28 13:04:47.979', false, '019194a4-e4ba-f2d1-79d6-23088c9c3112', 'dualipa-radicaloptimismtour:두아리파내한공연'), - ('01919e32-96f2-290b-fc24-b6f46e5c8021', '2024-08-29 12:53:21.335', '2024-08-29 12:53:21.335', false, '019194ba-562b-a6bc-b7e9-42d21e566111', 'bensonboonlive:벤슨분내한공연'), - ('01919e38-80c4-8cf2-6550-14f403370751', '2024-08-29 12:59:48.814', '2024-08-29 12:59:48.814', false, '019194b9-a3c3-5cd7-b35d-2c133907812d', 'thestrokes:스트록스내한공연'), - ('01919e3b-bc4f-0d72-9289-a592a9f8a11f', '2024-08-29 13:03:20.672', '2024-08-29 13:03:20.672', false, '019194b8-79f5-e976-7be4-1a07018ad0ee', 'christopherliveinseoul:크리스토퍼내한공연'), - ('01919e3e-cbd1-ca55-b1bc-49ccd34596d6', '2024-08-29 13:06:41.242', '2024-08-29 13:06:41.242', false, '019194b7-b2a8-33d0-6f93-dcdcfbd7fdea', 'ajrthemaybemantour'), - ('01919e41-8d69-d787-6fc6-152709822faf', '2024-08-29 13:09:41.872', '2024-08-29 13:09:41.872', false, '019194b6-bf4a-3f6d-91d5-4de8ab1bf027', 'radioheadthestoneroses:라디오헤드내한공연'), - ('01919e41-c211-270c-fcff-14d4da10c866', '2024-08-29 13:09:55.359', '2024-08-29 13:09:55.359', false, '019194ac-757e-265a-a639-0f20626ad748', 'eveasiatour2024‘culture’inseoul:이브내한공연'), - ('01919e42-f208-772c-977d-67eda677b979', '2024-08-29 13:11:13.170', '2024-08-29 13:11:13.170', false, '019194b5-d4a3-5186-2ae2-008109252b27', 'disclosuredjset:디스클로저내한공연'), - ('01919e44-9730-3e33-a7c3-73574ec4b9b0', '2024-08-29 13:13:00.984', '2024-08-29 13:13:00.984', false, '019194ad-1663-4319-c525-12ece13f18ad', 'spyairasiatour2024:스파이에어내한공연'), - ('01919e46-6233-e92d-5b03-965e6bf627b7', '2024-08-29 13:14:58.493', '2024-08-29 13:14:58.493', false, '019194b4-e020-8a98-ae34-fc1a6f633c18', 'lauvliveinseoul:라우브내한공연'), - ('01919e48-1249-05c7-9afa-4452ece08ee6', '2024-08-29 13:16:49.106', '2024-08-29 13:16:49.106', false, '019194b4-1d54-17c7-196b-8736d867649e', 'diveintooliviadean:올리비아딘내한공연'), - ('01919e48-bc70-0e1f-adbd-bb2b45a74ca2', '2024-08-29 13:17:32.662', '2024-08-29 13:17:32.662', false, '019194ad-db9c-09fc-e0a6-ed4ec8888fb8', 'ellegarden‘boysarebackintheeasttour2023’:엘르가든내한공연'), - ('01919e49-a9db-c33d-aeb6-483c3df53531', '2024-08-29 13:18:33.441', '2024-08-29 13:18:33.441', false, '019194b3-7974-5f00-d9cf-7a8632b8e0e9', 'justinbieberbeleivetour:저스틴비버내한공연'), - ('01919e4b-931a-cbe2-56fb-34d2a0139aa9', '2024-08-29 13:20:38.691', '2024-08-29 13:20:38.691', false, '019194ae-9b20-8972-0c7c-81704c1dfc1a', 'kinggnuasiatour‘thegreatestunknown’inseoul:킹누내한공연'), - ('01919e4b-bec8-db65-f374-d97be3a3a223', '2024-08-29 13:20:49.873', '2024-08-29 13:20:49.873', false, '019194b2-748c-b8e2-e00b-59d3c98d02c1', 'theweekand:위켄드내한공연'), - ('01919e4e-c622-6904-85c0-eb75ca4f0f90', '2024-08-29 13:24:08.363', '2024-08-29 13:24:08.363', false, '019194b0-cd60-a404-4151-ec9602666ea9', 'charlieputhliveinseoul:찰리푸스내한공연'); - - --- Show Ticketing Time -insert into public.show_ticketing_time (id, created_at, is_deleted, updated_at, ticketing_at, show_id, type) -values ('01919901-10ae-8324-814b-92e4613b30ef', '2024-08-28 12:41:09.552', false, '2024-08-28 12:41:09.552', '2024-08-28 21:40:00.000', '01919901-105d-b5b2-cbaf-912f20281ce8', 'NORMAL'), - ('01919906-7fbd-b22b-822e-5f715f6ada3a', '2024-08-28 12:47:05.662', false, '2024-08-28 12:47:05.662', '2024-05-17 00:00:00.000', '01919906-7fb9-6552-3819-91a5295bb3e6', 'NORMAL'), - ('0191990e-3c54-47e1-f67b-0cb6257d13fc', '2024-08-28 12:55:32.693', false, '2024-08-28 12:55:32.693', '2024-05-08 00:00:00.000', '0191948f-0ba0-2a3b-9b19-bd42694ecf58', 'NORMAL'), - ('01919916-b579-20e8-3c67-305ccfdd8b16', '2024-08-28 13:04:47.994', false, '2024-08-28 13:04:47.994', '2024-06-20 00:00:00.000', '019194a4-e4ba-f2d1-79d6-23088c9c3112', 'NORMAL'), - ('01919e32-97d2-6296-f7a0-3ac09e62531f', '2024-08-29 12:53:21.504', false, '2024-08-29 12:53:21.504', '2024-09-30 21:51:00.000', '019194ba-562b-a6bc-b7e9-42d21e566111', 'NORMAL'), - ('01919e34-6eee-d768-c7cb-522875f78df1', '2024-08-29 12:55:22.094', false, '2024-08-29 12:55:22.094', '2024-11-13 14:00:00.000', '019194a9-c1b5-407a-fae8-324bc240db6d', 'NORMAL'), - ('01919e38-80df-3777-7d8b-480b63e3e0b3', '2024-08-29 12:59:48.831', false, '2024-08-29 12:59:48.831', '2024-12-22 21:59:00.000', '019194b9-a3c3-5cd7-b35d-2c133907812d', 'NORMAL'), - ('01919e3b-bc68-8f33-760f-54c3ebc92a13', '2024-08-29 13:03:20.680', false, '2024-08-29 13:03:20.680', '2024-09-07 22:02:00.000', '019194b8-79f5-e976-7be4-1a07018ad0ee', 'NORMAL'), - ('01919e3c-3c3a-48d4-483f-71eff44ff89f', '2024-08-29 13:03:53.402', false, '2024-08-29 13:03:53.402', '2024-09-01 14:00:00.000', '019194aa-d2fd-e29f-96c7-df9101dfd1b6', 'NORMAL'), - ('01919e3e-cbe7-0272-bcae-c32bc50f2c03', '2024-08-29 13:06:41.255', false, '2024-08-29 13:06:41.255', '2024-10-03 22:05:00.000', '019194b7-b2a8-33d0-6f93-dcdcfbd7fdea', 'NORMAL'), - ('01919e41-8d79-8f51-3260-d081962e73da', '2024-08-29 13:09:41.882', false, '2024-08-29 13:09:41.882', '2024-10-05 22:09:00.000', '019194b6-bf4a-3f6d-91d5-4de8ab1bf027', 'NORMAL'), - ('01919e41-c22c-742d-c8b4-4f71a721076f', '2024-08-29 13:09:55.373', false, '2024-08-29 13:09:55.373', '2024-09-06 14:00:00.000', '019194ac-757e-265a-a639-0f20626ad748', 'NORMAL'), - ('01919e42-f220-bec9-3cd9-1c0e18d3e27e', '2024-08-29 13:11:13.185', false, '2024-08-29 13:11:13.185', '2024-09-05 22:10:00.000', '019194b5-d4a3-5186-2ae2-008109252b27', 'NORMAL'), - ('01919e44-974e-6ce6-a69e-c36641f53b3e', '2024-08-29 13:13:01.006', false, '2024-08-29 13:13:01.006', '2024-09-20 14:00:00.000', '019194ad-1663-4319-c525-12ece13f18ad', 'NORMAL'), - ('01919e46-624e-54e4-3d15-cefcfd465686', '2024-08-29 13:14:58.511', false, '2024-08-29 13:14:58.511', '2024-09-21 22:14:00.000', '019194b4-e020-8a98-ae34-fc1a6f633c18', 'NORMAL'), - ('01919e48-1259-9d23-0b35-021557855800', '2024-08-29 13:16:49.114', false, '2024-08-29 13:16:49.114', '2024-09-18 22:16:00.000', '019194b4-1d54-17c7-196b-8736d867649e', 'NORMAL'), - ('01919e48-bc80-51b4-4275-86aed78a70fa', '2024-08-29 13:17:32.673', false, '2024-08-29 13:17:32.673', '2024-09-13 14:00:00.000', '019194ad-db9c-09fc-e0a6-ed4ec8888fb8', 'NORMAL'), - ('01919e49-a9f0-b161-d1c5-ade0ad0406c8', '2024-08-29 13:18:33.457', false, '2024-08-29 13:18:33.457', '2024-09-28 22:18:00.000', '019194b3-7974-5f00-d9cf-7a8632b8e0e9', 'NORMAL'), - ('01919e4b-932a-6d80-5086-8e7d9819ec05', '2024-08-29 13:20:38.698', false, '2024-08-29 13:20:38.698', '2024-09-12 12:00:00.000', '019194ae-9b20-8972-0c7c-81704c1dfc1a', 'NORMAL'), - ('01919e4b-bee0-5d00-cc20-57c3cf222e9e', '2024-08-29 13:20:49.889', false, '2024-08-29 13:20:49.889', '2024-09-05 22:19:00.000', '019194b2-748c-b8e2-e00b-59d3c98d02c1', 'NORMAL'), - ('01919e4d-55b0-49a8-589e-56871819f9b2', '2024-08-29 13:22:34.033', false, '2024-08-29 13:22:34.033', '2024-09-21 22:21:00.000', '019194b1-a2b0-6a29-9d33-d1a4c8fad5cf', 'NORMAL'), - ('01919e4e-b01c-dc6e-a25b-f069e0526324', '2024-08-29 13:24:02.716', false, '2024-08-29 13:24:02.716', '2024-09-24 12:00:00.000', '019194af-d678-94df-5fe1-83c3b0d85941', 'NORMAL'), - ('01919e4e-c635-3117-baa3-11341f406aac', '2024-08-29 13:24:08.375', false, '2024-08-29 13:24:08.375', '2024-09-09 22:23:00.000', '019194b0-cd60-a404-4151-ec9602666ea9', 'NORMAL'); diff --git a/app/domain/common-domain/src/main/resources/schema.sql b/app/domain/common-domain/src/main/resources/schema.sql index f3de80e6..f4142650 100644 --- a/app/domain/common-domain/src/main/resources/schema.sql +++ b/app/domain/common-domain/src/main/resources/schema.sql @@ -39,13 +39,9 @@ create table artist created_at timestamp(3) not null, updated_at timestamp(3) not null, is_deleted boolean not null, - korean_name varchar(255) not null, - english_name varchar(255) not null, - gender varchar(255) not null check (gender in ('MAN', 'WOMAN', 'MIXED')), - type varchar(255) not null check (type in ('SOLO', 'GROUP')), - country varchar(255) not null, + name varchar(255) not null, image varchar(255) not null, - spotify_id varchar(255), + spotify_id varchar(255) not null unique, primary key (id) ); diff --git a/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistFilterDomain.java b/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistFilterDomain.java deleted file mode 100644 index 938e30fc..00000000 --- a/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistFilterDomain.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.example.dto.artist.request; - -import java.util.List; -import java.util.UUID; -import lombok.Builder; -import org.example.vo.ArtistGender; -import org.example.vo.ArtistType; - -@Builder -public record ArtistFilterDomain( - List artistGenders, - List artistTypes, - List genreIds -) { - - public static ArtistFilterDomain defaultArtistFilterDomain() { - return ArtistFilterDomain.builder() - .artistGenders(List.of()) - .artistTypes(List.of()) - .genreIds(List.of()) - .build(); - } -} diff --git a/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistFilterTotalCountDomainRequest.java b/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistFilterTotalCountDomainRequest.java deleted file mode 100644 index ba54a951..00000000 --- a/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistFilterTotalCountDomainRequest.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.example.dto.artist.request; - -import java.util.List; -import java.util.UUID; -import lombok.Builder; -import org.example.vo.ArtistGender; -import org.example.vo.ArtistType; - -@Builder -public record ArtistFilterTotalCountDomainRequest( - List artistGenders, - List artistTypes, - List genreIds, - List artistIds -) { - -} diff --git a/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistPaginationDomainRequest.java b/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistPaginationDomainRequest.java index ccf4bfb8..958f4350 100644 --- a/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistPaginationDomainRequest.java +++ b/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistPaginationDomainRequest.java @@ -3,17 +3,14 @@ import java.util.List; import java.util.UUID; import lombok.Builder; -import org.example.vo.ArtistSortType; import org.example.vo.SubscriptionStatus; @Builder public record ArtistPaginationDomainRequest( SubscriptionStatus subscriptionStatus, int size, - ArtistSortType sortStandard, UUID cursor, - List artistIds, - ArtistFilterDomain artistFilterDomain + List artistIds ) { } diff --git a/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistDetailDomainResponse.java b/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistDetailDomainResponse.java index 5606312c..5466a530 100644 --- a/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistDetailDomainResponse.java +++ b/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistDetailDomainResponse.java @@ -2,17 +2,11 @@ import java.util.List; import java.util.UUID; -import org.example.vo.ArtistGender; -import org.example.vo.ArtistType; public record ArtistDetailDomainResponse( UUID id, - String koreanName, - String englishName, + String name, String image, - String country, - ArtistGender artistGender, - ArtistType artistType, List genreNames ) { diff --git a/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistDomainResponse.java b/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistDomainResponse.java index b9f01b1a..cee82ca3 100644 --- a/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistDomainResponse.java +++ b/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistDomainResponse.java @@ -1,20 +1,14 @@ package org.example.dto.artist.response; import java.util.UUID; -import org.example.vo.ArtistGender; -import org.example.vo.ArtistType; /** * 엔티티 조회 객체 */ public record ArtistDomainResponse( UUID id, - String koreanName, - String englishName, - String image, - String country, - ArtistGender artistGender, - ArtistType artistType + String name, + String image ) { } diff --git a/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistKoreanNamesWithShowIdDomainResponse.java b/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistKoreanNamesWithShowIdDomainResponse.java deleted file mode 100644 index 19da1e0d..00000000 --- a/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistKoreanNamesWithShowIdDomainResponse.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.example.dto.artist.response; - -import java.util.List; -import java.util.UUID; - -public record ArtistKoreanNamesWithShowIdDomainResponse( - UUID showId, - List koreanNameDomainResponses -) { - -} diff --git a/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistKoreanNameDomainResponse.java b/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistNameDomainResponse.java similarity index 55% rename from app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistKoreanNameDomainResponse.java rename to app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistNameDomainResponse.java index 376c8c8a..2e6f9b28 100644 --- a/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistKoreanNameDomainResponse.java +++ b/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistNameDomainResponse.java @@ -2,9 +2,9 @@ import java.util.UUID; -public record ArtistKoreanNameDomainResponse( +public record ArtistNameDomainResponse( UUID id, - String koreanName + String name ) { } diff --git a/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistNamesWithShowIdDomainResponse.java b/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistNamesWithShowIdDomainResponse.java new file mode 100644 index 00000000..dd2bb803 --- /dev/null +++ b/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistNamesWithShowIdDomainResponse.java @@ -0,0 +1,11 @@ +package org.example.dto.artist.response; + +import java.util.List; +import java.util.UUID; + +public record ArtistNamesWithShowIdDomainResponse( + UUID showId, + List koreanNameDomainResponses +) { + +} diff --git a/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistSimpleDomainResponse.java b/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistSimpleDomainResponse.java index 9512d5c6..b30278c1 100644 --- a/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistSimpleDomainResponse.java +++ b/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistSimpleDomainResponse.java @@ -6,8 +6,7 @@ @Builder public record ArtistSimpleDomainResponse( UUID id, - String koreanName, - String englishName, + String name, String image ) { diff --git a/app/domain/show-domain/src/main/java/org/example/dto/show/response/ShowInfoDomainResponse.java b/app/domain/show-domain/src/main/java/org/example/dto/show/response/ShowInfoDomainResponse.java index b408db63..88a79658 100644 --- a/app/domain/show-domain/src/main/java/org/example/dto/show/response/ShowInfoDomainResponse.java +++ b/app/domain/show-domain/src/main/java/org/example/dto/show/response/ShowInfoDomainResponse.java @@ -1,12 +1,12 @@ package org.example.dto.show.response; import java.util.Set; -import org.example.dto.artist.response.ArtistKoreanNameDomainResponse; +import org.example.dto.artist.response.ArtistNameDomainResponse; import org.example.dto.genre.response.GenreNameDomainResponse; public record ShowInfoDomainResponse( ShowDomainResponse show, - Set artistKoreanNameResponses, + Set artistKoreanNameResponses, Set genreNameResponses, Set ticketingTimes ) { diff --git a/app/domain/show-domain/src/main/java/org/example/entity/artist/Artist.java b/app/domain/show-domain/src/main/java/org/example/entity/artist/Artist.java index f90a53fa..b6e4a379 100644 --- a/app/domain/show-domain/src/main/java/org/example/entity/artist/Artist.java +++ b/app/domain/show-domain/src/main/java/org/example/entity/artist/Artist.java @@ -2,8 +2,6 @@ import jakarta.persistence.Column; import jakarta.persistence.Entity; -import jakarta.persistence.EnumType; -import jakarta.persistence.Enumerated; import jakarta.persistence.Table; import java.util.List; import java.util.UUID; @@ -12,8 +10,6 @@ import lombok.Getter; import lombok.NoArgsConstructor; import org.example.entity.BaseEntity; -import org.example.vo.ArtistGender; -import org.example.vo.ArtistType; @Entity @Getter @@ -21,44 +17,24 @@ @Table(name = "artist") public class Artist extends BaseEntity { - @Column(name = "korean_name", nullable = false) - private String koreanName; - - @Column(name = "english_name", nullable = false) - private String englishName; + @Column(name = "name", nullable = false) + private String name; @Column(name = "image", nullable = false) private String image; - @Column(name = "country", nullable = false) - private String country; - - @Column(name = "gender", nullable = false) - @Enumerated(value = EnumType.STRING) - private ArtistGender artistGender; - - @Column(name = "type", nullable = false) - @Enumerated(value = EnumType.STRING) - private ArtistType artistType; - - @Column(name = "spotify_id", nullable = true) + @Column(name = "spotify_id", unique = true, nullable = false) private String spotifyId; @Builder private Artist( - String koreanName, - String englishName, + String name, String image, - String country, - ArtistGender artistGender, - ArtistType artistType + String spotifyId ) { - this.koreanName = koreanName; - this.englishName = englishName; + this.name = name; this.image = image; - this.country = country; - this.artistGender = artistGender; - this.artistType = artistType; + this.spotifyId = spotifyId; } public List toArtistGenre(List genreIds) { @@ -69,13 +45,4 @@ public List toArtistGenre(List genreIds) { .build()) .toList(); } - - public void changeArtistInfo(Artist newArtist) { - this.koreanName = newArtist.koreanName; - this.englishName = newArtist.englishName; - this.image = newArtist.image; - this.country = newArtist.country; - this.artistGender = newArtist.artistGender; - this.artistType = newArtist.artistType; - } } diff --git a/app/domain/show-domain/src/main/java/org/example/repository/artist/ArtistQuerydslRepository.java b/app/domain/show-domain/src/main/java/org/example/repository/artist/ArtistQuerydslRepository.java index 51ea6b14..a3d1fae6 100644 --- a/app/domain/show-domain/src/main/java/org/example/repository/artist/ArtistQuerydslRepository.java +++ b/app/domain/show-domain/src/main/java/org/example/repository/artist/ArtistQuerydslRepository.java @@ -1,13 +1,10 @@ package org.example.repository.artist; import java.util.List; -import java.util.Optional; import java.util.UUID; -import org.example.dto.artist.request.ArtistFilterTotalCountDomainRequest; import org.example.dto.artist.request.ArtistPaginationDomainRequest; import org.example.dto.artist.response.ArtistDetailDomainResponse; -import org.example.dto.artist.response.ArtistFilterTotalCountDomainResponse; -import org.example.dto.artist.response.ArtistKoreanNameDomainResponse; +import org.example.dto.artist.response.ArtistNameDomainResponse; import org.example.dto.artist.response.ArtistPaginationDomainResponse; import org.example.entity.artist.Artist; @@ -15,17 +12,11 @@ public interface ArtistQuerydslRepository { List findAllWithGenreNames(); - Optional findArtistWithGenreNamesById(UUID id); - - List findAllArtistKoreanName(); + List findAllArtistKoreanName(); List findAllInIds(List ids); ArtistPaginationDomainResponse findAllWithCursorPagination( ArtistPaginationDomainRequest request ); - - Optional findFilterArtistTotalCount( - ArtistFilterTotalCountDomainRequest request - ); } diff --git a/app/domain/show-domain/src/main/java/org/example/repository/artist/ArtistQuerydslRepositoryImpl.java b/app/domain/show-domain/src/main/java/org/example/repository/artist/ArtistQuerydslRepositoryImpl.java index 91650cb0..bfd0154e 100644 --- a/app/domain/show-domain/src/main/java/org/example/repository/artist/ArtistQuerydslRepositoryImpl.java +++ b/app/domain/show-domain/src/main/java/org/example/repository/artist/ArtistQuerydslRepositoryImpl.java @@ -7,7 +7,6 @@ import static org.example.entity.genre.QGenre.genre; import com.querydsl.core.BooleanBuilder; -import com.querydsl.core.types.OrderSpecifier; import com.querydsl.core.types.Predicate; import com.querydsl.core.types.Projections; import com.querydsl.core.types.dsl.BooleanExpression; @@ -15,21 +14,16 @@ import com.querydsl.jpa.impl.JPAQueryFactory; import java.util.Collection; import java.util.List; -import java.util.Optional; import java.util.UUID; import java.util.function.Function; import lombok.RequiredArgsConstructor; -import org.example.dto.artist.request.ArtistFilterDomain; -import org.example.dto.artist.request.ArtistFilterTotalCountDomainRequest; import org.example.dto.artist.request.ArtistPaginationDomainRequest; import org.example.dto.artist.response.ArtistDetailDomainResponse; -import org.example.dto.artist.response.ArtistFilterTotalCountDomainResponse; -import org.example.dto.artist.response.ArtistKoreanNameDomainResponse; +import org.example.dto.artist.response.ArtistNameDomainResponse; import org.example.dto.artist.response.ArtistPaginationDomainResponse; import org.example.dto.artist.response.ArtistSimpleDomainResponse; import org.example.entity.artist.Artist; import org.example.util.SliceUtil; -import org.example.vo.ArtistSortType; import org.example.vo.SubscriptionStatus; import org.springframework.data.domain.Slice; import org.springframework.stereotype.Repository; @@ -48,12 +42,8 @@ public List findAllWithGenreNames() { Projections.constructor( ArtistDetailDomainResponse.class, artist.id, - artist.koreanName, - artist.englishName, + artist.name, artist.image, - artist.country, - artist.artistGender, - artist.artistType, list(genre.name) ) ) @@ -61,37 +51,13 @@ public List findAllWithGenreNames() { } @Override - public Optional findArtistWithGenreNamesById(UUID id) { - return Optional.ofNullable( - createArtistJoinArtistGenreAndGenreQuery() - .where(artist.id.eq(id)) - .transform( - groupBy(artist.id).as( - Projections.constructor( - ArtistDetailDomainResponse.class, - artist.id, - artist.koreanName, - artist.englishName, - artist.image, - artist.country, - artist.artistGender, - artist.artistType, - list(genre.name) - ) - ) - ) - .get(id) - ); - } - - @Override - public List findAllArtistKoreanName() { + public List findAllArtistKoreanName() { return jpaQueryFactory .select( Projections.constructor( - ArtistKoreanNameDomainResponse.class, + ArtistNameDomainResponse.class, artist.id, - artist.koreanName + artist.name ) ) .from(artist) @@ -115,8 +81,7 @@ public ArtistPaginationDomainResponse findAllWithCursorPagination( Projections.constructor( ArtistSimpleDomainResponse.class, artist.id, - artist.koreanName, - artist.englishName, + artist.name, artist.image ) ).from(artist) @@ -124,11 +89,9 @@ public ArtistPaginationDomainResponse findAllWithCursorPagination( getWhereClauseInCursorPagination( request.subscriptionStatus(), request.cursor(), - request.artistIds(), - request.artistFilterDomain() + request.artistIds() ) ) - .orderBy(getOrderSpecifier(request.sortStandard())) .limit(request.size() + 1) .fetch(); @@ -143,21 +106,6 @@ public ArtistPaginationDomainResponse findAllWithCursorPagination( .build(); } - @Override - public Optional findFilterArtistTotalCount( - ArtistFilterTotalCountDomainRequest request - ) { - List totalCount = jpaQueryFactory - .selectDistinct(artist.id) - .from(artist) - .join(artistGenre).on(isArtistGenreEqualArtistIdAndIsDeletedFalse()) - .join(genre).on(isArtistGenreEqualGenreIdAndIsDeletedFalse()) - .where(getWhereClauseWithFilter(request)) - .fetch(); - - return Optional.of(new ArtistFilterTotalCountDomainResponse(totalCount.size())); - } - private JPAQuery createArtistJoinArtistGenreAndGenreQuery() { return jpaQueryFactory .selectFrom(artist) @@ -177,8 +125,7 @@ private BooleanExpression isArtistGenreEqualGenreIdAndIsDeletedFalse() { private BooleanBuilder getWhereClauseInCursorPagination( SubscriptionStatus status, UUID cursor, - List artistIds, - ArtistFilterDomain artistFilterDomain + List artistIds ) { BooleanBuilder whereClause = new BooleanBuilder(); whereClause.and(getDefaultPredicateInCursorPagination(cursor)); @@ -189,28 +136,11 @@ private BooleanBuilder getWhereClauseInCursorPagination( if (status.equals(SubscriptionStatus.UNSUBSCRIBED)) { addConditionIfNotEmpty(whereClause, artist.id::notIn, artistIds); - addConditionIfNotEmpty(whereClause, genre.id::in, artistFilterDomain.genreIds()); - addConditionIfNotEmpty(whereClause, artist.artistGender::in, artistFilterDomain.artistGenders()); - addConditionIfNotEmpty(whereClause, artist.artistType::in, artistFilterDomain.artistTypes()); } return whereClause; } - private BooleanBuilder getWhereClauseWithFilter( - ArtistFilterTotalCountDomainRequest request - ) { - BooleanBuilder whereClause = new BooleanBuilder(); - whereClause.and(artist.isDeleted.isFalse()); - - addConditionIfNotEmpty(whereClause, artist.id::notIn, request.artistIds()); - addConditionIfNotEmpty(whereClause, genre.id::in, request.genreIds()); - addConditionIfNotEmpty(whereClause, artist.artistGender::in, request.artistGenders()); - addConditionIfNotEmpty(whereClause, artist.artistType::in, request.artistTypes()); - - return whereClause; - } - private Predicate getDefaultPredicateInCursorPagination(UUID cursor) { BooleanExpression defaultPredicate = artist.isDeleted.isFalse(); @@ -226,13 +156,4 @@ private void addConditionIfNotEmpty( whereClause.and(conditionFunction.apply(values)); } } - - private OrderSpecifier getOrderSpecifier(ArtistSortType type) { - return switch (type) { - case KOREAN_NAME_ASC -> artist.koreanName.asc(); - case KOREAN_NAME_DESC -> artist.koreanName.desc(); - case ENGLISH_NAME_ASC -> artist.englishName.asc(); - case ENGLISH_NAME_DESC -> artist.englishName.desc(); - }; - } } diff --git a/app/domain/show-domain/src/main/java/org/example/repository/show/ShowQuerydslRepositoryImpl.java b/app/domain/show-domain/src/main/java/org/example/repository/show/ShowQuerydslRepositoryImpl.java index 9b0e299d..121e80a6 100644 --- a/app/domain/show-domain/src/main/java/org/example/repository/show/ShowQuerydslRepositoryImpl.java +++ b/app/domain/show-domain/src/main/java/org/example/repository/show/ShowQuerydslRepositoryImpl.java @@ -25,7 +25,7 @@ import java.util.UUID; import lombok.RequiredArgsConstructor; import org.example.dto.artist.response.ArtistDomainResponse; -import org.example.dto.artist.response.ArtistKoreanNameDomainResponse; +import org.example.dto.artist.response.ArtistNameDomainResponse; import org.example.dto.genre.response.GenreDomainResponse; import org.example.dto.genre.response.GenreNameDomainResponse; import org.example.dto.show.request.ShowPaginationDomainRequest; @@ -241,12 +241,8 @@ private ConstructorExpression getShowDetailConstructor Projections.constructor( ArtistDomainResponse.class, artist.id, - artist.koreanName, - artist.englishName, - artist.image, - artist.country, - artist.artistGender, - artist.artistType + artist.name, + artist.image ) ), set( @@ -285,9 +281,9 @@ private ConstructorExpression getShowInfoConstructor() { ), set( Projections.constructor( - ArtistKoreanNameDomainResponse.class, + ArtistNameDomainResponse.class, artist.id, - artist.koreanName + artist.name ) ), set( diff --git a/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepository.java b/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepository.java index fc079b61..35456cbc 100644 --- a/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepository.java +++ b/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepository.java @@ -1,9 +1,9 @@ package org.example.repository.show.showartist; import java.util.List; -import org.example.dto.artist.response.ArtistKoreanNamesWithShowIdDomainResponse; +import org.example.dto.artist.response.ArtistNamesWithShowIdDomainResponse; public interface ShowArtistQuerydslRepository { - List findArtistKoreanNamesWithShowId(); + List findArtistKoreanNamesWithShowId(); } diff --git a/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepositoryImpl.java b/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepositoryImpl.java index b6312e15..283f3bd2 100644 --- a/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepositoryImpl.java +++ b/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepositoryImpl.java @@ -10,8 +10,8 @@ import com.querydsl.jpa.impl.JPAQueryFactory; import java.util.List; import lombok.RequiredArgsConstructor; -import org.example.dto.artist.response.ArtistKoreanNameDomainResponse; -import org.example.dto.artist.response.ArtistKoreanNamesWithShowIdDomainResponse; +import org.example.dto.artist.response.ArtistNameDomainResponse; +import org.example.dto.artist.response.ArtistNamesWithShowIdDomainResponse; import org.springframework.stereotype.Repository; @Repository @@ -21,7 +21,7 @@ public class ShowArtistQuerydslRepositoryImpl implements ShowArtistQuerydslRepos private final JPAQueryFactory jpaQueryFactory; @Override - public List findArtistKoreanNamesWithShowId() { + public List findArtistKoreanNamesWithShowId() { return jpaQueryFactory.selectFrom(showArtist) .join(show).on(show.id.eq(showArtist.showId), show.isDeleted.isFalse()) .join(artist).on(artist.id.eq(showArtist.artistId), artist.isDeleted.isFalse()) @@ -29,13 +29,13 @@ public List findArtistKoreanNamesWith .transform( groupBy(showArtist.id).list( Projections.constructor( - ArtistKoreanNamesWithShowIdDomainResponse.class, + ArtistNamesWithShowIdDomainResponse.class, show.id, list( Projections.constructor( - ArtistKoreanNameDomainResponse.class, + ArtistNameDomainResponse.class, artist.id, - artist.koreanName + artist.name ) ) ) diff --git a/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java b/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java index 32a3d7f7..b95e123f 100644 --- a/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java +++ b/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java @@ -7,19 +7,15 @@ import java.util.function.Function; import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; -import org.example.dto.artist.request.ArtistFilterTotalCountDomainRequest; import org.example.dto.artist.request.ArtistPaginationDomainRequest; import org.example.dto.artist.request.ArtistSearchPaginationDomainRequest; import org.example.dto.artist.response.ArtistDetailDomainResponse; -import org.example.dto.artist.response.ArtistFilterTotalCountDomainResponse; -import org.example.dto.artist.response.ArtistKoreanNameDomainResponse; -import org.example.dto.artist.response.ArtistKoreanNamesWithShowIdDomainResponse; +import org.example.dto.artist.response.ArtistNameDomainResponse; +import org.example.dto.artist.response.ArtistNamesWithShowIdDomainResponse; import org.example.dto.artist.response.ArtistPaginationDomainResponse; import org.example.dto.artist.response.ArtistSearchPaginationDomainResponse; -import org.example.entity.BaseEntity; import org.example.entity.artist.Artist; import org.example.entity.artist.ArtistGenre; -import org.example.entity.show.ShowArtist; import org.example.port.ArtistSearchPort; import org.example.port.dto.request.ArtistSearchPortRequest; import org.example.port.dto.response.ArtistSearchPortResponse; @@ -50,16 +46,12 @@ public List findAllWithGenreNames() { return artistRepository.findAllWithGenreNames(); } - public List findAllArtistKoreanName() { + public List findAllArtistKoreanName() { return artistRepository.findAllArtistKoreanName(); } - public ArtistDetailDomainResponse findArtistDetailById(UUID id) { - return artistRepository.findArtistWithGenreNamesById(id) - .orElseThrow(NoSuchElementException::new); - } - public List findArtistKoreanNamesWithShowId() { + public List findArtistKoreanNamesWithShowId() { return showArtistRepository.findArtistKoreanNamesWithShowId(); } @@ -73,55 +65,6 @@ public ArtistPaginationDomainResponse findAllArtistInCursorPagination( return artistRepository.findAllWithCursorPagination(request); } - public ArtistFilterTotalCountDomainResponse findFilterArtistTotalCount( - ArtistFilterTotalCountDomainRequest request - ) { - return artistRepository.findFilterArtistTotalCount(request) - .orElseThrow(NoSuchElementException::new); - } - - @Transactional - public void updateArtist(UUID id, Artist newArtist, List newGenreIds) { - Artist artist = findArtistById(id); - artist.changeArtistInfo(newArtist); - - updateArtistGenre(newGenreIds, artist); - } - - private void updateArtistGenre(List newGenreIds, Artist artist) { - List currentGenres = artistGenreRepository.findAllByArtistIdAndIsDeletedFalse( - artist.getId()); - - List currentGenreIds = currentGenres.stream() - .map(ArtistGenre::getGenreId) - .toList(); - - List genreIdsToAdd = newGenreIds.stream() - .filter(newGenreId -> !currentGenreIds.contains(newGenreId)) - .toList(); - List artistGenresToAdd = artist.toArtistGenre(genreIdsToAdd); - artistGenreRepository.saveAll(artistGenresToAdd); - - List artistGenresToRemove = currentGenres.stream() - .filter(ag -> !newGenreIds.contains(ag.getGenreId())) - .toList(); - artistGenresToRemove.forEach(BaseEntity::softDelete); - } - - @Transactional - public void deleteArtist(UUID id) { - Artist artist = findArtistById(id); - artist.softDelete(); - - List artistGenres = artistGenreRepository.findAllByArtistIdAndIsDeletedFalse( - artist.getId()); - artistGenres.forEach(BaseEntity::softDelete); - - List showArtists = showArtistRepository.findAllByArtistIdAndIsDeletedFalse( - artist.getId()); - showArtists.forEach(BaseEntity::softDelete); - } - public ArtistSearchPaginationDomainResponse searchArtist( ArtistSearchPaginationDomainRequest request ) { @@ -134,7 +77,9 @@ public ArtistSearchPaginationDomainResponse searchArtist( .build() ); - Map artistBySpotifyId = getArtistBySpotifyId(response.getSpotifyArtistIds()); + Map artistBySpotifyId = getArtistBySpotifyId( + response.getSpotifyArtistIds() + ); return ArtistSearchPaginationDomainResponse.builder() .data( diff --git a/app/domain/show-domain/src/main/java/org/example/vo/ArtistGender.java b/app/domain/show-domain/src/main/java/org/example/vo/ArtistGender.java deleted file mode 100644 index aa7e855d..00000000 --- a/app/domain/show-domain/src/main/java/org/example/vo/ArtistGender.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.example.vo; - -public enum ArtistGender { - MAN, WOMAN, MIXED -} diff --git a/app/domain/show-domain/src/main/java/org/example/vo/ArtistSortType.java b/app/domain/show-domain/src/main/java/org/example/vo/ArtistSortType.java deleted file mode 100644 index af798fbc..00000000 --- a/app/domain/show-domain/src/main/java/org/example/vo/ArtistSortType.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.example.vo; - -public enum ArtistSortType { - KOREAN_NAME_ASC, - KOREAN_NAME_DESC, - ENGLISH_NAME_ASC, - ENGLISH_NAME_DESC -} diff --git a/app/domain/show-domain/src/main/java/org/example/vo/ArtistType.java b/app/domain/show-domain/src/main/java/org/example/vo/ArtistType.java deleted file mode 100644 index 17db33de..00000000 --- a/app/domain/show-domain/src/main/java/org/example/vo/ArtistType.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.example.vo; - -public enum ArtistType { - SOLO, GROUP -} diff --git a/app/domain/show-domain/src/test/java/org/example/repository/artist/ArtistRepositoryTest.java b/app/domain/show-domain/src/test/java/org/example/repository/artist/ArtistRepositoryTest.java index eefbfaa4..52c0a2e3 100644 --- a/app/domain/show-domain/src/test/java/org/example/repository/artist/ArtistRepositoryTest.java +++ b/app/domain/show-domain/src/test/java/org/example/repository/artist/ArtistRepositoryTest.java @@ -6,7 +6,6 @@ import java.util.List; import java.util.UUID; import org.example.QueryTest; -import org.example.dto.artist.request.ArtistFilterDomain; import org.example.entity.artist.Artist; import org.example.fixture.domain.ArtistFixture; import org.example.fixture.domain.ArtistGenreFixture; @@ -14,9 +13,6 @@ import org.example.fixture.dto.ArtistRequestDtoFixture; import org.example.repository.artist.artistgenre.ArtistGenreRepository; import org.example.repository.genre.GenreRepository; -import org.example.vo.ArtistGender; -import org.example.vo.ArtistSortType; -import org.example.vo.ArtistType; import org.example.vo.SubscriptionStatus; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; @@ -39,10 +35,7 @@ class ArtistRepositoryTest extends QueryTest { @DisplayName("findAllInIds 메서드가 의도대로 동작하는지 확인한다.") void find_all_in() { var artists = artistRepository.saveAll( - List.of( - ArtistFixture.womanGroup(), - ArtistFixture.womanGroup() - ) + ArtistFixture.manSoloArtists(2) ); ArrayList ids = new ArrayList<>(artists.stream().map(Artist::getId).toList()); @@ -81,10 +74,8 @@ void findArtistSubscriptionExistArtistIds() { var request = ArtistRequestDtoFixture.artistPaginationDomainRequest( SubscriptionStatus.SUBSCRIBED, size, - ArtistSortType.ENGLISH_NAME_ASC, null, - artists.stream().map(Artist::getId).toList(), - ArtistFilterDomain.defaultArtistFilterDomain() + artists.stream().map(Artist::getId).toList() ); //when @@ -106,10 +97,8 @@ void findArtistUnsubscriptionExceptSubscribedArtistIds() { var request = ArtistRequestDtoFixture.artistPaginationDomainRequest( SubscriptionStatus.UNSUBSCRIBED, size, - ArtistSortType.ENGLISH_NAME_ASC, null, - artists.stream().map(Artist::getId).toList(), - ArtistFilterDomain.defaultArtistFilterDomain() + artists.stream().map(Artist::getId).toList() ); //when @@ -131,10 +120,8 @@ void findArtistUnsubscriptionWithNoneSubscriptionArtistIds() { var request = ArtistRequestDtoFixture.artistPaginationDomainRequest( SubscriptionStatus.UNSUBSCRIBED, size, - ArtistSortType.ENGLISH_NAME_ASC, null, - List.of(), - ArtistFilterDomain.defaultArtistFilterDomain() + List.of() ); //when @@ -164,14 +151,8 @@ void findArtisNoneSubscribedArtistIdsWithFilter() { var request = ArtistRequestDtoFixture.artistPaginationDomainRequest( SubscriptionStatus.UNSUBSCRIBED, size, - ArtistSortType.ENGLISH_NAME_ASC, null, - List.of(), - ArtistFilterDomain.builder() - .artistGenders(List.of(ArtistGender.MAN)) - .artistTypes(List.of(ArtistType.SOLO)) - .genreIds(List.of()) - .build() + List.of() ); //when @@ -201,14 +182,8 @@ void findArtistExceptSubscribedArtistIdsWithFilter() { var request = ArtistRequestDtoFixture.artistPaginationDomainRequest( SubscriptionStatus.UNSUBSCRIBED, size, - ArtistSortType.ENGLISH_NAME_ASC, null, - artists.stream().map(Artist::getId).toList(), - ArtistFilterDomain.builder() - .artistGenders(List.of(ArtistGender.MAN, ArtistGender.WOMAN)) - .artistTypes(List.of(ArtistType.SOLO, ArtistType.GROUP)) - .genreIds(List.of()) - .build() + artists.stream().map(Artist::getId).toList() ); //when @@ -217,34 +192,4 @@ void findArtistExceptSubscribedArtistIdsWithFilter() { //then assertThat(result.data()).isEmpty(); } - - @Test - @DisplayName("구독한 아티스트가 없다면 필터링 후 구독하지 않은 아티스트 총 개수를 반환한다.") - void findArtisTotalCountNoneSubscribedArtistIds() { - int artistSize = 3; - var artists = ArtistFixture.manSoloArtists(artistSize); - artistRepository.saveAll(artists); - - var genres = GenreFixture.genres(1); - genreRepository.saveAll(genres); - - artists.forEach( - artist -> artistGenreRepository.save( - ArtistGenreFixture.artistGenre(artist.getId(), genres.get(0).getId()) - ) - ); - - var request = ArtistRequestDtoFixture.artistFilterTotalCountDomainRequest( - List.of(ArtistGender.MAN, ArtistGender.WOMAN), - List.of(ArtistType.SOLO, ArtistType.GROUP), - List.of(), - List.of() - ); - - //when - var result = artistRepository.findFilterArtistTotalCount(request).orElseThrow(); - - //then - assertThat(result.totalCount()).isEqualTo(artistSize); - } } \ No newline at end of file diff --git a/app/domain/show-domain/src/testFixtures/java/org/example/fixture/domain/ArtistFixture.java b/app/domain/show-domain/src/testFixtures/java/org/example/fixture/domain/ArtistFixture.java index 137e737d..e39d8d31 100644 --- a/app/domain/show-domain/src/testFixtures/java/org/example/fixture/domain/ArtistFixture.java +++ b/app/domain/show-domain/src/testFixtures/java/org/example/fixture/domain/ArtistFixture.java @@ -3,31 +3,23 @@ import java.util.List; import java.util.stream.IntStream; import org.example.entity.artist.Artist; -import org.example.vo.ArtistGender; -import org.example.vo.ArtistType; public class ArtistFixture { public static Artist womanGroup() { return Artist.builder() - .koreanName("아이브") - .englishName("IVE") + .name("IVE") .image("abc") - .country("KOREA") - .artistGender(ArtistGender.WOMAN) - .artistType(ArtistType.GROUP) + .spotifyId("spotifyId") .build(); } public static List manSoloArtists(int size) { return IntStream.range(0, size) .mapToObj(i -> Artist.builder() - .koreanName("testKoreanName" + i) - .englishName("testEnglishName" + i) + .name("testEnglishName" + i) .image("testImage" + i) - .country("testCountry" + i) - .artistGender(ArtistGender.MAN) - .artistType(ArtistType.SOLO) + .spotifyId("spotifyId" + i) .build() ) .toList(); diff --git a/app/domain/show-domain/src/testFixtures/java/org/example/fixture/dto/ArtistRequestDtoFixture.java b/app/domain/show-domain/src/testFixtures/java/org/example/fixture/dto/ArtistRequestDtoFixture.java index 37253cff..14177819 100644 --- a/app/domain/show-domain/src/testFixtures/java/org/example/fixture/dto/ArtistRequestDtoFixture.java +++ b/app/domain/show-domain/src/testFixtures/java/org/example/fixture/dto/ArtistRequestDtoFixture.java @@ -2,12 +2,7 @@ import java.util.List; import java.util.UUID; -import org.example.dto.artist.request.ArtistFilterDomain; -import org.example.dto.artist.request.ArtistFilterTotalCountDomainRequest; import org.example.dto.artist.request.ArtistPaginationDomainRequest; -import org.example.vo.ArtistGender; -import org.example.vo.ArtistSortType; -import org.example.vo.ArtistType; import org.example.vo.SubscriptionStatus; public class ArtistRequestDtoFixture { @@ -15,32 +10,14 @@ public class ArtistRequestDtoFixture { public static ArtistPaginationDomainRequest artistPaginationDomainRequest( SubscriptionStatus subscriptionStatus, int size, - ArtistSortType artistSortStandardDomainType, UUID cursor, - List artistIds, - ArtistFilterDomain artistFilterDomain + List artistIds ) { return ArtistPaginationDomainRequest.builder() .subscriptionStatus(subscriptionStatus) .size(size) - .sortStandard(artistSortStandardDomainType) .cursor(cursor) .artistIds(artistIds) - .artistFilterDomain(artistFilterDomain) - .build(); - } - - public static ArtistFilterTotalCountDomainRequest artistFilterTotalCountDomainRequest( - List artistGenders, - List artistTypes, - List genreIds, - List artistIds - ) { - return ArtistFilterTotalCountDomainRequest.builder() - .artistGenders(artistGenders) - .artistTypes(artistTypes) - .genreIds(genreIds) - .artistIds(artistIds) .build(); } From b38b414d84a6413147f9d1e896b9a824a22b76d2 Mon Sep 17 00:00:00 2001 From: GaBaljaintheroom Date: Sun, 22 Sep 2024 01:15:29 +0900 Subject: [PATCH 02/16] =?UTF-8?q?fix:=20=EA=B5=AC=EB=8F=85=ED=95=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EC=9D=80=20=EC=95=84=ED=8B=B0=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EB=AA=A9=EB=A1=9D=20=EB=B9=84=ED=9A=8C=EC=9B=90=20?= =?UTF-8?q?=EA=B0=80=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/org/example/util/ValidatorUser.java | 6 +++--- .../com/example/artist/controller/ArtistController.java | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/api/common-api/src/main/java/org/example/util/ValidatorUser.java b/app/api/common-api/src/main/java/org/example/util/ValidatorUser.java index 0a2c15da..244e81cb 100644 --- a/app/api/common-api/src/main/java/org/example/util/ValidatorUser.java +++ b/app/api/common-api/src/main/java/org/example/util/ValidatorUser.java @@ -5,12 +5,12 @@ public final class ValidatorUser { - public static UUID getUserId(AuthenticatedInfo user) { - if (user == null) { + public static UUID getUserId(AuthenticatedInfo info) { + if (info == null) { return null; } - return user.userId(); + return info.userId(); } } diff --git a/app/api/show-api/src/main/java/com/example/artist/controller/ArtistController.java b/app/api/show-api/src/main/java/com/example/artist/controller/ArtistController.java index d185cab7..62ef2fb1 100644 --- a/app/api/show-api/src/main/java/com/example/artist/controller/ArtistController.java +++ b/app/api/show-api/src/main/java/com/example/artist/controller/ArtistController.java @@ -45,8 +45,9 @@ public ResponseEntity Date: Sun, 22 Sep 2024 14:54:17 +0900 Subject: [PATCH 03/16] =?UTF-8?q?fix:=20=EC=95=84=ED=8B=B0=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EA=B5=AC=EB=8F=85=20API=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../request/ArtistSubscriptionApiRequest.java | 8 ++-- .../example/artist/service/ArtistService.java | 26 +++++------ .../ArtistSubscriptionServiceRequest.java | 2 +- .../artist/service/ArtistServiceTest.java | 18 ++++---- .../org/example/port/ArtistSearchPort.java | 5 +++ .../port/dto/param/ArtistSearchPortParam.java | 8 ++++ .../dto/request/FindArtistsPortRequest.java | 12 +++++ .../org/example/usecase/ArtistUseCase.java | 45 +++++++++++++++++++ .../org/example/fixture/ReflectionUtils.java | 27 +++++++++++ .../example/fixture/domain/ArtistFixture.java | 21 ++++++--- .../domain/ArtistSubscriptionFixture.java | 17 +++++-- .../fixture/port/ArtistSearchPortFixture.java | 10 +++++ .../spotify/adapter/ArtistSearchAdapter.java | 19 ++++++++ .../org/spotify/client/SpotifyClient.java | 22 +++++++++ .../request/FindArtistsSpotifyRequest.java | 22 +++++++++ .../dto/response/FindSpotifyResponse.java | 19 ++++++++ 16 files changed, 244 insertions(+), 37 deletions(-) create mode 100644 app/domain/show-domain/src/main/java/org/example/port/dto/request/FindArtistsPortRequest.java create mode 100644 app/domain/show-domain/src/testFixtures/java/org/example/fixture/ReflectionUtils.java create mode 100644 app/infrastructure/spotify/src/main/java/org/spotify/client/dto/request/FindArtistsSpotifyRequest.java create mode 100644 app/infrastructure/spotify/src/main/java/org/spotify/client/dto/response/FindSpotifyResponse.java diff --git a/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistSubscriptionApiRequest.java b/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistSubscriptionApiRequest.java index 9d93b831..d54c32da 100644 --- a/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistSubscriptionApiRequest.java +++ b/app/api/show-api/src/main/java/com/example/artist/controller/dto/request/ArtistSubscriptionApiRequest.java @@ -7,12 +7,12 @@ import java.util.UUID; public record ArtistSubscriptionApiRequest( - @Schema(description = "아티스트 ID 목록") - @NotEmpty(message = "아티스트 ID는 최소 하나 이상 입력해야합니다.") - List artistIds + @Schema(description = "spotify 아티스트 ID 목록") + @NotEmpty(message = "spotify 아티스트 ID는 최소 하나 이상 입력해야합니다.") + List spotifyArtistIds ) { public ArtistSubscriptionServiceRequest toServiceRequest(UUID userId) { - return new ArtistSubscriptionServiceRequest(artistIds, userId); + return new ArtistSubscriptionServiceRequest(spotifyArtistIds, userId); } } diff --git a/app/api/show-api/src/main/java/com/example/artist/service/ArtistService.java b/app/api/show-api/src/main/java/com/example/artist/service/ArtistService.java index 8ec6aea2..c4abbbcc 100644 --- a/app/api/show-api/src/main/java/com/example/artist/service/ArtistService.java +++ b/app/api/show-api/src/main/java/com/example/artist/service/ArtistService.java @@ -59,23 +59,23 @@ public PaginationServiceResponse searchArtis } public ArtistSubscriptionServiceResponse subscribe(ArtistSubscriptionServiceRequest request) { - // TODO : spotifyArtsit ID로 존재하는지 확인 - // - var existArtistsInRequest = artistUseCase.findAllArtistInIds(request.artistIds()); - var existArtistIdsInRequest = existArtistsInRequest.stream() + List requestArtist = artistUseCase.findOrCreateArtistBySpotifyId( + request.spotifyArtistIds() + ); + + List requestArtistIds = requestArtist.stream() .map(Artist::getId) .toList(); - var subscriptions = artistSubscriptionUseCase.subscribe( - existArtistIdsInRequest, - request.userId() - ); - var subscribedArtistIds = subscriptions.stream() + var subscribedArtistIds = artistSubscriptionUseCase + .subscribe(requestArtistIds, request.userId()).stream() .map(ArtistSubscription::getArtistId) .toList(); - var subscribedArtistMessage = artistUseCase.findAllArtistInIds(subscribedArtistIds) - .stream().map(ArtistServiceMessage::from) + var subscribedArtistMessage = requestArtist + .stream() + .filter(artist -> subscribedArtistIds.contains(artist.getId())) + .map(ArtistServiceMessage::from) .toList(); var userFcmToken = userUseCase.findUserFcmTokensByUserId(request.userId()); @@ -89,8 +89,8 @@ public ArtistSubscriptionServiceResponse subscribe(ArtistSubscriptionServiceRequ return ArtistSubscriptionServiceResponse.builder() .successSubscriptionArtistIds( - subscriptions.stream() - .map(ArtistSubscription::getArtistId) + subscribedArtistMessage.stream() + .map(ArtistServiceMessage::id) .toList() ).build(); } diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistSubscriptionServiceRequest.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistSubscriptionServiceRequest.java index 273ff7be..26c69b70 100644 --- a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistSubscriptionServiceRequest.java +++ b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistSubscriptionServiceRequest.java @@ -4,7 +4,7 @@ import java.util.UUID; public record ArtistSubscriptionServiceRequest( - List artistIds, + List spotifyArtistIds, UUID userId ) { diff --git a/app/api/show-api/src/test/java/artist/service/ArtistServiceTest.java b/app/api/show-api/src/test/java/artist/service/ArtistServiceTest.java index b32c0906..37455a39 100644 --- a/app/api/show-api/src/test/java/artist/service/ArtistServiceTest.java +++ b/app/api/show-api/src/test/java/artist/service/ArtistServiceTest.java @@ -165,12 +165,12 @@ void artistFilterEmptyResultWithPagination() { @DisplayName("아티스트를 구독하면 구독 성공한 아티스트 ID들을 반환한다.") void artistSubscribe() { //given - List artistsId = List.of(UUID.randomUUID(), UUID.randomUUID()); + List spotifyArtistsId = List.of("123", "456"); UUID userId = UUID.randomUUID(); - var request = new ArtistSubscriptionServiceRequest(artistsId, userId); - var existArtistsInRequest = ArtistFixture.manSoloArtists(3); + var request = new ArtistSubscriptionServiceRequest(spotifyArtistsId, userId); + var existArtistsInRequest = ArtistFixture.manSoloArtists(2); given( - artistUseCase.findAllArtistInIds(request.artistIds()) + artistUseCase.findOrCreateArtistBySpotifyId(request.spotifyArtistIds()) ).willReturn( existArtistsInRequest ); @@ -178,7 +178,7 @@ void artistSubscribe() { var existArtistIdsInRequest = existArtistsInRequest.stream() .map(Artist::getId) .toList(); - int artistSubscriptionCount = 2; + int artistSubscriptionCount = 3; given( artistSubscriptionUseCase.subscribe(existArtistIdsInRequest, userId) ).willReturn( @@ -193,7 +193,7 @@ void artistSubscribe() { soft -> { soft.assertThat(result).isNotNull(); soft.assertThat(result.successSubscriptionArtistIds().size()) - .isEqualTo(artistSubscriptionCount); + .isEqualTo(existArtistsInRequest.size()); } ); } @@ -202,12 +202,12 @@ void artistSubscribe() { @DisplayName("아티스트를 구독하면 구독 성공한 아티스트 ID들을 메시지 발행한다.") void artistSubscribePublishMessage() { //given - List artistsId = List.of(UUID.randomUUID(), UUID.randomUUID()); + List spotifyArtistsId = List.of("123", "456"); UUID userId = UUID.randomUUID(); - var request = new ArtistSubscriptionServiceRequest(artistsId, userId); + var request = new ArtistSubscriptionServiceRequest(spotifyArtistsId, userId); var existArtistsInRequest = ArtistFixture.manSoloArtists(3); given( - artistUseCase.findAllArtistInIds(request.artistIds()) + artistUseCase.findOrCreateArtistBySpotifyId(request.spotifyArtistIds()) ).willReturn( existArtistsInRequest ); diff --git a/app/domain/show-domain/src/main/java/org/example/port/ArtistSearchPort.java b/app/domain/show-domain/src/main/java/org/example/port/ArtistSearchPort.java index 00c94505..7aea24c0 100644 --- a/app/domain/show-domain/src/main/java/org/example/port/ArtistSearchPort.java +++ b/app/domain/show-domain/src/main/java/org/example/port/ArtistSearchPort.java @@ -1,6 +1,9 @@ package org.example.port; +import java.util.List; +import org.example.port.dto.param.ArtistSearchPortParam; import org.example.port.dto.request.ArtistSearchPortRequest; +import org.example.port.dto.request.FindArtistsPortRequest; import org.example.port.dto.response.ArtistSearchPortResponse; import org.example.vo.ArtistSearchAdapterType; import org.springframework.stereotype.Component; @@ -13,4 +16,6 @@ public interface ArtistSearchPort { String getAccessToken(); ArtistSearchPortResponse searchArtist(ArtistSearchPortRequest request); + + List findArtistsBySpotifyArtistId(FindArtistsPortRequest request); } diff --git a/app/domain/show-domain/src/main/java/org/example/port/dto/param/ArtistSearchPortParam.java b/app/domain/show-domain/src/main/java/org/example/port/dto/param/ArtistSearchPortParam.java index 75d62126..86349957 100644 --- a/app/domain/show-domain/src/main/java/org/example/port/dto/param/ArtistSearchPortParam.java +++ b/app/domain/show-domain/src/main/java/org/example/port/dto/param/ArtistSearchPortParam.java @@ -21,4 +21,12 @@ public ArtistSearchSimpleDomainResponse toDomainResponse(Artist artist) { .spotifyId(id) .build(); } + + public Artist toArtist() { + return Artist.builder() + .name(name) + .spotifyId(id) + .image(imageURL) + .build(); + } } diff --git a/app/domain/show-domain/src/main/java/org/example/port/dto/request/FindArtistsPortRequest.java b/app/domain/show-domain/src/main/java/org/example/port/dto/request/FindArtistsPortRequest.java new file mode 100644 index 00000000..3b7d8811 --- /dev/null +++ b/app/domain/show-domain/src/main/java/org/example/port/dto/request/FindArtistsPortRequest.java @@ -0,0 +1,12 @@ +package org.example.port.dto.request; + +import java.util.List; +import lombok.Builder; + +@Builder +public record FindArtistsPortRequest( + String accessToken, + List spotifyArtistIds +) { + +} diff --git a/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java b/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java index b95e123f..9c08be79 100644 --- a/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java +++ b/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java @@ -6,6 +6,7 @@ import java.util.UUID; import java.util.function.Function; import java.util.stream.Collectors; +import java.util.stream.Stream; import lombok.RequiredArgsConstructor; import org.example.dto.artist.request.ArtistPaginationDomainRequest; import org.example.dto.artist.request.ArtistSearchPaginationDomainRequest; @@ -17,7 +18,9 @@ import org.example.entity.artist.Artist; import org.example.entity.artist.ArtistGenre; import org.example.port.ArtistSearchPort; +import org.example.port.dto.param.ArtistSearchPortParam; import org.example.port.dto.request.ArtistSearchPortRequest; +import org.example.port.dto.request.FindArtistsPortRequest; import org.example.port.dto.response.ArtistSearchPortResponse; import org.example.repository.artist.ArtistRepository; import org.example.repository.artist.artistgenre.ArtistGenreRepository; @@ -59,6 +62,48 @@ public List findAllArtistInIds(List ids) { return artistRepository.findAllInIds(ids); } + public List findOrCreateArtistBySpotifyId(List spotifyIds) { + List existArtists = artistRepository.findArtistsBySpotifyIdIn(spotifyIds); + + List existSpotifyIds = existArtists.stream() + .map(Artist::getSpotifyId) + .toList(); + + List notExistSpotifyIds = spotifyIds.stream() + .filter(id -> !existSpotifyIds.contains(id)) + .toList(); + + if (notExistSpotifyIds.isEmpty()) { + return existArtists; + } + + List response = artistSearchPort.findArtistsBySpotifyArtistId( + FindArtistsPortRequest.builder() + .accessToken(artistSearchPort.getAccessToken()) + .spotifyArtistIds(notExistSpotifyIds) + .build() + ); + + return getArtists(existArtists, response); + } + + @Transactional + public List getArtists( + List existArtists, + List response + ) { + List newArtists = response.stream() + .map(artistParam -> { + Artist newArtist = artistParam.toArtist(); + artistRepository.save(newArtist); + + return newArtist; + }) + .toList(); + + return Stream.concat(existArtists.stream(), newArtists.stream()).toList(); + } + public ArtistPaginationDomainResponse findAllArtistInCursorPagination( ArtistPaginationDomainRequest request ) { diff --git a/app/domain/show-domain/src/testFixtures/java/org/example/fixture/ReflectionUtils.java b/app/domain/show-domain/src/testFixtures/java/org/example/fixture/ReflectionUtils.java new file mode 100644 index 00000000..bfdf07e8 --- /dev/null +++ b/app/domain/show-domain/src/testFixtures/java/org/example/fixture/ReflectionUtils.java @@ -0,0 +1,27 @@ +package org.example.fixture; + +import java.lang.reflect.Field; +import java.util.UUID; + +public class ReflectionUtils { + + public static void setSuperClassId(Object target, String filed, UUID id) { + try { + Field field = target.getClass().getSuperclass().getDeclaredField(filed); + field.setAccessible(true); + field.set(target, id); + } catch (NoSuchFieldException | IllegalAccessException e) { + throw new RuntimeException(e); + } + } + + public static void setId(Object target, String fieldName, UUID id) { + try { + Field field = target.getClass().getDeclaredField(fieldName); + field.setAccessible(true); + field.set(target, id); + } catch (NoSuchFieldException | IllegalAccessException e) { + throw new RuntimeException(e); + } + } +} diff --git a/app/domain/show-domain/src/testFixtures/java/org/example/fixture/domain/ArtistFixture.java b/app/domain/show-domain/src/testFixtures/java/org/example/fixture/domain/ArtistFixture.java index e39d8d31..5b87c64e 100644 --- a/app/domain/show-domain/src/testFixtures/java/org/example/fixture/domain/ArtistFixture.java +++ b/app/domain/show-domain/src/testFixtures/java/org/example/fixture/domain/ArtistFixture.java @@ -1,8 +1,10 @@ package org.example.fixture.domain; import java.util.List; +import java.util.UUID; import java.util.stream.IntStream; import org.example.entity.artist.Artist; +import org.example.fixture.ReflectionUtils; public class ArtistFixture { @@ -16,12 +18,19 @@ public static Artist womanGroup() { public static List manSoloArtists(int size) { return IntStream.range(0, size) - .mapToObj(i -> Artist.builder() - .name("testEnglishName" + i) - .image("testImage" + i) - .spotifyId("spotifyId" + i) - .build() - ) + .mapToObj(i -> { + Artist artist = Artist.builder() + .name("testEnglishName" + i) + .image("testImage" + i) + .spotifyId("spotifyId" + i) + .build(); + ReflectionUtils.setSuperClassId( + artist, + "id", + UUID.fromString("019217fe-2277-9fcf-26fd-90d22a5374d6") + ); + return artist; + }) .toList(); } } diff --git a/app/domain/show-domain/src/testFixtures/java/org/example/fixture/domain/ArtistSubscriptionFixture.java b/app/domain/show-domain/src/testFixtures/java/org/example/fixture/domain/ArtistSubscriptionFixture.java index 8db7f40d..aa8fd9b3 100644 --- a/app/domain/show-domain/src/testFixtures/java/org/example/fixture/domain/ArtistSubscriptionFixture.java +++ b/app/domain/show-domain/src/testFixtures/java/org/example/fixture/domain/ArtistSubscriptionFixture.java @@ -4,15 +4,24 @@ import java.util.UUID; import java.util.stream.IntStream; import org.example.entity.usershow.ArtistSubscription; +import org.example.fixture.ReflectionUtils; public class ArtistSubscriptionFixture { public static List artistSubscriptions(int count) { return IntStream.range(0, count) - .mapToObj(i -> ArtistSubscription.builder() - .artistId(UUID.randomUUID()) - .userId(UUID.randomUUID()) - .build()) + .mapToObj(i -> { + ArtistSubscription artistSubscription = ArtistSubscription.builder() + .artistId(UUID.randomUUID()) + .userId(UUID.randomUUID()) + .build(); + ReflectionUtils.setId( + artistSubscription, + "artistId", + UUID.fromString("019217fe-2277-9fcf-26fd-90d22a5374d6") + ); + return artistSubscription; + }) .toList(); } } diff --git a/app/domain/show-domain/src/testFixtures/java/org/example/fixture/port/ArtistSearchPortFixture.java b/app/domain/show-domain/src/testFixtures/java/org/example/fixture/port/ArtistSearchPortFixture.java index 3164114f..313d272b 100644 --- a/app/domain/show-domain/src/testFixtures/java/org/example/fixture/port/ArtistSearchPortFixture.java +++ b/app/domain/show-domain/src/testFixtures/java/org/example/fixture/port/ArtistSearchPortFixture.java @@ -1,7 +1,10 @@ package org.example.fixture.port; +import java.util.List; import org.example.port.ArtistSearchPort; +import org.example.port.dto.param.ArtistSearchPortParam; import org.example.port.dto.request.ArtistSearchPortRequest; +import org.example.port.dto.request.FindArtistsPortRequest; import org.example.port.dto.response.ArtistSearchPortResponse; import org.example.vo.ArtistSearchAdapterType; import org.springframework.stereotype.Component; @@ -23,4 +26,11 @@ public String getAccessToken() { public ArtistSearchPortResponse searchArtist(ArtistSearchPortRequest request) { return null; } + + @Override + public List findArtistsBySpotifyArtistId( + FindArtistsPortRequest request + ) { + return null; + } } diff --git a/app/infrastructure/spotify/src/main/java/org/spotify/adapter/ArtistSearchAdapter.java b/app/infrastructure/spotify/src/main/java/org/spotify/adapter/ArtistSearchAdapter.java index 98315add..1e92c90d 100644 --- a/app/infrastructure/spotify/src/main/java/org/spotify/adapter/ArtistSearchAdapter.java +++ b/app/infrastructure/spotify/src/main/java/org/spotify/adapter/ArtistSearchAdapter.java @@ -1,12 +1,17 @@ package org.spotify.adapter; +import java.util.List; import lombok.RequiredArgsConstructor; import org.example.port.ArtistSearchPort; +import org.example.port.dto.param.ArtistSearchPortParam; import org.example.port.dto.request.ArtistSearchPortRequest; +import org.example.port.dto.request.FindArtistsPortRequest; import org.example.port.dto.response.ArtistSearchPortResponse; import org.example.vo.ArtistSearchAdapterType; import org.spotify.client.SpotifyClient; import org.spotify.client.dto.request.ArtistSearchSpotifyRequest; +import org.spotify.client.dto.request.FindArtistsSpotifyRequest; +import org.spotify.client.dto.response.FindSpotifyResponse; import org.spotify.client.dto.response.SpotifySearchResponse; import org.springframework.stereotype.Component; @@ -39,4 +44,18 @@ public ArtistSearchPortResponse searchArtist(ArtistSearchPortRequest request) { return response.toPortResponse(); } + + @Override + public List findArtistsBySpotifyArtistId( + FindArtistsPortRequest request + ) { + FindSpotifyResponse response = spotifyClient.findArtistsBySpotifyArtistId( + FindArtistsSpotifyRequest.builder() + .accessToken(request.accessToken()) + .spotifyArtistIds(request.spotifyArtistIds()) + .build() + ); + + return response.toPortResponse(); + } } diff --git a/app/infrastructure/spotify/src/main/java/org/spotify/client/SpotifyClient.java b/app/infrastructure/spotify/src/main/java/org/spotify/client/SpotifyClient.java index 510eb1db..14363b78 100644 --- a/app/infrastructure/spotify/src/main/java/org/spotify/client/SpotifyClient.java +++ b/app/infrastructure/spotify/src/main/java/org/spotify/client/SpotifyClient.java @@ -6,6 +6,8 @@ import lombok.extern.slf4j.Slf4j; import org.spotify.client.dto.request.AccessTokenSpotifyRequest; import org.spotify.client.dto.request.ArtistSearchSpotifyRequest; +import org.spotify.client.dto.request.FindArtistsSpotifyRequest; +import org.spotify.client.dto.response.FindSpotifyResponse; import org.spotify.client.dto.response.SpotifyAccessTokenResponse; import org.spotify.client.dto.response.SpotifySearchResponse; import org.spotify.property.SpotifyProperty; @@ -65,4 +67,24 @@ public SpotifySearchResponse searchArtist(ArtistSearchSpotifyRequest request) { return result.getBody(); } + + public FindSpotifyResponse findArtistsBySpotifyArtistId(FindArtistsSpotifyRequest request) { + ResponseEntity result = RestClient.builder() + .defaultHeader("Authorization", "Bearer " + request.accessToken()) + .baseUrl(spotifyProperty.apiURL() + "/artists?" + request.toQueryParameter()) + .build() + .get() + .retrieve() + .toEntity(FindSpotifyResponse.class); + + if (result.getStatusCode() == HttpStatus.UNAUTHORIZED + || result.getStatusCode() == HttpStatus.FORBIDDEN + || result.getStatusCode() == HttpStatus.TOO_MANY_REQUESTS + ) { + log.error("Spotify API find artists failed: {}", result); + throw new RuntimeException("Spotify API request find artists failed"); + } + + return result.getBody(); + } } diff --git a/app/infrastructure/spotify/src/main/java/org/spotify/client/dto/request/FindArtistsSpotifyRequest.java b/app/infrastructure/spotify/src/main/java/org/spotify/client/dto/request/FindArtistsSpotifyRequest.java new file mode 100644 index 00000000..9ee349d3 --- /dev/null +++ b/app/infrastructure/spotify/src/main/java/org/spotify/client/dto/request/FindArtistsSpotifyRequest.java @@ -0,0 +1,22 @@ +package org.spotify.client.dto.request; + +import java.util.List; +import lombok.Builder; + +/** + * @param accessToken Spotify API 요청을 위한 토큰 + * @param spotifyArtistIds Spotify Artist Id들 + */ +@Builder +public record FindArtistsSpotifyRequest( + String accessToken, + List spotifyArtistIds +) { + + public String toQueryParameter() { + return String.format( + "ids=%s", + String.join(",", spotifyArtistIds) + ); + } +} diff --git a/app/infrastructure/spotify/src/main/java/org/spotify/client/dto/response/FindSpotifyResponse.java b/app/infrastructure/spotify/src/main/java/org/spotify/client/dto/response/FindSpotifyResponse.java new file mode 100644 index 00000000..9f276417 --- /dev/null +++ b/app/infrastructure/spotify/src/main/java/org/spotify/client/dto/response/FindSpotifyResponse.java @@ -0,0 +1,19 @@ +package org.spotify.client.dto.response; + +import java.util.List; +import org.example.port.dto.param.ArtistSearchPortParam; + +public record FindSpotifyResponse( + List artists +) { + + public List toPortResponse() { + if (artists == null) { + return List.of(); + } + + return artists.stream() + .map(SpotifyArtistItemSearchResponse::toPortParam) + .toList(); + } +} From 3757d63736606f3c257183bd07e937fcc589b175 Mon Sep 17 00:00:00 2001 From: GaBaljaintheroom Date: Sun, 22 Sep 2024 22:22:02 +0900 Subject: [PATCH 04/16] =?UTF-8?q?fix:=20=EC=95=84=ED=8B=B0=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=96=B4=EB=93=9C=EB=AF=BC=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EB=B7=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/artist_create_form.html | 64 ------------------- .../main/resources/templates/artist_form.html | 59 ----------------- .../resources/templates/artist_list_form.html | 48 +------------- .../src/main/resources/templates/home.html | 9 --- .../artist/ArtistQuerydslRepositoryImpl.java | 15 ++--- 5 files changed, 7 insertions(+), 188 deletions(-) delete mode 100644 app/api/user-api/src/main/resources/templates/artist_create_form.html delete mode 100644 app/api/user-api/src/main/resources/templates/artist_form.html diff --git a/app/api/user-api/src/main/resources/templates/artist_create_form.html b/app/api/user-api/src/main/resources/templates/artist_create_form.html deleted file mode 100644 index 62abe5ef..00000000 --- a/app/api/user-api/src/main/resources/templates/artist_create_form.html +++ /dev/null @@ -1,64 +0,0 @@ - -
-
-
-
-
-
-

추가할 아티스트

- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -
-
-
- - -
-
-
-
-
- -
-
-
-
-
-
- diff --git a/app/api/user-api/src/main/resources/templates/artist_form.html b/app/api/user-api/src/main/resources/templates/artist_form.html deleted file mode 100644 index 0865b88a..00000000 --- a/app/api/user-api/src/main/resources/templates/artist_form.html +++ /dev/null @@ -1,59 +0,0 @@ - -
-
-

아티스트 수정

-
- -
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -
-
-
- - -
-
-
-
-
- -
-
-
-
- diff --git a/app/api/user-api/src/main/resources/templates/artist_list_form.html b/app/api/user-api/src/main/resources/templates/artist_list_form.html index c07b79c3..748e34ef 100644 --- a/app/api/user-api/src/main/resources/templates/artist_list_form.html +++ b/app/api/user-api/src/main/resources/templates/artist_list_form.html @@ -5,51 +5,23 @@

아티스트 목록

- - + - - - - - + - - - -
아티스트 한국 이름아티스트 영어 이름아티스트 이름 아티스트 이미지국적성별타입 장르
아티스트 이미지 -
- - - -
-
-
- - -
-
-
- -
-
- - -
-
@@ -57,21 +29,5 @@

아티스트 목록

diff --git a/app/api/user-api/src/main/resources/templates/home.html b/app/api/user-api/src/main/resources/templates/home.html index 0a066cd9..3bc73f42 100644 --- a/app/api/user-api/src/main/resources/templates/home.html +++ b/app/api/user-api/src/main/resources/templates/home.html @@ -21,15 +21,6 @@
공연 조회
-
-
-
-
아티스트 추가
-

새로운 아티스트를 추가합니다.

- 추가하기 -
-
-
diff --git a/app/domain/show-domain/src/main/java/org/example/repository/artist/ArtistQuerydslRepositoryImpl.java b/app/domain/show-domain/src/main/java/org/example/repository/artist/ArtistQuerydslRepositoryImpl.java index bfd0154e..83a111be 100644 --- a/app/domain/show-domain/src/main/java/org/example/repository/artist/ArtistQuerydslRepositoryImpl.java +++ b/app/domain/show-domain/src/main/java/org/example/repository/artist/ArtistQuerydslRepositoryImpl.java @@ -10,7 +10,6 @@ import com.querydsl.core.types.Predicate; import com.querydsl.core.types.Projections; import com.querydsl.core.types.dsl.BooleanExpression; -import com.querydsl.jpa.impl.JPAQuery; import com.querydsl.jpa.impl.JPAQueryFactory; import java.util.Collection; import java.util.List; @@ -36,7 +35,11 @@ public class ArtistQuerydslRepositoryImpl implements ArtistQuerydslRepository { @Override public List findAllWithGenreNames() { - return createArtistJoinArtistGenreAndGenreQuery() + return jpaQueryFactory + .selectFrom(artist) + .join(artistGenre).on(isArtistGenreEqualArtistIdAndIsDeletedFalse()) + .join(genre).on(isArtistGenreEqualGenreIdAndIsDeletedFalse()) + .where(artist.isDeleted.isFalse()) .transform( groupBy(artist.id).list( Projections.constructor( @@ -106,14 +109,6 @@ public ArtistPaginationDomainResponse findAllWithCursorPagination( .build(); } - private JPAQuery createArtistJoinArtistGenreAndGenreQuery() { - return jpaQueryFactory - .selectFrom(artist) - .join(artistGenre).on(isArtistGenreEqualArtistIdAndIsDeletedFalse()) - .join(genre).on(isArtistGenreEqualGenreIdAndIsDeletedFalse()) - .where(artist.isDeleted.isFalse()); - } - private BooleanExpression isArtistGenreEqualArtistIdAndIsDeletedFalse() { return artistGenre.artistId.eq(artist.id).and(artistGenre.isDeleted.isFalse()); } From b0e3e4a23354a094e527a31d4bf7bac2192b10df Mon Sep 17 00:00:00 2001 From: GaBaljaintheroom Date: Sun, 22 Sep 2024 23:11:00 +0900 Subject: [PATCH 05/16] =?UTF-8?q?feat:=20=EC=95=84=ED=8B=B0=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=83=9D=EC=84=B1=20publish?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/example/port/ArtistCreatePort.java | 9 +++++ .../port/dto/param/ArtistSearchPortParam.java | 12 +++++++ .../dto/request/ArtistCreatePortRequest.java | 23 ++++++++++++ .../dto/request/ArtistDomainPortRequest.java | 16 +++++++++ .../org/example/usecase/ArtistUseCase.java | 35 ++++++------------- app/infrastructure/message-queue/build.gradle | 1 + .../example/adapter/ArtistCreateAdapter.java | 26 ++++++++++++++ .../request/ArtistCreateInfraRequest.java | 16 +++++++++ .../request/ArtistDomainInfraRequest.java | 28 +++++++++++++++ .../org/spotify/client/SpotifyClient.java | 8 ++--- 10 files changed, 145 insertions(+), 29 deletions(-) create mode 100644 app/domain/show-domain/src/main/java/org/example/port/ArtistCreatePort.java create mode 100644 app/domain/show-domain/src/main/java/org/example/port/dto/request/ArtistCreatePortRequest.java create mode 100644 app/domain/show-domain/src/main/java/org/example/port/dto/request/ArtistDomainPortRequest.java create mode 100644 app/infrastructure/message-queue/src/main/java/org/example/adapter/ArtistCreateAdapter.java create mode 100644 app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistCreateInfraRequest.java create mode 100644 app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistDomainInfraRequest.java diff --git a/app/domain/show-domain/src/main/java/org/example/port/ArtistCreatePort.java b/app/domain/show-domain/src/main/java/org/example/port/ArtistCreatePort.java new file mode 100644 index 00000000..b6e7f820 --- /dev/null +++ b/app/domain/show-domain/src/main/java/org/example/port/ArtistCreatePort.java @@ -0,0 +1,9 @@ +package org.example.port; + +import org.example.port.dto.request.ArtistCreatePortRequest; + +public interface ArtistCreatePort { + + void createArtist(String topic, ArtistCreatePortRequest request); + +} diff --git a/app/domain/show-domain/src/main/java/org/example/port/dto/param/ArtistSearchPortParam.java b/app/domain/show-domain/src/main/java/org/example/port/dto/param/ArtistSearchPortParam.java index 86349957..f0c2e29a 100644 --- a/app/domain/show-domain/src/main/java/org/example/port/dto/param/ArtistSearchPortParam.java +++ b/app/domain/show-domain/src/main/java/org/example/port/dto/param/ArtistSearchPortParam.java @@ -1,9 +1,11 @@ package org.example.port.dto.param; import java.util.List; +import java.util.UUID; import lombok.Builder; import org.example.dto.artist.response.ArtistSearchSimpleDomainResponse; import org.example.entity.artist.Artist; +import org.example.port.dto.request.ArtistDomainPortRequest; @Builder public record ArtistSearchPortParam( @@ -29,4 +31,14 @@ public Artist toArtist() { .image(imageURL) .build(); } + + public ArtistDomainPortRequest toDomainRequest(UUID artistId) { + return ArtistDomainPortRequest.builder() + .id(artistId) + .name(name) + .image(imageURL) + .genres(genres) + .spotifyId(id) + .build(); + } } diff --git a/app/domain/show-domain/src/main/java/org/example/port/dto/request/ArtistCreatePortRequest.java b/app/domain/show-domain/src/main/java/org/example/port/dto/request/ArtistCreatePortRequest.java new file mode 100644 index 00000000..c5ddf4b6 --- /dev/null +++ b/app/domain/show-domain/src/main/java/org/example/port/dto/request/ArtistCreatePortRequest.java @@ -0,0 +1,23 @@ +package org.example.port.dto.request; + +import java.util.List; +import java.util.stream.IntStream; +import org.example.entity.artist.Artist; +import org.example.port.dto.param.ArtistSearchPortParam; + +public record ArtistCreatePortRequest( + List artists +) { + + public static ArtistCreatePortRequest from( + List params, + List newArtists + ) { + return new ArtistCreatePortRequest( + IntStream.range(0, params.size()) + .mapToObj(i -> params.get(i).toDomainRequest(newArtists.get(i).getId())) + .toList() + ); + } + +} diff --git a/app/domain/show-domain/src/main/java/org/example/port/dto/request/ArtistDomainPortRequest.java b/app/domain/show-domain/src/main/java/org/example/port/dto/request/ArtistDomainPortRequest.java new file mode 100644 index 00000000..2af526a5 --- /dev/null +++ b/app/domain/show-domain/src/main/java/org/example/port/dto/request/ArtistDomainPortRequest.java @@ -0,0 +1,16 @@ +package org.example.port.dto.request; + +import java.util.List; +import java.util.UUID; +import lombok.Builder; + +@Builder +public record ArtistDomainPortRequest( + UUID id, + String name, + String image, + String spotifyId, + List genres +) { + +} diff --git a/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java b/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java index 9c08be79..0492f46f 100644 --- a/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java +++ b/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java @@ -2,7 +2,6 @@ import java.util.List; import java.util.Map; -import java.util.NoSuchElementException; import java.util.UUID; import java.util.function.Function; import java.util.stream.Collectors; @@ -17,8 +16,10 @@ import org.example.dto.artist.response.ArtistSearchPaginationDomainResponse; import org.example.entity.artist.Artist; import org.example.entity.artist.ArtistGenre; +import org.example.port.ArtistCreatePort; import org.example.port.ArtistSearchPort; import org.example.port.dto.param.ArtistSearchPortParam; +import org.example.port.dto.request.ArtistCreatePortRequest; import org.example.port.dto.request.ArtistSearchPortRequest; import org.example.port.dto.request.FindArtistsPortRequest; import org.example.port.dto.response.ArtistSearchPortResponse; @@ -36,6 +37,8 @@ public class ArtistUseCase { private final ArtistGenreRepository artistGenreRepository; private final ShowArtistRepository showArtistRepository; private final ArtistSearchPort artistSearchPort; + private final ArtistCreatePort artistCreatePort; + @Transactional public void save(Artist artist, List genreIds) { @@ -53,15 +56,10 @@ public List findAllArtistKoreanName() { return artistRepository.findAllArtistKoreanName(); } - public List findArtistKoreanNamesWithShowId() { return showArtistRepository.findArtistKoreanNamesWithShowId(); } - public List findAllArtistInIds(List ids) { - return artistRepository.findAllInIds(ids); - } - public List findOrCreateArtistBySpotifyId(List spotifyIds) { List existArtists = artistRepository.findArtistsBySpotifyIdIn(spotifyIds); @@ -84,23 +82,15 @@ public List findOrCreateArtistBySpotifyId(List spotifyIds) { .build() ); - return getArtists(existArtists, response); - } - - @Transactional - public List getArtists( - List existArtists, - List response - ) { List newArtists = response.stream() - .map(artistParam -> { - Artist newArtist = artistParam.toArtist(); - artistRepository.save(newArtist); - - return newArtist; - }) + .map(ArtistSearchPortParam::toArtist) .toList(); + artistCreatePort.createArtist( + "createArtist", + ArtistCreatePortRequest.from(response, newArtists) + ); + return Stream.concat(existArtists.stream(), newArtists.stream()).toList(); } @@ -143,11 +133,6 @@ public ArtistSearchPaginationDomainResponse searchArtist( .build(); } - private Artist findArtistById(UUID id) { - return artistRepository.findById(id) - .orElseThrow(NoSuchElementException::new); - } - private Map getArtistBySpotifyId(List spotifyIds) { return artistRepository.findArtistsBySpotifyIdIn(spotifyIds) .stream() diff --git a/app/infrastructure/message-queue/build.gradle b/app/infrastructure/message-queue/build.gradle index 47d93e97..b46248a0 100644 --- a/app/infrastructure/message-queue/build.gradle +++ b/app/infrastructure/message-queue/build.gradle @@ -1,5 +1,6 @@ dependencies { implementation project(":app:api:show-api") + implementation project(":app:domain:show-domain") //redis pub & sub implementation project(":app:infrastructure:redis") diff --git a/app/infrastructure/message-queue/src/main/java/org/example/adapter/ArtistCreateAdapter.java b/app/infrastructure/message-queue/src/main/java/org/example/adapter/ArtistCreateAdapter.java new file mode 100644 index 00000000..96d955dd --- /dev/null +++ b/app/infrastructure/message-queue/src/main/java/org/example/adapter/ArtistCreateAdapter.java @@ -0,0 +1,26 @@ +package org.example.adapter; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.example.adapter.request.ArtistCreateInfraRequest; +import org.example.port.ArtistCreatePort; +import org.example.port.dto.request.ArtistCreatePortRequest; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Component; + +@Slf4j +@Component +@RequiredArgsConstructor +public class ArtistCreateAdapter implements ArtistCreatePort { + + private final RedisTemplate template; + + @Override + public void createArtist(String topic, ArtistCreatePortRequest request) { + var infraMessage = ArtistCreateInfraRequest.from(request); + + template.convertAndSend(topic, infraMessage); + log.info("Message published successfully to topic: {}", topic); + log.info("Message Contents ( ArtistCreateInfraRequest : {})", infraMessage); + } +} diff --git a/app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistCreateInfraRequest.java b/app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistCreateInfraRequest.java new file mode 100644 index 00000000..c673726c --- /dev/null +++ b/app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistCreateInfraRequest.java @@ -0,0 +1,16 @@ +package org.example.adapter.request; + +import java.util.List; +import org.example.port.dto.request.ArtistCreatePortRequest; + +public record ArtistCreateInfraRequest( + List request +) { + + public static ArtistCreateInfraRequest from(ArtistCreatePortRequest request) { + return new ArtistCreateInfraRequest( + request.artists().stream().map(ArtistDomainInfraRequest::from).toList() + ); + } + +} diff --git a/app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistDomainInfraRequest.java b/app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistDomainInfraRequest.java new file mode 100644 index 00000000..b59d9bf5 --- /dev/null +++ b/app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistDomainInfraRequest.java @@ -0,0 +1,28 @@ +package org.example.adapter.request; + +import java.util.List; +import java.util.UUID; +import lombok.Builder; +import org.example.port.dto.request.ArtistDomainPortRequest; + +@Builder +public record ArtistDomainInfraRequest( + + UUID id, + String name, + String image, + String spotifyId, + List genres +) { + + public static ArtistDomainInfraRequest from(ArtistDomainPortRequest request) { + return ArtistDomainInfraRequest.builder() + .id(request.id()) + .name(request.name()) + .image(request.image()) + .spotifyId(request.spotifyId()) + .genres(request.genres()) + .build(); + } + +} diff --git a/app/infrastructure/spotify/src/main/java/org/spotify/client/SpotifyClient.java b/app/infrastructure/spotify/src/main/java/org/spotify/client/SpotifyClient.java index 14363b78..89367750 100644 --- a/app/infrastructure/spotify/src/main/java/org/spotify/client/SpotifyClient.java +++ b/app/infrastructure/spotify/src/main/java/org/spotify/client/SpotifyClient.java @@ -41,8 +41,8 @@ public String requestAccessToken() { if (result.getBody() == null || !result.getStatusCode().is2xxSuccessful() ) { - log.error("Spotify API request access token failed: {}", result); - throw new RuntimeException("Spotify API request access token failed"); + log.error("Spotify API artist access token failed: {}", result); + throw new RuntimeException("Spotify API artist access token failed"); } return result.getBody().accessToken(); @@ -62,7 +62,7 @@ public SpotifySearchResponse searchArtist(ArtistSearchSpotifyRequest request) { || result.getStatusCode() == HttpStatus.TOO_MANY_REQUESTS ) { log.error("Spotify API search artist failed: {}", result); - throw new RuntimeException("Spotify API request search artist failed"); + throw new RuntimeException("Spotify API artist search artist failed"); } return result.getBody(); @@ -82,7 +82,7 @@ public FindSpotifyResponse findArtistsBySpotifyArtistId(FindArtistsSpotifyReques || result.getStatusCode() == HttpStatus.TOO_MANY_REQUESTS ) { log.error("Spotify API find artists failed: {}", result); - throw new RuntimeException("Spotify API request find artists failed"); + throw new RuntimeException("Spotify API artist find artists failed"); } return result.getBody(); From 9d32b276018091f3d4cc3a242f9938fbd2a3d789 Mon Sep 17 00:00:00 2001 From: GaBaljaintheroom Date: Tue, 24 Sep 2024 22:44:48 +0900 Subject: [PATCH 06/16] =?UTF-8?q?feat:=20=EC=95=84=ED=8B=B0=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=83=9D=EC=84=B1=20Pub/Sub=20=EA=B5=AC=EC=A1=B0?= =?UTF-8?q?=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/error/RedisSubErrorHandler.java | 15 +++++++ app/api/show-api/build.gradle | 4 ++ .../artist/service/ArtistAdminService.java | 5 +++ .../example/artist/service/ArtistService.java | 6 +-- .../request/ArtistCreateServiceRequest.java | 9 +++++ .../request/ArtistDomainServiceRequest.java | 16 ++++++++ .../sub/config/SubscriptionMessageConfig.java | 40 +++++++++++++++++++ .../SubscriptionMessageConverter.java | 30 ++++++++++++++ .../sub/listener/ArtistCreateListener.java | 23 +++++++++++ .../message/ArtistCreateMessageRequest.java | 16 ++++++++ .../message/ArtistDomainMessageRequest.java | 26 ++++++++++++ .../com/example/config/ShowApiConfig.java | 3 +- .../example/genre/service/GenreService.java | 6 +-- .../{publish => pub}/MessagePublisher.java | 10 ++--- .../message/ArtistServiceMessage.java | 2 +- .../ArtistSubscriptionServiceMessage.java | 2 +- .../message/GenreServiceMessage.java | 2 +- .../GenreSubscriptionServiceMessage.java | 2 +- ...wRelationArtistAndGenreServiceMessage.java | 2 +- ...icketingAlertsToReserveServiceMessage.java | 2 +- .../message/TicketingTimeServiceMessage.java | 2 +- .../show/service/ShowAdminService.java | 4 +- .../example/show/service/UserShowService.java | 4 +- .../artist/service/ArtistServiceTest.java | 4 +- .../java/genre/service/GenreServiceTest.java | 4 +- .../show/service/ShowAdminServiceTest.java | 4 +- .../example/message/ArtistInfraMessage.java | 2 +- .../ArtistSubscriptionInfraMessage.java | 2 +- .../example/message/GenreInfraMessage.java | 2 +- .../GenreSubscriptionInfraMessage.java | 2 +- ...howRelationArtistAndGenreInfraMessage.java | 2 +- .../TicketingReservationInfraMessage.java | 2 +- .../message/TicketingTimeInfraMessage.java | 2 +- .../publish/RedisMessagePublisher.java | 10 ++--- 34 files changed, 226 insertions(+), 41 deletions(-) create mode 100644 app/api/common-api/src/main/java/org/example/error/RedisSubErrorHandler.java create mode 100644 app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistCreateServiceRequest.java create mode 100644 app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistDomainServiceRequest.java create mode 100644 app/api/show-api/src/main/java/com/example/artist/sub/config/SubscriptionMessageConfig.java create mode 100644 app/api/show-api/src/main/java/com/example/artist/sub/converter/SubscriptionMessageConverter.java create mode 100644 app/api/show-api/src/main/java/com/example/artist/sub/listener/ArtistCreateListener.java create mode 100644 app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistCreateMessageRequest.java create mode 100644 app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistDomainMessageRequest.java rename app/api/show-api/src/main/java/com/example/{publish => pub}/MessagePublisher.java (56%) rename app/api/show-api/src/main/java/com/example/{publish => pub}/message/ArtistServiceMessage.java (94%) rename app/api/show-api/src/main/java/com/example/{publish => pub}/message/ArtistSubscriptionServiceMessage.java (92%) rename app/api/show-api/src/main/java/com/example/{publish => pub}/message/GenreServiceMessage.java (94%) rename app/api/show-api/src/main/java/com/example/{publish => pub}/message/GenreSubscriptionServiceMessage.java (92%) rename app/api/show-api/src/main/java/com/example/{publish => pub}/message/ShowRelationArtistAndGenreServiceMessage.java (92%) rename app/api/show-api/src/main/java/com/example/{publish => pub}/message/TicketingAlertsToReserveServiceMessage.java (96%) rename app/api/show-api/src/main/java/com/example/{publish => pub}/message/TicketingTimeServiceMessage.java (94%) diff --git a/app/api/common-api/src/main/java/org/example/error/RedisSubErrorHandler.java b/app/api/common-api/src/main/java/org/example/error/RedisSubErrorHandler.java new file mode 100644 index 00000000..24fbee2f --- /dev/null +++ b/app/api/common-api/src/main/java/org/example/error/RedisSubErrorHandler.java @@ -0,0 +1,15 @@ +package org.example.error; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; +import org.springframework.util.ErrorHandler; + +@Component +@Slf4j +public class RedisSubErrorHandler implements ErrorHandler { + + @Override + public void handleError(Throwable t) { + log.error("Redis Sub error occurred - message : {}, cause : {} ", t.getMessage(), t.getCause()); + } +} diff --git a/app/api/show-api/build.gradle b/app/api/show-api/build.gradle index 658a2730..912be964 100644 --- a/app/api/show-api/build.gradle +++ b/app/api/show-api/build.gradle @@ -3,6 +3,10 @@ dependencies { implementation project(":app:domain:user-domain") implementation project(':app:api:common-api') + //redis sub + implementation 'org.springframework.data:spring-data-redis' + implementation 'io.lettuce:lettuce-core:6.3.0.RELEASE' + //testFixtures testImplementation(testFixtures(project(":app:domain:show-domain"))) testImplementation(testFixtures(project(":app:domain:user-domain"))) diff --git a/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java b/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java index da025654..b4739ab7 100644 --- a/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java +++ b/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java @@ -1,5 +1,6 @@ package com.example.artist.service; +import com.example.artist.service.dto.request.ArtistCreateServiceRequest; import com.example.artist.service.dto.response.ArtistDetailServiceResponse; import com.example.artist.service.dto.response.ArtistNameServiceResponse; import java.util.List; @@ -24,4 +25,8 @@ public List findAllWithGenreNames() { .map(ArtistDetailServiceResponse::new) .toList(); } + + public void saveArtist(ArtistCreateServiceRequest request) { + + } } diff --git a/app/api/show-api/src/main/java/com/example/artist/service/ArtistService.java b/app/api/show-api/src/main/java/com/example/artist/service/ArtistService.java index c4abbbcc..99306d5a 100644 --- a/app/api/show-api/src/main/java/com/example/artist/service/ArtistService.java +++ b/app/api/show-api/src/main/java/com/example/artist/service/ArtistService.java @@ -11,9 +11,9 @@ import com.example.artist.service.dto.response.ArtistSubscriptionServiceResponse; import com.example.artist.service.dto.response.ArtistUnsubscriptionServiceResponse; import com.example.artist.service.dto.response.NumberOfSubscribedArtistServiceResponse; -import com.example.publish.MessagePublisher; -import com.example.publish.message.ArtistServiceMessage; -import com.example.publish.message.ArtistSubscriptionServiceMessage; +import com.example.pub.MessagePublisher; +import com.example.pub.message.ArtistServiceMessage; +import com.example.pub.message.ArtistSubscriptionServiceMessage; import java.util.List; import java.util.UUID; import lombok.RequiredArgsConstructor; diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistCreateServiceRequest.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistCreateServiceRequest.java new file mode 100644 index 00000000..2d775dd6 --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistCreateServiceRequest.java @@ -0,0 +1,9 @@ +package com.example.artist.service.dto.request; + +import java.util.List; + +public record ArtistCreateServiceRequest( + List artists +) { + +} diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistDomainServiceRequest.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistDomainServiceRequest.java new file mode 100644 index 00000000..83ae6adc --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistDomainServiceRequest.java @@ -0,0 +1,16 @@ +package com.example.artist.service.dto.request; + +import java.util.List; +import java.util.UUID; +import lombok.Builder; + +@Builder +public record ArtistDomainServiceRequest( + UUID id, + String name, + String image, + String spotifyId, + List genres +) { + +} diff --git a/app/api/show-api/src/main/java/com/example/artist/sub/config/SubscriptionMessageConfig.java b/app/api/show-api/src/main/java/com/example/artist/sub/config/SubscriptionMessageConfig.java new file mode 100644 index 00000000..f18125ba --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/artist/sub/config/SubscriptionMessageConfig.java @@ -0,0 +1,40 @@ +package com.example.artist.sub.config; + +import lombok.RequiredArgsConstructor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.MessageListener; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.listener.ChannelTopic; +import org.springframework.data.redis.listener.RedisMessageListenerContainer; +import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; +import org.springframework.util.ErrorHandler; + +@Configuration +@RequiredArgsConstructor +public class SubscriptionMessageConfig { + + private final MessageListener artistCreateListener; + private final ErrorHandler redisSubErrorHandler; + + @Bean + MessageListenerAdapter artistCreateListenerAdapter() { + return new MessageListenerAdapter(artistCreateListener); + } + + @Bean + RedisMessageListenerContainer registerShowMessageListenerContainer( + RedisConnectionFactory connectionFactory, + MessageListenerAdapter artistCreateListenerAdapter + ) { + + RedisMessageListenerContainer container = new RedisMessageListenerContainer(); + container.setConnectionFactory(connectionFactory); + container.addMessageListener( + artistCreateListenerAdapter, + ChannelTopic.of("createArtist") + ); + container.setErrorHandler(redisSubErrorHandler); + return container; + } +} diff --git a/app/api/show-api/src/main/java/com/example/artist/sub/converter/SubscriptionMessageConverter.java b/app/api/show-api/src/main/java/com/example/artist/sub/converter/SubscriptionMessageConverter.java new file mode 100644 index 00000000..b8297cfc --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/artist/sub/converter/SubscriptionMessageConverter.java @@ -0,0 +1,30 @@ +package com.example.artist.sub.converter; + +import com.example.artist.sub.message.ArtistCreateMessageRequest; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import lombok.extern.slf4j.Slf4j; +import org.springframework.data.redis.connection.Message; + +@Slf4j +public class SubscriptionMessageConverter { + + private static final ObjectMapper objectMapper = new ObjectMapper(); + + public static ArtistCreateMessageRequest toArtistCreateMessage(Message message) { + try { + var convertedMessage = objectMapper.readValue( + message.getBody(), + ArtistCreateMessageRequest.class + ); + log.info("Message published successfully to topic: {}", + new String(message.getChannel())); + log.info("Subscribe Message Contents ( ArtistCreateServiceRequest : {} )", message); + + return convertedMessage; + } catch (IOException e) { + log.error("Failed to convert message to ArtistCreateServiceRequest", e); + throw new IllegalArgumentException("메시지를 받지 못했습니다."); + } + } +} diff --git a/app/api/show-api/src/main/java/com/example/artist/sub/listener/ArtistCreateListener.java b/app/api/show-api/src/main/java/com/example/artist/sub/listener/ArtistCreateListener.java new file mode 100644 index 00000000..a3629863 --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/artist/sub/listener/ArtistCreateListener.java @@ -0,0 +1,23 @@ +package com.example.artist.sub.listener; + +import com.example.artist.service.ArtistAdminService; +import com.example.artist.sub.converter.SubscriptionMessageConverter; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.data.redis.connection.Message; +import org.springframework.data.redis.connection.MessageListener; +import org.springframework.stereotype.Controller; + +@Controller +@RequiredArgsConstructor +@Qualifier(value = "artistCreateListener") +public class ArtistCreateListener implements MessageListener { + + private final ArtistAdminService artistAdminService; + + @Override + public void onMessage(Message message, byte[] pattern) { + var request = SubscriptionMessageConverter.toArtistCreateMessage(message); + artistAdminService.saveArtist(request.toServiceRequest()); + } +} diff --git a/app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistCreateMessageRequest.java b/app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistCreateMessageRequest.java new file mode 100644 index 00000000..1d2933d9 --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistCreateMessageRequest.java @@ -0,0 +1,16 @@ +package com.example.artist.sub.message; + +import com.example.artist.service.dto.request.ArtistCreateServiceRequest; +import java.util.List; + +public record ArtistCreateMessageRequest( + List request +) { + + public ArtistCreateServiceRequest toServiceRequest() { + return new ArtistCreateServiceRequest( + request.stream().map(ArtistDomainMessageRequest::toServiceRequest).toList() + ); + } + +} diff --git a/app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistDomainMessageRequest.java b/app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistDomainMessageRequest.java new file mode 100644 index 00000000..0a154384 --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistDomainMessageRequest.java @@ -0,0 +1,26 @@ +package com.example.artist.sub.message; + +import com.example.artist.service.dto.request.ArtistDomainServiceRequest; +import java.util.List; +import java.util.UUID; +import lombok.Builder; + +@Builder +public record ArtistDomainMessageRequest( + UUID id, + String name, + String image, + String spotifyId, + List genres +) { + public ArtistDomainServiceRequest toServiceRequest() { + return ArtistDomainServiceRequest.builder() + .id(id) + .name(name) + .image(image) + .spotifyId(spotifyId) + .genres(genres) + .build(); + } + +} diff --git a/app/api/show-api/src/main/java/com/example/config/ShowApiConfig.java b/app/api/show-api/src/main/java/com/example/config/ShowApiConfig.java index 4b694d0d..b8c2ff32 100644 --- a/app/api/show-api/src/main/java/com/example/config/ShowApiConfig.java +++ b/app/api/show-api/src/main/java/com/example/config/ShowApiConfig.java @@ -1,5 +1,6 @@ package com.example.config; +import com.example.artist.sub.config.SubscriptionMessageConfig; import org.example.config.ShowDomainConfig; import org.example.config.UserDomainConfig; import org.springframework.context.annotation.ComponentScan; @@ -7,7 +8,7 @@ import org.springframework.context.annotation.Import; @Configuration -@Import({ShowDomainConfig.class, UserDomainConfig.class}) +@Import({ShowDomainConfig.class, UserDomainConfig.class, SubscriptionMessageConfig.class}) @ComponentScan(basePackages = "com.example") public class ShowApiConfig { diff --git a/app/api/show-api/src/main/java/com/example/genre/service/GenreService.java b/app/api/show-api/src/main/java/com/example/genre/service/GenreService.java index 8b8eadee..5d01ec11 100644 --- a/app/api/show-api/src/main/java/com/example/genre/service/GenreService.java +++ b/app/api/show-api/src/main/java/com/example/genre/service/GenreService.java @@ -11,9 +11,9 @@ import com.example.genre.service.dto.response.GenreSubscriptionServiceResponse; import com.example.genre.service.dto.response.GenreUnsubscriptionServiceResponse; import com.example.genre.service.dto.response.NumberOfSubscribedGenreServiceResponse; -import com.example.publish.MessagePublisher; -import com.example.publish.message.GenreServiceMessage; -import com.example.publish.message.GenreSubscriptionServiceMessage; +import com.example.pub.MessagePublisher; +import com.example.pub.message.GenreServiceMessage; +import com.example.pub.message.GenreSubscriptionServiceMessage; import java.util.List; import java.util.UUID; import lombok.RequiredArgsConstructor; diff --git a/app/api/show-api/src/main/java/com/example/publish/MessagePublisher.java b/app/api/show-api/src/main/java/com/example/pub/MessagePublisher.java similarity index 56% rename from app/api/show-api/src/main/java/com/example/publish/MessagePublisher.java rename to app/api/show-api/src/main/java/com/example/pub/MessagePublisher.java index 3b985736..0b367d1a 100644 --- a/app/api/show-api/src/main/java/com/example/publish/MessagePublisher.java +++ b/app/api/show-api/src/main/java/com/example/pub/MessagePublisher.java @@ -1,9 +1,9 @@ -package com.example.publish; +package com.example.pub; -import com.example.publish.message.ArtistSubscriptionServiceMessage; -import com.example.publish.message.GenreSubscriptionServiceMessage; -import com.example.publish.message.ShowRelationArtistAndGenreServiceMessage; -import com.example.publish.message.TicketingAlertsToReserveServiceMessage; +import com.example.pub.message.ArtistSubscriptionServiceMessage; +import com.example.pub.message.GenreSubscriptionServiceMessage; +import com.example.pub.message.ShowRelationArtistAndGenreServiceMessage; +import com.example.pub.message.TicketingAlertsToReserveServiceMessage; public interface MessagePublisher { diff --git a/app/api/show-api/src/main/java/com/example/publish/message/ArtistServiceMessage.java b/app/api/show-api/src/main/java/com/example/pub/message/ArtistServiceMessage.java similarity index 94% rename from app/api/show-api/src/main/java/com/example/publish/message/ArtistServiceMessage.java rename to app/api/show-api/src/main/java/com/example/pub/message/ArtistServiceMessage.java index 79410e70..24c08b0c 100644 --- a/app/api/show-api/src/main/java/com/example/publish/message/ArtistServiceMessage.java +++ b/app/api/show-api/src/main/java/com/example/pub/message/ArtistServiceMessage.java @@ -1,4 +1,4 @@ -package com.example.publish.message; +package com.example.pub.message; import java.util.UUID; import lombok.Builder; diff --git a/app/api/show-api/src/main/java/com/example/publish/message/ArtistSubscriptionServiceMessage.java b/app/api/show-api/src/main/java/com/example/pub/message/ArtistSubscriptionServiceMessage.java similarity index 92% rename from app/api/show-api/src/main/java/com/example/publish/message/ArtistSubscriptionServiceMessage.java rename to app/api/show-api/src/main/java/com/example/pub/message/ArtistSubscriptionServiceMessage.java index 948fd3c3..9b091043 100644 --- a/app/api/show-api/src/main/java/com/example/publish/message/ArtistSubscriptionServiceMessage.java +++ b/app/api/show-api/src/main/java/com/example/pub/message/ArtistSubscriptionServiceMessage.java @@ -1,4 +1,4 @@ -package com.example.publish.message; +package com.example.pub.message; import java.util.List; import lombok.Builder; diff --git a/app/api/show-api/src/main/java/com/example/publish/message/GenreServiceMessage.java b/app/api/show-api/src/main/java/com/example/pub/message/GenreServiceMessage.java similarity index 94% rename from app/api/show-api/src/main/java/com/example/publish/message/GenreServiceMessage.java rename to app/api/show-api/src/main/java/com/example/pub/message/GenreServiceMessage.java index 8649e4b9..a8a98e4e 100644 --- a/app/api/show-api/src/main/java/com/example/publish/message/GenreServiceMessage.java +++ b/app/api/show-api/src/main/java/com/example/pub/message/GenreServiceMessage.java @@ -1,4 +1,4 @@ -package com.example.publish.message; +package com.example.pub.message; import java.util.UUID; import lombok.Builder; diff --git a/app/api/show-api/src/main/java/com/example/publish/message/GenreSubscriptionServiceMessage.java b/app/api/show-api/src/main/java/com/example/pub/message/GenreSubscriptionServiceMessage.java similarity index 92% rename from app/api/show-api/src/main/java/com/example/publish/message/GenreSubscriptionServiceMessage.java rename to app/api/show-api/src/main/java/com/example/pub/message/GenreSubscriptionServiceMessage.java index e5009cb5..4e251f66 100644 --- a/app/api/show-api/src/main/java/com/example/publish/message/GenreSubscriptionServiceMessage.java +++ b/app/api/show-api/src/main/java/com/example/pub/message/GenreSubscriptionServiceMessage.java @@ -1,4 +1,4 @@ -package com.example.publish.message; +package com.example.pub.message; import java.util.List; import lombok.Builder; diff --git a/app/api/show-api/src/main/java/com/example/publish/message/ShowRelationArtistAndGenreServiceMessage.java b/app/api/show-api/src/main/java/com/example/pub/message/ShowRelationArtistAndGenreServiceMessage.java similarity index 92% rename from app/api/show-api/src/main/java/com/example/publish/message/ShowRelationArtistAndGenreServiceMessage.java rename to app/api/show-api/src/main/java/com/example/pub/message/ShowRelationArtistAndGenreServiceMessage.java index 74d92d7d..2e5b9dfe 100644 --- a/app/api/show-api/src/main/java/com/example/publish/message/ShowRelationArtistAndGenreServiceMessage.java +++ b/app/api/show-api/src/main/java/com/example/pub/message/ShowRelationArtistAndGenreServiceMessage.java @@ -1,4 +1,4 @@ -package com.example.publish.message; +package com.example.pub.message; import java.util.List; import java.util.UUID; diff --git a/app/api/show-api/src/main/java/com/example/publish/message/TicketingAlertsToReserveServiceMessage.java b/app/api/show-api/src/main/java/com/example/pub/message/TicketingAlertsToReserveServiceMessage.java similarity index 96% rename from app/api/show-api/src/main/java/com/example/publish/message/TicketingAlertsToReserveServiceMessage.java rename to app/api/show-api/src/main/java/com/example/pub/message/TicketingAlertsToReserveServiceMessage.java index 17f131d6..ecb55851 100644 --- a/app/api/show-api/src/main/java/com/example/publish/message/TicketingAlertsToReserveServiceMessage.java +++ b/app/api/show-api/src/main/java/com/example/pub/message/TicketingAlertsToReserveServiceMessage.java @@ -1,4 +1,4 @@ -package com.example.publish.message; +package com.example.pub.message; import java.util.List; import java.util.UUID; diff --git a/app/api/show-api/src/main/java/com/example/publish/message/TicketingTimeServiceMessage.java b/app/api/show-api/src/main/java/com/example/pub/message/TicketingTimeServiceMessage.java similarity index 94% rename from app/api/show-api/src/main/java/com/example/publish/message/TicketingTimeServiceMessage.java rename to app/api/show-api/src/main/java/com/example/pub/message/TicketingTimeServiceMessage.java index e60fc331..f61adfa2 100644 --- a/app/api/show-api/src/main/java/com/example/publish/message/TicketingTimeServiceMessage.java +++ b/app/api/show-api/src/main/java/com/example/pub/message/TicketingTimeServiceMessage.java @@ -1,4 +1,4 @@ -package com.example.publish.message; +package com.example.pub.message; import com.example.show.controller.vo.TicketingAlertTimeApiType; import java.time.LocalDateTime; diff --git a/app/api/show-api/src/main/java/com/example/show/service/ShowAdminService.java b/app/api/show-api/src/main/java/com/example/show/service/ShowAdminService.java index 65eb0137..9ea39743 100644 --- a/app/api/show-api/src/main/java/com/example/show/service/ShowAdminService.java +++ b/app/api/show-api/src/main/java/com/example/show/service/ShowAdminService.java @@ -2,8 +2,8 @@ import com.example.component.FileUploadComponent; -import com.example.publish.MessagePublisher; -import com.example.publish.message.ShowRelationArtistAndGenreServiceMessage; +import com.example.pub.MessagePublisher; +import com.example.pub.message.ShowRelationArtistAndGenreServiceMessage; import com.example.show.service.dto.request.ShowCreateServiceRequest; import com.example.show.service.dto.request.ShowUpdateServiceRequest; import com.example.show.service.dto.response.ShowInfoServiceResponse; diff --git a/app/api/show-api/src/main/java/com/example/show/service/UserShowService.java b/app/api/show-api/src/main/java/com/example/show/service/UserShowService.java index 489ed79b..e885bc97 100644 --- a/app/api/show-api/src/main/java/com/example/show/service/UserShowService.java +++ b/app/api/show-api/src/main/java/com/example/show/service/UserShowService.java @@ -1,7 +1,7 @@ package com.example.show.service; -import com.example.publish.MessagePublisher; -import com.example.publish.message.TicketingAlertsToReserveServiceMessage; +import com.example.pub.MessagePublisher; +import com.example.pub.message.TicketingAlertsToReserveServiceMessage; import com.example.show.controller.vo.TicketingApiType; import com.example.show.error.ShowError; import com.example.show.service.dto.param.ShowAlertPaginationServiceParam; diff --git a/app/api/show-api/src/test/java/artist/service/ArtistServiceTest.java b/app/api/show-api/src/test/java/artist/service/ArtistServiceTest.java index 37455a39..4c0ac253 100644 --- a/app/api/show-api/src/test/java/artist/service/ArtistServiceTest.java +++ b/app/api/show-api/src/test/java/artist/service/ArtistServiceTest.java @@ -13,8 +13,8 @@ import com.example.artist.service.ArtistService; import com.example.artist.service.dto.request.ArtistSubscriptionServiceRequest; import com.example.artist.service.dto.request.ArtistUnsubscriptionServiceRequest; -import com.example.publish.MessagePublisher; -import com.example.publish.message.ArtistSubscriptionServiceMessage; +import com.example.pub.MessagePublisher; +import com.example.pub.message.ArtistSubscriptionServiceMessage; import java.util.List; import java.util.UUID; import org.assertj.core.api.SoftAssertions; diff --git a/app/api/show-api/src/test/java/genre/service/GenreServiceTest.java b/app/api/show-api/src/test/java/genre/service/GenreServiceTest.java index 7c4ce9f9..ae161b81 100644 --- a/app/api/show-api/src/test/java/genre/service/GenreServiceTest.java +++ b/app/api/show-api/src/test/java/genre/service/GenreServiceTest.java @@ -11,8 +11,8 @@ import com.example.genre.service.GenreService; import com.example.genre.service.dto.request.GenreSubscriptionServiceRequest; import com.example.genre.service.dto.request.GenreUnsubscriptionServiceRequest; -import com.example.publish.MessagePublisher; -import com.example.publish.message.GenreSubscriptionServiceMessage; +import com.example.pub.MessagePublisher; +import com.example.pub.message.GenreSubscriptionServiceMessage; import genre.fixture.GenreRequestDtoFixture; import genre.fixture.GenreResponseDtoFixture; import java.util.List; diff --git a/app/api/show-api/src/test/java/show/service/ShowAdminServiceTest.java b/app/api/show-api/src/test/java/show/service/ShowAdminServiceTest.java index c9dafa10..ceca5106 100644 --- a/app/api/show-api/src/test/java/show/service/ShowAdminServiceTest.java +++ b/app/api/show-api/src/test/java/show/service/ShowAdminServiceTest.java @@ -10,8 +10,8 @@ import static org.mockito.Mockito.verify; import com.example.component.FileUploadComponent; -import com.example.publish.MessagePublisher; -import com.example.publish.message.ShowRelationArtistAndGenreServiceMessage; +import com.example.pub.MessagePublisher; +import com.example.pub.message.ShowRelationArtistAndGenreServiceMessage; import com.example.show.service.ShowAdminService; import com.example.show.service.dto.request.ShowCreateServiceRequest; import com.example.show.service.dto.request.ShowUpdateServiceRequest; diff --git a/app/infrastructure/message-queue/src/main/java/org/example/message/ArtistInfraMessage.java b/app/infrastructure/message-queue/src/main/java/org/example/message/ArtistInfraMessage.java index 3bfe1a59..99d823b5 100644 --- a/app/infrastructure/message-queue/src/main/java/org/example/message/ArtistInfraMessage.java +++ b/app/infrastructure/message-queue/src/main/java/org/example/message/ArtistInfraMessage.java @@ -1,6 +1,6 @@ package org.example.message; -import com.example.publish.message.ArtistServiceMessage; +import com.example.pub.message.ArtistServiceMessage; import java.util.UUID; import lombok.Builder; diff --git a/app/infrastructure/message-queue/src/main/java/org/example/message/ArtistSubscriptionInfraMessage.java b/app/infrastructure/message-queue/src/main/java/org/example/message/ArtistSubscriptionInfraMessage.java index f1f801bc..fb9323f0 100644 --- a/app/infrastructure/message-queue/src/main/java/org/example/message/ArtistSubscriptionInfraMessage.java +++ b/app/infrastructure/message-queue/src/main/java/org/example/message/ArtistSubscriptionInfraMessage.java @@ -1,6 +1,6 @@ package org.example.message; -import com.example.publish.message.ArtistSubscriptionServiceMessage; +import com.example.pub.message.ArtistSubscriptionServiceMessage; import java.util.List; import lombok.Builder; diff --git a/app/infrastructure/message-queue/src/main/java/org/example/message/GenreInfraMessage.java b/app/infrastructure/message-queue/src/main/java/org/example/message/GenreInfraMessage.java index 94f679ba..5a5ec420 100644 --- a/app/infrastructure/message-queue/src/main/java/org/example/message/GenreInfraMessage.java +++ b/app/infrastructure/message-queue/src/main/java/org/example/message/GenreInfraMessage.java @@ -1,6 +1,6 @@ package org.example.message; -import com.example.publish.message.GenreServiceMessage; +import com.example.pub.message.GenreServiceMessage; import java.util.UUID; import lombok.Builder; diff --git a/app/infrastructure/message-queue/src/main/java/org/example/message/GenreSubscriptionInfraMessage.java b/app/infrastructure/message-queue/src/main/java/org/example/message/GenreSubscriptionInfraMessage.java index 55bd6933..9aedf885 100644 --- a/app/infrastructure/message-queue/src/main/java/org/example/message/GenreSubscriptionInfraMessage.java +++ b/app/infrastructure/message-queue/src/main/java/org/example/message/GenreSubscriptionInfraMessage.java @@ -1,6 +1,6 @@ package org.example.message; -import com.example.publish.message.GenreSubscriptionServiceMessage; +import com.example.pub.message.GenreSubscriptionServiceMessage; import java.util.List; import lombok.Builder; diff --git a/app/infrastructure/message-queue/src/main/java/org/example/message/ShowRelationArtistAndGenreInfraMessage.java b/app/infrastructure/message-queue/src/main/java/org/example/message/ShowRelationArtistAndGenreInfraMessage.java index 69cc5a99..a516975e 100644 --- a/app/infrastructure/message-queue/src/main/java/org/example/message/ShowRelationArtistAndGenreInfraMessage.java +++ b/app/infrastructure/message-queue/src/main/java/org/example/message/ShowRelationArtistAndGenreInfraMessage.java @@ -1,6 +1,6 @@ package org.example.message; -import com.example.publish.message.ShowRelationArtistAndGenreServiceMessage; +import com.example.pub.message.ShowRelationArtistAndGenreServiceMessage; import java.util.List; import java.util.UUID; import lombok.Builder; diff --git a/app/infrastructure/message-queue/src/main/java/org/example/message/TicketingReservationInfraMessage.java b/app/infrastructure/message-queue/src/main/java/org/example/message/TicketingReservationInfraMessage.java index f59197d3..01879500 100644 --- a/app/infrastructure/message-queue/src/main/java/org/example/message/TicketingReservationInfraMessage.java +++ b/app/infrastructure/message-queue/src/main/java/org/example/message/TicketingReservationInfraMessage.java @@ -1,6 +1,6 @@ package org.example.message; -import com.example.publish.message.TicketingAlertsToReserveServiceMessage; +import com.example.pub.message.TicketingAlertsToReserveServiceMessage; import java.util.List; import java.util.UUID; import lombok.Builder; diff --git a/app/infrastructure/message-queue/src/main/java/org/example/message/TicketingTimeInfraMessage.java b/app/infrastructure/message-queue/src/main/java/org/example/message/TicketingTimeInfraMessage.java index 6f77b3a7..0b2650b3 100644 --- a/app/infrastructure/message-queue/src/main/java/org/example/message/TicketingTimeInfraMessage.java +++ b/app/infrastructure/message-queue/src/main/java/org/example/message/TicketingTimeInfraMessage.java @@ -1,6 +1,6 @@ package org.example.message; -import com.example.publish.message.TicketingTimeServiceMessage; +import com.example.pub.message.TicketingTimeServiceMessage; import com.example.show.controller.vo.TicketingAlertTimeApiType; import lombok.Builder; diff --git a/app/infrastructure/message-queue/src/main/java/org/example/publish/RedisMessagePublisher.java b/app/infrastructure/message-queue/src/main/java/org/example/publish/RedisMessagePublisher.java index c16f358d..80a36398 100644 --- a/app/infrastructure/message-queue/src/main/java/org/example/publish/RedisMessagePublisher.java +++ b/app/infrastructure/message-queue/src/main/java/org/example/publish/RedisMessagePublisher.java @@ -1,10 +1,10 @@ package org.example.publish; -import com.example.publish.MessagePublisher; -import com.example.publish.message.ArtistSubscriptionServiceMessage; -import com.example.publish.message.GenreSubscriptionServiceMessage; -import com.example.publish.message.ShowRelationArtistAndGenreServiceMessage; -import com.example.publish.message.TicketingAlertsToReserveServiceMessage; +import com.example.pub.MessagePublisher; +import com.example.pub.message.ArtistSubscriptionServiceMessage; +import com.example.pub.message.GenreSubscriptionServiceMessage; +import com.example.pub.message.ShowRelationArtistAndGenreServiceMessage; +import com.example.pub.message.TicketingAlertsToReserveServiceMessage; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.example.message.ArtistSubscriptionInfraMessage; From ba1d5b3ddf38970adfd02a81f08ac2a55fbe7bc8 Mon Sep 17 00:00:00 2001 From: GaBaljaintheroom Date: Tue, 24 Sep 2024 23:49:19 +0900 Subject: [PATCH 07/16] =?UTF-8?q?feat:=20=EC=95=84=ED=8B=B0=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EB=B0=8F=20=EC=95=84=ED=8B=B0=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=9E=A5=EB=A5=B4=20=EC=A0=80=EC=9E=A5=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../artist/service/ArtistAdminService.java | 2 +- .../request/ArtistCreateServiceRequest.java | 8 ++- .../request/ArtistDomainServiceRequest.java | 16 ------ .../request/ArtistGenreServiceRequest.java | 36 ++++++++++++ .../SubscriptionMessageConverter.java | 4 +- .../message/ArtistCreateMessageRequest.java | 4 +- ...st.java => ArtistGenreMessageRequest.java} | 10 ++-- .../java/org/example/util/ReflectionUtil.java | 17 ++++++ .../request/ArtistCreateDomainRequest.java | 9 +++ .../request/ArtistGenreDomainRequest.java | 25 +++++++++ .../org/example/entity/artist/Artist.java | 13 ++--- .../repository/genre/GenreRepository.java | 3 + .../org/example/usecase/ArtistUseCase.java | 23 ++++++-- .../java/org/example/vo/ArtistGenreType.java | 56 +++++++++++++++++++ 14 files changed, 185 insertions(+), 41 deletions(-) delete mode 100644 app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistDomainServiceRequest.java create mode 100644 app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistGenreServiceRequest.java rename app/api/show-api/src/main/java/com/example/artist/sub/message/{ArtistDomainMessageRequest.java => ArtistGenreMessageRequest.java} (59%) create mode 100644 app/domain/common-domain/src/main/java/org/example/util/ReflectionUtil.java create mode 100644 app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistCreateDomainRequest.java create mode 100644 app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistGenreDomainRequest.java create mode 100644 app/domain/show-domain/src/main/java/org/example/vo/ArtistGenreType.java diff --git a/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java b/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java index b4739ab7..b2392fc8 100644 --- a/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java +++ b/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java @@ -27,6 +27,6 @@ public List findAllWithGenreNames() { } public void saveArtist(ArtistCreateServiceRequest request) { - + artistUseCase.save(request.toDomainRequest()); } } diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistCreateServiceRequest.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistCreateServiceRequest.java index 2d775dd6..e3400a31 100644 --- a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistCreateServiceRequest.java +++ b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistCreateServiceRequest.java @@ -1,9 +1,15 @@ package com.example.artist.service.dto.request; import java.util.List; +import org.example.dto.artist.request.ArtistCreateDomainRequest; public record ArtistCreateServiceRequest( - List artists + List artistGenres ) { + public ArtistCreateDomainRequest toDomainRequest() { + return new ArtistCreateDomainRequest( + artistGenres.stream().map(ArtistGenreServiceRequest::toDomainRequest).toList() + ); + } } diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistDomainServiceRequest.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistDomainServiceRequest.java deleted file mode 100644 index 83ae6adc..00000000 --- a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistDomainServiceRequest.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.example.artist.service.dto.request; - -import java.util.List; -import java.util.UUID; -import lombok.Builder; - -@Builder -public record ArtistDomainServiceRequest( - UUID id, - String name, - String image, - String spotifyId, - List genres -) { - -} diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistGenreServiceRequest.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistGenreServiceRequest.java new file mode 100644 index 00000000..82df27a4 --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistGenreServiceRequest.java @@ -0,0 +1,36 @@ +package com.example.artist.service.dto.request; + +import java.util.List; +import java.util.Objects; +import java.util.UUID; +import lombok.Builder; +import org.example.dto.artist.request.ArtistGenreDomainRequest; +import org.example.vo.ArtistGenreType; + +@Builder +public record ArtistGenreServiceRequest( + UUID artistId, + String name, + String image, + String spotifyId, + List genres +) { + + public ArtistGenreDomainRequest toDomainRequest() { + String mappedGenres = genres.stream() + .map(ArtistGenreType::findByGenreClassificationName) + .filter(Objects::nonNull) + .findFirst() + .orElse(genres.get(0)) + .toLowerCase(); + + return ArtistGenreDomainRequest.builder() + .artistId(artistId) + .name(name) + .image(image) + .spotifyId(spotifyId) + .genreName(mappedGenres) + .build(); + } + +} diff --git a/app/api/show-api/src/main/java/com/example/artist/sub/converter/SubscriptionMessageConverter.java b/app/api/show-api/src/main/java/com/example/artist/sub/converter/SubscriptionMessageConverter.java index b8297cfc..6a8f4db3 100644 --- a/app/api/show-api/src/main/java/com/example/artist/sub/converter/SubscriptionMessageConverter.java +++ b/app/api/show-api/src/main/java/com/example/artist/sub/converter/SubscriptionMessageConverter.java @@ -19,11 +19,11 @@ public static ArtistCreateMessageRequest toArtistCreateMessage(Message message) ); log.info("Message published successfully to topic: {}", new String(message.getChannel())); - log.info("Subscribe Message Contents ( ArtistCreateServiceRequest : {} )", message); + log.info("Subscribe Message Contents ( ArtistCreateMessageRequest : {} )", message); return convertedMessage; } catch (IOException e) { - log.error("Failed to convert message to ArtistCreateServiceRequest", e); + log.error("Failed to convert message to ArtistCreateMessageRequest", e); throw new IllegalArgumentException("메시지를 받지 못했습니다."); } } diff --git a/app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistCreateMessageRequest.java b/app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistCreateMessageRequest.java index 1d2933d9..f7c644c1 100644 --- a/app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistCreateMessageRequest.java +++ b/app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistCreateMessageRequest.java @@ -4,12 +4,12 @@ import java.util.List; public record ArtistCreateMessageRequest( - List request + List request ) { public ArtistCreateServiceRequest toServiceRequest() { return new ArtistCreateServiceRequest( - request.stream().map(ArtistDomainMessageRequest::toServiceRequest).toList() + request.stream().map(ArtistGenreMessageRequest::toServiceRequest).toList() ); } diff --git a/app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistDomainMessageRequest.java b/app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistGenreMessageRequest.java similarity index 59% rename from app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistDomainMessageRequest.java rename to app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistGenreMessageRequest.java index 0a154384..f605b7e7 100644 --- a/app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistDomainMessageRequest.java +++ b/app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistGenreMessageRequest.java @@ -1,21 +1,21 @@ package com.example.artist.sub.message; -import com.example.artist.service.dto.request.ArtistDomainServiceRequest; +import com.example.artist.service.dto.request.ArtistGenreServiceRequest; import java.util.List; import java.util.UUID; import lombok.Builder; @Builder -public record ArtistDomainMessageRequest( +public record ArtistGenreMessageRequest( UUID id, String name, String image, String spotifyId, List genres ) { - public ArtistDomainServiceRequest toServiceRequest() { - return ArtistDomainServiceRequest.builder() - .id(id) + public ArtistGenreServiceRequest toServiceRequest() { + return ArtistGenreServiceRequest.builder() + .artistId(id) .name(name) .image(image) .spotifyId(spotifyId) diff --git a/app/domain/common-domain/src/main/java/org/example/util/ReflectionUtil.java b/app/domain/common-domain/src/main/java/org/example/util/ReflectionUtil.java new file mode 100644 index 00000000..65ad3fb4 --- /dev/null +++ b/app/domain/common-domain/src/main/java/org/example/util/ReflectionUtil.java @@ -0,0 +1,17 @@ +package org.example.util; + +import java.lang.reflect.Field; +import java.util.UUID; + +public final class ReflectionUtil { + + public static void setSuperClassId(Object target, UUID id) { + try { + Field field = target.getClass().getSuperclass().getDeclaredField("id"); + field.setAccessible(true); + field.set(target, id); + } catch (NoSuchFieldException | IllegalAccessException e) { + throw new RuntimeException(e); + } + } +} diff --git a/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistCreateDomainRequest.java b/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistCreateDomainRequest.java new file mode 100644 index 00000000..0b5833f4 --- /dev/null +++ b/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistCreateDomainRequest.java @@ -0,0 +1,9 @@ +package org.example.dto.artist.request; + +import java.util.List; + +public record ArtistCreateDomainRequest( + List artistGenres +) { + +} diff --git a/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistGenreDomainRequest.java b/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistGenreDomainRequest.java new file mode 100644 index 00000000..94167af9 --- /dev/null +++ b/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistGenreDomainRequest.java @@ -0,0 +1,25 @@ +package org.example.dto.artist.request; + +import java.util.UUID; +import lombok.Builder; +import org.example.entity.artist.Artist; + +@Builder +public record ArtistGenreDomainRequest( + UUID artistId, + String name, + String image, + String spotifyId, + String genreName +) { + + public Artist toArtist() { + return Artist.builder() + .name(name) + .image(image) + .spotifyId(spotifyId) + .build(); + } + + +} diff --git a/app/domain/show-domain/src/main/java/org/example/entity/artist/Artist.java b/app/domain/show-domain/src/main/java/org/example/entity/artist/Artist.java index b6e4a379..9e5b4684 100644 --- a/app/domain/show-domain/src/main/java/org/example/entity/artist/Artist.java +++ b/app/domain/show-domain/src/main/java/org/example/entity/artist/Artist.java @@ -3,7 +3,6 @@ import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.Table; -import java.util.List; import java.util.UUID; import lombok.AccessLevel; import lombok.Builder; @@ -37,12 +36,10 @@ private Artist( this.spotifyId = spotifyId; } - public List toArtistGenre(List genreIds) { - return genreIds.stream() - .map(genreId -> ArtistGenre.builder() - .artistId(getId()) - .genreId(genreId) - .build()) - .toList(); + public ArtistGenre toArtistGenre(UUID genreId) { + return ArtistGenre.builder() + .artistId(getId()) + .genreId(genreId) + .build(); } } diff --git a/app/domain/show-domain/src/main/java/org/example/repository/genre/GenreRepository.java b/app/domain/show-domain/src/main/java/org/example/repository/genre/GenreRepository.java index b60208ad..9fe46584 100644 --- a/app/domain/show-domain/src/main/java/org/example/repository/genre/GenreRepository.java +++ b/app/domain/show-domain/src/main/java/org/example/repository/genre/GenreRepository.java @@ -1,6 +1,7 @@ package org.example.repository.genre; import java.util.List; +import java.util.Optional; import java.util.UUID; import org.example.entity.genre.Genre; import org.springframework.data.jpa.repository.JpaRepository; @@ -8,4 +9,6 @@ public interface GenreRepository extends JpaRepository, GenreQuerydslRepository { List findAllByIsDeletedFalse(); + + Optional findByName(String name); } diff --git a/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java b/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java index 0492f46f..ad3d0ac0 100644 --- a/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java +++ b/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java @@ -2,11 +2,13 @@ import java.util.List; import java.util.Map; -import java.util.UUID; +import java.util.NoSuchElementException; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; import lombok.RequiredArgsConstructor; +import org.example.dto.artist.request.ArtistCreateDomainRequest; +import org.example.dto.artist.request.ArtistGenreDomainRequest; import org.example.dto.artist.request.ArtistPaginationDomainRequest; import org.example.dto.artist.request.ArtistSearchPaginationDomainRequest; import org.example.dto.artist.response.ArtistDetailDomainResponse; @@ -15,7 +17,7 @@ import org.example.dto.artist.response.ArtistPaginationDomainResponse; import org.example.dto.artist.response.ArtistSearchPaginationDomainResponse; import org.example.entity.artist.Artist; -import org.example.entity.artist.ArtistGenre; +import org.example.entity.genre.Genre; import org.example.port.ArtistCreatePort; import org.example.port.ArtistSearchPort; import org.example.port.dto.param.ArtistSearchPortParam; @@ -25,7 +27,9 @@ import org.example.port.dto.response.ArtistSearchPortResponse; import org.example.repository.artist.ArtistRepository; import org.example.repository.artist.artistgenre.ArtistGenreRepository; +import org.example.repository.genre.GenreRepository; import org.example.repository.show.showartist.ShowArtistRepository; +import org.example.util.ReflectionUtil; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -36,16 +40,23 @@ public class ArtistUseCase { private final ArtistRepository artistRepository; private final ArtistGenreRepository artistGenreRepository; private final ShowArtistRepository showArtistRepository; + private final GenreRepository genreRepository; private final ArtistSearchPort artistSearchPort; private final ArtistCreatePort artistCreatePort; @Transactional - public void save(Artist artist, List genreIds) { - artistRepository.save(artist); + public void save(ArtistCreateDomainRequest request) { + for (ArtistGenreDomainRequest artistGenre : request.artistGenres()) { + Artist newArtist = artistGenre.toArtist(); + ReflectionUtil.setSuperClassId(newArtist, artistGenre.artistId()); + artistRepository.save(newArtist); - List artistGenres = artist.toArtistGenre(genreIds); - artistGenreRepository.saveAll(artistGenres); + Genre genre = genreRepository.findByName(artistGenre.genreName()) + .orElseThrow(NoSuchElementException::new); + + artistGenreRepository.save(newArtist.toArtistGenre(genre.getId())); + } } public List findAllWithGenreNames() { diff --git a/app/domain/show-domain/src/main/java/org/example/vo/ArtistGenreType.java b/app/domain/show-domain/src/main/java/org/example/vo/ArtistGenreType.java new file mode 100644 index 00000000..5cc17bd0 --- /dev/null +++ b/app/domain/show-domain/src/main/java/org/example/vo/ArtistGenreType.java @@ -0,0 +1,56 @@ +package org.example.vo; + +import java.util.Arrays; +import java.util.List; + +public enum ArtistGenreType { + + ROCK( + List.of("rock", "alt-rock", "alternative", "british", "garage", "grunge", "hard-rock", + "punk", "punk-rock", "rock-n-roll", "rockabilly", "psych-rock") + ), + BAND( + List.of("band", "bluegrass", "blues", "folk", "guitar", "indie", "indie-pop", + "singer-songwriter", "songwriter") + ), + EDM( + List.of("breakbeat", "club", "dance", "edm", "electro", "electronic", "idm", + "progressive-house", "trance") + ), + CLASSIC(List.of("classical", "new-age", "piano")), + HIPHOP(List.of("hip-hop", "emo")), + HOUSE( + List.of("chicago-house", "deep-house", "detroit-techno", "disco", "house", "minimal-techno", + "techno") + ), + OPERA(List.of("opera")), + POP( + List.of("acoustic", "anime", "cantopop", "disney", "pop", "power-pop", "swedish", "synth-pop") + ), + RNB(List.of("funk", "groove", "r-n-b", "soul")), + MUSICAL(List.of("comedy", "movies", "pop-film", "show-tunes", "soundtracks")), + METAL( + List.of("black-metal", "death-metal", "grindcore", "hardcore", "heavy-metal", "metal", + "metal-misc", "metalcore") + ), + JPOP(List.of("j-dance", "j-idol", "j-pop", "j-rock")); + + private final List genres; + + ArtistGenreType(List genres) { + this.genres = genres; + } + + public List getGenres() { + return genres; + } + + public static String findByGenreClassificationName(String genre) { + return Arrays.stream(ArtistGenreType.values()) + .filter(type -> type.genres.contains(genre)) + .map(Enum::name) + .findFirst() + .orElse(null); + } + +} From 44594a1f98980a61fd908e2f1718e207fa8ba046 Mon Sep 17 00:00:00 2001 From: GaBaljaintheroom Date: Wed, 25 Sep 2024 00:27:28 +0900 Subject: [PATCH 08/16] =?UTF-8?q?fix:=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/artist/service/ArtistServiceTest.java | 2 +- .../org/example/fixture/domain/ArtistFixture.java | 12 ++++++++++++ .../fixture/port/ArtistCreatePortFixture.java | 14 ++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 app/domain/show-domain/src/testFixtures/java/org/example/fixture/port/ArtistCreatePortFixture.java diff --git a/app/api/show-api/src/test/java/artist/service/ArtistServiceTest.java b/app/api/show-api/src/test/java/artist/service/ArtistServiceTest.java index 4c0ac253..d1570114 100644 --- a/app/api/show-api/src/test/java/artist/service/ArtistServiceTest.java +++ b/app/api/show-api/src/test/java/artist/service/ArtistServiceTest.java @@ -168,7 +168,7 @@ void artistSubscribe() { List spotifyArtistsId = List.of("123", "456"); UUID userId = UUID.randomUUID(); var request = new ArtistSubscriptionServiceRequest(spotifyArtistsId, userId); - var existArtistsInRequest = ArtistFixture.manSoloArtists(2); + var existArtistsInRequest = ArtistFixture.manSoloArtistsSetId(2); given( artistUseCase.findOrCreateArtistBySpotifyId(request.spotifyArtistIds()) ).willReturn( diff --git a/app/domain/show-domain/src/testFixtures/java/org/example/fixture/domain/ArtistFixture.java b/app/domain/show-domain/src/testFixtures/java/org/example/fixture/domain/ArtistFixture.java index 5b87c64e..cb300f3c 100644 --- a/app/domain/show-domain/src/testFixtures/java/org/example/fixture/domain/ArtistFixture.java +++ b/app/domain/show-domain/src/testFixtures/java/org/example/fixture/domain/ArtistFixture.java @@ -17,6 +17,18 @@ public static Artist womanGroup() { } public static List manSoloArtists(int size) { + return IntStream.range(0, size) + .mapToObj(i -> + Artist.builder() + .name("testEnglishName" + i) + .image("testImage" + i) + .spotifyId("spotifyId" + i) + .build() + ) + .toList(); + } + + public static List manSoloArtistsSetId(int size) { return IntStream.range(0, size) .mapToObj(i -> { Artist artist = Artist.builder() diff --git a/app/domain/show-domain/src/testFixtures/java/org/example/fixture/port/ArtistCreatePortFixture.java b/app/domain/show-domain/src/testFixtures/java/org/example/fixture/port/ArtistCreatePortFixture.java new file mode 100644 index 00000000..b73c9d8c --- /dev/null +++ b/app/domain/show-domain/src/testFixtures/java/org/example/fixture/port/ArtistCreatePortFixture.java @@ -0,0 +1,14 @@ +package org.example.fixture.port; + +import org.example.port.ArtistCreatePort; +import org.example.port.dto.request.ArtistCreatePortRequest; +import org.springframework.stereotype.Component; + +@Component +public class ArtistCreatePortFixture implements ArtistCreatePort { + + @Override + public void createArtist(String topic, ArtistCreatePortRequest request) { + + } +} From be4ea0798cfd422cd2c01370cbbdf78a2317d69f Mon Sep 17 00:00:00 2001 From: GaBaljaintheroom Date: Thu, 26 Sep 2024 12:12:50 +0900 Subject: [PATCH 09/16] =?UTF-8?q?fix:=20=EC=95=84=ED=8B=B0=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=ED=81=B4=EB=9E=98=EC=8A=A4=EB=AA=85=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EB=B0=8F=20ReflectionUtil=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../artist/service/ArtistAdminService.java | 4 ++-- .../dto/request/ArtistCreateServiceRequest.java | 15 --------------- .../ArtistWithGenreCreateServiceRequest.java | 15 +++++++++++++++ .../converter/SubscriptionMessageConverter.java | 10 +++++----- .../sub/message/ArtistCreateMessageRequest.java | 16 ---------------- .../ArtistWithGenreCreateMessageRequest.java | 16 ++++++++++++++++ .../java/org/example/entity/BaseEntity.java | 4 ++++ .../java/org/example/util/ReflectionUtil.java | 17 ----------------- .../request/ArtistGenreDomainRequest.java | 3 ++- ... => ArtistWithGenreCreateDomainRequest.java} | 2 +- .../java/org/example/entity/artist/Artist.java | 5 +++++ .../java/org/example/usecase/ArtistUseCase.java | 6 ++---- 12 files changed, 52 insertions(+), 61 deletions(-) delete mode 100644 app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistCreateServiceRequest.java create mode 100644 app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistWithGenreCreateServiceRequest.java delete mode 100644 app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistCreateMessageRequest.java create mode 100644 app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistWithGenreCreateMessageRequest.java delete mode 100644 app/domain/common-domain/src/main/java/org/example/util/ReflectionUtil.java rename app/domain/show-domain/src/main/java/org/example/dto/artist/request/{ArtistCreateDomainRequest.java => ArtistWithGenreCreateDomainRequest.java} (70%) diff --git a/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java b/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java index b2392fc8..d2bd3540 100644 --- a/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java +++ b/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java @@ -1,6 +1,6 @@ package com.example.artist.service; -import com.example.artist.service.dto.request.ArtistCreateServiceRequest; +import com.example.artist.service.dto.request.ArtistWithGenreCreateServiceRequest; import com.example.artist.service.dto.response.ArtistDetailServiceResponse; import com.example.artist.service.dto.response.ArtistNameServiceResponse; import java.util.List; @@ -26,7 +26,7 @@ public List findAllWithGenreNames() { .toList(); } - public void saveArtist(ArtistCreateServiceRequest request) { + public void saveArtist(ArtistWithGenreCreateServiceRequest request) { artistUseCase.save(request.toDomainRequest()); } } diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistCreateServiceRequest.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistCreateServiceRequest.java deleted file mode 100644 index e3400a31..00000000 --- a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistCreateServiceRequest.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.example.artist.service.dto.request; - -import java.util.List; -import org.example.dto.artist.request.ArtistCreateDomainRequest; - -public record ArtistCreateServiceRequest( - List artistGenres -) { - - public ArtistCreateDomainRequest toDomainRequest() { - return new ArtistCreateDomainRequest( - artistGenres.stream().map(ArtistGenreServiceRequest::toDomainRequest).toList() - ); - } -} diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistWithGenreCreateServiceRequest.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistWithGenreCreateServiceRequest.java new file mode 100644 index 00000000..367029b3 --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/artist/service/dto/request/ArtistWithGenreCreateServiceRequest.java @@ -0,0 +1,15 @@ +package com.example.artist.service.dto.request; + +import java.util.List; +import org.example.dto.artist.request.ArtistWithGenreCreateDomainRequest; + +public record ArtistWithGenreCreateServiceRequest( + List artistGenres +) { + + public ArtistWithGenreCreateDomainRequest toDomainRequest() { + return new ArtistWithGenreCreateDomainRequest( + artistGenres.stream().map(ArtistGenreServiceRequest::toDomainRequest).toList() + ); + } +} diff --git a/app/api/show-api/src/main/java/com/example/artist/sub/converter/SubscriptionMessageConverter.java b/app/api/show-api/src/main/java/com/example/artist/sub/converter/SubscriptionMessageConverter.java index 6a8f4db3..ed5d0655 100644 --- a/app/api/show-api/src/main/java/com/example/artist/sub/converter/SubscriptionMessageConverter.java +++ b/app/api/show-api/src/main/java/com/example/artist/sub/converter/SubscriptionMessageConverter.java @@ -1,6 +1,6 @@ package com.example.artist.sub.converter; -import com.example.artist.sub.message.ArtistCreateMessageRequest; +import com.example.artist.sub.message.ArtistWithGenreCreateMessageRequest; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import lombok.extern.slf4j.Slf4j; @@ -11,19 +11,19 @@ public class SubscriptionMessageConverter { private static final ObjectMapper objectMapper = new ObjectMapper(); - public static ArtistCreateMessageRequest toArtistCreateMessage(Message message) { + public static ArtistWithGenreCreateMessageRequest toArtistCreateMessage(Message message) { try { var convertedMessage = objectMapper.readValue( message.getBody(), - ArtistCreateMessageRequest.class + ArtistWithGenreCreateMessageRequest.class ); log.info("Message published successfully to topic: {}", new String(message.getChannel())); - log.info("Subscribe Message Contents ( ArtistCreateMessageRequest : {} )", message); + log.info("Subscribe Message Contents ( ArtistWithGenreCreateMessageRequest : {} )", message); return convertedMessage; } catch (IOException e) { - log.error("Failed to convert message to ArtistCreateMessageRequest", e); + log.error("Failed to convert message to ArtistWithGenreCreateMessageRequest", e); throw new IllegalArgumentException("메시지를 받지 못했습니다."); } } diff --git a/app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistCreateMessageRequest.java b/app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistCreateMessageRequest.java deleted file mode 100644 index f7c644c1..00000000 --- a/app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistCreateMessageRequest.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.example.artist.sub.message; - -import com.example.artist.service.dto.request.ArtistCreateServiceRequest; -import java.util.List; - -public record ArtistCreateMessageRequest( - List request -) { - - public ArtistCreateServiceRequest toServiceRequest() { - return new ArtistCreateServiceRequest( - request.stream().map(ArtistGenreMessageRequest::toServiceRequest).toList() - ); - } - -} diff --git a/app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistWithGenreCreateMessageRequest.java b/app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistWithGenreCreateMessageRequest.java new file mode 100644 index 00000000..9f9cd8d1 --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/artist/sub/message/ArtistWithGenreCreateMessageRequest.java @@ -0,0 +1,16 @@ +package com.example.artist.sub.message; + +import com.example.artist.service.dto.request.ArtistWithGenreCreateServiceRequest; +import java.util.List; + +public record ArtistWithGenreCreateMessageRequest( + List request +) { + + public ArtistWithGenreCreateServiceRequest toServiceRequest() { + return new ArtistWithGenreCreateServiceRequest( + request.stream().map(ArtistGenreMessageRequest::toServiceRequest).toList() + ); + } + +} diff --git a/app/domain/common-domain/src/main/java/org/example/entity/BaseEntity.java b/app/domain/common-domain/src/main/java/org/example/entity/BaseEntity.java index 57eb7d67..49d73660 100644 --- a/app/domain/common-domain/src/main/java/org/example/entity/BaseEntity.java +++ b/app/domain/common-domain/src/main/java/org/example/entity/BaseEntity.java @@ -42,6 +42,10 @@ public void revive() { isDeleted = false; } + protected void setId(UUID id) { + this.id = id; + } + @Override public boolean isNew() { return createdAt == null; diff --git a/app/domain/common-domain/src/main/java/org/example/util/ReflectionUtil.java b/app/domain/common-domain/src/main/java/org/example/util/ReflectionUtil.java deleted file mode 100644 index 65ad3fb4..00000000 --- a/app/domain/common-domain/src/main/java/org/example/util/ReflectionUtil.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.example.util; - -import java.lang.reflect.Field; -import java.util.UUID; - -public final class ReflectionUtil { - - public static void setSuperClassId(Object target, UUID id) { - try { - Field field = target.getClass().getSuperclass().getDeclaredField("id"); - field.setAccessible(true); - field.set(target, id); - } catch (NoSuchFieldException | IllegalAccessException e) { - throw new RuntimeException(e); - } - } -} diff --git a/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistGenreDomainRequest.java b/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistGenreDomainRequest.java index 94167af9..da7fd095 100644 --- a/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistGenreDomainRequest.java +++ b/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistGenreDomainRequest.java @@ -18,7 +18,8 @@ public Artist toArtist() { .name(name) .image(image) .spotifyId(spotifyId) - .build(); + .build() + .changeId(artistId); } diff --git a/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistCreateDomainRequest.java b/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistWithGenreCreateDomainRequest.java similarity index 70% rename from app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistCreateDomainRequest.java rename to app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistWithGenreCreateDomainRequest.java index 0b5833f4..7a06700b 100644 --- a/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistCreateDomainRequest.java +++ b/app/domain/show-domain/src/main/java/org/example/dto/artist/request/ArtistWithGenreCreateDomainRequest.java @@ -2,7 +2,7 @@ import java.util.List; -public record ArtistCreateDomainRequest( +public record ArtistWithGenreCreateDomainRequest( List artistGenres ) { diff --git a/app/domain/show-domain/src/main/java/org/example/entity/artist/Artist.java b/app/domain/show-domain/src/main/java/org/example/entity/artist/Artist.java index 9e5b4684..01a66990 100644 --- a/app/domain/show-domain/src/main/java/org/example/entity/artist/Artist.java +++ b/app/domain/show-domain/src/main/java/org/example/entity/artist/Artist.java @@ -36,6 +36,11 @@ private Artist( this.spotifyId = spotifyId; } + public Artist changeId(UUID id) { + this.setId(id); + return this; + } + public ArtistGenre toArtistGenre(UUID genreId) { return ArtistGenre.builder() .artistId(getId()) diff --git a/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java b/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java index ad3d0ac0..d2229506 100644 --- a/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java +++ b/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java @@ -7,10 +7,10 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import lombok.RequiredArgsConstructor; -import org.example.dto.artist.request.ArtistCreateDomainRequest; import org.example.dto.artist.request.ArtistGenreDomainRequest; import org.example.dto.artist.request.ArtistPaginationDomainRequest; import org.example.dto.artist.request.ArtistSearchPaginationDomainRequest; +import org.example.dto.artist.request.ArtistWithGenreCreateDomainRequest; import org.example.dto.artist.response.ArtistDetailDomainResponse; import org.example.dto.artist.response.ArtistNameDomainResponse; import org.example.dto.artist.response.ArtistNamesWithShowIdDomainResponse; @@ -29,7 +29,6 @@ import org.example.repository.artist.artistgenre.ArtistGenreRepository; import org.example.repository.genre.GenreRepository; import org.example.repository.show.showartist.ShowArtistRepository; -import org.example.util.ReflectionUtil; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -46,10 +45,9 @@ public class ArtistUseCase { @Transactional - public void save(ArtistCreateDomainRequest request) { + public void save(ArtistWithGenreCreateDomainRequest request) { for (ArtistGenreDomainRequest artistGenre : request.artistGenres()) { Artist newArtist = artistGenre.toArtist(); - ReflectionUtil.setSuperClassId(newArtist, artistGenre.artistId()); artistRepository.save(newArtist); Genre genre = genreRepository.findByName(artistGenre.genreName()) From d2fe2d3b1a1c15c6c99a0f0e5524c85a12c7dab6 Mon Sep 17 00:00:00 2001 From: GaBaljaintheroom Date: Thu, 26 Sep 2024 12:36:04 +0900 Subject: [PATCH 10/16] =?UTF-8?q?fix:=20response=20->=20param=20=EB=84=A4?= =?UTF-8?q?=EC=9D=B4=EB=B0=8D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/response/ArtistNameApiResponse.java | 4 +- .../artist/service/ArtistAdminService.java | 6 +- .../ArtistNameServiceParam.java} | 6 +- .../controller/GenreAdminController.java | 4 +- .../dto/response/GenreNameApiResponse.java | 4 +- .../genre/service/GenreAdminService.java | 10 ++-- .../GenreNameServiceParam.java} | 6 +- .../show/controller/ShowController.java | 2 +- .../dto/param/SeatTypePriceApiParam.java | 11 ++++ .../ShowArtistApiParam.java} | 10 ++-- .../ShowGenreApiParam.java} | 10 ++-- .../ShowPaginationApiParam.java | 2 +- .../dto/param/ShowTicketingTimeApiParam.java | 20 +++++++ .../dto/param/TicketingSiteApiParam.java | 11 ++++ .../response/SeatTypePriceApiResponse.java | 11 ---- .../dto/response/ShowDetailApiResponse.java | 25 +++++---- .../dto/response/ShowInfoApiResponse.java | 5 +- .../ShowTicketingTimeApiResponse.java | 20 ------- ...ertReservationAvailabilityApiResponse.java | 28 ---------- ...tingAlertReservationStatusApiResponse.java | 29 ---------- .../response/TicketingSiteApiResponse.java | 11 ---- .../ShowArtistServiceParam.java} | 8 +-- .../ShowGenreServiceParam.java} | 8 +-- .../ShowTicketingTimeServiceParam.java | 2 +- .../response/ShowDetailServiceResponse.java | 15 +++-- .../ShowGenreSimpleServiceResponse.java | 19 ------- .../dto/response/ShowInfoServiceResponse.java | 56 ++++++++++--------- .../response/ShowInterestServiceResponse.java | 12 ---- .../ShowTicketingTimeServiceResponse.java | 20 ------- ...eservationAvailabilityServiceResponse.java | 28 ---------- ...AlertReservationStatusServiceResponse.java | 43 -------------- .../ArtistNamesWithShowIdDomainParam.java | 12 ++++ .../ArtistNamesWithShowIdDomainResponse.java | 11 ---- ...a => GenreNamesWithShowIdDomainParam.java} | 2 +- .../ShowWithTicketingTimesDomainParam.java | 12 ++++ .../ShowWithTicketingTimesDomainResponse.java | 10 ---- .../show/ShowQuerydslRepository.java | 4 +- .../show/ShowQuerydslRepositoryImpl.java | 6 +- .../ShowArtistQuerydslRepository.java | 4 +- .../ShowArtistQuerydslRepositoryImpl.java | 6 +- .../ShowGenreQuerydslRepository.java | 4 +- .../ShowGenreQuerydslRepositoryImpl.java | 6 +- .../org/example/usecase/ArtistUseCase.java | 4 +- .../org/example/usecase/GenreUseCase.java | 4 +- .../org/example/usecase/ShowAdminUseCase.java | 4 +- 45 files changed, 185 insertions(+), 350 deletions(-) rename app/api/show-api/src/main/java/com/example/artist/service/dto/{response/ArtistNameServiceResponse.java => param/ArtistNameServiceParam.java} (57%) rename app/api/show-api/src/main/java/com/example/genre/service/dto/{response/GenreNameServiceResponse.java => param/GenreNameServiceParam.java} (57%) create mode 100644 app/api/show-api/src/main/java/com/example/show/controller/dto/param/SeatTypePriceApiParam.java rename app/api/show-api/src/main/java/com/example/show/controller/dto/{response/ShowArtistApiResponse.java => param/ShowArtistApiParam.java} (60%) rename app/api/show-api/src/main/java/com/example/show/controller/dto/{response/ShowGenreApiResponse.java => param/ShowGenreApiParam.java} (52%) rename app/api/show-api/src/main/java/com/example/show/controller/dto/{response => param}/ShowPaginationApiParam.java (95%) create mode 100644 app/api/show-api/src/main/java/com/example/show/controller/dto/param/ShowTicketingTimeApiParam.java create mode 100644 app/api/show-api/src/main/java/com/example/show/controller/dto/param/TicketingSiteApiParam.java delete mode 100644 app/api/show-api/src/main/java/com/example/show/controller/dto/response/SeatTypePriceApiResponse.java delete mode 100644 app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowTicketingTimeApiResponse.java delete mode 100644 app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingAlertReservationAvailabilityApiResponse.java delete mode 100644 app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingAlertReservationStatusApiResponse.java delete mode 100644 app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingSiteApiResponse.java rename app/api/show-api/src/main/java/com/example/show/service/dto/{response/ShowArtistServiceResponse.java => param/ShowArtistServiceParam.java} (57%) rename app/api/show-api/src/main/java/com/example/show/service/dto/{response/ShowGenreServiceResponse.java => param/ShowGenreServiceParam.java} (52%) rename app/api/show-api/src/main/java/com/example/show/service/dto/{response => param}/ShowTicketingTimeServiceParam.java (92%) delete mode 100644 app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowGenreSimpleServiceResponse.java delete mode 100644 app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowInterestServiceResponse.java delete mode 100644 app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowTicketingTimeServiceResponse.java delete mode 100644 app/api/show-api/src/main/java/com/example/show/service/dto/response/TicketingAlertReservationAvailabilityServiceResponse.java delete mode 100644 app/api/show-api/src/main/java/com/example/show/service/dto/response/TicketingAlertReservationStatusServiceResponse.java create mode 100644 app/domain/show-domain/src/main/java/org/example/dto/artist/param/ArtistNamesWithShowIdDomainParam.java delete mode 100644 app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistNamesWithShowIdDomainResponse.java rename app/domain/show-domain/src/main/java/org/example/dto/genre/response/{GenreNamesWithShowIdDomainResponse.java => GenreNamesWithShowIdDomainParam.java} (75%) create mode 100644 app/domain/show-domain/src/main/java/org/example/dto/show/param/ShowWithTicketingTimesDomainParam.java delete mode 100644 app/domain/show-domain/src/main/java/org/example/dto/show/response/ShowWithTicketingTimesDomainResponse.java diff --git a/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistNameApiResponse.java b/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistNameApiResponse.java index c4c0d6c7..c265a666 100644 --- a/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistNameApiResponse.java +++ b/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistNameApiResponse.java @@ -1,6 +1,6 @@ package com.example.artist.controller.dto.response; -import com.example.artist.service.dto.response.ArtistNameServiceResponse; +import com.example.artist.service.dto.param.ArtistNameServiceParam; import java.util.UUID; public record ArtistNameApiResponse( @@ -9,7 +9,7 @@ public record ArtistNameApiResponse( ) { public ArtistNameApiResponse( - ArtistNameServiceResponse artistKoreanNameServiceResponse + ArtistNameServiceParam artistKoreanNameServiceResponse ) { this( artistKoreanNameServiceResponse.id(), diff --git a/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java b/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java index d2bd3540..734622b3 100644 --- a/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java +++ b/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java @@ -1,8 +1,8 @@ package com.example.artist.service; +import com.example.artist.service.dto.param.ArtistNameServiceParam; import com.example.artist.service.dto.request.ArtistWithGenreCreateServiceRequest; import com.example.artist.service.dto.response.ArtistDetailServiceResponse; -import com.example.artist.service.dto.response.ArtistNameServiceResponse; import java.util.List; import lombok.RequiredArgsConstructor; import org.example.usecase.ArtistUseCase; @@ -14,9 +14,9 @@ public class ArtistAdminService { private final ArtistUseCase artistUseCase; - public List findAllArtistName() { + public List findAllArtistName() { return artistUseCase.findAllArtistKoreanName().stream() - .map(ArtistNameServiceResponse::new) + .map(ArtistNameServiceParam::new) .toList(); } diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/response/ArtistNameServiceResponse.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/param/ArtistNameServiceParam.java similarity index 57% rename from app/api/show-api/src/main/java/com/example/artist/service/dto/response/ArtistNameServiceResponse.java rename to app/api/show-api/src/main/java/com/example/artist/service/dto/param/ArtistNameServiceParam.java index e50be448..a4442163 100644 --- a/app/api/show-api/src/main/java/com/example/artist/service/dto/response/ArtistNameServiceResponse.java +++ b/app/api/show-api/src/main/java/com/example/artist/service/dto/param/ArtistNameServiceParam.java @@ -1,13 +1,13 @@ -package com.example.artist.service.dto.response; +package com.example.artist.service.dto.param; import java.util.UUID; import org.example.dto.artist.response.ArtistNameDomainResponse; -public record ArtistNameServiceResponse( +public record ArtistNameServiceParam( UUID id, String name ) { - public ArtistNameServiceResponse(ArtistNameDomainResponse artistKoreanNameResponse) { + public ArtistNameServiceParam(ArtistNameDomainResponse artistKoreanNameResponse) { this( artistKoreanNameResponse.id(), artistKoreanNameResponse.name() diff --git a/app/api/show-api/src/main/java/com/example/genre/controller/GenreAdminController.java b/app/api/show-api/src/main/java/com/example/genre/controller/GenreAdminController.java index 6530f55a..462470d9 100644 --- a/app/api/show-api/src/main/java/com/example/genre/controller/GenreAdminController.java +++ b/app/api/show-api/src/main/java/com/example/genre/controller/GenreAdminController.java @@ -4,7 +4,7 @@ import com.example.genre.controller.dto.request.GenreUpdateApiForm; import com.example.genre.controller.dto.response.GenreNameApiResponse; import com.example.genre.service.GenreAdminService; -import com.example.genre.service.dto.response.GenreNameServiceResponse; +import com.example.genre.service.dto.param.GenreNameServiceParam; import jakarta.validation.Valid; import java.util.List; import java.util.UUID; @@ -48,7 +48,7 @@ public String findAllGenres(Model model) { @GetMapping("/{id}") public String findGenre(@PathVariable("id") UUID id, Model model) { - GenreNameServiceResponse genreNameServiceResponse = genreAdminService.findGenreById( + GenreNameServiceParam genreNameServiceResponse = genreAdminService.findGenreById( id); GenreNameApiResponse genreNameApiFormResponse = new GenreNameApiResponse( genreNameServiceResponse.id(), diff --git a/app/api/show-api/src/main/java/com/example/genre/controller/dto/response/GenreNameApiResponse.java b/app/api/show-api/src/main/java/com/example/genre/controller/dto/response/GenreNameApiResponse.java index 9e24c5cd..3ea152cb 100644 --- a/app/api/show-api/src/main/java/com/example/genre/controller/dto/response/GenreNameApiResponse.java +++ b/app/api/show-api/src/main/java/com/example/genre/controller/dto/response/GenreNameApiResponse.java @@ -1,6 +1,6 @@ package com.example.genre.controller.dto.response; -import com.example.genre.service.dto.response.GenreNameServiceResponse; +import com.example.genre.service.dto.param.GenreNameServiceParam; import java.util.UUID; public record GenreNameApiResponse( @@ -8,7 +8,7 @@ public record GenreNameApiResponse( String name ) { - public GenreNameApiResponse(GenreNameServiceResponse genreNameServiceResponse) { + public GenreNameApiResponse(GenreNameServiceParam genreNameServiceResponse) { this ( genreNameServiceResponse.id(), genreNameServiceResponse.name() diff --git a/app/api/show-api/src/main/java/com/example/genre/service/GenreAdminService.java b/app/api/show-api/src/main/java/com/example/genre/service/GenreAdminService.java index efd0affe..2180bcc5 100644 --- a/app/api/show-api/src/main/java/com/example/genre/service/GenreAdminService.java +++ b/app/api/show-api/src/main/java/com/example/genre/service/GenreAdminService.java @@ -1,8 +1,8 @@ package com.example.genre.service; +import com.example.genre.service.dto.param.GenreNameServiceParam; import com.example.genre.service.dto.request.GenreCreateServiceRequest; import com.example.genre.service.dto.request.GenreUpdateServiceRequest; -import com.example.genre.service.dto.response.GenreNameServiceResponse; import java.util.List; import java.util.UUID; import lombok.RequiredArgsConstructor; @@ -20,10 +20,10 @@ public void save(GenreCreateServiceRequest genreCreateServiceRequest) { genreUseCase.save(genreCreateServiceRequest.toGenre()); } - public List findAllGenres() { + public List findAllGenres() { List genres = genreUseCase.findAllGenres(); return genres.stream() - .map(genre -> new GenreNameServiceResponse(genre.getId(), genre.getName())) + .map(genre -> new GenreNameServiceParam(genre.getId(), genre.getName())) .toList(); } @@ -35,9 +35,9 @@ public void deleteGenre(UUID id) { genreUseCase.deleteGenre(id); } - public GenreNameServiceResponse findGenreById(UUID id) { + public GenreNameServiceParam findGenreById(UUID id) { Genre genre = genreUseCase.findGenreById(id); - return new GenreNameServiceResponse(genre.getId(), genre.getName()); + return new GenreNameServiceParam(genre.getId(), genre.getName()); } } diff --git a/app/api/show-api/src/main/java/com/example/genre/service/dto/response/GenreNameServiceResponse.java b/app/api/show-api/src/main/java/com/example/genre/service/dto/param/GenreNameServiceParam.java similarity index 57% rename from app/api/show-api/src/main/java/com/example/genre/service/dto/response/GenreNameServiceResponse.java rename to app/api/show-api/src/main/java/com/example/genre/service/dto/param/GenreNameServiceParam.java index 53cb385d..44c188ad 100644 --- a/app/api/show-api/src/main/java/com/example/genre/service/dto/response/GenreNameServiceResponse.java +++ b/app/api/show-api/src/main/java/com/example/genre/service/dto/param/GenreNameServiceParam.java @@ -1,14 +1,14 @@ -package com.example.genre.service.dto.response; +package com.example.genre.service.dto.param; import java.util.UUID; import org.example.dto.genre.response.GenreNameDomainResponse; -public record GenreNameServiceResponse( +public record GenreNameServiceParam( UUID id, String name ) { - public GenreNameServiceResponse(GenreNameDomainResponse genreNameResponse) { + public GenreNameServiceParam(GenreNameDomainResponse genreNameResponse) { this( genreNameResponse.id(), genreNameResponse.name() diff --git a/app/api/show-api/src/main/java/com/example/show/controller/ShowController.java b/app/api/show-api/src/main/java/com/example/show/controller/ShowController.java index 369543e8..9b9f6837 100644 --- a/app/api/show-api/src/main/java/com/example/show/controller/ShowController.java +++ b/app/api/show-api/src/main/java/com/example/show/controller/ShowController.java @@ -1,10 +1,10 @@ package com.example.show.controller; +import com.example.show.controller.dto.param.ShowPaginationApiParam; import com.example.show.controller.dto.param.ShowSearchPaginationApiParam; import com.example.show.controller.dto.request.ShowPaginationApiRequest; import com.example.show.controller.dto.request.ShowSearchPaginationApiRequest; import com.example.show.controller.dto.response.ShowDetailApiResponse; -import com.example.show.controller.dto.response.ShowPaginationApiParam; import com.example.show.service.ShowService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/param/SeatTypePriceApiParam.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/param/SeatTypePriceApiParam.java new file mode 100644 index 00000000..abe4449a --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/show/controller/dto/param/SeatTypePriceApiParam.java @@ -0,0 +1,11 @@ +package com.example.show.controller.dto.param; + +public record SeatTypePriceApiParam( + String seatType, + int price +) { + public static SeatTypePriceApiParam of(String seatType, int price) { + return new SeatTypePriceApiParam(seatType, price); + } + +} diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowArtistApiResponse.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/param/ShowArtistApiParam.java similarity index 60% rename from app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowArtistApiResponse.java rename to app/api/show-api/src/main/java/com/example/show/controller/dto/param/ShowArtistApiParam.java index 6a3ac3bb..2ff93181 100644 --- a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowArtistApiResponse.java +++ b/app/api/show-api/src/main/java/com/example/show/controller/dto/param/ShowArtistApiParam.java @@ -1,12 +1,12 @@ -package com.example.show.controller.dto.response; +package com.example.show.controller.dto.param; -import com.example.show.service.dto.response.ShowArtistServiceResponse; +import com.example.show.service.dto.param.ShowArtistServiceParam; import io.swagger.v3.oas.annotations.media.Schema; import java.util.UUID; import lombok.Builder; @Builder -public record ShowArtistApiResponse( +public record ShowArtistApiParam( @Schema(description = "아티스트 ID") UUID id, @@ -18,8 +18,8 @@ public record ShowArtistApiResponse( String imageURL ) { - public static ShowArtistApiResponse from(ShowArtistServiceResponse artists) { - return ShowArtistApiResponse.builder() + public static ShowArtistApiParam from(ShowArtistServiceParam artists) { + return ShowArtistApiParam.builder() .id(artists.id()) .name(artists.name()) .imageURL(artists.image()) diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowGenreApiResponse.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/param/ShowGenreApiParam.java similarity index 52% rename from app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowGenreApiResponse.java rename to app/api/show-api/src/main/java/com/example/show/controller/dto/param/ShowGenreApiParam.java index 0db05f6f..577f4586 100644 --- a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowGenreApiResponse.java +++ b/app/api/show-api/src/main/java/com/example/show/controller/dto/param/ShowGenreApiParam.java @@ -1,12 +1,12 @@ -package com.example.show.controller.dto.response; +package com.example.show.controller.dto.param; -import com.example.show.service.dto.response.ShowGenreServiceResponse; +import com.example.show.service.dto.param.ShowGenreServiceParam; import io.swagger.v3.oas.annotations.media.Schema; import java.util.UUID; import lombok.Builder; @Builder -public record ShowGenreApiResponse( +public record ShowGenreApiParam( @Schema(description = "장르 ID") UUID id, @@ -15,8 +15,8 @@ public record ShowGenreApiResponse( String name ) { - public static ShowGenreApiResponse from(ShowGenreServiceResponse genre) { - return ShowGenreApiResponse.builder() + public static ShowGenreApiParam from(ShowGenreServiceParam genre) { + return ShowGenreApiParam.builder() .id(genre.id()) .name(genre.name()) .build(); diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowPaginationApiParam.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/param/ShowPaginationApiParam.java similarity index 95% rename from app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowPaginationApiParam.java rename to app/api/show-api/src/main/java/com/example/show/controller/dto/param/ShowPaginationApiParam.java index 11590c22..a77e6303 100644 --- a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowPaginationApiParam.java +++ b/app/api/show-api/src/main/java/com/example/show/controller/dto/param/ShowPaginationApiParam.java @@ -1,4 +1,4 @@ -package com.example.show.controller.dto.response; +package com.example.show.controller.dto.param; import com.example.show.service.dto.response.ShowPaginationServiceResponse; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/param/ShowTicketingTimeApiParam.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/param/ShowTicketingTimeApiParam.java new file mode 100644 index 00000000..7918bcfb --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/show/controller/dto/param/ShowTicketingTimeApiParam.java @@ -0,0 +1,20 @@ +package com.example.show.controller.dto.param; + +import com.example.show.controller.vo.TicketingApiType; +import com.example.show.service.dto.param.ShowTicketingTimeServiceParam; +import lombok.Builder; +import org.example.util.DateTimeUtil; + +@Builder +public record ShowTicketingTimeApiParam( + TicketingApiType ticketingApiType, + String ticketingAt +) { + + public static ShowTicketingTimeApiParam from(ShowTicketingTimeServiceParam response) { + return ShowTicketingTimeApiParam.builder() + .ticketingApiType(response.ticketingType()) + .ticketingAt(DateTimeUtil.formatDateTime(response.ticketingAt())) + .build(); + } +} diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/param/TicketingSiteApiParam.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/param/TicketingSiteApiParam.java new file mode 100644 index 00000000..2529c273 --- /dev/null +++ b/app/api/show-api/src/main/java/com/example/show/controller/dto/param/TicketingSiteApiParam.java @@ -0,0 +1,11 @@ +package com.example.show.controller.dto.param; + +public record TicketingSiteApiParam( + String name, + String link +) { + public static TicketingSiteApiParam of(String name, String link) { + return new TicketingSiteApiParam(name, link); + } + +} diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/SeatTypePriceApiResponse.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/SeatTypePriceApiResponse.java deleted file mode 100644 index 65abc780..00000000 --- a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/SeatTypePriceApiResponse.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.example.show.controller.dto.response; - -public record SeatTypePriceApiResponse( - String seatType, - int price -) { - public static SeatTypePriceApiResponse of(String seatType, int price) { - return new SeatTypePriceApiResponse(seatType, price); - } - -} diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowDetailApiResponse.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowDetailApiResponse.java index a4db43e3..496cabb8 100644 --- a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowDetailApiResponse.java +++ b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowDetailApiResponse.java @@ -1,5 +1,10 @@ package com.example.show.controller.dto.response; +import com.example.show.controller.dto.param.SeatTypePriceApiParam; +import com.example.show.controller.dto.param.ShowArtistApiParam; +import com.example.show.controller.dto.param.ShowGenreApiParam; +import com.example.show.controller.dto.param.ShowTicketingTimeApiParam; +import com.example.show.controller.dto.param.TicketingSiteApiParam; import com.example.show.service.dto.response.ShowDetailServiceResponse; import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; @@ -32,19 +37,19 @@ public record ShowDetailApiResponse( boolean isInterested, @Schema(description = "아티스트 정보") - List artists, + List artists, @Schema(description = "장르 정보") - List genres, + List genres, @Schema(description = "티켓팅 예매 시간 정보") - List ticketingTimes, + List ticketingTimes, @Schema(description = "좌석별 가격 정보") - List seats, + List seats, @Schema(description = "티켓팅 사이트별 링크") - List ticketingSites + List ticketingSites ) { public static ShowDetailApiResponse from(ShowDetailServiceResponse show) { @@ -58,27 +63,27 @@ public static ShowDetailApiResponse from(ShowDetailServiceResponse show) { .isInterested(show.isInterested()) .artists( show.artists().stream() - .map(ShowArtistApiResponse::from) + .map(ShowArtistApiParam::from) .toList() ) .genres( show.genres().stream() - .map(ShowGenreApiResponse::from) + .map(ShowGenreApiParam::from) .toList() ) .ticketingTimes( show.ticketingTimes().stream() - .map(ShowTicketingTimeApiResponse::from) + .map(ShowTicketingTimeApiParam::from) .toList() ) .seats( show.seats().priceBySeat().entrySet().stream() - .map(entry -> SeatTypePriceApiResponse.of(entry.getKey(), entry.getValue())) + .map(entry -> SeatTypePriceApiParam.of(entry.getKey(), entry.getValue())) .toList() ) .ticketingSites( show.ticketingSites().siteByURL().entrySet().stream() - .map(entry -> TicketingSiteApiResponse.of(entry.getKey(), entry.getValue())) + .map(entry -> TicketingSiteApiParam.of(entry.getKey(), entry.getValue())) .toList() ) .build(); diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowInfoApiResponse.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowInfoApiResponse.java index d3883706..39bc28e5 100644 --- a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowInfoApiResponse.java +++ b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowInfoApiResponse.java @@ -2,6 +2,7 @@ import com.example.artist.controller.dto.response.ArtistNameApiResponse; import com.example.genre.controller.dto.response.GenreNameApiResponse; +import com.example.show.controller.dto.param.ShowTicketingTimeApiParam; import com.example.show.service.dto.response.ShowInfoServiceResponse; import java.time.LocalDate; import java.util.List; @@ -19,7 +20,7 @@ public record ShowInfoApiResponse( int viewCount, ShowSeatApiResponse seatInfoApiResponse, ShowTicketingSiteApiResponse ticketingSiteApiResponse, - List ticketingTimes, + List ticketingTimes, List artistKoreanNameResponses, List genreNameResponses ) { @@ -37,7 +38,7 @@ public ShowInfoApiResponse(ShowInfoServiceResponse showInfoServiceResponse) { ShowSeatApiResponse.from(showInfoServiceResponse.seats()), ShowTicketingSiteApiResponse.from(showInfoServiceResponse.ticketingSiteInfos()), showInfoServiceResponse.ticketingSites().stream() - .map(ShowTicketingTimeApiResponse::from) + .map(ShowTicketingTimeApiParam::from) .toList(), showInfoServiceResponse.artistKoreanNameResponses().stream() .map(ArtistNameApiResponse::new) diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowTicketingTimeApiResponse.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowTicketingTimeApiResponse.java deleted file mode 100644 index 261b61dd..00000000 --- a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowTicketingTimeApiResponse.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.example.show.controller.dto.response; - -import com.example.show.controller.vo.TicketingApiType; -import com.example.show.service.dto.response.ShowTicketingTimeServiceResponse; -import lombok.Builder; -import org.example.util.DateTimeUtil; - -@Builder -public record ShowTicketingTimeApiResponse( - TicketingApiType ticketingApiType, - String ticketingAt -) { - - public static ShowTicketingTimeApiResponse from(ShowTicketingTimeServiceResponse response) { - return ShowTicketingTimeApiResponse.builder() - .ticketingApiType(response.ticketingApiType()) - .ticketingAt(DateTimeUtil.formatDateTime(response.ticketingAt())) - .build(); - } -} diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingAlertReservationAvailabilityApiResponse.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingAlertReservationAvailabilityApiResponse.java deleted file mode 100644 index 41b32c8b..00000000 --- a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingAlertReservationAvailabilityApiResponse.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.example.show.controller.dto.response; - -import com.example.show.service.dto.response.TicketingAlertReservationAvailabilityServiceResponse; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Builder; - -@Builder -public record TicketingAlertReservationAvailabilityApiResponse( - @Schema(description = "공연 티켓팅 24 시간 전") - boolean canReserve24, - - @Schema(description = "공연 티켓팅 6 시간 전") - boolean canReserve6, - - @Schema(description = "공연 티켓팅 1 시간 전") - boolean canReserve1 -) { - - public static TicketingAlertReservationAvailabilityApiResponse from( - TicketingAlertReservationAvailabilityServiceResponse response - ) { - return TicketingAlertReservationAvailabilityApiResponse.builder() - .canReserve24(response.canReserve24()) - .canReserve6(response.canReserve6()) - .canReserve1(response.canReserve1()) - .build(); - } -} diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingAlertReservationStatusApiResponse.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingAlertReservationStatusApiResponse.java deleted file mode 100644 index e6d2d03b..00000000 --- a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingAlertReservationStatusApiResponse.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.example.show.controller.dto.response; - -import com.example.show.service.dto.response.TicketingAlertReservationStatusServiceResponse; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Builder; - -@Builder -public record TicketingAlertReservationStatusApiResponse( - - @Schema(description = "공연 티켓팅 24 시간 전") - boolean before24, - - @Schema(description = "공연 티켓팅 6 시간 전") - boolean before6, - - @Schema(description = "공연 티켓팅 1 시간 전") - boolean before1 -) { - - public static TicketingAlertReservationStatusApiResponse from( - TicketingAlertReservationStatusServiceResponse response - ) { - return TicketingAlertReservationStatusApiResponse.builder() - .before24(response.before24()) - .before6(response.before6()) - .before1(response.before1()) - .build(); - } -} diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingSiteApiResponse.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingSiteApiResponse.java deleted file mode 100644 index 6827577e..00000000 --- a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/TicketingSiteApiResponse.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.example.show.controller.dto.response; - -public record TicketingSiteApiResponse( - String name, - String link -) { - public static TicketingSiteApiResponse of(String name, String link) { - return new TicketingSiteApiResponse(name, link); - } - -} diff --git a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowArtistServiceResponse.java b/app/api/show-api/src/main/java/com/example/show/service/dto/param/ShowArtistServiceParam.java similarity index 57% rename from app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowArtistServiceResponse.java rename to app/api/show-api/src/main/java/com/example/show/service/dto/param/ShowArtistServiceParam.java index 882b01da..2baf9e78 100644 --- a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowArtistServiceResponse.java +++ b/app/api/show-api/src/main/java/com/example/show/service/dto/param/ShowArtistServiceParam.java @@ -1,18 +1,18 @@ -package com.example.show.service.dto.response; +package com.example.show.service.dto.param; import java.util.UUID; import lombok.Builder; import org.example.dto.artist.response.ArtistDomainResponse; @Builder -public record ShowArtistServiceResponse( +public record ShowArtistServiceParam( UUID id, String name, String image ) { - public static ShowArtistServiceResponse from(ArtistDomainResponse artist) { - return ShowArtistServiceResponse.builder() + public static ShowArtistServiceParam from(ArtistDomainResponse artist) { + return ShowArtistServiceParam.builder() .id(artist.id()) .name(artist.name()) .image(artist.image()) diff --git a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowGenreServiceResponse.java b/app/api/show-api/src/main/java/com/example/show/service/dto/param/ShowGenreServiceParam.java similarity index 52% rename from app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowGenreServiceResponse.java rename to app/api/show-api/src/main/java/com/example/show/service/dto/param/ShowGenreServiceParam.java index 5b4dc655..2d4eb8f7 100644 --- a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowGenreServiceResponse.java +++ b/app/api/show-api/src/main/java/com/example/show/service/dto/param/ShowGenreServiceParam.java @@ -1,17 +1,17 @@ -package com.example.show.service.dto.response; +package com.example.show.service.dto.param; import java.util.UUID; import lombok.Builder; import org.example.dto.genre.response.GenreDomainResponse; @Builder -public record ShowGenreServiceResponse( +public record ShowGenreServiceParam( UUID id, String name ) { - public static ShowGenreServiceResponse from(GenreDomainResponse genre) { - return ShowGenreServiceResponse.builder() + public static ShowGenreServiceParam from(GenreDomainResponse genre) { + return ShowGenreServiceParam.builder() .id(genre.id()) .name(genre.name()) .build(); diff --git a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowTicketingTimeServiceParam.java b/app/api/show-api/src/main/java/com/example/show/service/dto/param/ShowTicketingTimeServiceParam.java similarity index 92% rename from app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowTicketingTimeServiceParam.java rename to app/api/show-api/src/main/java/com/example/show/service/dto/param/ShowTicketingTimeServiceParam.java index f280b3b6..0f039a26 100644 --- a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowTicketingTimeServiceParam.java +++ b/app/api/show-api/src/main/java/com/example/show/service/dto/param/ShowTicketingTimeServiceParam.java @@ -1,4 +1,4 @@ -package com.example.show.service.dto.response; +package com.example.show.service.dto.param; import com.example.show.controller.vo.TicketingApiType; import java.time.LocalDateTime; diff --git a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowDetailServiceResponse.java b/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowDetailServiceResponse.java index 835af703..89bc9193 100644 --- a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowDetailServiceResponse.java +++ b/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowDetailServiceResponse.java @@ -1,5 +1,8 @@ package com.example.show.service.dto.response; +import com.example.show.service.dto.param.ShowArtistServiceParam; +import com.example.show.service.dto.param.ShowGenreServiceParam; +import com.example.show.service.dto.param.ShowTicketingTimeServiceParam; import java.time.LocalDate; import java.util.List; import java.util.UUID; @@ -17,9 +20,9 @@ public record ShowDetailServiceResponse( String location, String posterImageURL, boolean isInterested, - List artists, - List genres, - List ticketingTimes, + List artists, + List genres, + List ticketingTimes, ShowSeatServiceResponse seats, ShowTicketingSiteServiceResponse ticketingSites ) { @@ -39,16 +42,16 @@ public static ShowDetailServiceResponse from( .isInterested(isInterested) .artists( show.artists().stream() - .map(ShowArtistServiceResponse::from) + .map(ShowArtistServiceParam::from) .toList() ) .genres( show.genres().stream() - .map(ShowGenreServiceResponse::from) + .map(ShowGenreServiceParam::from) .toList() ) .ticketingTimes(show.showTicketingTimes().stream() - .map(ShowTicketingTimeServiceResponse::from) + .map(ShowTicketingTimeServiceParam::from) .toList() ) .seats(ShowSeatServiceResponse.from(show.show().seatPrices())) diff --git a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowGenreSimpleServiceResponse.java b/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowGenreSimpleServiceResponse.java deleted file mode 100644 index 1e327b36..00000000 --- a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowGenreSimpleServiceResponse.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.example.show.service.dto.response; - -import java.util.UUID; -import lombok.Builder; -import org.example.dto.genre.response.GenreDomainResponse; - -@Builder -public record ShowGenreSimpleServiceResponse( - UUID id, - String name -) { - - public static ShowGenreSimpleServiceResponse from(GenreDomainResponse genre) { - return ShowGenreSimpleServiceResponse.builder() - .id(genre.id()) - .name(genre.name()) - .build(); - } -} diff --git a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowInfoServiceResponse.java b/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowInfoServiceResponse.java index 15950976..12e9f79b 100644 --- a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowInfoServiceResponse.java +++ b/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowInfoServiceResponse.java @@ -1,19 +1,20 @@ package com.example.show.service.dto.response; -import com.example.artist.service.dto.response.ArtistNameServiceResponse; -import com.example.genre.service.dto.response.GenreNameServiceResponse; +import com.example.artist.service.dto.param.ArtistNameServiceParam; +import com.example.genre.service.dto.param.GenreNameServiceParam; +import com.example.show.service.dto.param.ShowTicketingTimeServiceParam; import java.time.LocalDate; import java.util.List; import java.util.Set; import java.util.UUID; import lombok.Builder; +import org.example.dto.artist.param.ArtistNamesWithShowIdDomainParam; import org.example.dto.artist.response.ArtistNameDomainResponse; -import org.example.dto.artist.response.ArtistNamesWithShowIdDomainResponse; import org.example.dto.genre.response.GenreNameDomainResponse; -import org.example.dto.genre.response.GenreNamesWithShowIdDomainResponse; +import org.example.dto.genre.response.GenreNamesWithShowIdDomainParam; +import org.example.dto.show.param.ShowWithTicketingTimesDomainParam; import org.example.dto.show.response.ShowInfoDomainResponse; import org.example.dto.show.response.ShowTicketingTimeDomainResponse; -import org.example.dto.show.response.ShowWithTicketingTimesDomainResponse; @Builder public record ShowInfoServiceResponse( @@ -27,9 +28,9 @@ public record ShowInfoServiceResponse( int viewCount, ShowSeatServiceResponse seats, ShowTicketingSiteServiceResponse ticketingSiteInfos, - List ticketingSites, - List artistKoreanNameResponses, - List genreNameResponses + List ticketingSites, + List artistKoreanNameResponses, + List genreNameResponses ) { public ShowInfoServiceResponse(ShowInfoDomainResponse showInfo) { @@ -51,9 +52,9 @@ public ShowInfoServiceResponse(ShowInfoDomainResponse showInfo) { } public static List as( - List showWithTicketingTimes, - List artistNamesWithShowId, - List genreNamesWithShowId + List showWithTicketingTimes, + List artistNamesWithShowId, + List genreNamesWithShowId ) { return showWithTicketingTimes.stream() .map(showWithTicketingTime -> { @@ -77,9 +78,10 @@ public static List as( showWithTicketingTime.show().viewCount(), ShowSeatServiceResponse.from(showWithTicketingTime.show().seatPrices()), ShowTicketingSiteServiceResponse.from( - showWithTicketingTime.show().ticketingSites()), + showWithTicketingTime.show().ticketingSites() + ), showWithTicketingTime.ticketingTimes().stream() - .map(ShowTicketingTimeServiceResponse::from) + .map(ShowTicketingTimeServiceParam::from) .toList(), artistKoreanNameResponses, genreNameResponses @@ -88,51 +90,51 @@ public static List as( .toList(); } - private static List toShowTicketingTimeServiceResponses( + private static List toShowTicketingTimeServiceResponses( Set ticketingSites ) { return ticketingSites.stream() - .map(ShowTicketingTimeServiceResponse::from) + .map(ShowTicketingTimeServiceParam::from) .toList(); } - private static List toArtistKoreanNameServiceResponses( + private static List toArtistKoreanNameServiceResponses( Set artistKoreanNameResponses) { return artistKoreanNameResponses .stream() - .map(ArtistNameServiceResponse::new) + .map(ArtistNameServiceParam::new) .toList(); } - private static List toGenreNameServiceResponses( + private static List toGenreNameServiceResponses( Set genreNameResponses) { return genreNameResponses .stream() - .map(GenreNameServiceResponse::new) + .map(GenreNameServiceParam::new) .toList(); } - private static List getArtistKoreanNameResponses( - List artistNamesWithShowId, - ShowWithTicketingTimesDomainResponse showWitTicketingTimes + private static List getArtistKoreanNameResponses( + List artistNamesWithShowId, + ShowWithTicketingTimesDomainParam showWitTicketingTimes ) { return artistNamesWithShowId.stream() .filter( artistResponse -> artistResponse.showId().equals(showWitTicketingTimes.show().id())) .flatMap(artistResponse -> artistResponse.koreanNameDomainResponses().stream()) - .map(ArtistNameServiceResponse::new) + .map(ArtistNameServiceParam::new) .toList(); } - private static List getGenreNameResponses( - List genreNamesWithShowId, - ShowWithTicketingTimesDomainResponse showWithTicketingTimes + private static List getGenreNameResponses( + List genreNamesWithShowId, + ShowWithTicketingTimesDomainParam showWithTicketingTimes ) { return genreNamesWithShowId.stream() .filter( genreResponse -> genreResponse.showId().equals(showWithTicketingTimes.show().id())) .flatMap(genreResponse -> genreResponse.genreNames().stream()) - .map(GenreNameServiceResponse::new) + .map(GenreNameServiceParam::new) .toList(); } } diff --git a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowInterestServiceResponse.java b/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowInterestServiceResponse.java deleted file mode 100644 index a4558c14..00000000 --- a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowInterestServiceResponse.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.example.show.service.dto.response; - -import org.example.entity.usershow.InterestShow; - -public record ShowInterestServiceResponse( - boolean hasInterest -) { - - public static ShowInterestServiceResponse from(InterestShow interestShow) { - return new ShowInterestServiceResponse(interestShow.hasInterest()); - } -} diff --git a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowTicketingTimeServiceResponse.java b/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowTicketingTimeServiceResponse.java deleted file mode 100644 index de016129..00000000 --- a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowTicketingTimeServiceResponse.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.example.show.service.dto.response; - -import com.example.show.controller.vo.TicketingApiType; -import java.time.LocalDateTime; -import lombok.Builder; -import org.example.dto.show.response.ShowTicketingTimeDomainResponse; - -@Builder -public record ShowTicketingTimeServiceResponse( - TicketingApiType ticketingApiType, - LocalDateTime ticketingAt -) { - - public static ShowTicketingTimeServiceResponse from(ShowTicketingTimeDomainResponse response) { - return ShowTicketingTimeServiceResponse.builder() - .ticketingApiType(TicketingApiType.from(response.ticketingType())) - .ticketingAt(response.ticketingAt()) - .build(); - } -} diff --git a/app/api/show-api/src/main/java/com/example/show/service/dto/response/TicketingAlertReservationAvailabilityServiceResponse.java b/app/api/show-api/src/main/java/com/example/show/service/dto/response/TicketingAlertReservationAvailabilityServiceResponse.java deleted file mode 100644 index 15689d80..00000000 --- a/app/api/show-api/src/main/java/com/example/show/service/dto/response/TicketingAlertReservationAvailabilityServiceResponse.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.example.show.service.dto.response; - -import java.time.Duration; -import java.time.LocalDateTime; -import lombok.Builder; - -@Builder -public record TicketingAlertReservationAvailabilityServiceResponse( - boolean canReserve24, - boolean canReserve6, - boolean canReserve1 -) { - - public static TicketingAlertReservationAvailabilityServiceResponse as(LocalDateTime ticketingAt) { - LocalDateTime now = LocalDateTime.now(); - long hoursDifference = Duration.between(now, ticketingAt).toHours(); - - boolean canReserve24 = hoursDifference >= 24; - boolean canReserve6 = hoursDifference >= 6; - boolean canReserve1 = hoursDifference >= 1; - - return TicketingAlertReservationAvailabilityServiceResponse.builder() - .canReserve24(canReserve24) - .canReserve6(canReserve6) - .canReserve1(canReserve1) - .build(); - } -} diff --git a/app/api/show-api/src/main/java/com/example/show/service/dto/response/TicketingAlertReservationStatusServiceResponse.java b/app/api/show-api/src/main/java/com/example/show/service/dto/response/TicketingAlertReservationStatusServiceResponse.java deleted file mode 100644 index 04c9151c..00000000 --- a/app/api/show-api/src/main/java/com/example/show/service/dto/response/TicketingAlertReservationStatusServiceResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.example.show.service.dto.response; - -import java.time.Duration; -import java.time.LocalDateTime; -import java.util.List; -import lombok.Builder; - -@Builder -public record TicketingAlertReservationStatusServiceResponse( - boolean before24, - boolean before6, - boolean before1 -) { - - public static TicketingAlertReservationStatusServiceResponse as( - List reservedAlerts, - LocalDateTime ticketingAt - ) { - boolean before24 = false; - boolean before6 = false; - boolean before1 = false; - - for (LocalDateTime alertTime : reservedAlerts) { - long hoursDifference = Duration.between(alertTime, ticketingAt).toHours(); - - switch ((int) hoursDifference) { - case 24 -> before24 = true; - case 6 -> before6 = true; - case 1 -> before1 = true; - default -> { - - } - } - } - - return TicketingAlertReservationStatusServiceResponse.builder() - .before24(before24) - .before6(before6) - .before1(before1) - .build(); - } - -} diff --git a/app/domain/show-domain/src/main/java/org/example/dto/artist/param/ArtistNamesWithShowIdDomainParam.java b/app/domain/show-domain/src/main/java/org/example/dto/artist/param/ArtistNamesWithShowIdDomainParam.java new file mode 100644 index 00000000..1219d420 --- /dev/null +++ b/app/domain/show-domain/src/main/java/org/example/dto/artist/param/ArtistNamesWithShowIdDomainParam.java @@ -0,0 +1,12 @@ +package org.example.dto.artist.param; + +import java.util.List; +import java.util.UUID; +import org.example.dto.artist.response.ArtistNameDomainResponse; + +public record ArtistNamesWithShowIdDomainParam( + UUID showId, + List koreanNameDomainResponses +) { + +} diff --git a/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistNamesWithShowIdDomainResponse.java b/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistNamesWithShowIdDomainResponse.java deleted file mode 100644 index dd2bb803..00000000 --- a/app/domain/show-domain/src/main/java/org/example/dto/artist/response/ArtistNamesWithShowIdDomainResponse.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.example.dto.artist.response; - -import java.util.List; -import java.util.UUID; - -public record ArtistNamesWithShowIdDomainResponse( - UUID showId, - List koreanNameDomainResponses -) { - -} diff --git a/app/domain/show-domain/src/main/java/org/example/dto/genre/response/GenreNamesWithShowIdDomainResponse.java b/app/domain/show-domain/src/main/java/org/example/dto/genre/response/GenreNamesWithShowIdDomainParam.java similarity index 75% rename from app/domain/show-domain/src/main/java/org/example/dto/genre/response/GenreNamesWithShowIdDomainResponse.java rename to app/domain/show-domain/src/main/java/org/example/dto/genre/response/GenreNamesWithShowIdDomainParam.java index 265c47ee..36d25045 100644 --- a/app/domain/show-domain/src/main/java/org/example/dto/genre/response/GenreNamesWithShowIdDomainResponse.java +++ b/app/domain/show-domain/src/main/java/org/example/dto/genre/response/GenreNamesWithShowIdDomainParam.java @@ -3,7 +3,7 @@ import java.util.List; import java.util.UUID; -public record GenreNamesWithShowIdDomainResponse( +public record GenreNamesWithShowIdDomainParam( UUID showId, List genreNames ) { diff --git a/app/domain/show-domain/src/main/java/org/example/dto/show/param/ShowWithTicketingTimesDomainParam.java b/app/domain/show-domain/src/main/java/org/example/dto/show/param/ShowWithTicketingTimesDomainParam.java new file mode 100644 index 00000000..2b498937 --- /dev/null +++ b/app/domain/show-domain/src/main/java/org/example/dto/show/param/ShowWithTicketingTimesDomainParam.java @@ -0,0 +1,12 @@ +package org.example.dto.show.param; + +import java.util.List; +import org.example.dto.show.response.ShowDomainResponse; +import org.example.dto.show.response.ShowTicketingTimeDomainResponse; + +public record ShowWithTicketingTimesDomainParam( + ShowDomainResponse show, + List ticketingTimes +) { + +} diff --git a/app/domain/show-domain/src/main/java/org/example/dto/show/response/ShowWithTicketingTimesDomainResponse.java b/app/domain/show-domain/src/main/java/org/example/dto/show/response/ShowWithTicketingTimesDomainResponse.java deleted file mode 100644 index 40846394..00000000 --- a/app/domain/show-domain/src/main/java/org/example/dto/show/response/ShowWithTicketingTimesDomainResponse.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.example.dto.show.response; - -import java.util.List; - -public record ShowWithTicketingTimesDomainResponse( - ShowDomainResponse show, - List ticketingTimes -) { - -} diff --git a/app/domain/show-domain/src/main/java/org/example/repository/show/ShowQuerydslRepository.java b/app/domain/show-domain/src/main/java/org/example/repository/show/ShowQuerydslRepository.java index d8235587..337fa66a 100644 --- a/app/domain/show-domain/src/main/java/org/example/repository/show/ShowQuerydslRepository.java +++ b/app/domain/show-domain/src/main/java/org/example/repository/show/ShowQuerydslRepository.java @@ -4,17 +4,17 @@ import java.util.List; import java.util.Optional; import java.util.UUID; +import org.example.dto.show.param.ShowWithTicketingTimesDomainParam; import org.example.dto.show.request.ShowPaginationDomainRequest; import org.example.dto.show.response.ShowDetailDomainResponse; import org.example.dto.show.response.ShowInfoDomainResponse; import org.example.dto.show.response.ShowTicketingPaginationDomainResponse; -import org.example.dto.show.response.ShowWithTicketingTimesDomainResponse; public interface ShowQuerydslRepository { Optional findShowDetailById(UUID id); - List findShowDetailWithTicketingTimes(); + List findShowDetailWithTicketingTimes(); ShowTicketingPaginationDomainResponse findShows(ShowPaginationDomainRequest request); diff --git a/app/domain/show-domain/src/main/java/org/example/repository/show/ShowQuerydslRepositoryImpl.java b/app/domain/show-domain/src/main/java/org/example/repository/show/ShowQuerydslRepositoryImpl.java index 121e80a6..08ce194a 100644 --- a/app/domain/show-domain/src/main/java/org/example/repository/show/ShowQuerydslRepositoryImpl.java +++ b/app/domain/show-domain/src/main/java/org/example/repository/show/ShowQuerydslRepositoryImpl.java @@ -28,6 +28,7 @@ import org.example.dto.artist.response.ArtistNameDomainResponse; import org.example.dto.genre.response.GenreDomainResponse; import org.example.dto.genre.response.GenreNameDomainResponse; +import org.example.dto.show.param.ShowWithTicketingTimesDomainParam; import org.example.dto.show.request.ShowPaginationDomainRequest; import org.example.dto.show.response.ShowDetailDomainResponse; import org.example.dto.show.response.ShowDomainResponse; @@ -35,7 +36,6 @@ import org.example.dto.show.response.ShowTicketingDomainResponse; import org.example.dto.show.response.ShowTicketingPaginationDomainResponse; import org.example.dto.show.response.ShowTicketingTimeDomainResponse; -import org.example.dto.show.response.ShowWithTicketingTimesDomainResponse; import org.example.entity.show.Show; import org.example.util.SliceUtil; import org.springframework.data.domain.Slice; @@ -60,14 +60,14 @@ public Optional findShowDetailById(UUID id) { } @Override - public List findShowDetailWithTicketingTimes() { + public List findShowDetailWithTicketingTimes() { return jpaQueryFactory.selectFrom(show) .join(showTicketingTime).on(isShowTicketingEqualShowAndIsDeletedFalse()) .where(show.isDeleted.isFalse()) .transform( groupBy(show.id).list( Projections.constructor( - ShowWithTicketingTimesDomainResponse.class, + ShowWithTicketingTimesDomainParam.class, Projections.constructor( ShowDomainResponse.class, show.id, diff --git a/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepository.java b/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepository.java index 35456cbc..747fcf52 100644 --- a/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepository.java +++ b/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepository.java @@ -1,9 +1,9 @@ package org.example.repository.show.showartist; import java.util.List; -import org.example.dto.artist.response.ArtistNamesWithShowIdDomainResponse; +import org.example.dto.artist.param.ArtistNamesWithShowIdDomainParam; public interface ShowArtistQuerydslRepository { - List findArtistKoreanNamesWithShowId(); + List findArtistKoreanNamesWithShowId(); } diff --git a/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepositoryImpl.java b/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepositoryImpl.java index 283f3bd2..4b2d3a71 100644 --- a/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepositoryImpl.java +++ b/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepositoryImpl.java @@ -10,8 +10,8 @@ import com.querydsl.jpa.impl.JPAQueryFactory; import java.util.List; import lombok.RequiredArgsConstructor; +import org.example.dto.artist.param.ArtistNamesWithShowIdDomainParam; import org.example.dto.artist.response.ArtistNameDomainResponse; -import org.example.dto.artist.response.ArtistNamesWithShowIdDomainResponse; import org.springframework.stereotype.Repository; @Repository @@ -21,7 +21,7 @@ public class ShowArtistQuerydslRepositoryImpl implements ShowArtistQuerydslRepos private final JPAQueryFactory jpaQueryFactory; @Override - public List findArtistKoreanNamesWithShowId() { + public List findArtistKoreanNamesWithShowId() { return jpaQueryFactory.selectFrom(showArtist) .join(show).on(show.id.eq(showArtist.showId), show.isDeleted.isFalse()) .join(artist).on(artist.id.eq(showArtist.artistId), artist.isDeleted.isFalse()) @@ -29,7 +29,7 @@ public List findArtistKoreanNamesWithShowId .transform( groupBy(showArtist.id).list( Projections.constructor( - ArtistNamesWithShowIdDomainResponse.class, + ArtistNamesWithShowIdDomainParam.class, show.id, list( Projections.constructor( diff --git a/app/domain/show-domain/src/main/java/org/example/repository/show/showgenre/ShowGenreQuerydslRepository.java b/app/domain/show-domain/src/main/java/org/example/repository/show/showgenre/ShowGenreQuerydslRepository.java index 20682ca4..52ae85fc 100644 --- a/app/domain/show-domain/src/main/java/org/example/repository/show/showgenre/ShowGenreQuerydslRepository.java +++ b/app/domain/show-domain/src/main/java/org/example/repository/show/showgenre/ShowGenreQuerydslRepository.java @@ -1,10 +1,10 @@ package org.example.repository.show.showgenre; import java.util.List; -import org.example.dto.genre.response.GenreNamesWithShowIdDomainResponse; +import org.example.dto.genre.response.GenreNamesWithShowIdDomainParam; public interface ShowGenreQuerydslRepository { - List findGenreNamesWithShowId(); + List findGenreNamesWithShowId(); } diff --git a/app/domain/show-domain/src/main/java/org/example/repository/show/showgenre/ShowGenreQuerydslRepositoryImpl.java b/app/domain/show-domain/src/main/java/org/example/repository/show/showgenre/ShowGenreQuerydslRepositoryImpl.java index a2ed3db4..e4b79151 100644 --- a/app/domain/show-domain/src/main/java/org/example/repository/show/showgenre/ShowGenreQuerydslRepositoryImpl.java +++ b/app/domain/show-domain/src/main/java/org/example/repository/show/showgenre/ShowGenreQuerydslRepositoryImpl.java @@ -11,7 +11,7 @@ import java.util.List; import lombok.RequiredArgsConstructor; import org.example.dto.genre.response.GenreNameDomainResponse; -import org.example.dto.genre.response.GenreNamesWithShowIdDomainResponse; +import org.example.dto.genre.response.GenreNamesWithShowIdDomainParam; import org.springframework.stereotype.Repository; @Repository @@ -21,7 +21,7 @@ public class ShowGenreQuerydslRepositoryImpl implements ShowGenreQuerydslReposit private final JPAQueryFactory jpaQueryFactory; @Override - public List findGenreNamesWithShowId() { + public List findGenreNamesWithShowId() { return jpaQueryFactory.selectFrom(showGenre) .join(show).on(show.id.eq(showGenre.showId), show.isDeleted.isFalse()) .join(genre).on(genre.id.eq(showGenre.genreId), genre.isDeleted.isFalse()) @@ -29,7 +29,7 @@ public List findGenreNamesWithShowId() { .transform( groupBy(showGenre.id).list( Projections.constructor( - GenreNamesWithShowIdDomainResponse.class, + GenreNamesWithShowIdDomainParam.class, show.id, list( Projections.constructor( diff --git a/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java b/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java index d2229506..4e9429cf 100644 --- a/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java +++ b/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java @@ -7,13 +7,13 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import lombok.RequiredArgsConstructor; +import org.example.dto.artist.param.ArtistNamesWithShowIdDomainParam; import org.example.dto.artist.request.ArtistGenreDomainRequest; import org.example.dto.artist.request.ArtistPaginationDomainRequest; import org.example.dto.artist.request.ArtistSearchPaginationDomainRequest; import org.example.dto.artist.request.ArtistWithGenreCreateDomainRequest; import org.example.dto.artist.response.ArtistDetailDomainResponse; import org.example.dto.artist.response.ArtistNameDomainResponse; -import org.example.dto.artist.response.ArtistNamesWithShowIdDomainResponse; import org.example.dto.artist.response.ArtistPaginationDomainResponse; import org.example.dto.artist.response.ArtistSearchPaginationDomainResponse; import org.example.entity.artist.Artist; @@ -65,7 +65,7 @@ public List findAllArtistKoreanName() { return artistRepository.findAllArtistKoreanName(); } - public List findArtistKoreanNamesWithShowId() { + public List findArtistKoreanNamesWithShowId() { return showArtistRepository.findArtistKoreanNamesWithShowId(); } diff --git a/app/domain/show-domain/src/main/java/org/example/usecase/GenreUseCase.java b/app/domain/show-domain/src/main/java/org/example/usecase/GenreUseCase.java index 2b446e6f..262425b9 100644 --- a/app/domain/show-domain/src/main/java/org/example/usecase/GenreUseCase.java +++ b/app/domain/show-domain/src/main/java/org/example/usecase/GenreUseCase.java @@ -5,7 +5,7 @@ import java.util.UUID; import lombok.RequiredArgsConstructor; import org.example.dto.genre.request.GenrePaginationDomainRequest; -import org.example.dto.genre.response.GenreNamesWithShowIdDomainResponse; +import org.example.dto.genre.response.GenreNamesWithShowIdDomainParam; import org.example.dto.genre.response.GenrePaginationDomainResponse; import org.example.entity.BaseEntity; import org.example.entity.artist.ArtistGenre; @@ -58,7 +58,7 @@ public Genre findGenreById(UUID id) { return genreRepository.findById(id).orElseThrow(NoSuchElementException::new); } - public List findGenreNamesWithShowId() { + public List findGenreNamesWithShowId() { return showGenreRepository.findGenreNamesWithShowId(); } diff --git a/app/domain/show-domain/src/main/java/org/example/usecase/ShowAdminUseCase.java b/app/domain/show-domain/src/main/java/org/example/usecase/ShowAdminUseCase.java index 70d2f197..1cf97dba 100644 --- a/app/domain/show-domain/src/main/java/org/example/usecase/ShowAdminUseCase.java +++ b/app/domain/show-domain/src/main/java/org/example/usecase/ShowAdminUseCase.java @@ -4,10 +4,10 @@ import java.util.NoSuchElementException; import java.util.UUID; import lombok.RequiredArgsConstructor; +import org.example.dto.show.param.ShowWithTicketingTimesDomainParam; import org.example.dto.show.request.ShowCreationDomainRequest; import org.example.dto.show.request.ShowUpdateDomainRequest; import org.example.dto.show.response.ShowInfoDomainResponse; -import org.example.dto.show.response.ShowWithTicketingTimesDomainResponse; import org.example.entity.BaseEntity; import org.example.entity.show.Show; import org.example.entity.show.ShowArtist; @@ -50,7 +50,7 @@ public void save( showTicketingTimeRepository.saveAll(showTicketingTimes); } - public List findShowDetailWithTicketingTimes() { + public List findShowDetailWithTicketingTimes() { return showRepository.findShowDetailWithTicketingTimes(); } From c5778f05c77fffa99667e8336d3fa6dc32bc01bf Mon Sep 17 00:00:00 2001 From: GaBaljaintheroom Date: Thu, 26 Sep 2024 13:59:08 +0900 Subject: [PATCH 11/16] =?UTF-8?q?fix:=20spotify=20=EC=95=84=ED=8B=B0?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=9A=94=EC=B2=AD=20=EC=9D=91=EB=8B=B5=20?= =?UTF-8?q?=ED=98=95=ED=83=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/example/port/ArtistSearchPort.java | 7 +++---- ...est.java => ArtistsDetailPortRequest.java} | 2 +- .../response/ArtistsDetailPortResponse.java | 10 +++++++++ .../org/example/usecase/ArtistUseCase.java | 11 +++++----- .../fixture/port/ArtistSearchPortFixture.java | 9 ++++---- .../spotify/adapter/ArtistSearchAdapter.java | 17 +++++++-------- .../org/spotify/client/SpotifyClient.java | 10 ++++----- ...equest.java => ArtistsSpotifyRequest.java} | 2 +- .../dto/response/FindSpotifyResponse.java | 19 ----------------- .../dto/response/SpotifyArtistsResponse.java | 21 +++++++++++++++++++ 10 files changed, 59 insertions(+), 49 deletions(-) rename app/domain/show-domain/src/main/java/org/example/port/dto/request/{FindArtistsPortRequest.java => ArtistsDetailPortRequest.java} (80%) create mode 100644 app/domain/show-domain/src/main/java/org/example/port/dto/response/ArtistsDetailPortResponse.java rename app/infrastructure/spotify/src/main/java/org/spotify/client/dto/request/{FindArtistsSpotifyRequest.java => ArtistsSpotifyRequest.java} (91%) delete mode 100644 app/infrastructure/spotify/src/main/java/org/spotify/client/dto/response/FindSpotifyResponse.java create mode 100644 app/infrastructure/spotify/src/main/java/org/spotify/client/dto/response/SpotifyArtistsResponse.java diff --git a/app/domain/show-domain/src/main/java/org/example/port/ArtistSearchPort.java b/app/domain/show-domain/src/main/java/org/example/port/ArtistSearchPort.java index 7aea24c0..c421097d 100644 --- a/app/domain/show-domain/src/main/java/org/example/port/ArtistSearchPort.java +++ b/app/domain/show-domain/src/main/java/org/example/port/ArtistSearchPort.java @@ -1,10 +1,9 @@ package org.example.port; -import java.util.List; -import org.example.port.dto.param.ArtistSearchPortParam; import org.example.port.dto.request.ArtistSearchPortRequest; -import org.example.port.dto.request.FindArtistsPortRequest; +import org.example.port.dto.request.ArtistsDetailPortRequest; import org.example.port.dto.response.ArtistSearchPortResponse; +import org.example.port.dto.response.ArtistsDetailPortResponse; import org.example.vo.ArtistSearchAdapterType; import org.springframework.stereotype.Component; @@ -17,5 +16,5 @@ public interface ArtistSearchPort { ArtistSearchPortResponse searchArtist(ArtistSearchPortRequest request); - List findArtistsBySpotifyArtistId(FindArtistsPortRequest request); + ArtistsDetailPortResponse findArtistsBySpotifyArtistId(ArtistsDetailPortRequest request); } diff --git a/app/domain/show-domain/src/main/java/org/example/port/dto/request/FindArtistsPortRequest.java b/app/domain/show-domain/src/main/java/org/example/port/dto/request/ArtistsDetailPortRequest.java similarity index 80% rename from app/domain/show-domain/src/main/java/org/example/port/dto/request/FindArtistsPortRequest.java rename to app/domain/show-domain/src/main/java/org/example/port/dto/request/ArtistsDetailPortRequest.java index 3b7d8811..275faa54 100644 --- a/app/domain/show-domain/src/main/java/org/example/port/dto/request/FindArtistsPortRequest.java +++ b/app/domain/show-domain/src/main/java/org/example/port/dto/request/ArtistsDetailPortRequest.java @@ -4,7 +4,7 @@ import lombok.Builder; @Builder -public record FindArtistsPortRequest( +public record ArtistsDetailPortRequest( String accessToken, List spotifyArtistIds ) { diff --git a/app/domain/show-domain/src/main/java/org/example/port/dto/response/ArtistsDetailPortResponse.java b/app/domain/show-domain/src/main/java/org/example/port/dto/response/ArtistsDetailPortResponse.java new file mode 100644 index 00000000..4bd0a44f --- /dev/null +++ b/app/domain/show-domain/src/main/java/org/example/port/dto/response/ArtistsDetailPortResponse.java @@ -0,0 +1,10 @@ +package org.example.port.dto.response; + +import java.util.List; +import org.example.port.dto.param.ArtistSearchPortParam; + +public record ArtistsDetailPortResponse( + List artists +) { + +} diff --git a/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java b/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java index 4e9429cf..95527daf 100644 --- a/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java +++ b/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java @@ -23,8 +23,9 @@ import org.example.port.dto.param.ArtistSearchPortParam; import org.example.port.dto.request.ArtistCreatePortRequest; import org.example.port.dto.request.ArtistSearchPortRequest; -import org.example.port.dto.request.FindArtistsPortRequest; +import org.example.port.dto.request.ArtistsDetailPortRequest; import org.example.port.dto.response.ArtistSearchPortResponse; +import org.example.port.dto.response.ArtistsDetailPortResponse; import org.example.repository.artist.ArtistRepository; import org.example.repository.artist.artistgenre.ArtistGenreRepository; import org.example.repository.genre.GenreRepository; @@ -84,20 +85,20 @@ public List findOrCreateArtistBySpotifyId(List spotifyIds) { return existArtists; } - List response = artistSearchPort.findArtistsBySpotifyArtistId( - FindArtistsPortRequest.builder() + ArtistsDetailPortResponse response = artistSearchPort.findArtistsBySpotifyArtistId( + ArtistsDetailPortRequest.builder() .accessToken(artistSearchPort.getAccessToken()) .spotifyArtistIds(notExistSpotifyIds) .build() ); - List newArtists = response.stream() + List newArtists = response.artists().stream() .map(ArtistSearchPortParam::toArtist) .toList(); artistCreatePort.createArtist( "createArtist", - ArtistCreatePortRequest.from(response, newArtists) + ArtistCreatePortRequest.from(response.artists(), newArtists) ); return Stream.concat(existArtists.stream(), newArtists.stream()).toList(); diff --git a/app/domain/show-domain/src/testFixtures/java/org/example/fixture/port/ArtistSearchPortFixture.java b/app/domain/show-domain/src/testFixtures/java/org/example/fixture/port/ArtistSearchPortFixture.java index 313d272b..d949453b 100644 --- a/app/domain/show-domain/src/testFixtures/java/org/example/fixture/port/ArtistSearchPortFixture.java +++ b/app/domain/show-domain/src/testFixtures/java/org/example/fixture/port/ArtistSearchPortFixture.java @@ -1,11 +1,10 @@ package org.example.fixture.port; -import java.util.List; import org.example.port.ArtistSearchPort; -import org.example.port.dto.param.ArtistSearchPortParam; import org.example.port.dto.request.ArtistSearchPortRequest; -import org.example.port.dto.request.FindArtistsPortRequest; +import org.example.port.dto.request.ArtistsDetailPortRequest; import org.example.port.dto.response.ArtistSearchPortResponse; +import org.example.port.dto.response.ArtistsDetailPortResponse; import org.example.vo.ArtistSearchAdapterType; import org.springframework.stereotype.Component; @@ -28,8 +27,8 @@ public ArtistSearchPortResponse searchArtist(ArtistSearchPortRequest request) { } @Override - public List findArtistsBySpotifyArtistId( - FindArtistsPortRequest request + public ArtistsDetailPortResponse findArtistsBySpotifyArtistId( + ArtistsDetailPortRequest request ) { return null; } diff --git a/app/infrastructure/spotify/src/main/java/org/spotify/adapter/ArtistSearchAdapter.java b/app/infrastructure/spotify/src/main/java/org/spotify/adapter/ArtistSearchAdapter.java index 1e92c90d..cd48097c 100644 --- a/app/infrastructure/spotify/src/main/java/org/spotify/adapter/ArtistSearchAdapter.java +++ b/app/infrastructure/spotify/src/main/java/org/spotify/adapter/ArtistSearchAdapter.java @@ -1,17 +1,16 @@ package org.spotify.adapter; -import java.util.List; import lombok.RequiredArgsConstructor; import org.example.port.ArtistSearchPort; -import org.example.port.dto.param.ArtistSearchPortParam; import org.example.port.dto.request.ArtistSearchPortRequest; -import org.example.port.dto.request.FindArtistsPortRequest; +import org.example.port.dto.request.ArtistsDetailPortRequest; import org.example.port.dto.response.ArtistSearchPortResponse; +import org.example.port.dto.response.ArtistsDetailPortResponse; import org.example.vo.ArtistSearchAdapterType; import org.spotify.client.SpotifyClient; import org.spotify.client.dto.request.ArtistSearchSpotifyRequest; -import org.spotify.client.dto.request.FindArtistsSpotifyRequest; -import org.spotify.client.dto.response.FindSpotifyResponse; +import org.spotify.client.dto.request.ArtistsSpotifyRequest; +import org.spotify.client.dto.response.SpotifyArtistsResponse; import org.spotify.client.dto.response.SpotifySearchResponse; import org.springframework.stereotype.Component; @@ -46,11 +45,11 @@ public ArtistSearchPortResponse searchArtist(ArtistSearchPortRequest request) { } @Override - public List findArtistsBySpotifyArtistId( - FindArtistsPortRequest request + public ArtistsDetailPortResponse findArtistsBySpotifyArtistId( + ArtistsDetailPortRequest request ) { - FindSpotifyResponse response = spotifyClient.findArtistsBySpotifyArtistId( - FindArtistsSpotifyRequest.builder() + SpotifyArtistsResponse response = spotifyClient.findArtistsBySpotifyArtistId( + ArtistsSpotifyRequest.builder() .accessToken(request.accessToken()) .spotifyArtistIds(request.spotifyArtistIds()) .build() diff --git a/app/infrastructure/spotify/src/main/java/org/spotify/client/SpotifyClient.java b/app/infrastructure/spotify/src/main/java/org/spotify/client/SpotifyClient.java index 89367750..cdc36b28 100644 --- a/app/infrastructure/spotify/src/main/java/org/spotify/client/SpotifyClient.java +++ b/app/infrastructure/spotify/src/main/java/org/spotify/client/SpotifyClient.java @@ -6,9 +6,9 @@ import lombok.extern.slf4j.Slf4j; import org.spotify.client.dto.request.AccessTokenSpotifyRequest; import org.spotify.client.dto.request.ArtistSearchSpotifyRequest; -import org.spotify.client.dto.request.FindArtistsSpotifyRequest; -import org.spotify.client.dto.response.FindSpotifyResponse; +import org.spotify.client.dto.request.ArtistsSpotifyRequest; import org.spotify.client.dto.response.SpotifyAccessTokenResponse; +import org.spotify.client.dto.response.SpotifyArtistsResponse; import org.spotify.client.dto.response.SpotifySearchResponse; import org.spotify.property.SpotifyProperty; import org.springframework.http.HttpStatus; @@ -68,14 +68,14 @@ public SpotifySearchResponse searchArtist(ArtistSearchSpotifyRequest request) { return result.getBody(); } - public FindSpotifyResponse findArtistsBySpotifyArtistId(FindArtistsSpotifyRequest request) { - ResponseEntity result = RestClient.builder() + public SpotifyArtistsResponse findArtistsBySpotifyArtistId(ArtistsSpotifyRequest request) { + ResponseEntity result = RestClient.builder() .defaultHeader("Authorization", "Bearer " + request.accessToken()) .baseUrl(spotifyProperty.apiURL() + "/artists?" + request.toQueryParameter()) .build() .get() .retrieve() - .toEntity(FindSpotifyResponse.class); + .toEntity(SpotifyArtistsResponse.class); if (result.getStatusCode() == HttpStatus.UNAUTHORIZED || result.getStatusCode() == HttpStatus.FORBIDDEN diff --git a/app/infrastructure/spotify/src/main/java/org/spotify/client/dto/request/FindArtistsSpotifyRequest.java b/app/infrastructure/spotify/src/main/java/org/spotify/client/dto/request/ArtistsSpotifyRequest.java similarity index 91% rename from app/infrastructure/spotify/src/main/java/org/spotify/client/dto/request/FindArtistsSpotifyRequest.java rename to app/infrastructure/spotify/src/main/java/org/spotify/client/dto/request/ArtistsSpotifyRequest.java index 9ee349d3..a3472f10 100644 --- a/app/infrastructure/spotify/src/main/java/org/spotify/client/dto/request/FindArtistsSpotifyRequest.java +++ b/app/infrastructure/spotify/src/main/java/org/spotify/client/dto/request/ArtistsSpotifyRequest.java @@ -8,7 +8,7 @@ * @param spotifyArtistIds Spotify Artist Id들 */ @Builder -public record FindArtistsSpotifyRequest( +public record ArtistsSpotifyRequest( String accessToken, List spotifyArtistIds ) { diff --git a/app/infrastructure/spotify/src/main/java/org/spotify/client/dto/response/FindSpotifyResponse.java b/app/infrastructure/spotify/src/main/java/org/spotify/client/dto/response/FindSpotifyResponse.java deleted file mode 100644 index 9f276417..00000000 --- a/app/infrastructure/spotify/src/main/java/org/spotify/client/dto/response/FindSpotifyResponse.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.spotify.client.dto.response; - -import java.util.List; -import org.example.port.dto.param.ArtistSearchPortParam; - -public record FindSpotifyResponse( - List artists -) { - - public List toPortResponse() { - if (artists == null) { - return List.of(); - } - - return artists.stream() - .map(SpotifyArtistItemSearchResponse::toPortParam) - .toList(); - } -} diff --git a/app/infrastructure/spotify/src/main/java/org/spotify/client/dto/response/SpotifyArtistsResponse.java b/app/infrastructure/spotify/src/main/java/org/spotify/client/dto/response/SpotifyArtistsResponse.java new file mode 100644 index 00000000..4de9da5f --- /dev/null +++ b/app/infrastructure/spotify/src/main/java/org/spotify/client/dto/response/SpotifyArtistsResponse.java @@ -0,0 +1,21 @@ +package org.spotify.client.dto.response; + +import java.util.List; +import org.example.port.dto.response.ArtistsDetailPortResponse; + +public record SpotifyArtistsResponse( + List artists +) { + + public ArtistsDetailPortResponse toPortResponse() { + if (artists == null) { + return new ArtistsDetailPortResponse(List.of()); + } + + return new ArtistsDetailPortResponse( + artists.stream() + .map(SpotifyArtistItemSearchResponse::toPortParam) + .toList() + ); + } +} From d97f5abfcbb3bb8c1ead9eb662e220fd7d728d82 Mon Sep 17 00:00:00 2001 From: GaBaljaintheroom Date: Thu, 26 Sep 2024 14:04:43 +0900 Subject: [PATCH 12/16] =?UTF-8?q?fix:=20korean=20=EB=AA=85=EC=B9=AD=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/response/ArtistNameApiResponse.java | 6 +++--- .../artist/service/ArtistAdminService.java | 2 +- .../dto/param/ArtistNameServiceParam.java | 6 +++--- .../dto/response/ShowInfoApiResponse.java | 4 ++-- .../show/service/ShowAdminService.java | 4 ++-- .../dto/response/ShowInfoServiceResponse.java | 19 ++++++++++--------- .../ArtistNamesWithShowIdDomainParam.java | 2 +- .../show/response/ShowInfoDomainResponse.java | 2 +- .../artist/ArtistQuerydslRepository.java | 2 +- .../artist/ArtistQuerydslRepositoryImpl.java | 2 +- .../ShowArtistQuerydslRepository.java | 2 +- .../ShowArtistQuerydslRepositoryImpl.java | 2 +- .../org/example/usecase/ArtistUseCase.java | 8 ++++---- .../show/ShowArtistRepositoryTest.java | 6 +++--- 14 files changed, 34 insertions(+), 33 deletions(-) diff --git a/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistNameApiResponse.java b/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistNameApiResponse.java index c265a666..e244829f 100644 --- a/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistNameApiResponse.java +++ b/app/api/show-api/src/main/java/com/example/artist/controller/dto/response/ArtistNameApiResponse.java @@ -9,11 +9,11 @@ public record ArtistNameApiResponse( ) { public ArtistNameApiResponse( - ArtistNameServiceParam artistKoreanNameServiceResponse + ArtistNameServiceParam artistNameServiceResponse ) { this( - artistKoreanNameServiceResponse.id(), - artistKoreanNameServiceResponse.name() + artistNameServiceResponse.id(), + artistNameServiceResponse.name() ); } diff --git a/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java b/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java index 734622b3..3afd5724 100644 --- a/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java +++ b/app/api/show-api/src/main/java/com/example/artist/service/ArtistAdminService.java @@ -15,7 +15,7 @@ public class ArtistAdminService { private final ArtistUseCase artistUseCase; public List findAllArtistName() { - return artistUseCase.findAllArtistKoreanName().stream() + return artistUseCase.findAllArtistName().stream() .map(ArtistNameServiceParam::new) .toList(); } diff --git a/app/api/show-api/src/main/java/com/example/artist/service/dto/param/ArtistNameServiceParam.java b/app/api/show-api/src/main/java/com/example/artist/service/dto/param/ArtistNameServiceParam.java index a4442163..a5fbb4b8 100644 --- a/app/api/show-api/src/main/java/com/example/artist/service/dto/param/ArtistNameServiceParam.java +++ b/app/api/show-api/src/main/java/com/example/artist/service/dto/param/ArtistNameServiceParam.java @@ -7,10 +7,10 @@ public record ArtistNameServiceParam( UUID id, String name ) { - public ArtistNameServiceParam(ArtistNameDomainResponse artistKoreanNameResponse) { + public ArtistNameServiceParam(ArtistNameDomainResponse artistNameResponse) { this( - artistKoreanNameResponse.id(), - artistKoreanNameResponse.name() + artistNameResponse.id(), + artistNameResponse.name() ); } diff --git a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowInfoApiResponse.java b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowInfoApiResponse.java index 39bc28e5..f614cb28 100644 --- a/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowInfoApiResponse.java +++ b/app/api/show-api/src/main/java/com/example/show/controller/dto/response/ShowInfoApiResponse.java @@ -21,7 +21,7 @@ public record ShowInfoApiResponse( ShowSeatApiResponse seatInfoApiResponse, ShowTicketingSiteApiResponse ticketingSiteApiResponse, List ticketingTimes, - List artistKoreanNameResponses, + List artistNameResponses, List genreNameResponses ) { @@ -40,7 +40,7 @@ public ShowInfoApiResponse(ShowInfoServiceResponse showInfoServiceResponse) { showInfoServiceResponse.ticketingSites().stream() .map(ShowTicketingTimeApiParam::from) .toList(), - showInfoServiceResponse.artistKoreanNameResponses().stream() + showInfoServiceResponse.artistNameResponses().stream() .map(ArtistNameApiResponse::new) .toList(), showInfoServiceResponse.genreNameResponses().stream() diff --git a/app/api/show-api/src/main/java/com/example/show/service/ShowAdminService.java b/app/api/show-api/src/main/java/com/example/show/service/ShowAdminService.java index 9ea39743..8aa473fe 100644 --- a/app/api/show-api/src/main/java/com/example/show/service/ShowAdminService.java +++ b/app/api/show-api/src/main/java/com/example/show/service/ShowAdminService.java @@ -44,12 +44,12 @@ public void save(ShowCreateServiceRequest showCreateServiceRequest) { public List findShowDetailWithTicketingTimes() { var showWithTicketingTimesDomainResponses = showAdminUseCase.findShowDetailWithTicketingTimes(); - var artistKoreanNameWithShowIdDomainResponses = artistUseCase.findArtistKoreanNamesWithShowId(); + var artistNameWithShowIdDomainResponses = artistUseCase.findArtistNamesWithShowId(); var genreNameWithShowIdDomainResponses = genreUseCase.findGenreNamesWithShowId(); return ShowInfoServiceResponse.as( showWithTicketingTimesDomainResponses, - artistKoreanNameWithShowIdDomainResponses, + artistNameWithShowIdDomainResponses, genreNameWithShowIdDomainResponses ); diff --git a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowInfoServiceResponse.java b/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowInfoServiceResponse.java index 12e9f79b..c900d22b 100644 --- a/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowInfoServiceResponse.java +++ b/app/api/show-api/src/main/java/com/example/show/service/dto/response/ShowInfoServiceResponse.java @@ -29,7 +29,7 @@ public record ShowInfoServiceResponse( ShowSeatServiceResponse seats, ShowTicketingSiteServiceResponse ticketingSiteInfos, List ticketingSites, - List artistKoreanNameResponses, + List artistNameResponses, List genreNameResponses ) { @@ -46,7 +46,7 @@ public ShowInfoServiceResponse(ShowInfoDomainResponse showInfo) { ShowSeatServiceResponse.from(showInfo.show().seatPrices()), ShowTicketingSiteServiceResponse.from(showInfo.show().ticketingSites()), toShowTicketingTimeServiceResponses(showInfo.ticketingTimes()), - toArtistKoreanNameServiceResponses(showInfo.artistKoreanNameResponses()), + toArtistNameServiceResponses(showInfo.artistNameResponses()), toGenreNameServiceResponses(showInfo.genreNameResponses()) ); } @@ -58,7 +58,7 @@ public static List as( ) { return showWithTicketingTimes.stream() .map(showWithTicketingTime -> { - var artistKoreanNameResponses = getArtistKoreanNameResponses( + var artistNameResponses = getArtistNameResponses( artistNamesWithShowId, showWithTicketingTime ); @@ -83,7 +83,7 @@ public static List as( showWithTicketingTime.ticketingTimes().stream() .map(ShowTicketingTimeServiceParam::from) .toList(), - artistKoreanNameResponses, + artistNameResponses, genreNameResponses ); }) @@ -98,9 +98,10 @@ private static List toShowTicketingTimeServiceRes .toList(); } - private static List toArtistKoreanNameServiceResponses( - Set artistKoreanNameResponses) { - return artistKoreanNameResponses + private static List toArtistNameServiceResponses( + Set artistNameResponses + ) { + return artistNameResponses .stream() .map(ArtistNameServiceParam::new) .toList(); @@ -114,14 +115,14 @@ private static List toGenreNameServiceResponses( .toList(); } - private static List getArtistKoreanNameResponses( + private static List getArtistNameResponses( List artistNamesWithShowId, ShowWithTicketingTimesDomainParam showWitTicketingTimes ) { return artistNamesWithShowId.stream() .filter( artistResponse -> artistResponse.showId().equals(showWitTicketingTimes.show().id())) - .flatMap(artistResponse -> artistResponse.koreanNameDomainResponses().stream()) + .flatMap(artistResponse -> artistResponse.artistNameDomainResponses().stream()) .map(ArtistNameServiceParam::new) .toList(); } diff --git a/app/domain/show-domain/src/main/java/org/example/dto/artist/param/ArtistNamesWithShowIdDomainParam.java b/app/domain/show-domain/src/main/java/org/example/dto/artist/param/ArtistNamesWithShowIdDomainParam.java index 1219d420..7ec14041 100644 --- a/app/domain/show-domain/src/main/java/org/example/dto/artist/param/ArtistNamesWithShowIdDomainParam.java +++ b/app/domain/show-domain/src/main/java/org/example/dto/artist/param/ArtistNamesWithShowIdDomainParam.java @@ -6,7 +6,7 @@ public record ArtistNamesWithShowIdDomainParam( UUID showId, - List koreanNameDomainResponses + List artistNameDomainResponses ) { } diff --git a/app/domain/show-domain/src/main/java/org/example/dto/show/response/ShowInfoDomainResponse.java b/app/domain/show-domain/src/main/java/org/example/dto/show/response/ShowInfoDomainResponse.java index 88a79658..c1d4b3c1 100644 --- a/app/domain/show-domain/src/main/java/org/example/dto/show/response/ShowInfoDomainResponse.java +++ b/app/domain/show-domain/src/main/java/org/example/dto/show/response/ShowInfoDomainResponse.java @@ -6,7 +6,7 @@ public record ShowInfoDomainResponse( ShowDomainResponse show, - Set artistKoreanNameResponses, + Set artistNameResponses, Set genreNameResponses, Set ticketingTimes ) { diff --git a/app/domain/show-domain/src/main/java/org/example/repository/artist/ArtistQuerydslRepository.java b/app/domain/show-domain/src/main/java/org/example/repository/artist/ArtistQuerydslRepository.java index a3d1fae6..f2ec02b5 100644 --- a/app/domain/show-domain/src/main/java/org/example/repository/artist/ArtistQuerydslRepository.java +++ b/app/domain/show-domain/src/main/java/org/example/repository/artist/ArtistQuerydslRepository.java @@ -12,7 +12,7 @@ public interface ArtistQuerydslRepository { List findAllWithGenreNames(); - List findAllArtistKoreanName(); + List findAllArtistName(); List findAllInIds(List ids); diff --git a/app/domain/show-domain/src/main/java/org/example/repository/artist/ArtistQuerydslRepositoryImpl.java b/app/domain/show-domain/src/main/java/org/example/repository/artist/ArtistQuerydslRepositoryImpl.java index 83a111be..e2e5cb01 100644 --- a/app/domain/show-domain/src/main/java/org/example/repository/artist/ArtistQuerydslRepositoryImpl.java +++ b/app/domain/show-domain/src/main/java/org/example/repository/artist/ArtistQuerydslRepositoryImpl.java @@ -54,7 +54,7 @@ public List findAllWithGenreNames() { } @Override - public List findAllArtistKoreanName() { + public List findAllArtistName() { return jpaQueryFactory .select( Projections.constructor( diff --git a/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepository.java b/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepository.java index 747fcf52..10412102 100644 --- a/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepository.java +++ b/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepository.java @@ -5,5 +5,5 @@ public interface ShowArtistQuerydslRepository { - List findArtistKoreanNamesWithShowId(); + List findArtistNamesWithShowId(); } diff --git a/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepositoryImpl.java b/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepositoryImpl.java index 4b2d3a71..6fa78bfc 100644 --- a/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepositoryImpl.java +++ b/app/domain/show-domain/src/main/java/org/example/repository/show/showartist/ShowArtistQuerydslRepositoryImpl.java @@ -21,7 +21,7 @@ public class ShowArtistQuerydslRepositoryImpl implements ShowArtistQuerydslRepos private final JPAQueryFactory jpaQueryFactory; @Override - public List findArtistKoreanNamesWithShowId() { + public List findArtistNamesWithShowId() { return jpaQueryFactory.selectFrom(showArtist) .join(show).on(show.id.eq(showArtist.showId), show.isDeleted.isFalse()) .join(artist).on(artist.id.eq(showArtist.artistId), artist.isDeleted.isFalse()) diff --git a/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java b/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java index 95527daf..18e36d33 100644 --- a/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java +++ b/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java @@ -62,12 +62,12 @@ public List findAllWithGenreNames() { return artistRepository.findAllWithGenreNames(); } - public List findAllArtistKoreanName() { - return artistRepository.findAllArtistKoreanName(); + public List findAllArtistName() { + return artistRepository.findAllArtistName(); } - public List findArtistKoreanNamesWithShowId() { - return showArtistRepository.findArtistKoreanNamesWithShowId(); + public List findArtistNamesWithShowId() { + return showArtistRepository.findArtistNamesWithShowId(); } public List findOrCreateArtistBySpotifyId(List spotifyIds) { diff --git a/app/domain/show-domain/src/test/java/org/example/repository/show/ShowArtistRepositoryTest.java b/app/domain/show-domain/src/test/java/org/example/repository/show/ShowArtistRepositoryTest.java index 3cb7899b..e8c8d7c7 100644 --- a/app/domain/show-domain/src/test/java/org/example/repository/show/ShowArtistRepositoryTest.java +++ b/app/domain/show-domain/src/test/java/org/example/repository/show/ShowArtistRepositoryTest.java @@ -26,7 +26,7 @@ public class ShowArtistRepositoryTest extends QueryTest { @Test @DisplayName("공연과 연관된 아티스트 이름을 함께 가져온다.") - void findArtistKoreanNamesWithShowId() { + void findArtistNamesWithShowId() { //given var artists = ArtistFixture.manSoloArtists(2); artistRepository.saveAll(artists); @@ -42,13 +42,13 @@ void findArtistKoreanNamesWithShowId() { showArtistRepository.saveAll(showArtist); //when - var result = showArtistRepository.findArtistKoreanNamesWithShowId(); + var result = showArtistRepository.findArtistNamesWithShowId(); //then SoftAssertions.assertSoftly( soft -> { soft.assertThat(result.size()).isEqualTo(2); - soft.assertThat(result.get(0).koreanNameDomainResponses().size()).isEqualTo(1); + soft.assertThat(result.get(0).artistNameDomainResponses().size()).isEqualTo(1); } ); } From 8c84b0b7dd9455081b90fe5eced6211fc7c2861d Mon Sep 17 00:00:00 2001 From: GaBaljaintheroom Date: Thu, 26 Sep 2024 14:12:04 +0900 Subject: [PATCH 13/16] =?UTF-8?q?fix:=20Pub=20=EB=84=A4=EC=9D=B4=EB=B0=8D?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/example/adapter/ArtistCreateAdapter.java | 6 +++--- .../request/ArtistCreateInfraRequest.java | 16 ---------------- .../ArtistGenreDomainInfraMessage.java} | 8 ++++---- .../ArtistWithGenreCreateInfraMessage.java | 16 ++++++++++++++++ 4 files changed, 23 insertions(+), 23 deletions(-) delete mode 100644 app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistCreateInfraRequest.java rename app/infrastructure/message-queue/src/main/java/org/example/{adapter/request/ArtistDomainInfraRequest.java => message/ArtistGenreDomainInfraMessage.java} (67%) create mode 100644 app/infrastructure/message-queue/src/main/java/org/example/message/ArtistWithGenreCreateInfraMessage.java diff --git a/app/infrastructure/message-queue/src/main/java/org/example/adapter/ArtistCreateAdapter.java b/app/infrastructure/message-queue/src/main/java/org/example/adapter/ArtistCreateAdapter.java index 96d955dd..2b1d727c 100644 --- a/app/infrastructure/message-queue/src/main/java/org/example/adapter/ArtistCreateAdapter.java +++ b/app/infrastructure/message-queue/src/main/java/org/example/adapter/ArtistCreateAdapter.java @@ -2,7 +2,7 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.example.adapter.request.ArtistCreateInfraRequest; +import org.example.message.ArtistWithGenreCreateInfraMessage; import org.example.port.ArtistCreatePort; import org.example.port.dto.request.ArtistCreatePortRequest; import org.springframework.data.redis.core.RedisTemplate; @@ -17,10 +17,10 @@ public class ArtistCreateAdapter implements ArtistCreatePort { @Override public void createArtist(String topic, ArtistCreatePortRequest request) { - var infraMessage = ArtistCreateInfraRequest.from(request); + var infraMessage = ArtistWithGenreCreateInfraMessage.from(request); template.convertAndSend(topic, infraMessage); log.info("Message published successfully to topic: {}", topic); - log.info("Message Contents ( ArtistCreateInfraRequest : {})", infraMessage); + log.info("Message Contents ( ArtistWithGenreCreateInfraMessage : {})", infraMessage); } } diff --git a/app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistCreateInfraRequest.java b/app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistCreateInfraRequest.java deleted file mode 100644 index c673726c..00000000 --- a/app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistCreateInfraRequest.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.example.adapter.request; - -import java.util.List; -import org.example.port.dto.request.ArtistCreatePortRequest; - -public record ArtistCreateInfraRequest( - List request -) { - - public static ArtistCreateInfraRequest from(ArtistCreatePortRequest request) { - return new ArtistCreateInfraRequest( - request.artists().stream().map(ArtistDomainInfraRequest::from).toList() - ); - } - -} diff --git a/app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistDomainInfraRequest.java b/app/infrastructure/message-queue/src/main/java/org/example/message/ArtistGenreDomainInfraMessage.java similarity index 67% rename from app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistDomainInfraRequest.java rename to app/infrastructure/message-queue/src/main/java/org/example/message/ArtistGenreDomainInfraMessage.java index b59d9bf5..1ab8b54f 100644 --- a/app/infrastructure/message-queue/src/main/java/org/example/adapter/request/ArtistDomainInfraRequest.java +++ b/app/infrastructure/message-queue/src/main/java/org/example/message/ArtistGenreDomainInfraMessage.java @@ -1,4 +1,4 @@ -package org.example.adapter.request; +package org.example.message; import java.util.List; import java.util.UUID; @@ -6,7 +6,7 @@ import org.example.port.dto.request.ArtistDomainPortRequest; @Builder -public record ArtistDomainInfraRequest( +public record ArtistGenreDomainInfraMessage( UUID id, String name, @@ -15,8 +15,8 @@ public record ArtistDomainInfraRequest( List genres ) { - public static ArtistDomainInfraRequest from(ArtistDomainPortRequest request) { - return ArtistDomainInfraRequest.builder() + public static ArtistGenreDomainInfraMessage from(ArtistDomainPortRequest request) { + return ArtistGenreDomainInfraMessage.builder() .id(request.id()) .name(request.name()) .image(request.image()) diff --git a/app/infrastructure/message-queue/src/main/java/org/example/message/ArtistWithGenreCreateInfraMessage.java b/app/infrastructure/message-queue/src/main/java/org/example/message/ArtistWithGenreCreateInfraMessage.java new file mode 100644 index 00000000..f6e399d4 --- /dev/null +++ b/app/infrastructure/message-queue/src/main/java/org/example/message/ArtistWithGenreCreateInfraMessage.java @@ -0,0 +1,16 @@ +package org.example.message; + +import java.util.List; +import org.example.port.dto.request.ArtistCreatePortRequest; + +public record ArtistWithGenreCreateInfraMessage( + List request +) { + + public static ArtistWithGenreCreateInfraMessage from(ArtistCreatePortRequest request) { + return new ArtistWithGenreCreateInfraMessage( + request.artists().stream().map(ArtistGenreDomainInfraMessage::from).toList() + ); + } + +} From 6c22a08a08cde3fa521a2657598153e5ddf7d180 Mon Sep 17 00:00:00 2001 From: GaBaljaintheroom Date: Thu, 26 Sep 2024 14:18:53 +0900 Subject: [PATCH 14/16] =?UTF-8?q?fix:=20=EC=95=84=ED=8B=B0=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=9E=A5=EB=A5=B4=20=EC=A0=80=EC=9E=A5=20=EC=98=88?= =?UTF-8?q?=EC=99=B8=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/example/usecase/ArtistUseCase.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java b/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java index 18e36d33..fe229d68 100644 --- a/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java +++ b/app/domain/show-domain/src/main/java/org/example/usecase/ArtistUseCase.java @@ -7,6 +7,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.example.dto.artist.param.ArtistNamesWithShowIdDomainParam; import org.example.dto.artist.request.ArtistGenreDomainRequest; import org.example.dto.artist.request.ArtistPaginationDomainRequest; @@ -33,6 +34,7 @@ import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; +@Slf4j @Component @RequiredArgsConstructor public class ArtistUseCase { @@ -51,10 +53,14 @@ public void save(ArtistWithGenreCreateDomainRequest request) { Artist newArtist = artistGenre.toArtist(); artistRepository.save(newArtist); - Genre genre = genreRepository.findByName(artistGenre.genreName()) - .orElseThrow(NoSuchElementException::new); + try { + Genre genre = genreRepository.findByName(artistGenre.genreName()) + .orElseThrow(NoSuchElementException::new); - artistGenreRepository.save(newArtist.toArtistGenre(genre.getId())); + artistGenreRepository.save(newArtist.toArtistGenre(genre.getId())); + } catch (NoSuchElementException e) { + log.warn("해당하는 장르가 존재하지 않습니다."); + } } } From 618ec89db648c4b97e311c5a4704a54fc0a9b90d Mon Sep 17 00:00:00 2001 From: GaBaljaintheroom Date: Thu, 26 Sep 2024 15:44:04 +0900 Subject: [PATCH 15/16] =?UTF-8?q?fix:=20=EA=B3=B5=EC=97=B0=20=EC=96=B4?= =?UTF-8?q?=EB=93=9C=EB=AF=BC=20=EB=B7=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user-api/src/main/resources/templates/show_create_form.html | 2 +- app/api/user-api/src/main/resources/templates/show_form.html | 2 +- .../user-api/src/main/resources/templates/show_list_form.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/api/user-api/src/main/resources/templates/show_create_form.html b/app/api/user-api/src/main/resources/templates/show_create_form.html index 021d529c..1edeb970 100644 --- a/app/api/user-api/src/main/resources/templates/show_create_form.html +++ b/app/api/user-api/src/main/resources/templates/show_create_form.html @@ -50,7 +50,7 @@

추가할 공연 정보

diff --git a/app/api/user-api/src/main/resources/templates/show_form.html b/app/api/user-api/src/main/resources/templates/show_form.html index d9f1a083..dbab0418 100644 --- a/app/api/user-api/src/main/resources/templates/show_form.html +++ b/app/api/user-api/src/main/resources/templates/show_form.html @@ -50,7 +50,7 @@

공연 수정

diff --git a/app/api/user-api/src/main/resources/templates/show_list_form.html b/app/api/user-api/src/main/resources/templates/show_list_form.html index f217fe32..1d31fffe 100644 --- a/app/api/user-api/src/main/resources/templates/show_list_form.html +++ b/app/api/user-api/src/main/resources/templates/show_list_form.html @@ -37,7 +37,7 @@

공연 목록

    -
  • 아티스트
  • +
  • 아티스트
From 28b80ae909517f7e37283984f8e8fbaa6b6d59fe Mon Sep 17 00:00:00 2001 From: GaBaljaintheroom Date: Thu, 26 Sep 2024 15:44:22 +0900 Subject: [PATCH 16/16] =?UTF-8?q?fix:=20=EA=B3=B5=EC=97=B0=20=EC=95=8C?= =?UTF-8?q?=EB=A6=BC=20=ED=85=8C=EC=9D=B4=EB=B8=94=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common-domain/src/main/resources/schema.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/domain/common-domain/src/main/resources/schema.sql b/app/domain/common-domain/src/main/resources/schema.sql index f4142650..b59f95c3 100644 --- a/app/domain/common-domain/src/main/resources/schema.sql +++ b/app/domain/common-domain/src/main/resources/schema.sql @@ -259,3 +259,16 @@ create table alarm.ticketing_alert user_fcm_token varchar(255) not null, primary key (id) ); + +create table alarm.show_alarm +( + is_deleted boolean not null, + created_at timestamp(3) not null, + updated_at timestamp(3) not null, + id uuid not null, + user_fcm_token varchar(255) not null, + title varchar(255) not null, + content varchar(255) not null, + checked boolean not null, + primary key (id) +);