Skip to content

Commit

Permalink
[refactor] #185 - schedule, staff, cast의 add, delete, update DTO를 하나의…
Browse files Browse the repository at this point in the history
… DTO로 변경 및 scheduleNumber를 서버측에서 부여하도록 변경 (#187)
  • Loading branch information
hoonyworld authored Aug 23, 2024
1 parent c2966e2 commit 7e37618
Show file tree
Hide file tree
Showing 39 changed files with 661 additions and 792 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public GuestBookingResponse createGuestBooking(GuestBookingRequest guestBookingR
booking.isPaymentCompleted(),
schedule.getPerformance().getBankName(),
schedule.getPerformance().getAccountNumber(),
totalPaymentAmount,
totalPaymentAmount, // 회원 예매랑 다른 부분 확인하기
booking.getCreatedAt()
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public MemberBookingResponse createMemberBooking(Long memberId, MemberBookingReq
booking.isPaymentCompleted(),
schedule.getPerformance().getBankName(),
schedule.getPerformance().getAccountNumber(),
memberBookingRequest.totalPaymentAmount(),
memberBookingRequest.totalPaymentAmount(), // 비회원 예매처럼 int totalPaymentAmount = ticketPrice * guestBookingRequest.purchaseTicketCount();로 계산해서 반영하기 + 요청한 총 가격 == 티켓 가격 * 수 같은지 검증하는 로직 추가하기
booking.getCreatedAt()
);
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/beat/domain/cast/dao/CastRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

import com.beat.domain.cast.domain.Cast;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface CastRepository extends JpaRepository<Cast, Long> {
List<Cast> findByPerformanceId(Long performanceId);

List<Cast> findAllByPerformanceId(Long performanceId);

@Query("SELECT c.id FROM Cast c WHERE c.performance.id = :performanceId")
List<Long> findIdsByPerformanceId(Long performanceId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@Getter
@RequiredArgsConstructor
public enum CastErrorCode implements BaseErrorCode {
CAST_NOT_BELONG_TO_PERFORMANCE(403,"해당 등장인물은 해당 공연에 속해 있지 않습니다."),
CAST_NOT_FOUND(404, "등장인물이 존재하지 않습니다.")
;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.beat.domain.performance.api;

import com.beat.domain.performance.application.PerformanceManagementService;
import com.beat.domain.performance.application.PerformanceUpdateService;
import com.beat.domain.performance.application.PerformanceModifyService;
import com.beat.domain.performance.application.dto.BookingPerformanceDetailResponse;
import com.beat.domain.performance.application.dto.MakerPerformanceResponse;
import com.beat.domain.performance.application.dto.PerformanceDetailResponse;
import com.beat.domain.performance.application.dto.PerformanceEditResponse;
import com.beat.domain.performance.application.dto.create.PerformanceRequest;
import com.beat.domain.performance.application.dto.create.PerformanceResponse;
import com.beat.domain.performance.application.dto.update.PerformanceUpdateRequest;
import com.beat.domain.performance.application.dto.update.PerformanceUpdateResponse;
import com.beat.domain.performance.application.dto.modify.PerformanceModifyRequest;
import com.beat.domain.performance.application.dto.modify.PerformanceModifyResponse;
import com.beat.domain.performance.exception.PerformanceSuccessCode;
import com.beat.domain.performance.application.PerformanceService;
import com.beat.global.auth.annotation.CurrentMember;
Expand All @@ -36,7 +36,7 @@ public class PerformanceController {

private final PerformanceService performanceService;
private final PerformanceManagementService performanceManagementService;
private final PerformanceUpdateService performanceUpdateService;
private final PerformanceModifyService performanceModifyService;

@Operation(summary = "공연 생성 API", description = "공연을 생성하는 POST API입니다.")
@PostMapping
Expand All @@ -63,10 +63,10 @@ public ResponseEntity<SuccessResponse<PerformanceResponse>> createPerformance(
@ApiResponse(responseCode = "500", description = "서버 내부 오류")
})
@PutMapping
public ResponseEntity<SuccessResponse<PerformanceUpdateResponse>> updatePerformance(
public ResponseEntity<SuccessResponse<PerformanceModifyResponse>> updatePerformance(
@CurrentMember Long memberId,
@RequestBody PerformanceUpdateRequest performanceUpdateRequest) {
PerformanceUpdateResponse response = performanceUpdateService.updatePerformance(memberId, performanceUpdateRequest);
@RequestBody PerformanceModifyRequest performanceModifyRequest) {
PerformanceModifyResponse response = performanceModifyService.modifyPerformance(memberId, performanceModifyRequest);
return ResponseEntity.status(HttpStatus.OK)
.body(SuccessResponse.of(PerformanceSuccessCode.PERFORMANCE_UPDATE_SUCCESS, response));
}
Expand Down
Loading

0 comments on commit 7e37618

Please sign in to comment.