260826_01_ENH: notihub 수정으로 인한 후속 조치
This commit is contained in:
@@ -13,6 +13,7 @@ import com.kri.contact.server.common.external.notihub.NotiHubBulkSendResponseDto
|
||||
import com.kri.contact.server.common.external.notihub.NotiHubDestInfoDto;
|
||||
import com.kri.contact.server.common.external.notihub.NotiHubSendRequestBulkDto;
|
||||
import com.kri.contact.server.common.external.notihub.NotiHubSendRequestSingleDto;
|
||||
import com.kri.contact.server.common.external.notihub.NotiHubSendSingleResponseDto;
|
||||
import com.kri.contact.server.common.external.notihub.NotiHubTemplateDto;
|
||||
import com.kri.contact.server.dto.list.ListHeaderDto;
|
||||
import com.kri.contact.server.dto.list.ListSendResultDto;
|
||||
@@ -20,6 +21,7 @@ import com.kri.contact.server.dto.message.MessageBulkSendResponseDto;
|
||||
import com.kri.contact.server.dto.message.MessageFailedChunkDto;
|
||||
import com.kri.contact.server.dto.message.MessageSendBulkRequestDto;
|
||||
import com.kri.contact.server.dto.message.MessageSendSingleRequestDto;
|
||||
import com.kri.contact.server.dto.message.MessageSendSingleResponseDto;
|
||||
import com.kri.contact.server.dto.project.ProjectInfoDto;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@@ -52,13 +54,21 @@ public class MessageService {
|
||||
private final NotiHubApiClient notiHubApiClient;
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public void sendEmailSingle(Long prjctIdx, MessageSendSingleRequestDto request, RequestUserContext ctx) {
|
||||
sendSingle(prjctIdx, request, ctx, ChannelType.EMAIL);
|
||||
public MessageSendSingleResponseDto sendEmailSingle(
|
||||
Long prjctIdx,
|
||||
MessageSendSingleRequestDto request,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
return sendSingle(prjctIdx, request, ctx, ChannelType.EMAIL);
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public void sendSmsSingle(Long prjctIdx, MessageSendSingleRequestDto request, RequestUserContext ctx) {
|
||||
sendSingle(prjctIdx, request, ctx, ChannelType.SMS);
|
||||
public MessageSendSingleResponseDto sendSmsSingle(
|
||||
Long prjctIdx,
|
||||
MessageSendSingleRequestDto request,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
return sendSingle(prjctIdx, request, ctx, ChannelType.SMS);
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
@@ -71,7 +81,7 @@ public class MessageService {
|
||||
return sendBulk(prjctIdx, request, ctx, ChannelType.SMS);
|
||||
}
|
||||
|
||||
private void sendSingle(
|
||||
private MessageSendSingleResponseDto sendSingle(
|
||||
Long prjctIdx,
|
||||
MessageSendSingleRequestDto request,
|
||||
RequestUserContext ctx,
|
||||
@@ -100,6 +110,7 @@ public class MessageService {
|
||||
throw BusinessException.badRequest("NO_DESTINATION", "발송 대상 이메일 또는 전화번호가 없습니다.");
|
||||
}
|
||||
|
||||
NotiHubSendSingleResponseDto response = null;
|
||||
for (NotiHubDestInfoDto destInfo : destInfos) {
|
||||
NotiHubSendRequestSingleDto notiRequest = NotiHubSendRequestSingleDto.builder()
|
||||
.destInfo(destInfo)
|
||||
@@ -111,11 +122,12 @@ public class MessageService {
|
||||
.build();
|
||||
|
||||
if (channelType == ChannelType.EMAIL) {
|
||||
notiHubApiClient.sendEmailSingle(notiRequest, ctx);
|
||||
response = notiHubApiClient.sendEmailSingle(notiRequest, ctx);
|
||||
} else {
|
||||
notiHubApiClient.sendSmsSingle(notiRequest, ctx);
|
||||
response = notiHubApiClient.sendSmsSingle(notiRequest, ctx);
|
||||
}
|
||||
}
|
||||
return MessageSendSingleResponseDto.from(response);
|
||||
}
|
||||
|
||||
private MessageBulkSendResponseDto sendBulk(
|
||||
|
||||
Reference in New Issue
Block a user