作者 karlet

feat:修改与优化

... ... @@ -144,7 +144,7 @@ class BinanceFutures
//查询历史成交子订单
public function userTrades($param)
{
$path = 'fapi/v1/userTrades';
$path = '/fapi/v1/userTrades';
$method = 'GET';
return $this->requestAccount($method, $path, $param);
}
... ...
... ... @@ -2,45 +2,46 @@
namespace Jiaoyin;
class Feishu{
private static $users = [
'liquid' => 'gd1d6b34',
'jiaoyin' => 'efdgdecb',
'linghu' => '6ac9fb35',
'tanli' => 'f16c2bd7',
'small' => 'db9d9g4d',
'007' => '9de6cgf3',
];
//发送预警通知
static public function send($content)
static public function send($content,$users=[])
{
$url = 'https://open.feishu.cn/open-apis/bot/v2/hook/f30bbb72-091c-499d-a577-43c45dceb158';
$content = [
'msg_type'=>"text",
'content'=>[
'text'=>$content
]
];
$con = json_encode($content);
return self::send_post_json($url,$con);
}
return self::notice($content,'follow',$users);
static public function sendNoError($content)
}
static public function sendNoError($content,$users=[])
{
$url = 'https://open.feishu.cn/open-apis/bot/v2/hook/a344e313-4d5d-4aa4-912b-dda37b2e3ee8';
$content = [
'msg_type'=>"text",
'content'=>[
'text'=>$content
]
];
$con = json_encode($content);
return self::send_post_json($url,$con);
return self::notice($content,'error',$users);
}
static public function notice($content,$channel="warning")
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',
'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>";//直接用传入的。
}
}
$content = [
'msg_type'=>"text",
'content'=>[
'text'=>$content
'text'=>$content.$userXml
]
];
$con = json_encode($content);
... ... @@ -67,4 +68,4 @@ class Feishu{
curl_close($ch);
return array($httpCode, $response);
}
}
}
\ No newline at end of file
... ...