refactor(dependencies): 移除eureka依赖
This commit is contained in:
@@ -8,7 +8,6 @@ import com.lanyuanxiaoyao.service.web.controller.base.AmisMapResponse;
|
||||
import com.lanyuanxiaoyao.service.web.controller.base.AmisResponse;
|
||||
import com.lanyuanxiaoyao.service.web.controller.base.BaseController;
|
||||
import com.lanyuanxiaoyao.service.web.entity.CloudServiceVO;
|
||||
import com.netflix.appinfo.InstanceInfo;
|
||||
import java.util.Map;
|
||||
import org.apache.curator.x.discovery.ServiceInstance;
|
||||
import org.eclipse.collections.api.block.function.Function;
|
||||
@@ -20,7 +19,6 @@ import org.eclipse.collections.api.map.MutableMap;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cloud.client.discovery.DiscoveryClient;
|
||||
import org.springframework.cloud.netflix.eureka.EurekaServiceInstance;
|
||||
import org.springframework.cloud.zookeeper.discovery.ZookeeperInstance;
|
||||
import org.springframework.cloud.zookeeper.discovery.ZookeeperServiceInstance;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -57,20 +55,6 @@ public class CloudController extends BaseController {
|
||||
instance.getUri().toString(),
|
||||
Maps.immutable.ofAll(instance.getMetadata())
|
||||
);
|
||||
if (instance instanceof EurekaServiceInstance) {
|
||||
EurekaServiceInstance eurekaServiceInstance = (EurekaServiceInstance) instance;
|
||||
InstanceInfo info = eurekaServiceInstance.getInstanceInfo();
|
||||
service.setActionType(info.getActionType().name());
|
||||
service.setStatus(info.getStatus().name());
|
||||
service.setUpdateTime(info.getLastUpdatedTimestamp());
|
||||
if (ObjectUtil.isNotNull(info.getLeaseInfo())) {
|
||||
service.setDuration(info.getLeaseInfo().getDurationInSecs());
|
||||
service.setRegistrationTime(info.getLeaseInfo().getRegistrationTimestamp());
|
||||
service.setLastRenewalTime(info.getLeaseInfo().getRenewalTimestamp());
|
||||
service.setEvictionTime(info.getLeaseInfo().getEvictionTimestamp());
|
||||
service.setServiceUpTime(info.getLeaseInfo().getServiceUpTimestamp());
|
||||
}
|
||||
}
|
||||
if (instance instanceof ZookeeperServiceInstance) {
|
||||
ZookeeperServiceInstance zookeeperServiceInstance = (ZookeeperServiceInstance) instance;
|
||||
ServiceInstance<ZookeeperInstance> serviceInstance = zookeeperServiceInstance.getServiceInstance();
|
||||
|
||||
Reference in New Issue
Block a user