feign调用返回object类型转换成实体

    <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.9.8</version>
        </dependency> 
    /**
	 * @Description: 将数据转换到相应的容器
	 * @return
	 * @throws
	 */
	public static <T> T convertValue(Object bean, Class<T> clazz){
		try{
			ObjectMapper mapper = new ObjectMapper();
			return mapper.convertValue(bean, clazz);
		}catch(Exception e){
			logger.error("错误的转换:BeanUtil.convertValue() --->" + e.getMessage());
			return null;
		}
	}
原文地址:https://www.cnblogs.com/javalinux/p/14343130.html