Files
backend/app/Rpc/v1/WebsiteService.php
toom1996 f0eed20b0a update
2025-07-17 11:37:15 +08:00

29 lines
744 B
PHP

<?php
namespace App\Rpc\v1;
use App\Model\AppNews;
use App\Model\AppWebsiteConfig;
use App\Rpc\BaseService;
use Hyperf\RpcServer\Annotation\RpcService;
#[RpcService(name: "website", server: "jsonrpc-http", protocol: "jsonrpc-http")]
class WebsiteService extends BaseService
{
/**
* 查看单个新闻详情
* @url /news/view
* @param $id
* @return array
*/
public function config($host): array
{
$query = AppWebsiteConfig::query()->where('app_domain', 'like' , "%$host%")->where('is_delete', 0)->first()?->toArray();
if (!$query) {
return $this->getResponse()->setCode(404)->send();
}
return $this->getResponse()->setData($query)->setCode(0)->send();
}
}