来自于org.springframework.web.bind.annotaion
1. RequestParam
接收来自Request参数,通常用于GET请求
用来处理Content-Type 为 application/x-www-form-undencoded编码的内容时也可用于其它类型的请求,例如:POST、DELETE等请求。
2. RequestBody
接收来自Request请求体参数,通常用于POST请求,不能用于GET
一般用于处理非 Content-Type: application/x-www-form-urlencoded编码格式的数据,比如:application/json、application/xml等类型的数据。
3. RequestHeader
取RequestHeader中的值
4. PathVariable
路径变量,可以取路径中的占位符
|
5. ModelAttribute
我这里用ModelAttribute来接收GET方法的参数,将参数放到model对象里
可以注解在方法上、参数上。具体使用方法其实没搞明白
6. ParameterConvert(自定义注解)
springboot接口入参下划线转驼峰以及返回参数驼峰转下划线实现_springboot restful get请求参数 字段名使用下划线-优快云博客