-
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.
Feature: 화면 구현에 필요한 API를 추가 구현한다. (#128)
- Loading branch information
Showing
26 changed files
with
358 additions
and
32 deletions.
There are no files selected for viewing
Submodule backend-config
updated
from 193789 to a43389
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
18 changes: 18 additions & 0 deletions
18
src/main/java/com/thirdparty/ticketing/domain/ticket/dto/response/TicketSeatDetail.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,18 @@ | ||
package com.thirdparty.ticketing.domain.ticket.dto.response; | ||
|
||
import com.thirdparty.ticketing.domain.seat.Seat; | ||
import com.thirdparty.ticketing.domain.seat.dto.response.SeatGradeElement; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class TicketSeatDetail { | ||
private final long seatId; | ||
private final String seatCode; | ||
private final SeatGradeElement grade; | ||
|
||
public static TicketSeatDetail of(Seat seat) { | ||
return new TicketSeatDetail( | ||
seat.getSeatId(), seat.getSeatCode(), SeatGradeElement.of(seat.getSeatGrade())); | ||
} | ||
} |
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
27 changes: 27 additions & 0 deletions
27
src/main/java/com/thirdparty/ticketing/domain/ticket/service/ReservationManager.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,27 @@ | ||
package com.thirdparty.ticketing.domain.ticket.service; | ||
|
||
import org.springframework.stereotype.Component; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import com.thirdparty.ticketing.domain.common.ErrorCode; | ||
import com.thirdparty.ticketing.domain.common.TicketingException; | ||
import com.thirdparty.ticketing.domain.member.Member; | ||
import com.thirdparty.ticketing.domain.seat.Seat; | ||
import com.thirdparty.ticketing.domain.seat.repository.SeatRepository; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class ReservationManager { | ||
private final SeatRepository seatRepository; | ||
|
||
@Transactional | ||
public void releaseSeat(Member loginMember, long seatId) { | ||
Seat seat = | ||
seatRepository | ||
.findById(seatId) | ||
.orElseThrow(() -> new TicketingException(ErrorCode.NOT_FOUND_SEAT)); | ||
seat.releaseSeat(loginMember); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.