From e4bb03cb2850decf8cdfbae09501e13107d54a5e Mon Sep 17 00:00:00 2001 From: DongHoon Lee Date: Wed, 17 Jul 2024 23:29:52 +0900 Subject: [PATCH] =?UTF-8?q?[#113]=20feat(PerformanceController):=20?= =?UTF-8?q?=EA=B3=B5=EC=97=B0=20=EC=82=AD=EC=A0=9C=20DELETE=20API=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/PerformanceController.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/beat/domain/performance/api/PerformanceController.java b/src/main/java/com/beat/domain/performance/api/PerformanceController.java index 72c685d9..9cdf3171 100644 --- a/src/main/java/com/beat/domain/performance/api/PerformanceController.java +++ b/src/main/java/com/beat/domain/performance/api/PerformanceController.java @@ -1,6 +1,6 @@ package com.beat.domain.performance.api; -import com.beat.domain.performance.application.PerformanceCreateService; +import com.beat.domain.performance.application.PerformanceManagementService; import com.beat.domain.performance.application.dto.BookingPerformanceDetailResponse; import com.beat.domain.performance.application.dto.MakerPerformanceResponse; import com.beat.domain.performance.application.dto.PerformanceDetailResponse; @@ -14,6 +14,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; @@ -27,14 +28,14 @@ public class PerformanceController { private final PerformanceService performanceService; - private final PerformanceCreateService performanceCreateService; + private final PerformanceManagementService performanceManagementService; @Operation(summary = "공연 생성 API", description = "공연을 생성하는 POST API입니다.") @PostMapping public ResponseEntity> createPerformance( - @CurrentMember Long userId, + @CurrentMember Long memberId, @RequestBody PerformanceRequest performanceRequest) { - PerformanceResponse response = performanceCreateService.createPerformance(userId, performanceRequest); + PerformanceResponse response = performanceManagementService.createPerformance(memberId, performanceRequest); return ResponseEntity.status(HttpStatus.CREATED) .body(SuccessResponse.of(PerformanceSuccessCode.PERFORMANCE_CREATE_SUCCESS, response)); } @@ -61,4 +62,13 @@ public ResponseEntity> getUserPerforma MakerPerformanceResponse response = performanceService.getMemberPerformances(memberId); return ResponseEntity.ok(SuccessResponse.of(PerformanceSuccessCode.MAKER_PERFORMANCE_RETRIEVE_SUCCESS, response)); } -} + + @Operation(summary = "공연 삭제 API", description = "공연을 삭제하는 DELETE API입니다.") + @DeleteMapping("/{performanceId}") + public ResponseEntity> deletePerformance( + @CurrentMember Long memberId, + @PathVariable Long performanceId) { + performanceManagementService.deletePerformance(memberId, performanceId); + return ResponseEntity.ok(SuccessResponse.of(PerformanceSuccessCode.PERFORMANCE_DELETE_SUCCESS, null)); + } +} \ No newline at end of file