ums 연동 테스트
This commit is contained in:
@@ -35,6 +35,8 @@ import java.util.function.BiConsumer;
|
|||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class KjbUmsService {
|
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 SEND_URL = "/ums/openapi/send";
|
||||||
private final static String CONTENT_TYPE = "application/json; charset=utf-8";
|
private final static String CONTENT_TYPE = "application/json; charset=utf-8";
|
||||||
private final static String AUTHORIZATION_FMT = "Bearer %s";
|
private final static String AUTHORIZATION_FMT = "Bearer %s";
|
||||||
@@ -69,6 +71,17 @@ public class KjbUmsService {
|
|||||||
this.property = property;
|
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) {
|
public boolean send(MessageRequest messageRequest) {
|
||||||
if (messageRequest == null) {
|
if (messageRequest == null) {
|
||||||
throw new IllegalArgumentException("messageRequest is null");
|
throw new IllegalArgumentException("messageRequest is null");
|
||||||
|
|||||||
Reference in New Issue
Block a user