Skip to content

Commit

Permalink
feat: 增加notice函数(待完成)
Browse files Browse the repository at this point in the history
  • Loading branch information
linkunyuan committed Feb 19, 2024
1 parent ee90a52 commit 0552041
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions src/function.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
use EasySwoole\Redis\Redis;
use EasySwoole\RedisPool\RedisPool;
use EasySwoole\Spl\SplArray;
use WonderGame\EsUtility\Notify\DingTalk\Message\Markdown;
use WonderGame\EsUtility\Notify\DingTalk\Message\Text;
use WonderGame\EsUtility\Notify\Feishu\Message\Textarea;
use WonderGame\EsUtility\Notify\Feishu\Message\Text AS FeishuText;
use WonderGame\EsUtility\Notify\Feishu\Message\Card;
use WonderGame\EsUtility\Notify\EsNotify;
use WonderGame\EsUtility\Notify\WeChat\Message\Notice;
use WonderGame\EsUtility\Common\Classes\CtxRequest;
use WonderGame\EsUtility\Common\Classes\LamJwt;
use WonderGame\EsUtility\Common\Classes\Mysqli;
use WonderGame\EsUtility\Common\Exception\HttpParamException;
use WonderGame\EsUtility\Common\Http\Code;
use WonderGame\EsUtility\Common\OrmCache\Strings;
use WonderGame\EsUtility\HttpTracker\Index as HttpTracker;
use WonderGame\EsUtility\Notify\DingTalk\Message\Markdown;
use WonderGame\EsUtility\Notify\DingTalk\Message\Text;
use WonderGame\EsUtility\Notify\EsNotify;
use WonderGame\EsUtility\Notify\Feishu\Message\Card;
use WonderGame\EsUtility\Notify\Feishu\Message\Text as FeishuText;
use WonderGame\EsUtility\Notify\Feishu\Message\Textarea;
use WonderGame\EsUtility\Notify\WeChat\Message\Notice;


if ( ! function_exists('is_super')) {
Expand Down Expand Up @@ -520,6 +520,17 @@ function lang($const = '')
}
}

if ( ! function_exists('notice')) {
function notice($content = '', $title = null, $name = 'default')
{
// 富文本
if ($title) {
config('ES_NOTIFY.driver') == 'feishu' ? feishu_textarea($content, true, $name) : dingtalk_markdown($title, $content, true, $name);
} else {
config('ES_NOTIFY.driver') == 'feishu' ? feishu_text($content, true, $name) : dingtalk_text($content, true, $name);
}
}
}

if ( ! function_exists('wechat_notice')) {
function wechat_notice($content = '', $name = 'default')
Expand Down

0 comments on commit 0552041

Please sign in to comment.