chengyouling commented on code in PR #3942: URL: https://github.com/apache/servicecomb-java-chassis/pull/3942#discussion_r1326689648
########## service-registry/registry-nacos/src/main/java/org/apache/servicecomb/registry/nacos/NacosDiscoveryInstance.java: ########## @@ -0,0 +1,133 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.registry.nacos; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.servicecomb.config.MicroserviceProperties; +import org.apache.servicecomb.registry.api.AbstractDiscoveryInstance; +import org.apache.servicecomb.registry.api.DataCenterInfo; +import org.apache.servicecomb.registry.api.MicroserviceInstanceStatus; +import org.springframework.util.CollectionUtils; + +import com.alibaba.nacos.api.naming.pojo.Instance; + +public class NacosDiscoveryInstance extends AbstractDiscoveryInstance { + private final NacosDiscoveryProperties nacosDiscoveryProperties; + + private final Instance instance; + + private final MicroserviceProperties microserviceProperties; + + private final Map<String, String> schemas = new HashMap<>(); + + public NacosDiscoveryInstance(Instance instance, NacosDiscoveryProperties nacosDiscoveryProperties, + MicroserviceProperties microserviceProperties) { + this.instance = instance; + this.nacosDiscoveryProperties = nacosDiscoveryProperties; + this.microserviceProperties = microserviceProperties; + } + + @Override + public MicroserviceInstanceStatus getStatus() { + return instance.isEnabled() ? MicroserviceInstanceStatus.UP : MicroserviceInstanceStatus.DOWN; + } + + @Override + public String getRegistryName() { + return NacosConst.NACOS_REGISTRY_NAME; + } + + @Override + public String getEnvironment() { + return nacosDiscoveryProperties.getNamespace(); + } + + @Override + public String getApplication() { + return microserviceProperties.getApplication(); Review Comment: no application or group info in instance, i have change it get from discovery application. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@servicecomb.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org