From f75ed75cf1d6d2b6e01d7c55b86fbd9ab98d155c Mon Sep 17 00:00:00 2001 From: Dompoo Date: Wed, 31 Jul 2024 13:26:34 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=9C=84=EC=B9=98=EA=B4=80?= =?UTF-8?q?=EB=A0=A8=20API=EB=93=A4=EC=9D=98=20URL=20=EC=A3=BC=EC=86=8C?= =?UTF-8?q?=EB=A5=BC=20RequestMapping=EC=9C=BC=EB=A1=9C=20=EA=B3=B5?= =?UTF-8?q?=ED=86=B5=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../blooming/api/controller/LocationController.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/dnd11th/blooming/api/controller/LocationController.kt b/src/main/kotlin/dnd11th/blooming/api/controller/LocationController.kt index 7c930f80..6379c0dc 100644 --- a/src/main/kotlin/dnd11th/blooming/api/controller/LocationController.kt +++ b/src/main/kotlin/dnd11th/blooming/api/controller/LocationController.kt @@ -11,27 +11,29 @@ import org.springframework.web.bind.annotation.PatchMapping import org.springframework.web.bind.annotation.PathVariable import org.springframework.web.bind.annotation.PostMapping import org.springframework.web.bind.annotation.RequestBody +import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController @RestController +@RequestMapping("/location") class LocationController( private val locationService: LocationService, ) { - @PostMapping("/location") + @PostMapping fun saveLocation( @RequestBody request: LocationSaveRequest, ): LocationSaveResponse = locationService.saveLocation(request) - @GetMapping("/location") + @GetMapping fun findAllLocation(): List = locationService.findAllLocation() - @PatchMapping("/location/{locationId}") + @PatchMapping("/{locationId}") fun modifyLocation( @PathVariable locationId: Long, @RequestBody request: LocationModifyRequest, ): LocationResponse = locationService.modifyLocation(locationId, request) - @DeleteMapping("/location/{locationId}") + @DeleteMapping("/{locationId}") fun deleteLocation( @PathVariable locationId: Long, ) = locationService.deleteLocation(locationId)