Skip to content

Commit 132ef06

Browse files
committed
docs: 대여기록 관리 API 스웨거 문서화
1 parent 549079a commit 132ef06

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

src/main/kotlin/site/billilge/api/backend/domain/rental/controller/AdminRentalApi.kt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.ModelAttribute
1010
import org.springframework.web.bind.annotation.PathVariable
1111
import org.springframework.web.bind.annotation.RequestBody
1212
import org.springframework.web.bind.annotation.RequestParam
13+
import site.billilge.api.backend.domain.rental.dto.request.AdminRentalHistoryRequest
1314
import site.billilge.api.backend.domain.rental.dto.request.RentalStatusUpdateRequest
1415
import site.billilge.api.backend.domain.rental.dto.response.AdminRentalHistoryFindAllResponse
1516
import site.billilge.api.backend.domain.rental.dto.response.DashboardResponse
@@ -70,4 +71,34 @@ interface AdminRentalApi {
7071
@PathVariable rentalHistoryId: Long,
7172
@RequestBody request: RentalStatusUpdateRequest
7273
): ResponseEntity<Void>
74+
75+
@Operation(
76+
summary = "대여 기록 추가 (관리자용)",
77+
description = "임의로 대여 기록을 추가하는 관리자용 API"
78+
)
79+
@ApiResponses(
80+
value = [
81+
ApiResponse(
82+
responseCode = "200",
83+
description = "대여 기록 추가 성공"
84+
)
85+
]
86+
)
87+
fun addRentalHistory(
88+
@RequestBody request: AdminRentalHistoryRequest
89+
): ResponseEntity<Void>
90+
91+
@Operation(
92+
summary = "대여 기록 삭제 (관리자용)",
93+
description = "대여 기록을 임의로 삭제하는 관리자용 API"
94+
)
95+
@ApiResponses(
96+
value = [
97+
ApiResponse(
98+
responseCode = "200",
99+
description = "대여 기록 삭제 성공"
100+
)
101+
]
102+
)
103+
fun deleteRentalHistory(@PathVariable rentalHistoryId: Long): ResponseEntity<Void>
73104
}

src/main/kotlin/site/billilge/api/backend/domain/rental/controller/AdminRentalController.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ class AdminRentalController(
4747
}
4848

4949
@PostMapping
50-
fun addRentalHistory(
50+
override fun addRentalHistory(
5151
@RequestBody request: AdminRentalHistoryRequest
5252
): ResponseEntity<Void> {
5353
rentalService.createRentalByAdmin(request)
5454
return ResponseEntity.ok().build()
5555
}
5656

5757
@DeleteMapping("/{rentalHistoryId}")
58-
fun deleteRentalHistory(@PathVariable rentalHistoryId: Long): ResponseEntity<Void> {
58+
override fun deleteRentalHistory(@PathVariable rentalHistoryId: Long): ResponseEntity<Void> {
5959
rentalService.deleteRentalHistory(rentalHistoryId)
6060
return ResponseEntity.ok().build()
6161
}

0 commit comments

Comments
 (0)