qm1995 / jsondemo Goto Github PK
View Code? Open in Web Editor NEW这是个springboot 自定义解析json参数的project
这是个springboot 自定义解析json参数的project
/**
map转换器
@author: qiumin
**/
@deprecated
public class MapConverter implements Converter{
/**
@OverRide
public boolean support(Class<?> clazz) {
return ConverterUtil.isMapType(clazz);
}
}
没有新的方法能够代替,是因为有什么问题吗
去掉@EnableWebMvc
@Autowired
private RequestMappingHandlerAdapter requestMappingHandlerAdapter;
@Autowired
private RequestJsonHandler requestJsonHandler;
@PostConstruct
public void init() {
// 获取内建的resolvers
List<HandlerMethodArgumentResolver> buildInList = requestMappingHandlerAdapter.getArgumentResolvers();
// 重建resolvers
List<HandlerMethodArgumentResolver> newResolvers = new ArrayList<>(buildInList.size() + 1);
// 自定义的放到第一位
newResolvers.add(requestJsonHandler);
// 再放内建的
newResolvers.addAll(buildInList);
// 重设resolvers
requestMappingHandlerAdapter.setArgumentResolvers(newResolvers);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.