Commit 5e2bfda7 by fudahua

feat:存储桶

parent 0d371ad2
......@@ -2,6 +2,8 @@ package com.gic.cloud.data.hook.service.impl;
import cn.medubi.client.utils.LogPak;
import com.alibaba.fastjson.JSON;
import com.ctrip.framework.apollo.Config;
import com.ctrip.framework.apollo.ConfigService;
import com.gic.cloud.common.api.base.Page;
import com.gic.cloud.data.hook.api.dto.*;
import com.gic.cloud.data.hook.api.entity.DownloadTaskStatus;
......@@ -99,9 +101,27 @@ public class DownloadTaskServiceImpl implements IDownloadTaskService {
result.setList(preResult.getList()); // 设置数据集
result.setTotal(preResult.getTotal()); // 设置总数
result.setPageNum(preResult.getPageNum()); // 设置当前页数
if (CollectionUtils.isNotEmpty(result.getList())) {
for (DownloadTask downloadTask : result.getList()) {
downloadTask.setFilePath(getDownloadUrl(downloadTask.getFilePath(),downloadTask.getName()));
}
}
return result;
}
private String getDownloadUrl(String url,String filename) {
Config config = ConfigService.getConfig("COMMON.cloud.file.setting");
String hostUrl = config.getProperty("gic.proxy.url", null);
if (org.apache.commons.lang.StringUtils.isBlank(hostUrl)) {
return url;
}else{
int pos = url.lastIndexOf(".");
String ext = url.substring(pos);
return hostUrl+"/"+filename+ext+"?url="+url;
}
}
/** 创建下载任务
* @param task
* @return
......
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