dd/app/Http/Controllers/Api/v1/FreenodeCountrySpeedController.php
2026-02-12 17:27:01 +08:00

76 lines
1.8 KiB
PHP
Executable File
Raw Permalink 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
declare(strict_types=1);
namespace App\Http\Controllers\Api\v1;
use Illuminate\Http\Request;
//use App\Models\BoxCountry as ModelCountry;
final class FreenodeCountrySpeedController
{
static $aCountry = [
"美国",
"美国",
"日本",
"日本",
"新加坡",
"新加坡",
"香港",
"香港",
"台湾",
"台湾",
"越南",
"越南",
"俄罗斯",
"新西兰",
"瑞士",
"荷兰",
"冰岛",
"爱尔兰",
"乌克兰",
"泰国",
"阿根廷",
"葡萄牙",
"美国",
"日本",
"新加坡",
"台湾",
"香港",
"韩国",
"德国",
"土耳其",
"法国",
"加拿大",
"加拿大",
];
public function build(Request $oRequest)
{
//// 地区
$iCountryLimit = rand(5, 12);
$aCountryKey = array_rand(self::$aCountry, $iCountryLimit);
$aCountry = [];
foreach ($aCountryKey as $sCountryKey) {
$aCountry[] = self::$aCountry[$sCountryKey];
}
$sNodeZone = implode("", $aCountry);
//// 速度
$iNodeSpeed = rand(config("freenode.speed_min"), config("freenode.speed_max"));
$iNodeCount = rand(config("freenode.count_min"), config("freenode.count_max"));
$sContent = "
<p>本次更新共".$iNodeCount."个可用节点,最高速度".$iNodeSpeed."M/S。</p>
<p>覆盖".$sNodeZone."等多个区域。</p>
<p>复制下方的v2ray/Clash订阅链接在客户端添加即可正常使用。<br />
";
return response()->json($sContent);
}
}