-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/main/java/org/sopt/confeti/api/controller/HomeViewController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.sopt.confeti.api.controller; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.sopt.confeti.global.common.BaseResponse; | ||
import org.sopt.confeti.global.message.SuccessMessage; | ||
import org.sopt.confeti.global.util.ApiResponseUtil; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestHeader; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
public class HomeViewController { | ||
|
||
@GetMapping("/performances/reservation") | ||
public ResponseEntity<BaseResponse<?>> performanceReservation(@RequestHeader("Authorization") String userId ) { | ||
String a = "Aa"; //임시값 | ||
return ApiResponseUtil.success(SuccessMessage.SUCCESS, a); //임시값 | ||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/org/sopt/confeti/api/dto/response/PerformanceReservationResponse.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 org.sopt.confeti.api.dto.response; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
public record PerformanceReservationResponse( | ||
Integer index, | ||
Long performanceId, | ||
String type, | ||
String subtitle, | ||
LocalDateTime reserveAt, | ||
String reservationBgUrl | ||
) {} |
12 changes: 12 additions & 0 deletions
12
src/main/java/org/sopt/confeti/api/facade/UserFavoritePerformance.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 org.sopt.confeti.api.facade; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.sopt.confeti.domain.festivalfavorite.application.FestivalFavoriteService; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class UserFavoritePerformance { | ||
private final FestivalFavoriteService festivalFavoriteService; | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
...main/java/org/sopt/confeti/domain/concertfavorite/application/ConcertFavoriteService.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,4 @@ | ||
package org.sopt.confeti.domain.concertfavorite.application; | ||
|
||
public class ConcertFavoriteService { | ||
} |
29 changes: 29 additions & 0 deletions
29
...sopt/confeti/domain/concertfavorite/application/dto/response/ConcertFavoriteResponse.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,29 @@ | ||
package org.sopt.confeti.domain.concertfavorite.application.dto.response; | ||
|
||
import lombok.Builder; | ||
import java.time.LocalDateTime; | ||
|
||
@Builder | ||
public class ConcertFavoriteResponse( | ||
long performanceId, | ||
String type, | ||
String subtitle, | ||
LocalDateTime reserveAt, | ||
String reservationBgUrl | ||
) { | ||
public static ConcertFavoriteResponse of( | ||
final long performanceId, | ||
final String type, | ||
final String subtitle, | ||
final LocalDateTime reserveAt, | ||
final String reservationBgUrl){ | ||
return ConcertFavoriteResponse.builder() | ||
.performanceId(performanceId) | ||
.type(type) | ||
.subtitle(subtitle) | ||
.reserveAt(reserveAt) | ||
.reservationBgUrl(reservationBgUrl) | ||
.build(); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...in/java/org/sopt/confeti/domain/festivalfavorite/application/FestivalFavoriteService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.sopt.confeti.domain.festivalfavorite.application; | ||
|
||
import org.sopt.confeti.domain.festival.Festival; | ||
import org.sopt.confeti.domain.festivalfavorite.FestivalFavorite; | ||
import org.sopt.confeti.domain.festivalfavorite.application.dto.response.FestivalFavoriteResponse; | ||
import org.sopt.confeti.domain.festivalfavorite.infra.repository.FestivalFavoriteRepository; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
@Service | ||
public class FestivalFavoriteService { | ||
private final FestivalFavoriteRepository festivalFavoriteRepository; | ||
|
||
public FestivalFavoriteService(FestivalFavoriteRepository festivalFavoriteRepository) { | ||
this.festivalFavoriteRepository = festivalFavoriteRepository; | ||
} | ||
|
||
public List<FestivalFavoriteResponse> getConcertFavorites(Long userId) { | ||
List<FestivalFavorite> festivalFavorites = festivalFavoriteRepository.findByUserId(userId); | ||
|
||
return festivalFavorites.stream() | ||
.map(favorite -> { | ||
Festival festival = favorite.getFestival(); | ||
return FestivalFavoriteResponse.builder() | ||
.performanceId(festival.getId()) | ||
.type("festival") | ||
.subtitle(festival.getFestivalSubtitle()) | ||
.reserveAt(festival.getReserveAt()) | ||
.reservationBgUrl(festival.getFestivalReservationBgPath()) | ||
.build(); | ||
}) | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
|
||
} |
29 changes: 29 additions & 0 deletions
29
...pt/confeti/domain/festivalfavorite/application/dto/response/FestivalFavoriteResponse.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,29 @@ | ||
package org.sopt.confeti.domain.festivalfavorite.application.dto.response; | ||
|
||
import lombok.Builder; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Builder | ||
public record FestivalFavoriteResponse ( | ||
long performanceId, | ||
String type, | ||
String subtitle, | ||
LocalDateTime reserveAt, | ||
String reservationBgUrl | ||
){ | ||
public static FestivalFavoriteResponse of( | ||
final long performanceId, | ||
final String type, | ||
final String subtitle, | ||
final LocalDateTime reserveAt, | ||
final String reservationBgUrl){ | ||
return FestivalFavoriteResponse.builder() | ||
.performanceId(performanceId) | ||
.type(type) | ||
.subtitle(subtitle) | ||
.reserveAt(reserveAt) | ||
.reservationBgUrl(reservationBgUrl) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters