|
...
|
...
|
@@ -2,41 +2,31 @@ |
|
|
|
namespace Jiaoyin;
|
|
|
|
|
|
|
|
class Feishu{
|
|
|
|
private static $users = [
|
|
|
|
'liquid' => 'gd1d6b34',
|
|
|
|
'jiaoyin' => 'efdgdecb',
|
|
|
|
'linghu' => '6ac9fb35',
|
|
|
|
'tanli' => 'f16c2bd7',
|
|
|
|
'small' => 'db9d9g4d',
|
|
|
|
'007' => '9de6cgf3',
|
|
|
|
];
|
|
|
|
//发送预警通知
|
|
|
|
static public function send($content,$users=[])
|
|
|
|
{
|
|
|
|
return self::notice($content,'follow',$users);
|
|
|
|
|
|
|
|
}
|
|
|
|
static public function sendNoError($content,$users=[])
|
|
|
|
const user_liquid = 'gd1d6b34';
|
|
|
|
const user_jiaoyin = 'efdgdecb';
|
|
|
|
const user_small = 'db9d9g4d';
|
|
|
|
const user_linghu = '6ac9fb35';
|
|
|
|
const user_tanli = 'f16c2bd7';
|
|
|
|
const user_007 = '9de6cgf3';
|
|
|
|
//风控处置群
|
|
|
|
const url_risk ='https://open.feishu.cn/open-apis/bot/v2/hook/7509c731-a1ab-4e2f-b781-9082a26fd11d';
|
|
|
|
//零容忍
|
|
|
|
const url_error = 'https://open.feishu.cn/open-apis/bot/v2/hook/a344e313-4d5d-4aa4-912b-dda37b2e3ee8';
|
|
|
|
//零忽略
|
|
|
|
const url_warning = 'https://open.feishu.cn/open-apis/bot/v2/hook/01c53b94-378a-45a3-abed-415f84f57f4a';
|
|
|
|
//软件异常报警
|
|
|
|
const url_warning_soft ='https://open.feishu.cn/open-apis/bot/v2/hook/d48c2e4a-0ef9-4684-88d4-e62d878fdaca';
|
|
|
|
//测试频道
|
|
|
|
const url_test = 'https://open.feishu.cn/open-apis/bot/v2/hook/34a9f127-3838-43fc-bc35-6f5e4e96bf6d';
|
|
|
|
//交易与跟单业务沟通
|
|
|
|
const url_follow = 'https://open.feishu.cn/open-apis/bot/v2/hook/f30bbb72-091c-499d-a577-43c45dceb158';
|
|
|
|
//A01-交易策略研发沟通
|
|
|
|
const url_strategy = 'https://open.feishu.cn/open-apis/bot/v2/hook/53444f37-cfec-420c-a4e6-2f415b908dee';
|
|
|
|
static public function notice($content,$channel_url,$users=[])
|
|
|
|
{
|
|
|
|
return self::notice($content,'error',$users);
|
|
|
|
}
|
|
|
|
|
|
|
|
static public function notice($content,$channel="warning",$users=[])
|
|
|
|
{
|
|
|
|
$urls = [
|
|
|
|
'follow' => 'https://open.feishu.cn/open-apis/bot/v2/hook/f30bbb72-091c-499d-a577-43c45dceb158',//跟单
|
|
|
|
'warning' => 'https://open.feishu.cn/open-apis/bot/v2/hook/d48c2e4a-0ef9-4684-88d4-e62d878fdaca',//盈迪苟异常报警
|
|
|
|
'error' => 'https://open.feishu.cn/open-apis/bot/v2/hook/a344e313-4d5d-4aa4-912b-dda37b2e3ee8',//零容忍
|
|
|
|
'strategy'=>'https://open.feishu.cn/open-apis/bot/v2/hook/53444f37-cfec-420c-a4e6-2f415b908dee',//A01-交易策略研发沟通
|
|
|
|
];
|
|
|
|
$url = $urls[$channel] ?? $urls['warning'];
|
|
|
|
$userXml = '';
|
|
|
|
foreach ($users as $user) {
|
|
|
|
if(!empty(self::$users[$user])){
|
|
|
|
$userXml .= "<at user_id='" . self::$users[$user] . "'></at>";
|
|
|
|
}else{
|
|
|
|
$userXml .= "<at user_id='" . $user. "'></at>";//直接用传入的。
|
|
|
|
}
|
|
|
|
$userXml .= "<at user_id='" . $user . "'></at>";
|
|
|
|
}
|
|
|
|
$content = [
|
|
|
|
'msg_type'=>"text",
|
|
...
|
...
|
@@ -45,10 +35,8 @@ class Feishu{ |
|
|
|
]
|
|
|
|
];
|
|
|
|
$con = json_encode($content);
|
|
|
|
return self::send_post_json($url,$con);
|
|
|
|
return self::send_post_json($channel_url,$con);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static public function send_post_json($url, $jsonStr)
|
|
|
|
{
|
|
|
|
$ch = curl_init();
|
...
|
...
|
|