Skip to content

Commit

Permalink
refactor: 위치관련 API들의 URL 주소를 RequestMapping으로 공통화
Browse files Browse the repository at this point in the history
  • Loading branch information
Dompoo committed Jul 31, 2024
1 parent 082edbb commit f75ed75
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<LocationResponse> = 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)
Expand Down

0 comments on commit f75ed75

Please sign in to comment.