diff --git a/src/main/java/com/eactive/ext/kjb/ums/KjbUmsService.java b/src/main/java/com/eactive/ext/kjb/ums/KjbUmsService.java index 0f321b1..659e73b 100644 --- a/src/main/java/com/eactive/ext/kjb/ums/KjbUmsService.java +++ b/src/main/java/com/eactive/ext/kjb/ums/KjbUmsService.java @@ -35,6 +35,8 @@ import java.util.function.BiConsumer; @Slf4j public class KjbUmsService { + public final static int[] ALLOW_CHANNELS = { MessageCode.Channels.KAKAO_ALIMTALK.getValue() }; + private final static String SEND_URL = "/ums/openapi/send"; private final static String CONTENT_TYPE = "application/json; charset=utf-8"; private final static String AUTHORIZATION_FMT = "Bearer %s"; @@ -69,6 +71,17 @@ public class KjbUmsService { this.property = property; } + + public static boolean isAllowChannel(MessageRequest message) { + for (int channel : ALLOW_CHANNELS) { + if ((message.getMessageCode().getChannels() & channel) == channel) { + return true; + } + } + return false; + } + + public boolean send(MessageRequest messageRequest) { if (messageRequest == null) { throw new IllegalArgumentException("messageRequest is null");