261008_01_ENH: 알림톡 템플릿 관련내용 구현 및 발송 구현
This commit is contained in:
@@ -23,6 +23,12 @@ Source: .agent/consumer-references/platform-capabilities.md
|
|||||||
- Redis and scheduling are opt-in through their `kri.*.enabled` settings and matching runtime dependencies.
|
- Redis and scheduling are opt-in through their `kri.*.enabled` settings and matching runtime dependencies.
|
||||||
- HTTP bypass targets are server-configured. Never accept an arbitrary full target URL from a frontend; retain allowed-path checks and do not forward hop-by-hop headers.
|
- HTTP bypass targets are server-configured. Never accept an arbitrary full target URL from a frontend; retain allowed-path checks and do not forward hop-by-hop headers.
|
||||||
- The external API client returns response bodies as documented, while bypass responses preserve raw bytes and target `Content-Type`.
|
- The external API client returns response bodies as documented, while bypass responses preserve raw bytes and target `Content-Type`.
|
||||||
|
- Bypass filters all HTTP/2 pseudo headers (names starting with `:`) in addition to existing hop-by-hop headers; use the response status accessor instead of forwarding `:status`.
|
||||||
|
- `kri.http.bypass.targets.<target>.throw-on-error` defaults to `false`. When enabled, the final response after response customizers throws public `com.kri.common.feature.http.ExternalApiResponseException` for non-2xx status; existing targets retain response-return behavior by default.
|
||||||
|
- `BypassResponse.requireSuccess()` and `ExternalApiResponse.requireSuccess()` explicitly enforce the same non-2xx guard. `ExternalApiClient` keeps its existing default behavior and decoded `getBody()` API, and `getBodyBytes()` exposes a defensive copy of the original received bytes, including compressed and binary error bodies.
|
||||||
|
- A response customizer's `ExternalApiResponseException`, including one thrown by `requireSuccess()`, propagates unchanged; other customizer failures keep the existing `BYPASS_RESPONSE_CUSTOMIZE_FAILED` behavior. Response charset parsing ignores charset-like text inside other quoted `Content-Type` parameters and retains the UTF-8 fallback.
|
||||||
|
- With Spring MVC and Servlet API present and `kri.web.enabled=true` (default), `ExternalApiErrorAutoConfiguration` registers a handler for this dedicated exception before the general error advice. It relays the original status, body bytes, `Content-Type`, and `Content-Encoding`, including empty bodies; authentication, cookie, and transport headers are not relayed by the error handler. Enable this policy only for targets whose raw errors may be exposed to clients. Connection failures remain distinct from upstream HTTP errors.
|
||||||
|
- A consumer-provided error handler bean named `externalApiResponseAdvice` replaces the default without importing runtime types; explicitly caught/controller-handled exceptions also remain under the consumer's control.
|
||||||
- `ExternalApiClient` multipart requests generate their own boundary and ignore a caller-supplied `Content-Type`. Multipart headers and `formField` values use UTF-8, while file bodies preserve the supplied bytes.
|
- `ExternalApiClient` multipart requests generate their own boundary and ignore a caller-supplied `Content-Type`. Multipart headers and `formField` values use UTF-8, while file bodies preserve the supplied bytes.
|
||||||
- Multipart filenames, including non-ASCII names, are sent unchanged in the quoted `filename` parameter as raw UTF-8. No ASCII fallback or `filename*` parameter is added; CR/LF rejection and quote/backslash escaping still apply.
|
- Multipart filenames, including non-ASCII names, are sent unchanged in the quoted `filename` parameter as raw UTF-8. No ASCII fallback or `filename*` parameter is added; CR/LF rejection and quote/backslash escaping still apply.
|
||||||
- `JsonUtil` requires the consumer's explicit `ObjectMapper`; shared date/time helpers define KST as `Asia/Seoul` and also expose UTC semantics.
|
- `JsonUtil` requires the consumer's explicit `ObjectMapper`; shared date/time helpers define KST as `Asia/Seoul` and also expose UTC semantics.
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
### Shared Library and Integrations
|
### Shared Library and Integrations
|
||||||
|
|
||||||
- Consume `com.kri.common:starter:beta.1.6.3`. Do not change this approved version or duplicate an available KriCommon feature without separate explicit approval.
|
- Consume `com.kri.common:starter:beta.1.6.8`. Do not change this approved version or duplicate an available KriCommon feature without separate explicit approval.
|
||||||
- Import public KriCommon APIs from `com.kri.common.feature.*` and keep application code out of KriCommon runtime internals.
|
- Import public KriCommon APIs from `com.kri.common.feature.*` and keep application code out of KriCommon runtime internals.
|
||||||
- Treat IntranetExtension, NotiHub, ShortUrl, CTI, file storage, and other external dependencies as explicit boundaries with validated inputs, timeouts, error mapping, retry/idempotency decisions, and safe rollback behavior.
|
- Treat IntranetExtension, NotiHub, ShortUrl, CTI, file storage, and other external dependencies as explicit boundaries with validated inputs, timeouts, error mapping, retry/idempotency decisions, and safe rollback behavior.
|
||||||
- Never log API keys, credentials, full message bodies, telephone numbers in bulk, uploaded list contents, or unrestricted personal information.
|
- Never log API keys, credentials, full message bodies, telephone numbers in bulk, uploaded list contents, or unrestricted personal information.
|
||||||
|
|||||||
@@ -242,6 +242,8 @@ When implementation is complete, report in Korean:
|
|||||||
- Consume KriCommon as `com.kri.common:starter:<approved-version>` through the repository's established Gradle version-management convention.
|
- Consume KriCommon as `com.kri.common:starter:<approved-version>` through the repository's established Gradle version-management convention.
|
||||||
- Import service-facing APIs from `com.kri.common.feature.*`; treat `com.kri.common.runtime.*` as internal.
|
- Import service-facing APIs from `com.kri.common.feature.*`; treat `com.kri.common.runtime.*` as internal.
|
||||||
- Prefer a shared feature or approved extension point over duplicating authentication, HTTP, error, enum, Excel, Redis, JSON, date/time, JPA, crypto, or utility behavior locally.
|
- Prefer a shared feature or approved extension point over duplicating authentication, HTTP, error, enum, Excel, Redis, JSON, date/time, JPA, crypto, or utility behavior locally.
|
||||||
|
- For HTTP/2 header safety and original upstream error propagation, use the shared HTTP/bypass features documented in the routed platform-capabilities reference instead of implementing consumer-local header filters and raw-response exception handlers.
|
||||||
|
- Response customizers may call `requireSuccess()`; its upstream exception propagates unchanged. Response charset parsing ignores charset-like text inside other quoted header parameters.
|
||||||
- Do not modify KriCommon or another consumer repository unless it is explicitly included in the approved task scope.
|
- Do not modify KriCommon or another consumer repository unless it is explicitly included in the approved task scope.
|
||||||
|
|
||||||
### Required Shared References
|
### Required Shared References
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation "com.kri.common:starter:beta.1.6.7"
|
implementation "com.kri.common:starter:beta.1.6.8"
|
||||||
|
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-security'
|
implementation 'org.springframework.boot:spring-boot-starter-security'
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ public enum ChannelType implements CodeEnum<Short> {
|
|||||||
@Schema(description = "이메일")
|
@Schema(description = "이메일")
|
||||||
EMAIL((short) 1),
|
EMAIL((short) 1),
|
||||||
@Schema(description = "문자")
|
@Schema(description = "문자")
|
||||||
SMS((short) 2);
|
SMS((short) 2),
|
||||||
|
@Schema(description = "알림톡")
|
||||||
|
KKO_AT((short) 3);
|
||||||
|
|
||||||
private final Short code;
|
private final Short code;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.kri.contact.server.common.external.notihub;
|
package com.kri.contact.server.common.external.notihub;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.kri.common.feature.http.bypass.BypassClient;
|
import com.kri.common.feature.http.bypass.BypassClient;
|
||||||
import com.kri.common.feature.http.bypass.BypassForwardOptions;
|
import com.kri.common.feature.http.bypass.BypassForwardOptions;
|
||||||
@@ -14,6 +13,10 @@ import com.kri.common.feature.web.RequestUserContext;
|
|||||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendCreateRequestDto;
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendCreateRequestDto;
|
||||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendInfoDto;
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendInfoDto;
|
||||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendResponseDto;
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendResponseDto;
|
||||||
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailDto;
|
||||||
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailRequestDto;
|
||||||
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateListRequestDto;
|
||||||
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateListResponseDto;
|
||||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubReportExcelResponseDto;
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubReportExcelResponseDto;
|
||||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubReportPageRequestDto;
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubReportPageRequestDto;
|
||||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubReportPageResponseDto;
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubReportPageResponseDto;
|
||||||
@@ -74,7 +77,7 @@ public class NotiHubApiClient {
|
|||||||
public NotiHubTemplateDto getTemplate(Long tmplatIdx) {
|
public NotiHubTemplateDto getTemplate(Long tmplatIdx) {
|
||||||
String url = notiHubBaseUrl + "/template/" + tmplatIdx;
|
String url = notiHubBaseUrl + "/template/" + tmplatIdx;
|
||||||
try {
|
try {
|
||||||
ExternalApiResponse response = externalApiClient.get(url, headers());
|
ExternalApiResponse response = externalApiClient.get(url, headers()).requireSuccess();
|
||||||
return objectMapper.readValue(response.getBody(), NotiHubTemplateDto.class);
|
return objectMapper.readValue(response.getBody(), NotiHubTemplateDto.class);
|
||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
throw BusinessException.badRequest("NOTI_HUB_RESPONSE_PARSE_FAILED", "noti-hub 응답을 해석할 수 없습니다.")
|
throw BusinessException.badRequest("NOTI_HUB_RESPONSE_PARSE_FAILED", "noti-hub 응답을 해석할 수 없습니다.")
|
||||||
@@ -96,6 +99,37 @@ public class NotiHubApiClient {
|
|||||||
return postSingle("/send-sms/single", request, ctx);
|
return postSingle("/send-sms/single", request, ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NotiHubSendSingleResponseDto sendKkoSingle(
|
||||||
|
NotiHubSendRequestSingleDto request,
|
||||||
|
RequestUserContext ctx
|
||||||
|
) {
|
||||||
|
return postSingle("/send-kko/single", request, ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String createKkoBulk(NotiHubBulkSendCreateRequestDto request) {
|
||||||
|
return createBulk("/send-kko/create/bulk", request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NotiHubBulkSendResponseDto sendKkoBulk(NotiHubSendRequestBulkDto request) {
|
||||||
|
return sendBulk("/send-kko/bulk", request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResponseEntity<NotiHubKkoTemplateListResponseDto> getKkoTemplateList(
|
||||||
|
NotiHubKkoTemplateListRequestDto body,
|
||||||
|
HttpServletRequest request,
|
||||||
|
RequestUserContext ctx
|
||||||
|
) {
|
||||||
|
return relay(request, body, NotiHubKkoTemplateListResponseDto.class, ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResponseEntity<NotiHubKkoTemplateDetailDto> getKkoTemplateDetail(
|
||||||
|
NotiHubKkoTemplateDetailRequestDto body,
|
||||||
|
HttpServletRequest request,
|
||||||
|
RequestUserContext ctx
|
||||||
|
) {
|
||||||
|
return relay(request, body, NotiHubKkoTemplateDetailDto.class, ctx);
|
||||||
|
}
|
||||||
|
|
||||||
public String createEmailBulk(NotiHubBulkSendCreateRequestDto request) {
|
public String createEmailBulk(NotiHubBulkSendCreateRequestDto request) {
|
||||||
return createBulk("/send-email/create/bulk", request);
|
return createBulk("/send-email/create/bulk", request);
|
||||||
}
|
}
|
||||||
@@ -240,8 +274,13 @@ public class NotiHubApiClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String createBulk(String path, NotiHubBulkSendCreateRequestDto request) {
|
private String createBulk(String path, NotiHubBulkSendCreateRequestDto request) {
|
||||||
ExternalApiResponse response = put(notiHubBaseUrl + path, request);
|
ExternalApiResponse response = put(notiHubBaseUrl + path, request).requireSuccess();
|
||||||
return response.getBody();
|
String bulkSendKey = response.getBody();
|
||||||
|
if (bulkSendKey == null || bulkSendKey.isBlank() || bulkSendKey.length() != 32) {
|
||||||
|
throw BusinessException.of(HttpStatus.BAD_GATEWAY, "NOTI_HUB_BULK_KEY_INVALID",
|
||||||
|
"noti-hub 대량 발송 키가 올바르지 않습니다.");
|
||||||
|
}
|
||||||
|
return bulkSendKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
private NotiHubBulkSendResponseDto sendBulk(String path, NotiHubSendRequestBulkDto request) {
|
private NotiHubBulkSendResponseDto sendBulk(String path, NotiHubSendRequestBulkDto request) {
|
||||||
@@ -257,7 +296,7 @@ public class NotiHubApiClient {
|
|||||||
|
|
||||||
private ExternalApiResponse post(String url, Object request) {
|
private ExternalApiResponse post(String url, Object request) {
|
||||||
try {
|
try {
|
||||||
return externalApiClient.post(url, headers(), objectMapper.writeValueAsString(request));
|
return externalApiClient.post(url, headers(), objectMapper.writeValueAsString(request)).requireSuccess();
|
||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
throw BusinessException.badRequest("NOTI_HUB_REQUEST_SERIALIZE_FAILED", "noti-hub 요청을 생성할 수 없습니다.")
|
throw BusinessException.badRequest("NOTI_HUB_REQUEST_SERIALIZE_FAILED", "noti-hub 요청을 생성할 수 없습니다.")
|
||||||
.with("url", url);
|
.with("url", url);
|
||||||
@@ -270,6 +309,9 @@ public class NotiHubApiClient {
|
|||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
throw BusinessException.badRequest("NOTI_HUB_REQUEST_SERIALIZE_FAILED", "noti-hub 요청을 생성할 수 없습니다.")
|
throw BusinessException.badRequest("NOTI_HUB_REQUEST_SERIALIZE_FAILED", "noti-hub 요청을 생성할 수 없습니다.")
|
||||||
.with("url", url);
|
.with("url", url);
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
throw BusinessException.of(HttpStatus.BAD_GATEWAY, "NOTI_HUB_CALL_FAILED",
|
||||||
|
"noti-hub에 연결할 수 없습니다.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,7 +396,7 @@ public class NotiHubApiClient {
|
|||||||
HttpHeaders headers = new HttpHeaders();
|
HttpHeaders headers = new HttpHeaders();
|
||||||
headers.putAll(response.getHeaders());
|
headers.putAll(response.getHeaders());
|
||||||
// JSON serialization changes the bytes; upstream representation headers no longer apply.
|
// JSON serialization changes the bytes; upstream representation headers no longer apply.
|
||||||
headers.remove(HttpHeaders.CONTENT_LENGTH);
|
headers.remove(HttpHeaders.CONTENT_LENGTH);
|
||||||
headers.remove(HttpHeaders.CONTENT_ENCODING);
|
headers.remove(HttpHeaders.CONTENT_ENCODING);
|
||||||
headers.remove(HttpHeaders.ETAG);
|
headers.remove(HttpHeaders.ETAG);
|
||||||
if (headers.getContentType() == null) {
|
if (headers.getContentType() == null) {
|
||||||
@@ -374,32 +416,6 @@ public class NotiHubApiClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void requireSuccessfulResponse(ResponseEntity<byte[]> response) {
|
|
||||||
if (response.getStatusCode().is2xxSuccessful()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
HttpStatus status = HttpStatus.resolve(response.getStatusCode().value());
|
|
||||||
if (status == null) {
|
|
||||||
status = HttpStatus.BAD_GATEWAY;
|
|
||||||
}
|
|
||||||
String code = "NOTI_HUB_ERROR";
|
|
||||||
String message = status.getReasonPhrase();
|
|
||||||
byte[] body = response.getBody();
|
|
||||||
if (body != null && body.length > 0) {
|
|
||||||
try {
|
|
||||||
JsonNode error = objectMapper.readTree(body);
|
|
||||||
if (error != null) {
|
|
||||||
code = error.path("code").asText(code);
|
|
||||||
message = error.path("detail").asText(message);
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
|
||||||
// An invalid error body retains the HTTP status and its standard message.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw BusinessException.of(status, code, message);
|
|
||||||
}
|
|
||||||
|
|
||||||
private ResponseEntity<byte[]> forward(
|
private ResponseEntity<byte[]> forward(
|
||||||
HttpServletRequest request,
|
HttpServletRequest request,
|
||||||
byte[] body,
|
byte[] body,
|
||||||
@@ -425,9 +441,7 @@ public class NotiHubApiClient {
|
|||||||
}
|
}
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
ResponseEntity<byte[]> result = toResponseEntity(response, request);
|
return toResponseEntity(response, request);
|
||||||
requireSuccessfulResponse(result);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ResponseEntity<byte[]> relayMultipart(
|
private ResponseEntity<byte[]> relayMultipart(
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.kri.contact.server.common.external.notihub.dto;
|
package com.kri.contact.server.common.external.notihub.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -24,6 +25,7 @@ public class NotiHubBulkSendCreateRequestDto {
|
|||||||
@Schema(description = "resve")
|
@Schema(description = "resve")
|
||||||
private Boolean resve;
|
private Boolean resve;
|
||||||
@Schema(description = "sendDt")
|
@Schema(description = "sendDt")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime sendDt;
|
private LocalDateTime sendDt;
|
||||||
@Schema(description = "trgtCnt")
|
@Schema(description = "trgtCnt")
|
||||||
private Integer trgtCnt;
|
private Integer trgtCnt;
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.kri.contact.server.common.external.notihub.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
|
import java.util.List;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public class NotiHubKkoTemplateDetailDto {
|
||||||
|
|
||||||
|
private String templateCode;
|
||||||
|
private String templateName;
|
||||||
|
private String templateContent;
|
||||||
|
private String templatePreviewMessage;
|
||||||
|
private String templateMessageType;
|
||||||
|
private String templateEmphasizeType;
|
||||||
|
private String inspectionStatus;
|
||||||
|
private String status;
|
||||||
|
private Boolean block;
|
||||||
|
private Boolean dormant;
|
||||||
|
private String templateExtra;
|
||||||
|
private String templateImageName;
|
||||||
|
private String templateImageUrl;
|
||||||
|
private String templateTitle;
|
||||||
|
private String templateSubtitle;
|
||||||
|
private String templateHeader;
|
||||||
|
private JsonNode templateItemHighlight;
|
||||||
|
private JsonNode templateItem;
|
||||||
|
private JsonNode templateRepresentLink;
|
||||||
|
private List<JsonNode> buttons;
|
||||||
|
private List<JsonNode> quickReplies;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.kri.contact.server.common.external.notihub.dto;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Pattern;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class NotiHubKkoTemplateDetailRequestDto {
|
||||||
|
|
||||||
|
@NotBlank
|
||||||
|
@Size(max = 30)
|
||||||
|
@Pattern(regexp = "[A-Za-z0-9_-]+")
|
||||||
|
private String templateCode;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.kri.contact.server.common.external.notihub.dto;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class NotiHubKkoTemplateListRequestDto {
|
||||||
|
|
||||||
|
@Size(min = 2, max = 50)
|
||||||
|
private String keyword;
|
||||||
|
|
||||||
|
public NotiHubKkoTemplateListRequestDto(String keyword) {
|
||||||
|
setKeyword(keyword);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKeyword(String keyword) {
|
||||||
|
this.keyword = keyword == null || keyword.isBlank() ? null : keyword.trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.kri.contact.server.common.external.notihub.dto;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class NotiHubKkoTemplateListResponseDto {
|
||||||
|
|
||||||
|
private int totalCount;
|
||||||
|
private int totalPage;
|
||||||
|
private int currentPage;
|
||||||
|
private List<NotiHubKkoTemplateSummaryDto> list;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.kri.contact.server.common.external.notihub.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public class NotiHubKkoTemplateSummaryDto {
|
||||||
|
|
||||||
|
private String templateCode;
|
||||||
|
private String templateName;
|
||||||
|
private String serviceStatus;
|
||||||
|
private String createdAt;
|
||||||
|
private String modifiedAt;
|
||||||
|
}
|
||||||
@@ -33,7 +33,6 @@ public class NotiHubTemplateBasicDto extends NotiHubExtensibleDto {
|
|||||||
@Size(max = 128)
|
@Size(max = 128)
|
||||||
private String tmplatTitle;
|
private String tmplatTitle;
|
||||||
|
|
||||||
@NotBlank
|
|
||||||
private String tmplatBody;
|
private String tmplatBody;
|
||||||
|
|
||||||
private String senderKey;
|
private String senderKey;
|
||||||
|
|||||||
@@ -44,6 +44,26 @@ public class MessageSendController {
|
|||||||
return messageSendService.sendEmailBulk(prjctIdx, request, ctx);
|
return messageSendService.sendEmailBulk(prjctIdx, request, ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "Kakao Alimtalk single send")
|
||||||
|
@PostMapping("/kko/single/{prjctIdx}")
|
||||||
|
public MessageSendSingleResponseDto sendKkoSingle(
|
||||||
|
@PathVariable Long prjctIdx,
|
||||||
|
@Valid @RequestBody MessageSendSingleRequestDto request,
|
||||||
|
RequestUserContext ctx
|
||||||
|
) {
|
||||||
|
return messageSendService.sendKkoSingle(prjctIdx, request, ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "Kakao Alimtalk bulk send")
|
||||||
|
@PostMapping("/kko/bulk/{prjctIdx}")
|
||||||
|
public MessageSendBulkResponseDto sendKkoBulk(
|
||||||
|
@PathVariable Long prjctIdx,
|
||||||
|
@Valid @RequestBody MessageSendBulkRequestDto request,
|
||||||
|
RequestUserContext ctx
|
||||||
|
) {
|
||||||
|
return messageSendService.sendKkoBulk(prjctIdx, request, ctx);
|
||||||
|
}
|
||||||
|
|
||||||
@Operation(summary = "SMS single send")
|
@Operation(summary = "SMS single send")
|
||||||
@PostMapping("/sms/single/{prjctIdx}")
|
@PostMapping("/sms/single/{prjctIdx}")
|
||||||
public MessageSendSingleResponseDto sendSmsSingle(
|
public MessageSendSingleResponseDto sendSmsSingle(
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
package com.kri.contact.server.controller;
|
package com.kri.contact.server.controller;
|
||||||
|
|
||||||
import com.kri.common.feature.web.RequestUserContext;
|
import com.kri.common.feature.web.RequestUserContext;
|
||||||
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailDto;
|
||||||
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailRequestDto;
|
||||||
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateListRequestDto;
|
||||||
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateListResponseDto;
|
||||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateBasicDto;
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateBasicDto;
|
||||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateDetailDto;
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateDetailDto;
|
||||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateSummaryDto;
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateSummaryDto;
|
||||||
@@ -15,7 +19,9 @@ import org.springframework.http.ResponseEntity;
|
|||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PatchMapping;
|
import org.springframework.web.bind.annotation.PatchMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
@@ -30,6 +36,24 @@ public class MessageTemplateController {
|
|||||||
|
|
||||||
private final MessageTemplateService messageTemplateService;
|
private final MessageTemplateService messageTemplateService;
|
||||||
|
|
||||||
|
@PostMapping(value = "/kko/list", consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public ResponseEntity<NotiHubKkoTemplateListResponseDto> getKkoTemplateList(
|
||||||
|
@Valid @RequestBody NotiHubKkoTemplateListRequestDto body,
|
||||||
|
HttpServletRequest request,
|
||||||
|
RequestUserContext ctx
|
||||||
|
) {
|
||||||
|
return messageTemplateService.getKkoTemplateList(body, request, ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/kko/detail", consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public ResponseEntity<NotiHubKkoTemplateDetailDto> getKkoTemplateDetail(
|
||||||
|
@Valid @RequestBody NotiHubKkoTemplateDetailRequestDto body,
|
||||||
|
HttpServletRequest request,
|
||||||
|
RequestUserContext ctx
|
||||||
|
) {
|
||||||
|
return messageTemplateService.getKkoTemplateDetail(body, request, ctx);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/list/{chnnlTy}/{itrntPrjctCd}")
|
@GetMapping("/list/{chnnlTy}/{itrntPrjctCd}")
|
||||||
public ResponseEntity<List<NotiHubTemplateSummaryDto>> getTemplateList(
|
public ResponseEntity<List<NotiHubTemplateSummaryDto>> getTemplateList(
|
||||||
@PathVariable Integer chnnlTy,
|
@PathVariable Integer chnnlTy,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.kri.contact.server.dto.message;
|
package com.kri.contact.server.dto.message;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.kri.contact.server.dto.list.ListFilterDto;
|
import com.kri.contact.server.dto.list.ListFilterDto;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
@@ -26,6 +27,7 @@ public class MessageSendBulkRequestDto {
|
|||||||
private Boolean resve;
|
private Boolean resve;
|
||||||
|
|
||||||
@Schema(description = "예약 발송 일시")
|
@Schema(description = "예약 발송 일시")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime sendDt;
|
private LocalDateTime sendDt;
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.kri.contact.server.dto.message;
|
package com.kri.contact.server.dto.message;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
@@ -23,6 +24,7 @@ public class MessageSendSingleRequestDto {
|
|||||||
@Schema(description = "resve")
|
@Schema(description = "resve")
|
||||||
private Boolean resve;
|
private Boolean resve;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@Schema(description = "sendDt")
|
@Schema(description = "sendDt")
|
||||||
private LocalDateTime sendDt;
|
private LocalDateTime sendDt;
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import com.kri.contact.server.dto.message.MessageSendBulkRequestDto;
|
|||||||
import com.kri.contact.server.dto.message.MessageSendSingleRequestDto;
|
import com.kri.contact.server.dto.message.MessageSendSingleRequestDto;
|
||||||
import com.kri.contact.server.dto.message.MessageSendSingleResponseDto;
|
import com.kri.contact.server.dto.message.MessageSendSingleResponseDto;
|
||||||
import com.kri.contact.server.dto.project.ProjectInfoDto;
|
import com.kri.contact.server.dto.project.ProjectInfoDto;
|
||||||
|
import com.kri.contact.server.dto.project.ProjectSurveyDto;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -81,6 +82,24 @@ public class MessageSendService {
|
|||||||
return sendBulk(prjctIdx, request, ctx, ChannelType.SMS);
|
return sendBulk(prjctIdx, request, ctx, ChannelType.SMS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(readOnly = true)
|
||||||
|
public MessageSendSingleResponseDto sendKkoSingle(
|
||||||
|
Long prjctIdx,
|
||||||
|
MessageSendSingleRequestDto request,
|
||||||
|
RequestUserContext ctx
|
||||||
|
) {
|
||||||
|
return sendSingle(prjctIdx, request, ctx, ChannelType.KKO_AT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(readOnly = true)
|
||||||
|
public MessageSendBulkResponseDto sendKkoBulk(
|
||||||
|
Long prjctIdx,
|
||||||
|
MessageSendBulkRequestDto request,
|
||||||
|
RequestUserContext ctx
|
||||||
|
) {
|
||||||
|
return sendBulk(prjctIdx, request, ctx, ChannelType.KKO_AT);
|
||||||
|
}
|
||||||
|
|
||||||
private MessageSendSingleResponseDto sendSingle(
|
private MessageSendSingleResponseDto sendSingle(
|
||||||
Long prjctIdx,
|
Long prjctIdx,
|
||||||
MessageSendSingleRequestDto request,
|
MessageSendSingleRequestDto request,
|
||||||
@@ -124,6 +143,8 @@ public class MessageSendService {
|
|||||||
|
|
||||||
if (channelType == ChannelType.EMAIL) {
|
if (channelType == ChannelType.EMAIL) {
|
||||||
response = notiHubApiClient.sendEmailSingle(notiRequest, ctx);
|
response = notiHubApiClient.sendEmailSingle(notiRequest, ctx);
|
||||||
|
} else if (channelType == ChannelType.KKO_AT) {
|
||||||
|
response = notiHubApiClient.sendKkoSingle(notiRequest, ctx);
|
||||||
} else {
|
} else {
|
||||||
response = notiHubApiClient.sendSmsSingle(notiRequest, ctx);
|
response = notiHubApiClient.sendSmsSingle(notiRequest, ctx);
|
||||||
}
|
}
|
||||||
@@ -237,7 +258,7 @@ public class MessageSendService {
|
|||||||
) {
|
) {
|
||||||
List<NotiHubDestInfoDto> result = new ArrayList<>();
|
List<NotiHubDestInfoDto> result = new ArrayList<>();
|
||||||
for (ListSearchService.DownloadListRow row : rows) {
|
for (ListSearchService.DownloadListRow row : rows) {
|
||||||
Map<String, String> msgParam = createMessageParams(row, messageContext.paramHeaderByName());
|
Map<String, String> msgParam = createMessageParams(row, messageContext);
|
||||||
String destNm = resolveHeaderValue(row, messageContext.headerById().get(destNameHeaderId));
|
String destNm = resolveHeaderValue(row, messageContext.headerById().get(destNameHeaderId));
|
||||||
|
|
||||||
for (Integer destHeaderId : destHeaderIds) {
|
for (Integer destHeaderId : destHeaderIds) {
|
||||||
@@ -274,7 +295,7 @@ public class MessageSendService {
|
|||||||
Set<String> bodyParams = extractTemplateParams(template.getTmplatBody());
|
Set<String> bodyParams = extractTemplateParams(template.getTmplatBody());
|
||||||
Set<String> templateParams = SetUtils.union(titleParams, bodyParams);
|
Set<String> templateParams = SetUtils.union(titleParams, bodyParams);
|
||||||
|
|
||||||
Map<Integer, ListHeaderDto> headerById = listHeaderService.getHeader(prjctIdx).stream()
|
Map<Integer, ListHeaderDto> headerById = listHeaderService.getHeader(prjctIdx).stream()
|
||||||
.collect(Collectors.toMap(
|
.collect(Collectors.toMap(
|
||||||
ListHeaderDto::getListHderId,
|
ListHeaderDto::getListHderId,
|
||||||
header -> header,
|
header -> header,
|
||||||
@@ -299,7 +320,29 @@ public class MessageSendService {
|
|||||||
LinkedHashMap::new
|
LinkedHashMap::new
|
||||||
));
|
));
|
||||||
|
|
||||||
return new MessageContext(project, template, headerById, paramHeaderByName);
|
Map<String, String> surveyUrlByName = new LinkedHashMap<>();
|
||||||
|
if (project.getSurveys() != null) {
|
||||||
|
for (ProjectSurveyDto survey : project.getSurveys()) {
|
||||||
|
String name = survey.getSurveyName();
|
||||||
|
String url = normalizeBlank(survey.getSurveyUrl());
|
||||||
|
if (!templateParams.contains(name) || paramHeaderByName.containsKey(name) || url == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (surveyUrlByName.putIfAbsent(name, url) != null) {
|
||||||
|
throw BusinessException.badRequest("DUPLICATE_SURVEY_NAME", "치환할 설문명이 중복됩니다.")
|
||||||
|
.with("surveyName", name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Set<String> requiredHeaderParams = new HashSet<>(templateParams);
|
||||||
|
surveyUrlByName.values().forEach(url -> requiredHeaderParams.addAll(extractTemplateParams(url)));
|
||||||
|
headerById.values().stream()
|
||||||
|
.filter(header -> requiredHeaderParams.contains(header.getListHderNm()))
|
||||||
|
.forEach(header -> paramHeaderByName.putIfAbsent(header.getListHderNm(), header));
|
||||||
|
|
||||||
|
return new MessageContext(project, template, headerById, paramHeaderByName,
|
||||||
|
templateParams, surveyUrlByName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String createBulkSendKey(
|
private String createBulkSendKey(
|
||||||
@@ -320,9 +363,11 @@ public class MessageSendService {
|
|||||||
.trgtCnt(targetCount)
|
.trgtCnt(targetCount)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
return channelType == ChannelType.EMAIL
|
return switch (channelType) {
|
||||||
? notiHubApiClient.createEmailBulk(notiRequest)
|
case EMAIL -> notiHubApiClient.createEmailBulk(notiRequest);
|
||||||
: notiHubApiClient.createSmsBulk(notiRequest);
|
case SMS -> notiHubApiClient.createSmsBulk(notiRequest);
|
||||||
|
case KKO_AT -> notiHubApiClient.createKkoBulk(notiRequest);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private NotiHubBulkSendResponseDto sendBulkChunk(
|
private NotiHubBulkSendResponseDto sendBulkChunk(
|
||||||
@@ -335,25 +380,44 @@ public class MessageSendService {
|
|||||||
.destInfoList(destInfos)
|
.destInfoList(destInfos)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
return channelType == ChannelType.EMAIL
|
return switch (channelType) {
|
||||||
? notiHubApiClient.sendEmailBulk(request)
|
case EMAIL -> notiHubApiClient.sendEmailBulk(request);
|
||||||
: notiHubApiClient.sendSmsBulk(request);
|
case SMS -> notiHubApiClient.sendSmsBulk(request);
|
||||||
|
case KKO_AT -> notiHubApiClient.sendKkoBulk(request);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, String> createMessageParams(
|
private Map<String, String> createMessageParams(
|
||||||
ListSearchService.DownloadListRow row,
|
ListSearchService.DownloadListRow row,
|
||||||
Map<String, ListHeaderDto> paramHeaderByName
|
MessageContext messageContext
|
||||||
) {
|
) {
|
||||||
|
Map<String, String> headerParams = new LinkedHashMap<>();
|
||||||
Map<String, String> msgParam = new LinkedHashMap<>();
|
Map<String, String> msgParam = new LinkedHashMap<>();
|
||||||
for (Map.Entry<String, ListHeaderDto> entry : paramHeaderByName.entrySet()) {
|
for (Map.Entry<String, ListHeaderDto> entry : messageContext.paramHeaderByName().entrySet()) {
|
||||||
String value = resolveHeaderValue(row, entry.getValue());
|
String value = resolveHeaderValue(row, entry.getValue());
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
msgParam.put(entry.getKey(), value);
|
headerParams.put(entry.getKey(), value);
|
||||||
|
if (messageContext.templateParams().contains(entry.getKey())) {
|
||||||
|
msgParam.put(entry.getKey(), value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
messageContext.surveyUrlByName().forEach((name, url) ->
|
||||||
|
msgParam.put(name, resolveSurveyUrlParams(url, headerParams)));
|
||||||
return msgParam;
|
return msgParam;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String resolveSurveyUrlParams(String url, Map<String, String> headerParams) {
|
||||||
|
Matcher matcher = TEMPLATE_PARAM_PATTERN.matcher(url);
|
||||||
|
StringBuilder resolved = new StringBuilder();
|
||||||
|
while (matcher.find()) {
|
||||||
|
String value = headerParams.get(normalizeBlank(matcher.group(1)));
|
||||||
|
matcher.appendReplacement(resolved, Matcher.quoteReplacement(value == null ? matcher.group() : value));
|
||||||
|
}
|
||||||
|
matcher.appendTail(resolved);
|
||||||
|
return resolved.toString();
|
||||||
|
}
|
||||||
|
|
||||||
private String resolveHeaderValue(ListSearchService.DownloadListRow row, ListHeaderDto header) {
|
private String resolveHeaderValue(ListSearchService.DownloadListRow row, ListHeaderDto header) {
|
||||||
if (header == null) {
|
if (header == null) {
|
||||||
return null;
|
return null;
|
||||||
@@ -419,7 +483,7 @@ public class MessageSendService {
|
|||||||
if (normalized == null) {
|
if (normalized == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (channelType == ChannelType.SMS) {
|
if (channelType == ChannelType.SMS || channelType == ChannelType.KKO_AT) {
|
||||||
String digits = normalized.replaceAll("\\D", "");
|
String digits = normalized.replaceAll("\\D", "");
|
||||||
return digits.isBlank() ? null : digits;
|
return digits.isBlank() ? null : digits;
|
||||||
}
|
}
|
||||||
@@ -461,7 +525,9 @@ public class MessageSendService {
|
|||||||
ProjectInfoDto project,
|
ProjectInfoDto project,
|
||||||
NotiHubTemplateDto template,
|
NotiHubTemplateDto template,
|
||||||
Map<Integer, ListHeaderDto> headerById,
|
Map<Integer, ListHeaderDto> headerById,
|
||||||
Map<String, ListHeaderDto> paramHeaderByName
|
Map<String, ListHeaderDto> paramHeaderByName,
|
||||||
|
Set<String> templateParams,
|
||||||
|
Map<String, String> surveyUrlByName
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
private static class ListFilterDtoFactory {
|
private static class ListFilterDtoFactory {
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ package com.kri.contact.server.service;
|
|||||||
|
|
||||||
import com.kri.common.feature.web.BusinessException;
|
import com.kri.common.feature.web.BusinessException;
|
||||||
import com.kri.common.feature.web.RequestUserContext;
|
import com.kri.common.feature.web.RequestUserContext;
|
||||||
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailDto;
|
||||||
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailRequestDto;
|
||||||
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateListRequestDto;
|
||||||
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateListResponseDto;
|
||||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateBasicDto;
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateBasicDto;
|
||||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateDetailDto;
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateDetailDto;
|
||||||
import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateSummaryDto;
|
import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateSummaryDto;
|
||||||
@@ -19,6 +23,22 @@ public class MessageTemplateService {
|
|||||||
|
|
||||||
private final NotiHubApiClient notiHubApiClient;
|
private final NotiHubApiClient notiHubApiClient;
|
||||||
|
|
||||||
|
public ResponseEntity<NotiHubKkoTemplateListResponseDto> getKkoTemplateList(
|
||||||
|
NotiHubKkoTemplateListRequestDto body,
|
||||||
|
HttpServletRequest request,
|
||||||
|
RequestUserContext ctx
|
||||||
|
) {
|
||||||
|
return notiHubApiClient.getKkoTemplateList(body, request, ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResponseEntity<NotiHubKkoTemplateDetailDto> getKkoTemplateDetail(
|
||||||
|
NotiHubKkoTemplateDetailRequestDto body,
|
||||||
|
HttpServletRequest request,
|
||||||
|
RequestUserContext ctx
|
||||||
|
) {
|
||||||
|
return notiHubApiClient.getKkoTemplateDetail(body, request, ctx);
|
||||||
|
}
|
||||||
|
|
||||||
public ResponseEntity<List<NotiHubTemplateSummaryDto>> getTemplateList(
|
public ResponseEntity<List<NotiHubTemplateSummaryDto>> getTemplateList(
|
||||||
HttpServletRequest request,
|
HttpServletRequest request,
|
||||||
RequestUserContext ctx
|
RequestUserContext ctx
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ kri:
|
|||||||
request-timeout: 30s
|
request-timeout: 30s
|
||||||
targets:
|
targets:
|
||||||
noti-hub:
|
noti-hub:
|
||||||
|
throw-on-error: true
|
||||||
base-url: ${kri.api-url.noti-hub}
|
base-url: ${kri.api-url.noti-hub}
|
||||||
allowed-paths:
|
allowed-paths:
|
||||||
- /message-template
|
- /message-template
|
||||||
|
|||||||
Reference in New Issue
Block a user