Skip to content

Commit

Permalink
Merge pull request #118 from mash-up-kr/fix/field-names
Browse files Browse the repository at this point in the history
fix: Fix Some Errors (field name, api prefix)
  • Loading branch information
KimDoubleB authored Jul 31, 2024
2 parents 68f0242 + cbfc8a3 commit 4868029
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,3 @@ data class ModifyPlaceRequest(
)
}
}

data class DeletePlaceRequest(
@field:NotNull(message = "삭제할 장소 ID는 필수입니다.")
@field:Schema(description = "삭제할 장소 ID", example = "1")
val targetPlaceId: Long,
)
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "모임 비밀번호는 필수입니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import io.swagger.v3.oas.annotations.media.Schema
@Schema(description = "방 스케줄 정보 응답")
data class SchedulesResponse(
@field:Schema(description = "방 스케줄 정보 목록")
val categories: List<ScheduleResponse>,
val schedules: List<ScheduleResponse>,
) {
companion object {
fun from(schedules: List<Schedule>): SchedulesResponse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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<MultipartFile>?,
): ResponseForm<PlaceResponse> {
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<Unit> {
placeUseCase.delete(deletePlaceRequest.targetPlaceId)
placeUseCase.delete(placeId)
return ResponseForm.EMPTY_RESPONSE
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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",
Expand All @@ -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<Unit>
}

0 comments on commit 4868029

Please sign in to comment.