Skip to content

Commit

Permalink
feat: SchoolController에 Swagger 정보 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunseo committed Nov 3, 2023
1 parent 0027082 commit c2445c9
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.festago.school.application.SchoolService;
import com.festago.school.dto.SchoolResponse;
import com.festago.school.dto.SchoolsResponse;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
Expand All @@ -12,18 +14,21 @@

@RestController
@RequestMapping("/schools")
@Tag(name = "학교 정보 요청")
@RequiredArgsConstructor
public class SchoolController {

private final SchoolService schoolService;

@GetMapping
@Operation(description = "모든 학교 정보를 조회한다.", summary = "전체 학교 조회")
public ResponseEntity<SchoolsResponse> findAll() {
return ResponseEntity.ok()
.body(schoolService.findAll());
}

@GetMapping("/{schoolId}")
@Operation(description = "단일 학교 정보를 조회한다.", summary = "단일 학교 조회")
public ResponseEntity<SchoolResponse> findById(@PathVariable Long schoolId) {
return ResponseEntity.ok()
.body(schoolService.findById(schoolId));
Expand Down

0 comments on commit c2445c9

Please sign in to comment.