Search in sources :

Example 1 with NotifyPlatform

use of com.dtp.common.dto.NotifyPlatform in project dynamic-tp by lyh200.

the class DtpWechatNotifier method sendChangeMsg.

@Override
public void sendChangeMsg(DtpMainProp oldProp, List<String> diffs) {
    DtpContext contextWrapper = DtpContextHolder.get();
    NotifyPlatform platform = contextWrapper.getPlatform(NotifyPlatformEnum.WECHAT.name());
    String content = buildNoticeContent(platform, WECHAT_CHANGE_NOTICE_TEMPLATE, oldProp, diffs);
    if (StringUtils.isBlank(content)) {
        return;
    }
    doSend(platform, content);
}
Also used : DtpContext(com.dtp.core.context.DtpContext) NotifyPlatform(com.dtp.common.dto.NotifyPlatform)

Example 2 with NotifyPlatform

use of com.dtp.common.dto.NotifyPlatform in project dynamic-tp by lyh200.

the class DtpDingNotifier method sendAlarmMsg.

@Override
public void sendAlarmMsg(NotifyTypeEnum typeEnum) {
    DtpContext contextWrapper = DtpContextHolder.get();
    NotifyPlatform platform = contextWrapper.getPlatform(NotifyPlatformEnum.DING.name());
    String content = buildAlarmContent(platform, typeEnum, DING_ALARM_TEMPLATE);
    if (StringUtils.isBlank(content)) {
        return;
    }
    List<String> receivesList = StrUtil.split(platform.getReceivers(), ',');
    doSend(platform, DingNotifyConst.DING_ALARM_TITLE, content, receivesList);
}
Also used : DtpContext(com.dtp.core.context.DtpContext) NotifyPlatform(com.dtp.common.dto.NotifyPlatform)

Example 3 with NotifyPlatform

use of com.dtp.common.dto.NotifyPlatform in project dynamic-tp by dromara.

the class DtpDingNotifier method sendAlarmMsg.

@Override
public void sendAlarmMsg(NotifyTypeEnum typeEnum) {
    DtpContext contextWrapper = DtpContextHolder.get();
    NotifyPlatform platform = contextWrapper.getPlatform(NotifyPlatformEnum.DING.name());
    String content = buildAlarmContent(platform, typeEnum, DING_ALARM_TEMPLATE);
    if (StringUtils.isBlank(content)) {
        return;
    }
    List<String> receivesList = StrUtil.split(platform.getReceivers(), ',');
    doSend(platform, DingNotifyConst.DING_ALARM_TITLE, content, receivesList);
}
Also used : DtpContext(com.dtp.core.context.DtpContext) NotifyPlatform(com.dtp.common.dto.NotifyPlatform)

Example 4 with NotifyPlatform

use of com.dtp.common.dto.NotifyPlatform in project dynamic-tp by dromara.

the class DtpLarkNotifier method sendAlarmMsg.

@Override
public void sendAlarmMsg(NotifyTypeEnum typeEnum) {
    DtpContext contextWrapper = DtpContextHolder.get();
    NotifyPlatform platform = contextWrapper.getPlatform(NotifyPlatformEnum.LARK.name());
    String content = buildAlarmContent(platform, typeEnum, LARK_ALARM_JSON_STR);
    if (StringUtils.isBlank(content)) {
        return;
    }
    doSend(platform, content);
}
Also used : DtpContext(com.dtp.core.context.DtpContext) NotifyPlatform(com.dtp.common.dto.NotifyPlatform)

Example 5 with NotifyPlatform

use of com.dtp.common.dto.NotifyPlatform in project dynamic-tp by dromara.

the class DtpWechatNotifier method sendAlarmMsg.

@Override
public void sendAlarmMsg(NotifyTypeEnum typeEnum) {
    DtpContext contextWrapper = DtpContextHolder.get();
    NotifyPlatform platform = contextWrapper.getPlatform(NotifyPlatformEnum.WECHAT.name());
    String content = buildAlarmContent(platform, typeEnum, WECHAT_ALARM_TEMPLATE);
    if (StringUtils.isBlank(content)) {
        return;
    }
    doSend(platform, content);
}
Also used : DtpContext(com.dtp.core.context.DtpContext) NotifyPlatform(com.dtp.common.dto.NotifyPlatform)

Aggregations

NotifyPlatform (com.dtp.common.dto.NotifyPlatform)10 DtpContext (com.dtp.core.context.DtpContext)10