diff --git a/piikii-application/src/main/kotlin/com/piikii/application/port/input/dto/request/PlaceRequest.kt b/piikii-application/src/main/kotlin/com/piikii/application/port/input/dto/request/PlaceRequest.kt index 2548302b..440240fe 100644 --- a/piikii-application/src/main/kotlin/com/piikii/application/port/input/dto/request/PlaceRequest.kt +++ b/piikii-application/src/main/kotlin/com/piikii/application/port/input/dto/request/PlaceRequest.kt @@ -137,9 +137,3 @@ data class ModifyPlaceRequest( ) } } - -data class DeletePlaceRequest( - @field:NotNull(message = "삭제할 장소 ID는 필수입니다.") - @field:Schema(description = "삭제할 장소 ID", example = "1") - val targetPlaceId: Long, -) diff --git a/piikii-application/src/main/kotlin/com/piikii/application/port/input/dto/request/RoomRequest.kt b/piikii-application/src/main/kotlin/com/piikii/application/port/input/dto/request/RoomRequest.kt index 872108e4..20094885 100644 --- a/piikii-application/src/main/kotlin/com/piikii/application/port/input/dto/request/RoomRequest.kt +++ b/piikii-application/src/main/kotlin/com/piikii/application/port/input/dto/request/RoomRequest.kt @@ -15,9 +15,6 @@ data class RoomSaveRequestForm( val name: String, @field:Schema(description = "적고 싶은 메시지", example = "늦으면 밥값 몰빵") val message: String?, - @field:NotBlank - @field:Schema(description = "모임 장소 주소", example = "경기 화성시 봉담읍 동화길 51") - val address: String, @field:Schema(description = "썸네일 이미지 링크", example = "https://github.com/k-diger.png") val thumbnailLink: String, @field:NotNull(message = "모임 비밀번호는 필수입니다.") diff --git a/piikii-application/src/main/kotlin/com/piikii/application/port/input/dto/response/ScheduleResponse.kt b/piikii-application/src/main/kotlin/com/piikii/application/port/input/dto/response/ScheduleResponse.kt index cbe579a0..3555970a 100644 --- a/piikii-application/src/main/kotlin/com/piikii/application/port/input/dto/response/ScheduleResponse.kt +++ b/piikii-application/src/main/kotlin/com/piikii/application/port/input/dto/response/ScheduleResponse.kt @@ -9,7 +9,7 @@ import io.swagger.v3.oas.annotations.media.Schema @Schema(description = "방 스케줄 정보 응답") data class SchedulesResponse( @field:Schema(description = "방 스케줄 정보 목록") - val categories: List, + val schedules: List, ) { companion object { fun from(schedules: List): SchedulesResponse { diff --git a/piikii-input-http/src/main/kotlin/com/piikii/input/http/controller/PlaceApi.kt b/piikii-input-http/src/main/kotlin/com/piikii/input/http/controller/PlaceApi.kt index 1c3db14d..ad602e68 100644 --- a/piikii-input-http/src/main/kotlin/com/piikii/input/http/controller/PlaceApi.kt +++ b/piikii-input-http/src/main/kotlin/com/piikii/input/http/controller/PlaceApi.kt @@ -2,7 +2,6 @@ package com.piikii.input.http.controller import com.piikii.application.port.input.PlaceUseCase import com.piikii.application.port.input.dto.request.AddPlaceRequest -import com.piikii.application.port.input.dto.request.DeletePlaceRequest import com.piikii.application.port.input.dto.request.ModifyPlaceRequest import com.piikii.application.port.input.dto.response.PlaceResponse import com.piikii.application.port.input.dto.response.ScheduleTypeGroupResponse @@ -17,7 +16,6 @@ import org.springframework.web.bind.annotation.GetMapping 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.RequestPart import org.springframework.web.bind.annotation.ResponseStatus @@ -48,29 +46,29 @@ class PlaceApi( return ResponseForm(placeUseCase.findAllByRoomUidGroupByPlaceType(roomUid)) } - @PatchMapping("/{targetPlaceId}") + @PatchMapping("/{placeId}") override fun modifyPlace( @NotNull @PathVariable roomUid: UUID, - @NotNull @PathVariable targetPlaceId: Long, + @NotNull @PathVariable placeId: Long, @Valid @NotNull @RequestPart modifyPlaceRequest: ModifyPlaceRequest, @RequestPart(required = false) newPlaceImages: List?, ): ResponseForm { return ResponseForm( placeUseCase.modify( targetRoomUid = roomUid, - targetPlaceId = targetPlaceId, + targetPlaceId = placeId, modifyPlaceRequest = modifyPlaceRequest, newPlaceImages = newPlaceImages, ), ) } - @DeleteMapping + @DeleteMapping("/{placeId}") override fun deletePlace( @NotNull @PathVariable roomUid: UUID, - @Valid @NotNull @RequestBody deletePlaceRequest: DeletePlaceRequest, + @NotNull @PathVariable placeId: Long, ): ResponseForm { - placeUseCase.delete(deletePlaceRequest.targetPlaceId) + placeUseCase.delete(placeId) return ResponseForm.EMPTY_RESPONSE } } diff --git a/piikii-input-http/src/main/kotlin/com/piikii/input/http/controller/VoteApi.kt b/piikii-input-http/src/main/kotlin/com/piikii/input/http/controller/VoteApi.kt index 57711289..fc5a517c 100644 --- a/piikii-input-http/src/main/kotlin/com/piikii/input/http/controller/VoteApi.kt +++ b/piikii-input-http/src/main/kotlin/com/piikii/input/http/controller/VoteApi.kt @@ -24,7 +24,7 @@ import java.util.UUID @Validated @RestController -@RequestMapping("/room/{roomUid}/votes") +@RequestMapping("/v1/rooms/{roomUid}/votes") class VoteApi( private val voteUseCase: VoteUseCase, private val roomUseCase: RoomUseCase, diff --git a/piikii-input-http/src/main/kotlin/com/piikii/input/http/controller/docs/PlaceDocs.kt b/piikii-input-http/src/main/kotlin/com/piikii/input/http/controller/docs/PlaceDocs.kt index d28c8669..737a6532 100644 --- a/piikii-input-http/src/main/kotlin/com/piikii/input/http/controller/docs/PlaceDocs.kt +++ b/piikii-input-http/src/main/kotlin/com/piikii/input/http/controller/docs/PlaceDocs.kt @@ -1,7 +1,6 @@ package com.piikii.input.http.controller.docs import com.piikii.application.port.input.dto.request.AddPlaceRequest -import com.piikii.application.port.input.dto.request.DeletePlaceRequest import com.piikii.application.port.input.dto.request.ModifyPlaceRequest import com.piikii.application.port.input.dto.response.PlaceResponse import com.piikii.application.port.input.dto.response.ScheduleTypeGroupResponse @@ -11,7 +10,6 @@ import io.swagger.v3.oas.annotations.Parameter import io.swagger.v3.oas.annotations.enums.ParameterIn import io.swagger.v3.oas.annotations.media.Content import io.swagger.v3.oas.annotations.media.Schema -import io.swagger.v3.oas.annotations.parameters.RequestBody import io.swagger.v3.oas.annotations.responses.ApiResponse import io.swagger.v3.oas.annotations.responses.ApiResponses import io.swagger.v3.oas.annotations.tags.Tag @@ -107,11 +105,11 @@ interface PlaceDocs { `in` = ParameterIn.PATH, ) @NotNull roomUid: UUID, @Parameter( - name = "targetPlaceId", + name = "placeId", description = "수정하고자 하는 장소의 id", required = true, `in` = ParameterIn.PATH, - ) @NotNull targetPlaceId: Long, + ) @NotNull placeId: Long, @Parameter( name = "modifyPlaceRequest", description = "방 장소 수정 Request body", @@ -133,10 +131,11 @@ interface PlaceDocs { required = true, `in` = ParameterIn.PATH, ) @NotNull roomUid: UUID, - @RequestBody( - description = "방 장소 삭제 Request body", + @Parameter( + name = "placeId", + description = "삭제하고자 하는 장소의 id", required = true, - content = [Content(schema = Schema(implementation = DeletePlaceRequest::class))], - ) @Valid @NotNull deletePlaceRequest: DeletePlaceRequest, + `in` = ParameterIn.PATH, + ) @NotNull placeId: Long, ): ResponseForm }