update
This commit is contained in:
29
app/Rpc/v1/WebsiteService.php
Normal file
29
app/Rpc/v1/WebsiteService.php
Normal 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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user