wudner/rediscovery

rediscovery

v1.0 2020-08-11 06:45 UTC

This package is not auto-updated.

Last update: 2024-04-11 23:30:18 UTC


README

介绍

swoft服务注册小工具

安装教程

composer require wudner/rediscovery

使用说明

bean配置:

"rediscovery"=>[
        "class"=>\Wudner\Rediscovery\Bean\Rediscovery::class,
        'host'=>'192.168.25.234',                           // 注册中心IP
        'port'=>18331,                                      // 注册中心端口
        'sync'=>\Wudner\Rediscovery\Config\Sync::ALL        // 同步方式 目前只支持RPC
    ]
@ServiceRegister注解使用:

作用于控制器

/**
 * Class ServiceService
 * @package App\Rpc
 * @Service()
 * @ServiceRegister(title="service服务",description="service的服务")
 */
class ServiceService implements ServiceInterface
{
    
}

作用于方法

/**
     * @return array
     * @ServiceRegister(title="list",description="list方法")
     */
    public function list():array {
        return [
            "code"=>1,
            "message"=>"service OK"
        ];
    }

源码地址