|
@@ -6,6 +6,7 @@ import io.netty.buffer.Unpooled;
|
|
import org.apache.commons.beanutils.BeanUtilsBean;
|
|
import org.apache.commons.beanutils.BeanUtilsBean;
|
|
import org.apache.commons.beanutils.Converter;
|
|
import org.apache.commons.beanutils.Converter;
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
+import org.springframework.http.MediaType;
|
|
|
|
|
|
@Configuration
|
|
@Configuration
|
|
public class CommonConfiguration {
|
|
public class CommonConfiguration {
|
|
@@ -26,6 +27,14 @@ public class CommonConfiguration {
|
|
return convert(aClass, JSON.toJSONBytes(o));
|
|
return convert(aClass, JSON.toJSONBytes(o));
|
|
}
|
|
}
|
|
}, ByteBuf.class);
|
|
}, ByteBuf.class);
|
|
|
|
+
|
|
|
|
+ BeanUtilsBean.getInstance().getConvertUtils().register(new Converter() {
|
|
|
|
+ @Override
|
|
|
|
+ public <T> T convert(Class<T> aClass, Object o) {
|
|
|
|
+ return (T) MediaType.valueOf(String.valueOf(o));
|
|
|
|
+ }
|
|
|
|
+ }, MediaType.class);
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|