Skip to content

Commit

Permalink
mod: ktlint formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
wonlog-g committed Jul 21, 2024
1 parent ea519af commit 353e1da
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions api/src/main/kotlin/com/mashup/dojo/PickController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class PickController(
}
return DojoApiResponse.success(ReceivedPickListGetResponse(pickResponseList, sort))
}

@PostMapping("/open")
@Operation(
summary = "내가 받은 픽 정보 오픈 API",
Expand All @@ -63,7 +63,7 @@ class PickController(
)
fun openPick(
// todo: add userInfo
@Valid @RequestBody request: PickOpenRequest
@Valid @RequestBody request: PickOpenRequest,
): DojoApiResponse<PickOpenResponse> {
return pickUseCase.openPick(
PickUseCase.OpenPickCommand(pickId = request.pickId, pickedId = MemberId("MOCK_MEMBER_ID"), pickOpenItem = request.pickOpenItem)
Expand Down
4 changes: 2 additions & 2 deletions api/src/main/kotlin/com/mashup/dojo/dto/PickDto.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ data class PickOpenRequest(
@field:NotBlank
val pickId: PickId,
@field:NotNull
val pickOpenItem: PickOpenItem
val pickOpenItem: PickOpenItem,
)

data class PickOpenResponse(
val pickId: PickId,
val pickOpenItem: PickOpenItem,
val value: String
val value: String,
)
11 changes: 5 additions & 6 deletions service/src/main/kotlin/com/mashup/dojo/service/PickService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ interface PickService {
fun openPick(
pickId: PickId,
pickedId: MemberId,
pickOpenItem: PickOpenItem
pickOpenItem: PickOpenItem,
): String
}

@Transactional(readOnly = true)
@Service
class DefaultPickService: PickService {
class DefaultPickService : PickService {
override fun getReceivedPickList(
pickedMemberId: MemberId,
sort: PickSort,
Expand All @@ -39,17 +39,16 @@ class DefaultPickService: PickService {
override fun openPick(
pickId: PickId,
pickedId: MemberId,
pickOpenItem: PickOpenItem
pickOpenItem: PickOpenItem,
): String {
// todo : 로직 구현
// Pick 조회
// - pickId에 해당하는 Pick이 존재하지 않을 때 : 예외 반환
// Pick 유효성 검사
// - 전달된 pickedId와 조회된 Pick.pickedId 값이 같지 않을 때 : 예외 반환
// Pick Open 처리
// - 오픈하지 않은 정보일 때 : 해당 정보 오픈 처리, 해당 정보 반환
// - 이미 오픈한 정보일 때 : 예외 반환

// - 오픈하지 않은 정보일 때 : 해당 정보 오픈 처리, 해당 정보 반환
// - 이미 오픈한 정보일 때 : 예외 반환
return "MOCK_PICK_INFO_VALUE"
}

Expand Down
11 changes: 6 additions & 5 deletions service/src/main/kotlin/com/mashup/dojo/usecase/PickUseCase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,17 @@ interface PickUseCase {
data class OpenPickCommand(
val pickId: PickId,
val pickedId: MemberId,
val pickOpenItem: PickOpenItem
val pickOpenItem: PickOpenItem,
)

data class PickOpenInfo (
data class PickOpenInfo(
val pickId: PickId,
val pickOpenItem: PickOpenItem,
val value: String
val value: String,
)

fun getReceivedPickList(command: GetReceivedPickListCommand): List<GetReceivedPick>

fun openPick(openPickCommand: OpenPickCommand): PickOpenInfo
}

Expand Down Expand Up @@ -93,7 +94,7 @@ class DefaultPickUseCase(

override fun openPick(openPickCommand: OpenPickCommand): PickOpenInfo {
return pickService.openPick(
openPickCommand.pickId,
openPickCommand.pickId,
openPickCommand.pickedId,
openPickCommand.pickOpenItem
).let { PickOpenInfo(openPickCommand.pickId, openPickCommand.pickOpenItem, it) }
Expand Down

0 comments on commit 353e1da

Please sign in to comment.