Skip to content

Commit

Permalink
어드민 장소 & 건물 정보 삭제 API 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeniuus committed Mar 17, 2024
1 parent 6285c77 commit 7a59d3e
Showing 1 changed file with 29 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
package club.staircrusher.accessibility.infra.adapter.`in`.controller

import club.staircrusher.accessibility.application.port.`in`.AdminDeleteBuildingAccessibilityUseCase
import club.staircrusher.accessibility.application.port.`in`.AdminDeletePlaceAccessibilityUseCase
import club.staircrusher.accessibility.application.port.`in`.AdminSearchAccessibilitiesUseCase
import club.staircrusher.admin_api.spec.dto.AdminAccessibilityDTO
import club.staircrusher.admin_api.spec.dto.AdminSearchAccessibilitiesResultDTO
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.DeleteMapping
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController

@RestController
class AdminAccessibilityController(
private val adminSearchAccessibilitiesUseCase: AdminSearchAccessibilitiesUseCase,
private val adminDeletePlaceAccessibilityUseCase: AdminDeletePlaceAccessibilityUseCase,
private val adminDeleteBuildingAccessibilityUseCase: AdminDeleteBuildingAccessibilityUseCase,
) {
@GetMapping("/admin/accessibilities/search")
fun searchAccessibilities(
@RequestParam placeName: String?,
@RequestParam cursor: String?,
@RequestParam limit: Int?,
@RequestParam(required = false) placeName: String?,
@RequestParam(required = false) cursor: String?,
@RequestParam(required = false) limit: Int?,
): AdminSearchAccessibilitiesResultDTO {
val result = adminSearchAccessibilitiesUseCase.handle(
placeName = placeName,
Expand All @@ -39,4 +45,24 @@ class AdminAccessibilityController(
cursor = result.cursor,
)
}

@DeleteMapping("/admin/place-accessibilities/{id}")
fun deletePlaceAccessibility(
@RequestParam id: String,
): ResponseEntity<Unit> {
adminDeletePlaceAccessibilityUseCase.handle(placeAccessibilityId = id)
return ResponseEntity
.noContent()
.build()
}

@DeleteMapping("/admin/building-accessibilities/{id}")
fun deleteBuildingAccessibility(
@RequestParam id: String,
): ResponseEntity<Unit> {
adminDeleteBuildingAccessibilityUseCase.handle(buildingAccessibilityId = id)
return ResponseEntity
.noContent()
.build()
}
}

0 comments on commit 7a59d3e

Please sign in to comment.