-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ EnvironmentController 작성 및 오늘의 환경 정보 불러오기 api 등록
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/main/kotlin/andreas311/miso/domain/environment/presentation/EnvironmentController.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package andreas311.miso.domain.environment.presentation | ||
|
||
import andreas311.miso.domain.environment.presentation.data.response.EnvironmentInfoResponseDto | ||
import andreas311.miso.domain.environment.service.GetTodayEnvironmentInfoService | ||
import andreas311.miso.global.annotation.RequestController | ||
import org.springframework.http.HttpStatus | ||
import org.springframework.http.ResponseEntity | ||
import org.springframework.web.bind.annotation.GetMapping | ||
|
||
@RequestController("/environment") | ||
class EnvironmentController( | ||
private val getTodayEnvironmentInfoService: GetTodayEnvironmentInfoService | ||
) { | ||
|
||
@GetMapping | ||
fun today(): ResponseEntity<EnvironmentInfoResponseDto> = | ||
getTodayEnvironmentInfoService.execute() | ||
.let { ResponseEntity.status(HttpStatus.OK).body(it) } | ||
} |