-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
446 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 11 additions & 6 deletions
17
...c/main/java/com/example/show/controller/dto/request/ShowInterestPaginationApiRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
package com.example.show.controller.dto.request; | ||
|
||
import com.example.show.service.dto.request.InterestShowPaginationServiceRequest; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.util.UUID; | ||
import org.example.pagination.vo.SortDirection; | ||
|
||
public record ShowInterestPaginationApiRequest( | ||
|
||
@Schema(description = "정렬 방향") | ||
SortDirection sortDirection, | ||
|
||
@Parameter(description = "페이지네이션 데이터 개수") | ||
int size, | ||
@Parameter(description = "이전 페이지네이션 마지막 데이터의 ID / 최초 조회라면 null") | ||
UUID cursor | ||
UUID cursorId | ||
) { | ||
|
||
public InterestShowPaginationServiceRequest toServiceRequest(UUID userId) { | ||
return InterestShowPaginationServiceRequest.builder() | ||
.userId(userId) | ||
.size(size) | ||
.cursorId(cursorId) | ||
.build(); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...main/java/com/example/show/controller/dto/response/InterestShowPaginationApiResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.example.show.controller.dto.response; | ||
|
||
import com.example.show.service.dto.response.InterestShowPaginationServiceResponse; | ||
import java.util.UUID; | ||
import lombok.Builder; | ||
import org.example.util.DateTimeUtil; | ||
|
||
@Builder | ||
public record InterestShowPaginationApiResponse( | ||
UUID id, | ||
String title, | ||
String startAt, | ||
String endAt, | ||
String location, | ||
String posterImageURL, | ||
String interestedAt | ||
) { | ||
|
||
public static InterestShowPaginationApiResponse from(InterestShowPaginationServiceResponse response) { | ||
return InterestShowPaginationApiResponse.builder() | ||
.id(response.showId()) | ||
.title(response.title()) | ||
.startAt(DateTimeUtil.formatDate(response.startAt())) | ||
.endAt(DateTimeUtil.formatDate(response.endAt())) | ||
.location(response.location()) | ||
.posterImageURL(response.posterImageURL()) | ||
.interestedAt(DateTimeUtil.formatDateTime(response.interestedAt())) | ||
.build(); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...w-api/src/main/java/com/example/show/controller/dto/response/ShowInterestApiResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
package com.example.show.controller.dto.response; | ||
|
||
import com.example.show.service.dto.response.ShowInterestServiceResponse; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
public record ShowInterestApiResponse( | ||
@Schema(description = "관심 여부 (T: 관심 있음, F: 관심 없음)") | ||
boolean hasInterest | ||
) { | ||
|
||
public static ShowInterestApiResponse from(ShowInterestServiceResponse response) { | ||
return new ShowInterestApiResponse(response.hasInterest()); | ||
} | ||
} |
16 changes: 0 additions & 16 deletions
16
...main/java/com/example/show/controller/dto/response/ShowInterestPaginationApiResponse.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
.../main/java/com/example/show/service/dto/request/InterestShowPaginationServiceRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.example.show.service.dto.request; | ||
|
||
import java.util.UUID; | ||
import lombok.Builder; | ||
import org.example.dto.request.InterestShowPaginationDomainRequest; | ||
|
||
@Builder | ||
public record InterestShowPaginationServiceRequest( | ||
UUID userId, | ||
int size, | ||
UUID cursorId | ||
) { | ||
|
||
public InterestShowPaginationDomainRequest toDomainRequest() { | ||
return InterestShowPaginationDomainRequest.builder() | ||
.userId(userId) | ||
.size(size) | ||
.cursorId(cursorId) | ||
.build(); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...ow-api/src/main/java/com/example/show/service/dto/request/ShowInterestServiceRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.example.show.service.dto.request; | ||
|
||
import java.util.UUID; | ||
import lombok.Builder; | ||
import org.example.dto.request.InterestShowDomainRequest; | ||
|
||
@Builder | ||
public record ShowInterestServiceRequest( | ||
UUID showId, | ||
UUID userId | ||
) { | ||
|
||
public InterestShowDomainRequest toDomainRequest() { | ||
return InterestShowDomainRequest.builder() | ||
.showId(showId()) | ||
.userId(userId()) | ||
.build(); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...ain/java/com/example/show/service/dto/response/InterestShowPaginationServiceResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.example.show.service.dto.response; | ||
|
||
import java.time.LocalDate; | ||
import java.time.LocalDateTime; | ||
import java.util.UUID; | ||
import lombok.Builder; | ||
import org.example.entity.InterestShow; | ||
import org.example.entity.show.Show; | ||
|
||
@Builder | ||
public record InterestShowPaginationServiceResponse( | ||
UUID showId, | ||
LocalDateTime interestedAt, | ||
String title, | ||
String location, | ||
String posterImageURL, | ||
LocalDate startAt, | ||
LocalDate endAt | ||
) { | ||
|
||
public static InterestShowPaginationServiceResponse from( | ||
Show show, | ||
InterestShow interestShow | ||
) { | ||
return InterestShowPaginationServiceResponse.builder() | ||
.showId(show.getId()) | ||
.interestedAt(interestShow.getUpdatedAt()) | ||
.title(show.getTitle()) | ||
.location(show.getTitle()) | ||
.posterImageURL(show.getImage()) | ||
.startAt(show.getStartDate()) | ||
.endAt(show.getEndDate()) | ||
.build(); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...-api/src/main/java/com/example/show/service/dto/response/ShowInterestServiceResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.example.show.service.dto.response; | ||
|
||
import org.example.entity.InterestShow; | ||
|
||
public record ShowInterestServiceResponse( | ||
boolean hasInterest | ||
) { | ||
|
||
public static ShowInterestServiceResponse from(InterestShow interestShow) { | ||
return new ShowInterestServiceResponse(interestShow.hasInterest()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.