linkedHashMap转对象

2017-12-20  本文已影响0人  炒面Z
   ObjectMapper mapper = new ObjectMapper();
        List<TableColumns> columns = mapper.convertValue(params.get("columns"), new TypeReference<List<TableColumns>>() {
        });
    //第一步缓存参数
    @SuppressWarnings("unchecked")
    @RequestMapping(value = "/export")
    @ResponseBody
    public R export(@RequestBody ExcelParam excelParam) {
        Assert.notNull(excelParam,"参数不能为空");
        Assert.notNull(excelParam.getUrl(),"url参数不能为空");
        Assert.notNull(excelParam.getColumns(),"columns参数不能为空");
        Assert.notNull(excelParam.getFileName(),"fileName参数不能为空");
        String key = UUID.randomUUID().toString();
        excelParamCache.put(key,excelParam);
        return CommonUtils.msg(key);
    }
上一篇 下一篇

猜你喜欢

热点阅读