Преглед на файлове

获取底部导航及搭建基本信息 解决冲突

15313670163 преди 3 месеца
родител
ревизия
d1b5aa142b

+ 409 - 0
app/Controller/FooterController.php

@@ -0,0 +1,409 @@
+<?php
+
+declare(strict_types=1);
+namespace App\Controller;
+
+use App\JsonRpc\FooterServiceInterface;
+use App\Tools\PublicData;
+use Hyperf\Di\Annotation\Inject;
+use Hyperf\HttpServer\Annotation\AutoController;
+use App\Tools\Result;
+use Hyperf\Validation\Contract\ValidatorFactoryInterface;
+use App\Constants\ErrorCode;
+/**
+ * Class FooterController
+ * @package App\Controller
+ */
+
+class FooterController extends AbstractController
+{
+    #[Inject]
+    protected ValidatorFactoryInterface $validationFactory;
+
+    /**
+     * @var FooterServiceInterface
+    */
+
+    #[Inject]
+    private $footerServiceClient;
+     /**
+     * 获取底部导航
+     * @return array
+     */
+    public function getFooterCategory()
+    {
+        $requireData = $this->request->all();
+        if(isset($requireData['website_name'])){
+            $validator = $this->validationFactory->make(
+                $requireData,
+                [
+                    'website_name' =>'required'
+                ],
+                [
+                    'website_name.required' => '网站名称不能为空'
+                ]
+            );
+            if ($validator->fails()){
+                $errorMessage = $validator->errors()->first();
+                return Result::error($errorMessage);
+            }
+            $data['website_name'] = $requireData['website_name'];
+        }
+        if(isset($requireData['name'])){
+            $validator = $this->validationFactory->make(
+                $requireData,
+                [
+                    'name' =>'required'
+                ],
+                [
+                    'name.required' => '底部导航名称不能为空'
+                ]
+            );
+            if ($validator->fails()){
+                $errorMessage = $validator->errors()->first();
+                return Result::error($errorMessage);
+            }
+            $data['name'] = $requireData['name'];
+        }
+        $validator = $this->validationFactory->make(
+            $requireData,
+            [
+                'page' =>'required',
+                'pageSize' =>'required'
+            ],
+            [
+                'page.required' => '第几页不能为空',
+                'pageSize.required' => '每页显示数量不能为空'
+            ]
+        );
+        if ($validator->fails()){
+            $errorMessage = $validator->errors()->first();
+            return Result::error($errorMessage);
+        }
+        $data['page'] = $requireData['page'];
+        $data['pageSize'] = $requireData['pageSize'];
+        // var_dump($data);
+        $result = $this->footerServiceClient->getFooterCategory($data);
+        if ($result['code'] != ErrorCode::SUCCESS) {
+            return Result::error($result['message'],0,[]);
+        }else{
+            return Result::success($result['data']);
+        }
+        
+    }
+    /**
+     * 添加底部导航
+     * @return array
+     */
+    public function addFooterCategory()
+    {
+        $requireData = $this->request->all();
+        if(!empty($requireData)){
+            $validator = $this->validationFactory->make(
+                $requireData,
+                [
+                    'website_id' =>'required',
+                    'name' =>'required',
+                    'type' =>'required'
+                ],
+                [
+                    'website_id.required' => '网站id不能为空',
+                    'name.required' => '底部导航名称不能为空',
+                    'type.required' => '底部导航类型不能为空'
+                ]
+            );
+            if ($validator->fails()){
+                $errorMessage = $validator->errors()->first();
+                return Result::error($errorMessage);
+            }
+            $data = $requireData;
+        }else{
+           $data = []; 
+        }
+        $result = $this->footerServiceClient->addFooterCategory($data);
+        if ($result['code'] != ErrorCode::SUCCESS) {
+            return Result::error($result['message'],0,[]);
+        }else{
+            return Result::success($result['data']);
+        }
+    }
+    /**
+     * 修改底部导航
+     * @return array
+     */
+    public function upFooterCategory()
+    {
+        $requireData = $this->request->all();
+        $validator = $this->validationFactory->make(
+            $requireData,
+            [
+                'id' =>'required'
+            ],
+            [
+                'id.required' => '底部导航id不能为空'
+            ]
+        );
+        if ($validator->fails()){
+            $errorMessage = $validator->errors()->first();
+            return Result::error($errorMessage);
+        }
+        if(isset($requireData['name'])){
+            $validator = $this->validationFactory->make(
+                $requireData,
+                [
+                    'name' =>'required' 
+                ],
+                [
+                    'name.required' => '底部导航名称不能为空'
+                ]
+            );
+            if ($validator->fails()){
+                $errorMessage = $validator->errors()->first();
+                return Result::error($errorMessage);
+            }
+            $data['name'] = $requireData['name'];
+        }
+        if(isset($requireData['website_id'])){
+            $validator = $this->validationFactory->make(
+                $requireData,
+                [
+                    'website_id' =>'required'
+                ],
+                [
+                    'website_id.required' => '网站id不能为空'
+                ]
+            );
+            if ($validator->fails()){
+                $errorMessage = $validator->errors()->first();
+                return Result::error($errorMessage);
+            }
+             $data['website_id'] = $requireData['website_id'];
+        }
+       
+        $data['id'] = $requireData['id'];
+        // var_dump($data);
+        $result = $this->footerServiceClient->upFooterCategory($data);
+        if ($result['code'] != ErrorCode::SUCCESS) {
+            return Result::error($result['message'],0,[]);
+        }else{
+            return Result::success($result['data']);
+        }        
+    }    
+     /**
+     * 删除底部导航
+     * @return array
+     */
+    public function delFooterCategory()
+    {
+        $requireData = $this->request->all();
+        $validator = $this->validationFactory->make(
+            $requireData,
+            [
+                'id' =>'required'
+            ],
+            [
+                'id.required' => '底部导航id不能为空'
+            ]
+        );
+        $data['id'] = $requireData['id'];
+        if($validator->fails()){
+            $errorMessage = $validator->errors()->first();
+            return Result::error($errorMessage);
+        }
+        $result = $this->footerServiceClient->delFooterCategory($data);
+        if ($result['code']!= ErrorCode::SUCCESS) {
+            return Result::error($result['message'],0,[]);
+        }else{
+            return Result::success($result['data']);
+        }
+    }
+     /**
+     * 添加底部导航(列表)内容
+     * @return array
+     */
+    public function addFooterContent()
+    {
+        $requireData = $this->request->all();
+        $validator = $this->validationFactory->make(
+            $requireData,
+            [
+                'type' =>'required',
+                'fcat_id' =>'required',
+                'con_title' =>'required',
+                'content' =>'required'
+            ],
+            [
+                'type.required' => '底部导航类型不能为空',
+                'fcat_id.required' => '底部导航id不能为空',
+                'con_title.required' => '内容标题不能为空',
+                'content.required' => '内容不能为空'
+            ]
+        );
+        
+        if($validator->fails()){
+            $errorMessage = $validator->errors()->first();
+            return Result::error($errorMessage);
+        }
+        $data['type'] = $requireData['type'];
+        $data['fcat_id'] = $requireData['fcat_id'];
+        $data['con_title'] = $requireData['con_title'];
+        $data['content'] = $requireData['content'];
+        if($data['type'] == 1){
+            $validator = $this->validationFactory->make(
+                $requireData,
+                [
+                    'list_title' =>'required'
+                ],
+                [
+                    'list_title.required' => '列表标题不能为空'
+                ]
+            );
+            if ($validator->fails()){
+                $errorMessage = $validator->errors()->first();
+                return Result::error($errorMessage);
+            }
+            $data['list_title'] = $requireData['list_title'];
+        }
+        // var_dump($data);
+        $result = $this->footerServiceClient->addFooterContent($data);
+        if ($result['code']!= ErrorCode::SUCCESS) {
+            return Result::error($result['message'],0,[]);
+        }else{
+            return Result::success($result['data']);
+        }
+    }
+     /**
+     * 获取并搜索底部导航(列表)内容
+     * @return array
+     */
+    public function getFooterContent()
+    {
+        $requireData = $this->request->all();
+        $validator = $this->validationFactory->make(
+            $requireData,
+            [
+                'fcat_id' =>'required',
+                'page' =>'required',
+                'pageSize' =>'required'
+            ],
+            [
+                'fcat_id.required' => '底部导航类型不能为空',
+                'page.required' => '第几页不能为空',
+                'pageSize.required' => '每页显示数量不能为空'
+            ]
+        );
+        if($validator->fails()){
+            $errorMessage = $validator->errors()->first();
+            return Result::error($errorMessage);
+        }
+        if(isset($requireData['con_title'])){
+            $validator = $this->validationFactory->make(
+                $requireData,
+                [
+                    'con_title' =>'required'
+                ],
+                [
+                    'con_title.required' => '内容标题不能为空'
+                ]
+            );
+            if($validator->fails()){
+                $errorMessage = $validator->errors()->first();
+                return Result::error($errorMessage);
+            }
+            $data['con_title'] = $requireData['con_title'];
+        }
+        
+        $data['fcat_id'] = $requireData['fcat_id'];
+        $data['page'] = $requireData['page'];
+        $data['pageSize'] = $requireData['pageSize'];
+        $result = $this->footerServiceClient->getFooterContent($data);
+        if ($result['code']!= ErrorCode::SUCCESS) {
+            return Result::error($result['message'],0,[]);
+        }else{
+            return Result::success($result['data']);
+        }
+    }
+     /**
+     * 修改底部导航(列表)内容
+     * @return array
+     */
+    public function upFooterContent()
+    {
+        $requireData = $this->request->all();
+        $validator = $this->validationFactory->make(
+            $requireData,
+            [
+                'id' =>'required',
+                'type' =>'required',
+                'con_title' =>'required',
+                'content' =>'required'
+            ],
+            [
+                'id.required' => '底部导航内容id不能为空',
+                'type.required' => '底部导航类型不能为空',
+                'con_title.required' => '内容标题不能为空',
+                'content.required' => '内容不能为空'
+            ]
+        );
+        if($validator->fails()){
+            $errorMessage = $validator->errors()->first();
+            return Result::error($errorMessage);
+        }
+        $data['id'] = $requireData['id'];
+        $data['type'] = $requireData['type'];
+        $data['con_title'] = $requireData['con_title'];
+        $data['content'] = $requireData['content'];
+        if($data['type'] == 1){
+            $validator = $this->validationFactory->make(
+                $requireData,
+                [
+                    'list_title' =>'required'
+                ],
+                [
+                    'list_title.required' => '列表标题不能为空'
+                ]
+            );
+            if ($validator->fails()){
+                $errorMessage = $validator->errors()->first();
+                return Result::error($errorMessage);
+            }
+            $data['list_title'] = $requireData['list_title'];
+        }
+        // var_dump($data);
+        $result = $this->footerServiceClient->upFooterContent($data);
+        if ($result['code']!= ErrorCode::SUCCESS) {
+            return Result::error($result['message'],0,[]);
+        }else{
+            return Result::success($result['data']);
+        }
+    }
+     /**
+     * 删除底部导航(列表)内容
+     * @return array
+     */
+    public function delFooterContent()
+    {
+        $requireData = $this->request->all();
+        $validator = $this->validationFactory->make(
+            $requireData,
+            [
+                'id' =>'required'
+            ],
+            [
+                'id.required' => '底部导航id不能为空'
+            ]
+        );
+        if($validator->fails()){
+            $errorMessage = $validator->errors()->first();
+            return Result::error($errorMessage);
+        }
+        $data['id'] = $requireData['id'];
+        // var_dump($data);
+        $result = $this->footerServiceClient->delFooterContent($data);
+        if ($result['code']!= ErrorCode::SUCCESS) {
+            return Result::error($result['message'],0,[]);
+        }else{
+            return Result::success($result['data']);
+        }
+    }
+}

