1.接收参数,无非前端发过来就两种方式
①application/x-www-form-urlencoded
②application/json
前端contentType:application/x-www-form-urlencoded
1.public ResponseVo register(@RequestParam(value="username") String username)
//或者直接用对象接收
2.public ResponseVo register(User user)
前端contentType:application/json
public ResponseVo register(@RequestBody User user)
返回Json格式
直接在ResponseVo对象上用注解
@JsonInclude(value=这个自己选 基本选 NOT_NULL)