This commit is contained in:
toom1996
2025-06-24 16:08:43 +08:00
parent 84dab07fec
commit b6607928bd
4 changed files with 190 additions and 2 deletions

View File

@ -0,0 +1,29 @@
<?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', $host)->where('is_delete', 0)->first()?->toArray();
if (!$query) {
return $this->getResponse()->setCode(404)->send();
}
return $this->getResponse()->setData($query)->setCode(0)->send();
}
}