1、如果默认不加注解,默认是@RequestParam
public GeneralResult investmentAnalysis(@RequestParam(value = "queryType") String queryType, @RequestParam(value = "token") String token, InvestmentAnalysisDto dto)
2、提交json格式的数据,用@RequestBody绑定参数
json.stringify()
本文详细解析了Spring MVC中@RequestParam和@RequestBody注解的使用场景和方法,通过具体示例展示了如何利用这些注解进行参数绑定,是Spring框架学习者不可多得的参考资料。
1、如果默认不加注解,默认是@RequestParam
public GeneralResult investmentAnalysis(@RequestParam(value = "queryType") String queryType, @RequestParam(value = "token") String token, InvestmentAnalysisDto dto)
2、提交json格式的数据,用@RequestBody绑定参数
json.stringify()

被折叠的 条评论
为什么被折叠?