| | |
| | | import org.springblade.common.config.FtpConfig; |
| | | import org.springblade.common.utils.FileUtil; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.oss.model.BladeFile; |
| | | import org.springblade.core.oss.model.OssFile; |
| | | import org.springblade.core.secure.annotation.PreAuth; |
| | |
| | | String fileType = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase(Locale.US); |
| | | //判断文件是不是zip类型 |
| | | if(!fileType.equals("zip")){ |
| | | map.put("data","上传文件类型不符!"); |
| | | return R.data(map); |
| | | // map.put("data","上传文件类型不符!"); |
| | | // return R.data(map); |
| | | throw new ServiceException("上传文件类型不符!必须是 zip 压缩文件格式!"); |
| | | } |
| | | //FileConfig.localtion是配置文件和config类生产的,测试demo可以直接把FileConfig.localtion替换成D:/test |
| | | String uuid = UUID.randomUUID().toString(); |
| | |
| | | String fileType = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase(Locale.US); |
| | | //判断文件是不是zip类型 |
| | | if(!fileType.equals("zip")){ |
| | | map.put("data","上传文件类型不符!"); |
| | | return R.data(map); |
| | | // map.put("data","上传文件类型不符!"); |
| | | // return R.data(map); |
| | | throw new ServiceException("上传文件类型不符!必须是 zip 压缩文件格式!"); |
| | | } |
| | | //FileConfig.localtion是配置文件和config类生产的,测试demo可以直接把FileConfig.localtion替换成D:/test |
| | | String uuid = UUID.randomUUID().toString(); |