ing
This commit is contained in:
parent
343b2f1f58
commit
65e10cfc1a
|
@ -246,6 +246,8 @@ public class CentralInfraService implements InfraService {
|
||||||
infraHostPort = this.infraHostPortService.regist(infraHostPort);
|
infraHostPort = this.infraHostPortService.regist(infraHostPort);
|
||||||
|
|
||||||
com.loafle.overflow.model.infra.InfraService infraService = new com.loafle.overflow.model.infra.InfraService();
|
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.setInfraHostPort(infraHostPort);
|
||||||
infraService.setMetaCryptoType(metaCryptoType);
|
infraService.setMetaCryptoType(metaCryptoType);
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
package com.loafle.overflow.central.proxy;
|
package com.loafle.overflow.central.proxy;
|
||||||
|
|
||||||
import com.google.gson.internal.Primitives;
|
|
||||||
import com.google.protobuf.ByteString;
|
import com.google.protobuf.ByteString;
|
||||||
import com.loafle.overflow.core.exception.OverflowException;
|
import com.loafle.overflow.core.exception.OverflowException;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.JavaType;
|
import com.fasterxml.jackson.databind.JavaType;
|
||||||
|
|
||||||
|
import org.springframework.aop.support.AopUtils;
|
||||||
import org.springframework.beans.BeansException;
|
import org.springframework.beans.BeansException;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
|
@ -76,8 +77,8 @@ public class ServiceInvoker {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Method getMethod(String methodName) {
|
private Method getMethod(String methodName) {
|
||||||
// Class<?> clazz = AopUtils.getTargetClass(serviceCache.bean);
|
Class<?> clazz = AopUtils.getTargetClass(serviceCache.bean);
|
||||||
Class<?> clazz = serviceCache.bean.getClass();
|
// Class<?> clazz = serviceCache.bean.getClass();
|
||||||
Method[] methods = clazz.getMethods();
|
Method[] methods = clazz.getMethods();
|
||||||
|
|
||||||
Method targetMethod = null;
|
Method targetMethod = null;
|
||||||
|
@ -120,7 +121,10 @@ public class ServiceInvoker {
|
||||||
|
|
||||||
private Object getValue(Type parameterType, String json) throws IllegalArgumentException {
|
private Object getValue(Type parameterType, String json) throws IllegalArgumentException {
|
||||||
JavaType targetType = objectMapper.getTypeFactory().constructType(parameterType);
|
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 {
|
try {
|
||||||
return objectMapper.readValue(json, targetType);
|
return objectMapper.readValue(json, targetType);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user