Skip to content

Commit

Permalink
fix: 누락된 CursorApiResponse 추가 (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
GaBaljaintheroom authored Sep 16, 2024
1 parent 6976c13 commit 745097d
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import com.example.artist.service.dto.param.ArtistSearchPaginationServiceParam;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.UUID;
import org.example.dto.response.CursorApiResponse;

public record ArtistSearchPaginationApiParam(
@Schema(description = "아티스트 ID")
UUID id,
@Schema(description = "조회한 데이터의 Cursor")
CursorApiResponse cursor,

@Schema(description = "아티스트 이미지 URL")
String imageURL,
Expand All @@ -23,7 +23,7 @@ public record ArtistSearchPaginationApiParam(

public static ArtistSearchPaginationApiParam from(ArtistSearchPaginationServiceParam param) {
return new ArtistSearchPaginationApiParam(
param.artistId(),
CursorApiResponse.toCursorId(param.artistId()),
param.artistImageUrl(),
param.artistKoreanName(),
param.artistEnglishName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import com.example.artist.service.dto.param.ArtistSubscriptionPaginationServiceParam;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.UUID;
import org.example.dto.response.CursorApiResponse;

public record ArtistSubscriptionPaginationApiParam(
@Schema(description = "아티스트 ID")
UUID id,
@Schema(description = "조회한 데이터의 Cursor")
CursorApiResponse cursor,
@Schema(description = "아티스트 이미지 URL")
String imageURL,
@Schema(description = "아티스트 한글 이름")
Expand All @@ -15,9 +15,11 @@ public record ArtistSubscriptionPaginationApiParam(
String englishName
) {

public static ArtistSubscriptionPaginationApiParam from(ArtistSubscriptionPaginationServiceParam param) {
public static ArtistSubscriptionPaginationApiParam from(
ArtistSubscriptionPaginationServiceParam param
) {
return new ArtistSubscriptionPaginationApiParam(
param.artistId(),
CursorApiResponse.toCursorId(param.artistId()),
param.artistImageUrl(),
param.artistKoreanName(),
param.artistEnglishName()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import com.example.artist.service.dto.param.ArtistUnsubscriptionPaginationServiceParam;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.UUID;
import org.example.dto.response.CursorApiResponse;

public record ArtistUnsubscriptionPaginationApiParam(
@Schema(description = "아티스트 ID")
UUID id,
@Schema(description = "조회한 데이터의 Cursor")
CursorApiResponse cursor,
@Schema(description = "아티스트 이미지 URL")
String imageURL,
@Schema(description = "아티스트 한글 이름")
Expand All @@ -19,7 +19,7 @@ public static ArtistUnsubscriptionPaginationApiParam from(
ArtistUnsubscriptionPaginationServiceParam param
) {
return new ArtistUnsubscriptionPaginationApiParam(
param.artistId(),
CursorApiResponse.toCursorId(param.artistId()),
param.artistImageUrl(),
param.artistKoreanName(),
param.artistEnglishName()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import com.example.genre.service.dto.param.GenrePaginationServiceParam;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.UUID;
import org.example.dto.response.CursorApiResponse;

public record GenrePaginationApiParam(

@Schema(description = "장르 ID")
UUID id,
@Schema(description = "조회한 데이터의 Cursor")
CursorApiResponse cursor,

@Schema(description = "장르 이름")
String name,
Expand All @@ -18,7 +18,7 @@ public record GenrePaginationApiParam(

public GenrePaginationApiParam(GenrePaginationServiceParam param) {
this(
param.id(),
CursorApiResponse.toCursorId(param.id()),
param.name(),
param.isSubscribed()
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
package com.example.genre.controller.dto.param;

import com.example.genre.service.dto.param.GenreSubscriptionPaginationServiceParam;
import java.util.UUID;
import io.swagger.v3.oas.annotations.media.Schema;
import org.example.dto.response.CursorApiResponse;

public record GenreSubscriptionPaginationApiParam(
UUID id,
@Schema(description = "조회한 데이터의 Cursor")
CursorApiResponse cursor,

@Schema(description = "장르 이름")
String name
) {

public GenreSubscriptionPaginationApiParam(
GenreSubscriptionPaginationServiceParam response
) {
this(
response.id(),
CursorApiResponse.toCursorId(response.id()),
response.name()
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
package com.example.genre.controller.dto.param;

import com.example.genre.service.dto.param.GenreUnsubscriptionPaginationServiceParam;
import java.util.UUID;
import io.swagger.v3.oas.annotations.media.Schema;
import org.example.dto.response.CursorApiResponse;

public record GenreUnsubscriptionPaginationApiParam(
UUID id,
@Schema(description = "조회한 데이터의 Cursor")
CursorApiResponse cursor,

@Schema(description = "장르 이름")
String name
) {

public GenreUnsubscriptionPaginationApiParam(
GenreUnsubscriptionPaginationServiceParam response
) {
this(
response.id(),
CursorApiResponse.toCursorId(response.id()),
response.name()
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import com.example.show.service.dto.param.ShowSearchPaginationServiceParam;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.UUID;
import org.example.dto.response.CursorApiResponse;
import org.example.util.DateTimeUtil;

public record ShowSearchPaginationApiParam(
@Schema(description = "공연 ID")
UUID id,
@Schema(description = "조회한 데이터의 Cursor")
CursorApiResponse cursor,

@Schema(description = "공연 제목")
String title,
Expand All @@ -27,7 +27,7 @@ public record ShowSearchPaginationApiParam(

public static ShowSearchPaginationApiParam from(ShowSearchPaginationServiceParam serviceParam) {
return new ShowSearchPaginationApiParam(
serviceParam.id(),
CursorApiResponse.toCursorId(serviceParam.id()),
serviceParam.title(),
DateTimeUtil.formatDate(serviceParam.startAt()),
DateTimeUtil.formatDate(serviceParam.endAt()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

import com.example.show.service.dto.response.ShowPaginationServiceResponse;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.UUID;
import lombok.Builder;
import org.example.dto.response.CursorApiResponse;
import org.example.util.DateTimeUtil;

@Builder
public record ShowPaginationApiParam(

@Schema(description = "공연 ID")
UUID id,
@Schema(description = "조회한 데이터의 Cursor")
CursorApiResponse cursor,

@Schema(description = "공연 이름")
String title,
Expand All @@ -30,7 +30,7 @@ public record ShowPaginationApiParam(

public static ShowPaginationApiParam from(ShowPaginationServiceResponse response) {
return ShowPaginationApiParam.builder()
.id(response.id())
.cursor(CursorApiResponse.toCursorId(response.id()))
.title(response.title())
.location(response.location())
.posterImageURL(response.image())
Expand Down

0 comments on commit 745097d

Please sign in to comment.