未调用自定义RequestBodyAdvice

新建一个package,加入了controller及service,当请求进入controller时,总是没有调用自定义的RequestBodyAdvice,导致不能解密客户端的请求数据,与同一工程其他pack对比,没发现异常,折腾到下班,被其他事情搔扰,没搞定, 第二天建立一个测试package,建立 controller,从正常的controller中复制一个方法过来,测试controller运行正常,再回到不正常的controller中的方法

    @RequestMapping(value="/test/get",method = RequestMethod.POST)
    @ResponseBody
    @SecurityParameter
    public MyRetEntity getTestData(MyRequestModel mInObj) {
        return null ;
    } ;

  仔细与正常的比对,大爷的,在 MyRequestModel mInObj前少了 @RequestBody  注解,应该为:

    @RequestMapping(value="/test/get",method = RequestMethod.POST)
    @ResponseBody
    @SecurityParameter
    public MyRetEntity getTestData(@RequestBody MyRequestModel mInObj) {
        return null ;
    } ;

  自吻以谢罪

MyRequestModel mInObj
posted @ 2019-08-30 17:33  唯起  阅读(942)  评论(0)    收藏  举报