Skip to content

Commit

Permalink
Merge pull request #33 from SWM-Flash/develop
Browse files Browse the repository at this point in the history
Problem API 스웨거 추가
  • Loading branch information
ChoiWonYu authored Jul 19, 2024
2 parents 5fb8995 + e922413 commit 858380d
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import com.first.flash.climbing.problem.application.dto.ProblemDetailResponseDto;
import com.first.flash.climbing.problem.application.dto.ProblemsResponseDto;
import com.first.flash.climbing.problem.domain.dto.ProblemCreateRequestDto;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import java.util.List;
import java.util.UUID;
import lombok.RequiredArgsConstructor;
Expand All @@ -28,6 +31,10 @@ public class ProblemController {
private final ProblemsSaveService problemsSaveService;
private final ProblemReadService problemReadService;

@Operation(summary = "문제 저장", description = "특정 섹터에 문제 저장")
@ApiResponses(value = {
@ApiResponse(responseCode = "201", description = "성공적으로 문제 저장함"),
})
@PostMapping("/gyms/{gymId}/sectors/{sectorId}/problems")
public ResponseEntity<ProblemCreateResponseDto> saveProblems(
@PathVariable("gymId") final Long gymId,
Expand All @@ -37,6 +44,10 @@ public ResponseEntity<ProblemCreateResponseDto> saveProblems(
.body(problemsSaveService.saveProblems(gymId, sectorId, requestDto));
}

@Operation(summary = "문제 여러건 조회", description = "문제 필터링, 정렬, 페이지네이션 후 여러건 조회")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "성공적으로 문제 조회"),
})
@GetMapping("/gyms/{gymId}/problems")
public ResponseEntity<ProblemsResponseDto> findAllProblems(
@PathVariable final Long gymId,
Expand All @@ -51,6 +62,10 @@ public ResponseEntity<ProblemsResponseDto> findAllProblems(
hasSolution));
}

@Operation(summary = "문제 단건 조회", description = "특정 문제의 정보 조회")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "성공적으로 문제 정보 조회함"),
})
@GetMapping("/problems/{problemId}")
public ResponseEntity<ProblemDetailResponseDto> findProblemById(
@PathVariable final UUID problemId) {
Expand Down

0 comments on commit 858380d

Please sign in to comment.