Skip to content

Commit

Permalink
[#50] feat(PerformanceController): 공연 생성 POST API 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
hoonyworld committed Jul 17, 2024
1 parent 206b89a commit 4937401
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
package com.beat.domain.performance.api;

import com.beat.domain.performance.application.PerformanceCreateService;
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.create.PerformanceRequest;
import com.beat.domain.performance.application.dto.create.PerformanceResponse;
import com.beat.domain.performance.exception.PerformanceSuccessCode;
import com.beat.domain.performance.application.PerformanceService;
import com.beat.global.auth.annotation.CurrentMember;
import com.beat.global.common.dto.SuccessResponse;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

Expand All @@ -21,6 +27,17 @@
public class PerformanceController {

private final PerformanceService performanceService;
private final PerformanceCreateService performanceCreateService;

@Operation(summary = "공연 생성 API", description = "공연을 생성하는 POST API입니다.")
@PostMapping
public ResponseEntity<SuccessResponse<PerformanceResponse>> createPerformance(
@CurrentMember Long userId,
@RequestBody PerformanceRequest performanceRequest) {
PerformanceResponse response = performanceCreateService.createPerformance(userId, performanceRequest);
return ResponseEntity.status(HttpStatus.CREATED)
.body(SuccessResponse.of(PerformanceSuccessCode.PERFORMANCE_CREATE_SUCCESS, response));
}

@Operation(summary = "공연 상세정보 조회 API", description = "공연 상세페이지의 공연 상세정보를 조회하는 GET API입니다.")
@GetMapping("/detail/{performanceId}")
Expand Down

0 comments on commit 4937401

Please sign in to comment.