liurunyu
2025-01-13 f62e059353b86b7d18958dbeaa17cdebcc2093c2
上传视频接口中增加缩略图属性
2个文件已修改
26 ■■■■■ 已修改文件
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/dyFile/FileOperate.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/webCtrls/WebFileCtrl.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/dyFile/FileOperate.java
@@ -101,6 +101,27 @@
    }
    /**
     * 通过视频路径,得到对应缩略图的路径
     * @param videoPath
     * @return
     */
    public String getVideoFileZipPath(String videoPath, String extName){
        String path_ = null ;
        String prePath = null ;
        if(videoPath != null && !videoPath.trim().equals("")) {
            int lastDotIndex = videoPath.lastIndexOf('.');
            if (lastDotIndex >= 0) {
                prePath = videoPath.substring(0, lastDotIndex);
                path_ = prePath + "_." + extName ;
            }
        }
        if(path_ == null){
            path_ = videoPath ;
        }
        return path_ ;
    }
    /**
     * web分布式文件系统保存文件
     * @param file
     * @param fmUrl
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/webCtrls/WebFileCtrl.java
@@ -37,6 +37,9 @@
    @Value("${dy.webFile.supportedFileTypes}")
    private String supportedFileTypes ;
    //视频的缩略图的扩展名
    private static final String VideoZipPicFileType = "jpg";
    /**
     * 上传照片图片文件 (当前只对png jpg格式图片支持缩略图)
     * @param file web端上传文件的post对象
@@ -153,7 +156,7 @@
                                fileNameGrp[0],
                                fileNameGrp[1],
                                frVo.getFileWebUrl() + frVo.getFileWebPath(),
                                null,
                                fileOp.getVideoFileZipPath(frVo.getFileWebUrl() + frVo.getFileWebPath(), VideoZipPicFileType),
                                frVo.fileWebDownloadPath + id) ;
                        return  BaseResponseUtils.buildSuccess(fvo) ;
                    }else {