dd/app/Services/Tg/Hook/Mod/Test.php
2026-05-15 15:15:37 +08:00

84 lines
2.4 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace App\Services\Tg\Hook\Mod;
use App\Models\BladeJctj as ModelBladeJctj;
use App\Services\Tg\Hook\Dog;
use App\Services\TomTool\Flow;
use App\Services\TomTool\HttpV2;
use App\Services\TomTool\Telegram\Slave as TeleSlave;
use App\Services\TomTool\Http;
use App\Services\UrlMap;
class Test extends Base {
private $oDog;
public function __construct($aUpdate)
{
$this->oDog = new Dog(new ModelBladeJctj());
$this->oDog->_setDogName("jctj"); // 必须me用正常就是类名只不过后期没准改名所以就这里写死
$this->oDog->_setPrimaryKey("id"); // 可选默认id
$this->oDog->_setStrField(["content"]); // 可选,指定长文本字段
}
public function __call($sName, $aArg)
{
return $this->oDog->$sName($aArg[0]);
}
public function tmail()
{
$resend = Resend::client('re_5wGp8mP6_654KJcRifD52rfzkoEoTjR8u');
$resend->emails->send([
'from' => 'onboarding@resend.dev',
'to' => 'mukaitao@proton.me',
'subject' => 'Hello World',
'html' => '<p>Congrats on sending your <strong>first email</strong>!</p>'
]);
}
public function t1()
{
$oHttp = new Http();
$sFnClient = "xxx";
$oHttp->sToUrl = "https://".env("url_master_base")."/api/v1/freenode/url_feed_today/".env("site_code")."/{$sFnClient}";
$s = $oHttp->send();
echo $s;
// tt($s);
// TeleSlave::log()->enableSlaveQueue(false)->setFileUrl("https://master.tomshell.my/freenode/template/clash.txt")->setMsgS("fff")->send();
// echo 1;
}
public function httpJson($aParam)
{
$sUrl = $aParam["aOption"][1] ?? '';
$aDataJson = $aParam["aArg"] ?? [];
$sDataJson = implode(" ", $aDataJson);
$aDataJson = json_decode($sDataJson, true);
$r = HttpV2::make($sUrl)->enableJsonAs(true)->withToken()->setDataA($aDataJson)->send();
return $r;
}
public function http($aParam)
{
$sUrl = $aParam["aOption"][1] ?? '';
$aDataJson = $aParam["aArg"] ?? [];
$sDataJson = implode(" ", $aDataJson);
$aDataJson = json_decode($sDataJson, true);
$r = HttpV2::make($sUrl)->enableJsonAs(false)->withToken()->setDataA($aDataJson)->send();
return $r;
}
}