+ 85 - 0
app/JsonRpc/FooterService.php

@@ -0,0 +1,85 @@
+<?php
+
+namespace App\JsonRpc;
+
+use Hyperf\RpcClient\AbstractServiceClient;
+
+class FooterService extends AbstractServiceClient implements FooterServiceInterface
+{
+    /**
+     * 定义对应服务提供者的服务名称
+     * @var string
+     */
+    protected string $serviceName = 'FooterService';
+    /**
+     * 定义对应服务提供者的服务协议
+     * @var string
+     */
+    protected string $protocol = 'jsonrpc-http';
+
+
+    /**
+     * @param array $data
+     * @return mixed
+     */
+    public function getFooterCategory(array $data)
+    {
+        return $this->__request(__FUNCTION__, $data);
+    }
+    /**
+     * @param array $data
+     * @return mixed
+     */
+    public function addFooterCategory(array $data)
+    {
+        return $this->__request(__FUNCTION__, $data);
+    }
+    /**
+     * @param array $data
+     * @return mixed
+     */
+    public function upFooterCategory(array $data)
+    {
+        return $this->__request(__FUNCTION__, $data);
+    }
+    /**
+     * @param array $data
+     * @return mixed
+     */
+    public function delFooterCategory(array $data)
+    {
+        return $this->__request(__FUNCTION__, $data);
+    }
+    /**
+     * @param array $data
+     * @return mixed
+     */
+    public function getFooterContent(array $data)
+    {
+        return $this->__request(__FUNCTION__, $data);
+    }
+    /**
+     * @param array $data
+     * @return mixed
+     */
+    public function addFooterContent(array $data)
+    {
+        return $this->__request(__FUNCTION__, $data);
+    }
+    /**
+     * @param array $data
+     * @return mixed
+     */
+    public function upFooterContent(array $data)
+    {
+        return $this->__request(__FUNCTION__, $data);
+    }
+    /**
+     * @param array $data
+     * @return mixed
+     */
+    public function delFooterContent(array $data)
+    {
+        return $this->__request(__FUNCTION__, $data);
+    }
+}

