第一种方法使用map中的lamboda的流方法

 List<User> list=    userService.list();

        

   List<UserDTO>  listvo=    list.stream().map((obj)->{
            UserDTO userDTO = new UserDTO();
            BeanUtils.copyProperties(obj,userDTO);
                 return userDTO;
        }).toList();