Search in sources :

Example 16 with DtpContext

use of com.dtp.core.context.DtpContext 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

DtpContext (com.dtp.core.context.DtpContext)16 NotifyPlatform (com.dtp.common.dto.NotifyPlatform)10 NotifyItem (com.dtp.common.dto.NotifyItem)3 lombok.val (lombok.val)3 DtpProperties (com.dtp.common.config.DtpProperties)2 DtpMainProp (com.dtp.common.dto.DtpMainProp)2 DtpExecutor (com.dtp.core.thread.DtpExecutor)2 FieldInfo (com.github.dadiyang.equator.FieldInfo)2 AlarmInfo (com.dtp.common.dto.AlarmInfo)1