Skip to content

Commit

Permalink
[#113] feat(PerformanceController): 공연 삭제 DELETE API 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
hoonyworld committed Jul 17, 2024
1 parent 501bf76 commit e4bb03c
Showing 1 changed file with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand All @@ -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<SuccessResponse<PerformanceResponse>> 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));
}
Expand All @@ -61,4 +62,13 @@ public ResponseEntity<SuccessResponse<MakerPerformanceResponse>> 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<SuccessResponse<Void>> deletePerformance(
@CurrentMember Long memberId,
@PathVariable Long performanceId) {
performanceManagementService.deletePerformance(memberId, performanceId);
return ResponseEntity.ok(SuccessResponse.of(PerformanceSuccessCode.PERFORMANCE_DELETE_SUCCESS, null));
}
}

0 comments on commit e4bb03c

Please sign in to comment.