261020_02_BUG: KKO 템플릿 리스트 조회에 ACT 결과가 없으면 RDY 조회 없이 오류 수정
This commit is contained in:
@@ -72,6 +72,14 @@ public class KkoTemplateApiClient {
|
||||
if (root == null || !root.isObject() || !root.path("code").isTextual()) {
|
||||
throw invalidResponse();
|
||||
}
|
||||
if ("/template/list".equals(path) && "508".equals(root.path("code").asText())) {
|
||||
var empty = objectMapper.createObjectNode();
|
||||
empty.put("totalCount", 0);
|
||||
empty.put("totalPage", 0);
|
||||
empty.put("currentPage", 0);
|
||||
empty.putObject("data").putArray("list");
|
||||
return empty;
|
||||
}
|
||||
if (!"200".equals(root.path("code").asText())) {
|
||||
throw providerError();
|
||||
}
|
||||
|
||||
@@ -56,6 +56,9 @@ public class KkoTemplateService {
|
||||
totalPage = Math.max(totalPage, nonNegativeInt(root, "totalPage"));
|
||||
currentPage = Math.max(currentPage, nonNegativeInt(root, "currentPage"));
|
||||
}
|
||||
if (templates.isEmpty()) {
|
||||
throw BusinessException.notFound("KKO_TEMPLATE_NOT_FOUND", "조회된 알림톡 템플릿이 없습니다.");
|
||||
}
|
||||
return new KkoTemplateListResponseDto(totalCount, totalPage, currentPage,
|
||||
new ArrayList<>(templates.values()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user