no message
This commit is contained in:
parent
55cface7a2
commit
ac2bbe27bf
@ -58,9 +58,9 @@ class TestsController
|
|||||||
@$k = $_GET["k"];
|
@$k = $_GET["k"];
|
||||||
@$s = $_GET["s"];
|
@$s = $_GET["s"];
|
||||||
|
|
||||||
if ($k !== "wocaonide") {
|
// if ($k !== "wocaonide") {
|
||||||
exit("?");
|
// exit("?");
|
||||||
}
|
// }
|
||||||
|
|
||||||
$s = '/'.$s;
|
$s = '/'.$s;
|
||||||
|
|
||||||
@ -69,6 +69,10 @@ class TestsController
|
|||||||
// $s = "\/git#LastTime 1";
|
// $s = "\/git#LastTime 1";
|
||||||
$s= "/test#cron__i 07";
|
$s= "/test#cron__i 07";
|
||||||
|
|
||||||
|
$s = "/dog#list";
|
||||||
|
|
||||||
|
$s = "/dog#github 1";
|
||||||
|
|
||||||
$oHttp = new Http();
|
$oHttp = new Http();
|
||||||
$oHttp->sMethod = "post";
|
$oHttp->sMethod = "post";
|
||||||
$oHttp->sToUrl = env("APP_URL")."/api/tg/hook";
|
$oHttp->sToUrl = env("APP_URL")."/api/tg/hook";
|
||||||
|
|||||||
@ -3,7 +3,27 @@
|
|||||||
namespace App\Services\TG\Hook\Mod;
|
namespace App\Services\TG\Hook\Mod;
|
||||||
use App\Models\Article as ModelArticle;
|
use App\Models\Article as ModelArticle;
|
||||||
|
|
||||||
class Article extends Base {
|
class Dog extends Base {
|
||||||
|
|
||||||
|
public function Github($aParam)
|
||||||
|
{
|
||||||
|
$iId = $aParam["aArg"][1] ?? false;
|
||||||
|
|
||||||
|
if (empty($aParam["aOption"]) && empty($aParam["aArg"])) {
|
||||||
|
return "/dog#github {id}";
|
||||||
|
}
|
||||||
|
|
||||||
|
$oArticle = ModelArticle::find($iId);
|
||||||
|
|
||||||
|
// https://api.github.com/repos/v2rayclashfree-com/v2rayclashfree
|
||||||
|
$this->oHttp->sToUrl = "https://api.github.com/repos/".$oArticle->user_name."/".$oArticle->project_name;
|
||||||
|
$this->oHttp->sMetHod = "get";
|
||||||
|
$this->oHttp->bIsJson = true;
|
||||||
|
$r = $this->oHttp->send();
|
||||||
|
|
||||||
|
|
||||||
|
tomd($r);
|
||||||
|
}
|
||||||
|
|
||||||
public function List($aParam)
|
public function List($aParam)
|
||||||
{
|
{
|
||||||
21
app/Services/TG/Hook/Mod/Tom.php
Normal file
21
app/Services/TG/Hook/Mod/Tom.php
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Services\TG\Hook\Mod;
|
||||||
|
use App\Models\Article as ModelArticle;
|
||||||
|
|
||||||
|
class Tom extends Base {
|
||||||
|
|
||||||
|
public function me()
|
||||||
|
{
|
||||||
|
$str = "";
|
||||||
|
|
||||||
|
$str .= "
|
||||||
|
|
||||||
|
status=0,暂停
|
||||||
|
|
||||||
|
id可以修改!
|
||||||
|
|
||||||
|
";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -57,6 +57,10 @@ class Http
|
|||||||
// 默认使用 GET 请求
|
// 默认使用 GET 请求
|
||||||
curl_setopt($ch, CURLOPT_HTTPGET, true); // 设置为 GET 请求
|
curl_setopt($ch, CURLOPT_HTTPGET, true); // 设置为 GET 请求
|
||||||
curl_setopt($ch, CURLOPT_URL, $this->sToUrl . '?' . http_build_query($this->aData)); // 设置请求 URL
|
curl_setopt($ch, CURLOPT_URL, $this->sToUrl . '?' . http_build_query($this->aData)); // 设置请求 URL
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||||
|
'User-Agent: JohnDoeDev' // 替换为你的应用名称
|
||||||
|
]);
|
||||||
|
|
||||||
if ($this->bIsJson) {
|
if ($this->bIsJson) {
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||||
'Accept: application/json' // 设置接受的内容类型为 JSON
|
'Accept: application/json' // 设置接受的内容类型为 JSON
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"id": 1003,
|
"id": 105,
|
||||||
"user_name": "telegram",
|
"user_name": "telegram",
|
||||||
"project_name": "windows-clash-v2ray",
|
"project_name": "windows-clash-v2ray",
|
||||||
"mail_name": "haoliugen1212",
|
"mail_name": "haoliugen1212",
|
||||||
|
|||||||
@ -11,7 +11,7 @@ Route::get('/cron', [CronController::class, 'index']);
|
|||||||
|
|
||||||
Route::get('/test/hello', [TestsController::class, 'hello']);
|
Route::get('/test/hello', [TestsController::class, 'hello']);
|
||||||
|
|
||||||
Route::get('/tests/hook', [TestsController::class, 'hook']);
|
Route::get('/test/hook', [TestsController::class, 'hook']);
|
||||||
|
|
||||||
//Route::post('/api/tg/hook', [HookController::class, 'cmd']);
|
//Route::post('/api/tg/hook', [HookController::class, 'cmd']);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user