This commit is contained in:
huangzhhui 2020-07-20 00:39:49 +08:00
parent 9b1d4ae3cb
commit 9f682b4cc4
2 changed files with 12 additions and 12 deletions

View File

@ -131,7 +131,7 @@ class NacosInstance extends AbstractNacos
/** @var InstanceModel $node */
foreach ($nodes as $node) {
$loadNodes[] = new Node($node->ip, $node->port, $node->weight);
$key = sprintf('%s:%d', $node->host, $node->port);
$key = sprintf('%s:%d', $node->ip, $node->port);
$nacosNodes[$key] = $node;
}

View File

@ -14,57 +14,57 @@ namespace Hyperf\Nacos\Model;
class InstanceModel extends AbstractModel
{
/**
* @var string
* @var string|null
*/
public $serviceName;
/**
* @var string
* @var string|null
*/
public $groupName;
/**
* @var string
* @var string|null
*/
public $ip;
/**
* @var int
* @var int|null
*/
public $port;
/**
* @var string
* @var string|null
*/
public $clusterName;
/**
* @var string
* @var string|null
*/
public $namespaceId;
/**
* @var float|float|int
* @var float|float|int|null
*/
public $weight;
/**
* @var string
* @var string|null
*/
public $metadata;
/**
* @var bool
* @var bool|null
*/
public $enabled;
/**
* @var bool
* @var bool|null
*/
public $ephemeral;
/**
* @var bool
* @var bool|null
*/
public $healthy;