Commit 5fb06474 by 翁国栋 Committed by 284718418@qq.com

区分出云盘文件

parent 9c3609e8
......@@ -68,6 +68,9 @@ public class DiskFilesController {
@ApiOperation(value = "上传普通文件", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> upload(@CurrentUser UserBean userBean, @RequestParam(required = true) MultipartFile[] file,
@ApiParam("文件文件夹或共享空间ID") @RequestParam(required = true) Integer catalogueId) {
if(catalogueId<=0){
return ResultUtil.error("上传失败,请选择文件夹");
}
if (file == null || file.length == 0) {
return ResultUtil.error("上传失败,请选择上传文件");
}
......@@ -108,7 +111,7 @@ public class DiskFilesController {
diskFilesLog.insert();
}
return ResultUtil.data(imageUrls);
return ResultUtil.data(diskFiles);
} catch (Exception e) {
e.printStackTrace();
}
......
......@@ -9,10 +9,12 @@ import com.google.common.base.Strings;
import com.google.common.collect.Maps;
import io.swagger.models.auth.In;
import org.bouncycastle.util.encoders.UrlBase64Encoder;
import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.UrlEncoded;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -64,6 +66,8 @@ public class HtzzController {
private String project_package;
@Value("${zip.path}")
private String zipPath;
@Value("${config-8timer.Aliyun.endpoint}")
private String endpoint;
/**
......@@ -305,12 +309,21 @@ public class HtzzController {
return ResultUtil.error("操作失败");
}
Map<String, String> url = Maps.newHashMap();
Map<String,String> ftp=Maps.newHashMap();
ids.forEach(i -> {
HtzzAdminZzda htzzAdminZzda = HtzzAdminZzda.builder().id(i).build().selectById();
/*格式化获取文字*/
String urla =UrlEncoded.decodeString(htzzAdminZzda.getZjfj());
int index = urla.indexOf(project_package);
url.put(htzzAdminZzda.getId() +"_"+ htzzAdminZzda.getZjmc(), urla.substring(index));
if(StringUtil.isNotBlank(htzzAdminZzda.getZjfj())){
/*格式化获取文字*/
String urla =UrlEncoded.decodeString(htzzAdminZzda.getZjfj());
/*判断是保存在oss还是ftp*/
if(urla.contains(endpoint.replace("http://","."))) {
int index = urla.indexOf(project_package);
url.put(htzzAdminZzda.getId() + "_" + htzzAdminZzda.getZjmc(), urla.substring(index));
}else {
//TODO 区分出云盘文件暂时不下载
ftp.put(htzzAdminZzda.getId()+"_"+htzzAdminZzda.getZjmc(),urla);
}
}
});
String zipUrl = null;
try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment