Commit 54af3725 authored by unset's avatar unset

Merge remote-tracking branch 'origin/dev' into dev

parents 15c84da9 d376c0a8
...@@ -750,6 +750,23 @@ public class GtDataRestClient { ...@@ -750,6 +750,23 @@ public class GtDataRestClient {
return open(path, defaultSign, defaultTime); return open(path, defaultSign, defaultTime);
} }
/**
*
* Description:根据路径读取文件内容的请求地址 如果出现内存溢出,请使用openLarge(只能在Linux环境使用)
*
* @see #openLarge(String, String)
*
* @param path
* @return url
*
*/
public String openUrl(String path) {
String resourceUrl = MessageFormat
.format("{0}{1}?op=OPEN&sign={2}&time={3}", gtDataUrl, path,
defaultSign, defaultTime);
return resourceUrl;
}
/** /**
* *
* Description:根据路径读取文件内容(小文件,1G以内的) 如果出现内存溢出,请使用openLarge(只能在Linux环境使用) * Description:根据路径读取文件内容(小文件,1G以内的) 如果出现内存溢出,请使用openLarge(只能在Linux环境使用)
......
...@@ -6,7 +6,9 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; ...@@ -6,7 +6,9 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController; import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.rest.CommonBaseController; import com.github.wxiaoqi.security.common.rest.CommonBaseController;
import com.upyuns.platform.rs.datacenter.entity.RscpAreaInfo; import com.upyuns.platform.rs.datacenter.entity.RscpAreaInfo;
import com.upyuns.platform.rs.gtdata.GtDataRestClient;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.FileCopyUtils; import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -25,13 +27,18 @@ import java.net.URLEncoder; ...@@ -25,13 +27,18 @@ import java.net.URLEncoder;
@Slf4j @Slf4j
@RequestMapping("/web/gtdata/") @RequestMapping("/web/gtdata/")
public class GtdataController extends CommonBaseController { public class GtdataController extends CommonBaseController {
@Autowired
GtDataRestClient gtDataRestClient;
@RequestMapping(value = "/app/unauth/image/**", method = RequestMethod.GET) @RequestMapping(value = "/app/unauth/image/**", method = RequestMethod.GET)
@IgnoreUserToken @IgnoreUserToken
public void queryAreaInfoByAreaId() throws Exception { public void queryAreaInfoByAreaId() throws Exception {
String url = request.getRequestURI(); String url = request.getRequestURI();
String fileName = url.substring(url.lastIndexOf("/")+1); String fileName = url.substring(url.lastIndexOf("/")+1);
downloadVideoById(fileName, "https://box.bdimg.com/static/fisp_static/common/img/searchbox/logo_news_276_88_1f9876a.png", getResponse()); // String filePath = "/obt/thumbnail/"+ url.substring(url.lastIndexOf("/app/unauth/image/")+18);
String filePath = "/obt/thumbnail/data/VDM2/20200613/VDM2_20200525232637_0015_L1_MSS_CMOS5/VDM2_20200525232637_0015_L1_MSS_CMOS5_98_98.jpg";
filePath = gtDataRestClient.openUrl(filePath);
downloadVideoById(fileName, filePath, getResponse());
return; 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