| | |
| | | } |
| | | |
| | | /** |
| | | * 通过视频路径,得到对应缩略图的路径 |
| | | * @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 |
| | |
| | | @Value("${dy.webFile.supportedFileTypes}") |
| | | private String supportedFileTypes ; |
| | | |
| | | //视频的缩略图的扩展名 |
| | | private static final String VideoZipPicFileType = "jpg"; |
| | | |
| | | /** |
| | | * 上传照片图片文件 (当前只对png jpg格式图片支持缩略图) |
| | | * @param file web端上传文件的post对象 |
| | |
| | | fileNameGrp[0], |
| | | fileNameGrp[1], |
| | | frVo.getFileWebUrl() + frVo.getFileWebPath(), |
| | | null, |
| | | fileOp.getVideoFileZipPath(frVo.getFileWebUrl() + frVo.getFileWebPath(), VideoZipPicFileType), |
| | | frVo.fileWebDownloadPath + id) ; |
| | | return BaseResponseUtils.buildSuccess(fvo) ; |
| | | }else { |