<?php
declare(strict_types=1);
namespace App\Controller;

use App\JsonRpc\PublicRpcServiceInterface;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\AutoController;
use App\Tools\Result;
/**
 * Class PublicController
 * @package App\Controller
 */
#[AutoController]
class PublicController extends AbstractController
{

    /**
     * @var PublicRpcServiceInterface
     */
    #[Inject]
    private $publicServiceClient;

    /**
     * 创建站点
     * @return array
     */
    public function getDistrictList()
    {
        $pid = $this->request->input("pid",0);
        $data = [
            'pid'=>$pid
        ];
        $result = $this->publicServiceClient->getDistrictList($data);
        return $result ? Result::success($result['data']) : Result::error($result['message']);
    }
}