diff --git a/core/src/main/kotlin/com/core/adapter/in/web/MealController.kt b/core/src/main/kotlin/com/core/adapter/in/web/MealController.kt index 2ae8948..937762c 100644 --- a/core/src/main/kotlin/com/core/adapter/in/web/MealController.kt +++ b/core/src/main/kotlin/com/core/adapter/in/web/MealController.kt @@ -2,19 +2,18 @@ package com.core.adapter.`in`.web import com.core.adapter.`in`.web.dto.AdapterMealDto import com.core.application.port.`in`.GetMealUseCase -import com.core.application.port.`in`.dto.ApplicationMealDto import com.core.common.response.ApplicationResponse import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.RestController -@RestController("/api/v1/foods") +@RestController("/api/v1/meals") class MealController(private val getMealUseCase: GetMealUseCase) { @GetMapping - fun getFood() : ApplicationResponse> { + fun getMeal() : ApplicationResponse> { val data = getMealUseCase.execute() - val toResponse = AdapterMealDto.GetFoodRes.toResponse(data) + val toResponse = AdapterMealDto.GetMealRes.toResponse(data) return ApplicationResponse.ok(toResponse) } diff --git a/core/src/main/kotlin/com/core/adapter/in/web/dto/AdapterMealDto.kt b/core/src/main/kotlin/com/core/adapter/in/web/dto/AdapterMealDto.kt index c3acc5a..bd204bb 100644 --- a/core/src/main/kotlin/com/core/adapter/in/web/dto/AdapterMealDto.kt +++ b/core/src/main/kotlin/com/core/adapter/in/web/dto/AdapterMealDto.kt @@ -1,20 +1,19 @@ package com.core.adapter.`in`.web.dto import com.core.application.port.`in`.dto.ApplicationMealDto -import java.time.LocalDateTime class AdapterMealDto { - data class GetFoodRes( + data class GetMealRes( val idx: Long, val type: String, val status: String, val meals: String ) { companion object { - fun toResponse(data: List) : List{ + fun toResponse(data: List) : List{ return data.map { - GetFoodRes( + GetMealRes( idx = it.idx, type = it.type, status = it.status, diff --git a/core/src/main/kotlin/com/core/application/domain/meal/service/MealReadService.kt b/core/src/main/kotlin/com/core/application/domain/meal/service/MealReadService.kt index 1f55dff..241fee1 100644 --- a/core/src/main/kotlin/com/core/application/domain/meal/service/MealReadService.kt +++ b/core/src/main/kotlin/com/core/application/domain/meal/service/MealReadService.kt @@ -7,7 +7,7 @@ import org.springframework.stereotype.Service @Service class MealReadService : GetMealUseCase { - override fun execute(): List { + override fun execute(): List { TODO("Not yet implemented") } diff --git a/core/src/main/kotlin/com/core/application/port/in/GetMealUseCase.kt b/core/src/main/kotlin/com/core/application/port/in/GetMealUseCase.kt index 528298a..e750e1b 100644 --- a/core/src/main/kotlin/com/core/application/port/in/GetMealUseCase.kt +++ b/core/src/main/kotlin/com/core/application/port/in/GetMealUseCase.kt @@ -4,6 +4,6 @@ import com.core.application.port.`in`.dto.ApplicationMealDto interface GetMealUseCase { - fun execute(): List + fun execute(): List } \ No newline at end of file diff --git a/core/src/main/kotlin/com/core/application/port/in/dto/ApplicationMealDto.kt b/core/src/main/kotlin/com/core/application/port/in/dto/ApplicationMealDto.kt index d263817..370597d 100644 --- a/core/src/main/kotlin/com/core/application/port/in/dto/ApplicationMealDto.kt +++ b/core/src/main/kotlin/com/core/application/port/in/dto/ApplicationMealDto.kt @@ -5,7 +5,7 @@ data class ApplicationMealDto ( val price: Int, val description: String ) { - data class GetFoodRes( + data class GetMealRes( val idx: Long, val type: String, val status: String,