+ 39 - 0
app/JsonRpc/FooterServiceInterface.php

@@ -0,0 +1,39 @@
+<?php
+
+namespace App\JsonRpc;
+interface FooterServiceInterface
+{
+
+    /**
+     * @param array $data
+     */
+    public function getFooterCategory(array $data);
+     /**
+     * @param array $data
+     */
+    public function addFooterCategory(array $data);
+     /**
+     * @param array $data
+     */
+    public function upFooterCategory(array $data);
+     /**
+     * @param array $data
+     */
+    public function delFooterCategory(array $data);
+     /**
+     * @param array $data
+     */
+    public function getFooterContent(array $data);
+     /**
+     * @param array $data
+     */
+    public function addFooterContent(array $data);
+     /**
+     * @param array $data
+     */
+    public function upFooterContent(array $data);
+     /**
+     * @param array $data
+     */
+    public function delFooterContent(array $data);
+}

+ 27 - 0
app/JsonRpc/WebsiteService.php

@@ -469,6 +469,25 @@ class WebsiteService extends AbstractServiceClient implements WebsiteServiceInte
     /**
     /**
      * @param array $data
      * @param array $data
      * @return array|mixed
      * @return array|mixed
+     /**
+     * @param array $data
+     * @return mixed
+     */
+    public function getWebsiteTemplateinfo(array $data)
+    {
+        return $this->__request(__FUNCTION__, $data);
+    }
+     /**
+     * @param array $data
+     * @return mixed
+     */
+    public function addWebsiteTemplateinfo(array $data)
+    {
+        return $this->__request(__FUNCTION__, $data);
+    }    
+    /**
+     * @param array $data
+     * @return mixed
      */
      */
     public function addWebsiteTemplate(array $data)
     public function addWebsiteTemplate(array $data)
     {
     {
@@ -520,4 +539,12 @@ class WebsiteService extends AbstractServiceClient implements WebsiteServiceInte
         return $this->__request(__FUNCTION__, $data);
         return $this->__request(__FUNCTION__, $data);
     }
     }
 
 
