spring mvc接收json传参,使用postman模拟数据

记录一下spring mvc接收复杂的json传参

 @PostMapping("/createGrayPublish")
    @ResponseBody
    public Object createGrayPublish(Long sheetId,  @RequestBody CreateStrategyModel createStrategyModel) throws ServiceException{
        try {
            System.out.println(createStrategyModel);
            return renderSuccess(null);
        } catch (Exception e) {
            logger.error("DeviceController createGrayPublish Fail {} {}", sheetId, JSON.toJSONString(createStrategyModel), e);
            throw convertToServiceException(ErrCode.SYSTEM_ERROR);
        }
    }

postman截图如下

 

posted @ 2018-07-18 14:24  kangjianrong  阅读(1072)  评论(0编辑  收藏  举报