<?php
if($objectType == 'instance' && $actionType == 'monitor')
{
    $messageSetting = $this->config->message->setting;
    if(is_string($messageSetting)) $messageSetting = json_decode($messageSetting, true);
    $this->loadModel('space');
    $monitor = $this->space->getMonitorInfo($actionID);
    if(!$monitor) return;
    if (isset($messageSetting['webhook']['setting'][$objectType]) && in_array($actionType, $messageSetting['message']['setting'][$objectType]))
    {
        $this->loadModel('space')->sendMonitorWebhook($monitor);
    }
    if (isset($messageSetting['message']['setting'][$objectType]) && in_array($actionType, $messageSetting['message']['setting'][$objectType]))
    {
        $this->loadModel('space')->sendMonitorNotice($monitor);
    }
    if (isset($messageSetting['mail']['setting'][$objectType]) && in_array($actionType, $messageSetting['mail']['setting'][$objectType]))
    {
        $this->loadModel('space')->sendMonitorMail($monitor);
    }
    if (isset($messageSetting['sms']['setting'][$objectType]) && in_array($actionType, $messageSetting['sms']['setting'][$objectType]))
    {
        $this->loadModel('space')->sendMonitorSms($monitor);
    }
    if (isset($messageSetting['xuanxuan']['setting'][$objectType]) && in_array($actionType, $messageSetting['xuanxuan']['setting'][$objectType]))
    {
        $this->loadModel('space')->sendMonitorByXuanxuan($monitor);
    }
    return;
}