Skip to content
This repository was archived by the owner on Jul 7, 2025. It is now read-only.

Commit 783c02d

Browse files
committed
ASAP-458 LetterShareStatus API userId nullable 처리
- `LetterLogApi.getLetterShareStatus` 메서드의 파라미터 `userId`를 nullable로 수정. - `LetterLogController`의 관련 로직 변경: nullable `userId` 지원. - API 문서 스키마 공백 및 포맷 관련 경미한 수정.
1 parent 9c43dcf commit 783c02d

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/letter/api/LetterLogApi.kt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.RequestParam
1515
@Tag(name = "Letter", description = "Letter API")
1616
@RequestMapping("/api/v1/letters/logs")
1717
interface LetterLogApi {
18-
1918
@Operation(summary = "편지 공유 상태 조회")
2019
@GetMapping("/share/status")
2120
@ApiResponses(
@@ -41,14 +40,14 @@ interface LetterLogApi {
4140
content = [
4241
Content(
4342
mediaType = "application/json",
44-
schema = Schema(implementation = LetterShareStatusResponse::class)
45-
)
46-
]
47-
)
48-
]
43+
schema = Schema(implementation = LetterShareStatusResponse::class),
44+
),
45+
],
46+
),
47+
],
4948
)
5049
fun getLetterShareStatus(
5150
@RequestParam("letterCode") letterCode: String,
52-
@AccessUser userId: String
51+
@AccessUser userId: String?,
5352
): LetterShareStatusResponse
5453
}

Bootstrap-Module/src/main/kotlin/com/asap/bootstrap/web/letter/controller/LetterLogController.kt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,20 @@ import org.springframework.web.bind.annotation.RestController
1010
@RestController
1111
class LetterLogController(
1212
private val letterLogUsecase: LetterLogUsecase,
13-
private val objectMapper: ObjectMapper
13+
private val objectMapper: ObjectMapper,
1414
) : LetterLogApi {
15-
override fun getLetterShareStatus(letterCode: String, userId: String): LetterShareStatusResponse {
16-
return letterLogUsecase.finLatestLogByLetterCode(letterCode)?.let {
17-
val kakaoWebHookRequest =
18-
objectMapper.readValue(it.logContent, KakaoWebHookRequest::class.java)
15+
override fun getLetterShareStatus(
16+
letterCode: String,
17+
userId: String?,
18+
): LetterShareStatusResponse =
19+
letterLogUsecase.finLatestLogByLetterCode(letterCode)?.let {
20+
val kakaoWebHookRequest = objectMapper.readValue(it.logContent, KakaoWebHookRequest::class.java)
21+
1922
LetterShareStatusResponse.success(
2023
letterId = it.letterId,
21-
shareTarget = kakaoWebHookRequest.chatType
24+
shareTarget = kakaoWebHookRequest.chatType,
2225
)
2326
} ?: run {
2427
LetterShareStatusResponse.fail()
2528
}
26-
}
27-
}
29+
}

0 commit comments

Comments
 (0)