+    /**
+     *@param array $data
+     * @return mixed
+     */
+    public function getAllTemplateClass(array $data)
+    {
+        return $this->__request(__FUNCTION__, $data);
+    }
 }
 }

+ 25 - 0
app/JsonRpc/WebsiteServiceInterface.php

@@ -293,6 +293,31 @@ interface WebsiteServiceInterface
      * @return mixed
      * @return mixed
      */
      */
     public function checkWebsiteUrl(array $data);
     public function checkWebsiteUrl(array $data);
+    /**
+     * @param array $data
+     * @return mixed
+     *
+     */
+    public function getWebsiteTemplateinfo(array $data);
+    /** 
+    * @param array $data
+    * @return mixed
+    *
+    */
+   public function addWebsiteTemplateinfo(array $data);
+
+   /** 
+    * @param array $data
+    * @return mixed
+    *
+    */
+    public function addWebsiteTemplate(array $data);
+     /** 
+    * @param array $data
+    * @return mixed
+    *
+    */
+    public function getAllTemplateClass(array $data);
 
 
     /**
     /**
      * @param array $data
      * @param array $data

+ 2 - 2
composer.lock

@@ -12082,12 +12082,12 @@
     ],
     ],
     "aliases": [],
     "aliases": [],
     "minimum-stability": "dev",
     "minimum-stability": "dev",
-    "stability-flags": [],
+    "stability-flags": {},
     "prefer-stable": true,
     "prefer-stable": true,
     "prefer-lowest": false,
     "prefer-lowest": false,
     "platform": {
     "platform": {
         "php": ">=8.1"
         "php": ">=8.1"
     },
     },
-    "platform-dev": [],
+    "platform-dev": {},
     "plugin-api-version": "2.6.0"
     "plugin-api-version": "2.6.0"
 }
 }

+ 30 - 0
config/api/footer.php

@@ -0,0 +1,30 @@
+<?php
+
+declare(strict_types=1);
+
+use App\Controller\FooterController;
+use Hyperf\HttpServer\Router\Router;
+use App\Middleware\Auth\FooMiddleware;
+Router::addGroup(
+    '/footer', function () {
+        /**获取并搜索底部导航 */
+        Router::post('/getFooterCategory', [FooterController::class, 'getFooterCategory']);
+        /**创建底部导航 */
+        Router::post('/addFooterCategory', [FooterController::class, 'addFooterCategory']);
+        /**修改底部导航 */
+        Router::post('/upFooterCategory', [FooterController::class, 'upFooterCategory']);
+         /**删除底部导航 */
+        Router::post('/delFooterCategory', [FooterController::class, 'delFooterCategory']);
+        
+
+        /**获取并搜索底部导航(列表)内容 */
+        Router::post('/getFooterContent', [FooterController::class, 'getFooterContent']);
+        /**添加底部导航(列表)内容 */
+        Router::post('/addFooterContent', [FooterController::class, 'addFooterContent']);
+        /**修改底部导航(列表)内容 */
+        Router::post('/upFooterContent', [FooterController::class, 'upFooterContent']);
+        /**删除底部导航(列表)内容 */
+        Router::post('/delFooterContent', [FooterController::class, 'delFooterContent']);
+    },
+    ['middleware' => [FooMiddleware::class]]
+);

