diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraService.java index 7fe93a3..8ad512d 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraService.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraService.java @@ -246,6 +246,8 @@ public class CentralInfraService implements InfraService { infraHostPort = this.infraHostPortService.regist(infraHostPort); com.loafle.overflow.model.infra.InfraService infraService = new com.loafle.overflow.model.infra.InfraService(); + infraService.setMetaInfraType(MetaInfraType.Enum.SERVICE.to()); + infraService.setProbe(probe); infraService.setInfraHostPort(infraHostPort); infraService.setMetaCryptoType(metaCryptoType); diff --git a/src/main/java/com/loafle/overflow/central/proxy/ServiceInvoker.java b/src/main/java/com/loafle/overflow/central/proxy/ServiceInvoker.java index 72771aa..eec8d37 100644 --- a/src/main/java/com/loafle/overflow/central/proxy/ServiceInvoker.java +++ b/src/main/java/com/loafle/overflow/central/proxy/ServiceInvoker.java @@ -1,11 +1,12 @@ package com.loafle.overflow.central.proxy; -import com.google.gson.internal.Primitives; import com.google.protobuf.ByteString; import com.loafle.overflow.core.exception.OverflowException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JavaType; + +import org.springframework.aop.support.AopUtils; import org.springframework.beans.BeansException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; @@ -76,8 +77,8 @@ public class ServiceInvoker { } private Method getMethod(String methodName) { - // Class clazz = AopUtils.getTargetClass(serviceCache.bean); - Class clazz = serviceCache.bean.getClass(); + Class clazz = AopUtils.getTargetClass(serviceCache.bean); + // Class clazz = serviceCache.bean.getClass(); Method[] methods = clazz.getMethods(); Method targetMethod = null; @@ -120,7 +121,10 @@ public class ServiceInvoker { private Object getValue(Type parameterType, String json) throws IllegalArgumentException { JavaType targetType = objectMapper.getTypeFactory().constructType(parameterType); - if (!Primitives.isPrimitive(parameterType) && !parameterType.getTypeName().equals(String.class.getName())) { + + if (!targetType.isPrimitive() && !parameterType.getTypeName().equals(String.class.getName())) { + // if (!Primitives.isPrimitive(parameterType) && + // !parameterType.getTypeName().equals(String.class.getName())) { try { return objectMapper.readValue(json, targetType); } catch (IOException e) {