0
点赞
收藏
分享

微信扫一扫

C#将货币金额数字转大写汉字

双井暮色 2024-01-18 阅读 11

springboot版本3.2.0,数据库版本8

mybatisplus版本3.5.4.1

controller层
    @PostMapping("/import")
    @ResponseBody
    public List<User> excelUpload( MultipartFile file) throws IOException{
        if (file==null){
            System.out.println("文件为空");
        }
      List<User> userList= EasyExcel.read(file.getInputStream(), User.class,new UserUploadListener(userService))
              .head(User.class)
               .sheet()
               .doReadSync();
        System.out.println(userList);
       return userList;
    }
测试结果
后端返回数据

Postman返回数据

注意

使用postman进行测试时,需要把key传进去,不然会报空文件异常,

举报

相关推荐

0 条评论