dd/app/Http/Controllers/Web/Nasa/V1/GithubArticleGithubController.php
2026-08-07 19:44:39 +08:00

48 lines
1.5 KiB
PHP

<?php
namespace App\Http\Controllers\Web\Nasa\V1;
use Illuminate\Http\Request;
use App\Http\Requests\Nasa\NasaQueryRequest;
use Illuminate\View\View;
use Illuminate\Support\Facades\Http;
use App\Http\Controllers\Web\Nasa\V1\Base\ListController;
use Illuminate\Routing\Events\RouteMatched;
class GithubArticleGithubController extends ListController
{
protected string $sApiPath = "article/base";
protected string $sView = 'nasa._commons.list';
protected string $sSiteWww;
protected string $sHeaderActionView = 'nasa.v1._actions.list';
protected array $aBookCode = [
// "fn爬取说明书",
];
public function __construct()
{
$this->sSiteWww = config("path.url_github_base") ?? '';
}
public function index(NasaQueryRequest $oRequest)
{
$sNick = $oRequest->route('nick');
$this->sSiteWww = $sNick.'.'.$this->sSiteWww;
$aCleanQuery = $oRequest->cleanQuery();
$oResponse = Http::nasa($this->sSiteWww)->get($this->sApiPath, $aCleanQuery);
$aResponse = $oResponse->json();
$aResponse['sApiPath'] = $this->sApiPath;
$aResponse['sSiteWww'] = $this->sSiteWww;
$aResponse['sHeaderActionView'] = $this->sHeaderActionView;
$aResponse['sListView'] = $this->sListView;
$aResponse['cNasaBook'] = $this->getNasaBook();
$aResponse['aCustom'] = $this->aCustom ?? [];
return view($this->sView, $aResponse);
}
}