+ 9 - 0
config/api/website.php

@@ -90,6 +90,15 @@ Router::addGroup(
         //获取模板的数据
         //获取模板的数据
         Router::get('/getWebsiteTemplateData', [WebsiteController::class, 'getWebsiteTemplateData']);
         Router::get('/getWebsiteTemplateData', [WebsiteController::class, 'getWebsiteTemplateData']);
 
 
+
+        //获取并搜索网站
+        Router::post('/getWebsiteTemplateinfo', [WebsiteController::class, 'getWebsiteTemplateinfo']);
+        //搭建网站基础信息
+        Router::post('/addWebsiteTemplateinfo', [WebsiteController::class, 'addWebsiteTemplateinfo']);
+        //获取网站所有风格
+        Router::post('/getAllTemplateClass', [WebsiteController::class, 'getAllTemplateClass']);
+        //添加网站选择风格
+        Router::post('/addWebsiteTemplate', [WebsiteController::class, 'addWebsiteTemplate']);
     },
     },
     ['middleware' => [FooMiddleware::class]]
     ['middleware' => [FooMiddleware::class]]
 );
 );

+ 106 - 97
config/autoload/services.php

@@ -1,97 +1,106 @@
-<?php
-
-return [
-    'consumers' => [
-        [
-            // 用戶中心
-            'name' => 'UserService',
-            'service' => \App\JsonRpc\UserServiceInterface::class,
-            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
-            'nodes' => [
-                ['host' => '127.0.0.1', 'port' => 9504],
-            ],
-        ],
-        [
-            // 权限管理
-            'name' => 'AuthorityService',
-            'service' => \App\JsonRpc\AuthorityServiceInterface::class,
-            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
-            'nodes' => [
-                ['host' => '127.0.0.1', 'port' => 9504],
-            ],
-        ],
-        [
-            // 广告中心
-            'name' => 'AdService',
-            'service' => \App\JsonRpc\AdServiceInterface::class,
-            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
-            'nodes' => [
-                ['host' => '127.0.0.1', 'port' => 9503],
-            ],
-        ],
-        [
-            //网站管理
-            'name' => 'WebsiteService',
-            'service' => \App\JsonRpc\WebsiteServiceInterface::class,
-            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
-            'nodes' => [
-                ['host' => '127.0.0.1', 'port' => 9502],
-            ],
-        ],
-        [
-            //公共方法
-            'name' => 'PublicRpcService',
-            'service' => \App\JsonRpc\PublicRpcServiceInterface::class,
-            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
-            'nodes' => [
-                ['host' => '127.0.0.1', 'port' => 9502],
-            ],
-        ],
-        [
-            //资讯-新闻
-            'name' => 'NewsService',
-            'service' => \App\JsonRpc\NewsServiceInterface::class,
-            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
-            'nodes' => [
-                ['host' => '127.0.0.1', 'port' => 9505],
-            ],
-        ],
-        [
-            //友情链接服务
-            'name' => 'LinkService',
-            'service' => \App\JsonRpc\LinkServiceInterface::class,
-            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
-            'nodes' => [
-                ['host' => '127.0.0.1', 'port' => 9502],
-            ],
-        ],
-        [
-            //友情链接服务
-            'name' => 'ChatService',
-            'service' => \App\JsonRpc\ChatServiceInterface::class,
-            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
-            'nodes' => [
-                ['host' => '127.0.0.1', 'port' => 9507],
-            ],
-        ],
-        [
-            //广告订单服务
-            'name' => 'OrderService',
-            'service' => \App\JsonRpc\OrderServiceInterface::class,
-            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
-            'nodes' => [
-                ['host' => '127.0.0.1', 'port' => 9508],
-            ],
-        ],
-        [
-            //采集服务
-            'name' => 'CollectorService',
-            'service' => \App\JsonRpc\CollectorServiceInterface::class,
-
-            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
-            'nodes' => [
-                ['host' => '127.0.0.1', 'port' => 9509],
-            ],
-        ],
-    ],
-];
+<?php
+
+return [
+    'consumers' => [
+        [
+            // 用戶中心
+            'name' => 'UserService',
+            'service' => \App\JsonRpc\UserServiceInterface::class,
+            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
+            'nodes' => [
+                ['host' => '127.0.0.1', 'port' => 9504],
+            ],
+        ],
+        [
+            // 权限管理
+            'name' => 'AuthorityService',
+            'service' => \App\JsonRpc\AuthorityServiceInterface::class,
+            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
+            'nodes' => [
+                ['host' => '127.0.0.1', 'port' => 9504],
+            ],
+        ],
+        [
+            // 广告中心
+            'name' => 'AdService',
+            'service' => \App\JsonRpc\AdServiceInterface::class,
+            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
+            'nodes' => [
+                ['host' => '127.0.0.1', 'port' => 9503],
+            ],
+        ],
+        [
+            //网站管理
+            'name' => 'WebsiteService',
+            'service' => \App\JsonRpc\WebsiteServiceInterface::class,
+            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
+            'nodes' => [
+                ['host' => '127.0.0.1', 'port' => 9502],
+            ],
+        ],
+        [
+            //公共方法
+            'name' => 'PublicRpcService',
+            'service' => \App\JsonRpc\PublicRpcServiceInterface::class,
+            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
+            'nodes' => [
+                ['host' => '127.0.0.1', 'port' => 9502],
+            ],
+        ],
+        [
+            //资讯-新闻
+            'name' => 'NewsService',
+            'service' => \App\JsonRpc\NewsServiceInterface::class,
+            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
+            'nodes' => [
+                ['host' => '127.0.0.1', 'port' => 9505],
+            ],
+        ],
+        [
+            //友情链接服务
+            'name' => 'LinkService',
+            'service' => \App\JsonRpc\LinkServiceInterface::class,
+            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
+            'nodes' => [
+                ['host' => '127.0.0.1', 'port' => 9502],
+            ],
+        ],
+        [
+            //商圈服务
+            'name' => 'ChatService',
+            'service' => \App\JsonRpc\ChatServiceInterface::class,
+            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
+            'nodes' => [
+                ['host' => '127.0.0.1', 'port' => 9507],
+            ],
+        ],
+        [
+            //广告订单服务
+            'name' => 'OrderService',
+            'service' => \App\JsonRpc\OrderServiceInterface::class,
+            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
+            'nodes' => [
+                ['host' => '127.0.0.1', 'port' => 9508],
+            ],
+        ],
+        [
+            //采集器服务
+            'name' => 'CollectorService',
+            'service' => \App\JsonRpc\CollectorServiceInterface::class,
+
+            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
+            'nodes' => [
+                ['host' => '127.0.0.1', 'port' => 9509],
+            ],
+        ],
+        [
+            //底部导航服务
+            'name' => 'FooterService',
+            'service' => \App\JsonRpc\FooterServiceInterface::class,
+            // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
+            'nodes' => [
+                ['host' => '127.0.0.1', 'port' => 9502],
+            ],
+        ],
+    ],
+];

+ 1 - 0
config/routes.php

@@ -36,4 +36,5 @@ require __DIR__ . '/api/website.php';
 require __DIR__ . '/api/web.php';
 require __DIR__ . '/api/web.php';
 require __DIR__ . '/api/order.php';
 require __DIR__ . '/api/order.php';
 require __DIR__ . '/api/collector.php';
 require __DIR__ . '/api/collector.php';
+require __DIR__ . '/api/footer.php';