Skip to content

Commit

Permalink
#2 스웨거 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
Qbeom0925 committed Aug 18, 2024
1 parent dcdb1b6 commit eb8e48f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@ import com.core.adapter.`in`.web.dto.AdapterMealDto
import com.core.application.port.`in`.GetWeekMealUseCase
import com.core.common.response.ApplicationResponse
import io.swagger.v3.oas.annotations.Operation
import io.swagger.v3.oas.annotations.media.Schema
import io.swagger.v3.oas.annotations.tags.Tag
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController

@Tag(name = "식단 조회 API", description = "식단 조회 API")
@RestController
class MealController(val getWeekMealUseCase: GetWeekMealUseCase) {


@GetMapping("/api/v1/meals/week")
@Operation(summary = "주간 식단 조회")
@Operation(summary = "주간 식단 조회", description = "주간 식단 조회 API입니다.")
fun getWeekMeal(
@RequestParam("restaurantIdx") restaurantIdx: Long
@Schema(description = "식당 인덱스", example = "1")
@RequestParam("restaurantIdx")
restaurantIdx: Long
) : ApplicationResponse<List<AdapterMealDto.GroupedWeekMealRes>> {
val data = getWeekMealUseCase(restaurantIdx)
val toResponse = AdapterMealDto.GetWeekMealRes.from(data)
Expand Down
10 changes: 10 additions & 0 deletions core/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,13 @@ spring:
highlight_sql: true
default_batch_fetch_size: 20
open-in-view: false

springdoc:
swagger-ui:
path: /docs
groups-order: DESC
doc-expansion: none
tags-sorter: alpha
paths-to-match:
- /api/v1/**

0 comments on commit eb8e48f

Please sign in to comment.