Commit 462a7bb4 authored by 周健威's avatar 周健威

添加处理gtdata接口

parent 4fa2baba
...@@ -27,6 +27,8 @@ public class DataTempcache implements Serializable { ...@@ -27,6 +27,8 @@ public class DataTempcache implements Serializable {
public static final int UPTYPE_GTDATA = 2; public static final int UPTYPE_GTDATA = 2;
public static final int UPTYPE_URL = 3; public static final int UPTYPE_URL = 3;
public static final int UPTYPE_GTDIR = 4;
/** /**
* *
*/ */
...@@ -166,7 +168,7 @@ public class DataTempcache implements Serializable { ...@@ -166,7 +168,7 @@ public class DataTempcache implements Serializable {
private String remark; private String remark;
@Column(name = "uptype") @Column(name = "uptype")
@ApiModelProperty(value = "上传类型 1--文件上传;2--gtdata路径;3--url") @ApiModelProperty(value = "上传类型 1--文件上传;2--gtdata路径;3--url;4--gain")
private Integer uptype; private Integer uptype;
@Column(name = "upurl") @Column(name = "upurl")
......
...@@ -14,6 +14,7 @@ import com.github.wxiaoqi.security.common.util.process.SystemConfig; ...@@ -14,6 +14,7 @@ import com.github.wxiaoqi.security.common.util.process.SystemConfig;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.upyuns.platform.rs.gtdata.GtDataRestClient; import com.upyuns.platform.rs.gtdata.GtDataRestClient;
import com.upyuns.platform.rs.gtdata.GtFileInfo; import com.upyuns.platform.rs.gtdata.GtFileInfo;
import com.upyuns.platform.rs.universal.utils.DateUtil;
import com.upyuns.platform.rs.website.biz.DataTempcacheBiz; import com.upyuns.platform.rs.website.biz.DataTempcacheBiz;
import com.upyuns.platform.rs.website.entity.DataTempcache; import com.upyuns.platform.rs.website.entity.DataTempcache;
import com.upyuns.platform.rs.website.entity.FileData; import com.upyuns.platform.rs.website.entity.FileData;
...@@ -26,6 +27,7 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -26,6 +27,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -51,9 +53,37 @@ public class DataTempcacheController extends BaseController<DataTempcacheBiz,Dat ...@@ -51,9 +53,37 @@ public class DataTempcacheController extends BaseController<DataTempcacheBiz,Dat
//BaseController.baseLogicPages //BaseController.baseLogicPages
//BaseController.del //BaseController.del
@RequestMapping(value = "/app/unauth/dealGtdataDir", method = RequestMethod.GET)
@IgnoreUserToken
public ObjectRestResponse dealGtdataPath(String gtdataPaths) {
if(StrUtil.isBlank(gtdataPaths)) {
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "分布式路径不对");
}
String[] gtdataPathArray = gtdataPaths.split(",");
//创建临时目录
String gtdataDirPath = "/rscloudmart"+ tempcachePath + "/" + (new Date()).getTime();
gtDataRestClient.mkdirs(gtdataDirPath);
//循环判断复制数据
for(String gtdataPath : gtdataPathArray) {
Integer indexNum = StrUtil.lastIndexOfIgnoreCase(gtdataPath, "/");
//带/的filename
String fileName = gtdataPath.substring(indexNum, gtdataPath.length());
String targetPath = gtdataDirPath + fileName;
gtDataRestClient.copy(gtdataPath, targetPath);
}
return ObjectRestResponse.succ(gtdataDirPath);
}
@RequestMapping(value = "/app/unauth/dealGtdataPath", method = RequestMethod.GET) @RequestMapping(value = "/app/unauth/dealGtdataPath", method = RequestMethod.GET)
@IgnoreUserToken @IgnoreUserToken
public ObjectRestResponse dealGtdataPath(DataTempcache dataTempcache) throws Exception { public ObjectRestResponse dealGtdataPath(DataTempcache dataTempcache) {
//查询dataTempcache 的上传方式 //查询dataTempcache 的上传方式
DataTempcache dataTempcacheDB = baseBiz.selectById(dataTempcache.getId()); DataTempcache dataTempcacheDB = baseBiz.selectById(dataTempcache.getId());
String resultPath = ""; String resultPath = "";
......
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