管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-12-30 afb74b6bb1dbb3ea0c0f4eb206d803f30c60ffc2
src/main/java/com/lf/server/service/all/BaseUploadService.java
@@ -31,16 +31,9 @@
    public final Log log = LogFactory.getLog(getClass());
    /**
     * 查询目录
     */
    public String selectPath() {
        return pathHelper.getTempPathName();
    }
    /**
     * 查询文件
     */
    public List<MetaFileEntity> selectFiles(String subPath) throws IOException {
    public List<MetaFileEntity> selectFiles(String subPath, List<String> extList) throws IOException {
        String root = pathHelper.getConfig().getTempPath() + File.separator + subPath;
        File file = new File(root);
@@ -55,6 +48,13 @@
        List<MetaFileEntity> list = new ArrayList<MetaFileEntity>();
        for (File f : files) {
            String fileName = FileHelper.getFileName(f.getPath());
            if (null != extList) {
                String extName = FileHelper.getExtension(fileName);
                if (!extList.contains(extName)) {
                    continue;
                }
            }
            double sizes = FileHelper.sizeToMb(f.length());
            String filePath = subPath + File.separator + fileName;
@@ -71,6 +71,13 @@
    }
    /**
     * 查询目录
     */
    public String selectPath() {
        return pathHelper.getTempPathName();
    }
    /**
     * 上传文件
     */
    public <T> List<MetaFileEntity> uploadData(T t, String path, HttpServletRequest req, HttpServletResponse res) throws Exception {