Search in sources :

Example 6 with NotifyPlatform

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

the class DtpDingNotifier method sendChangeMsg.

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

Example 7 with NotifyPlatform

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

the class DtpLarkNotifier method sendChangeMsg.

@Override
public void sendChangeMsg(DtpMainProp oldProp, List<String> diffs) {
    DtpContext contextWrapper = DtpContextHolder.get();
    NotifyPlatform platform = contextWrapper.getPlatform(NotifyPlatformEnum.LARK.name());
    String content = buildNoticeContent(platform, LARK_CHANGE_NOTICE_JSON_STR, 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 8 with NotifyPlatform

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

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 9 with NotifyPlatform

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

the class DtpDingNotifier method sendChangeMsg.

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

Example 10 with NotifyPlatform

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

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