Commit 72077691 authored by 周健威's avatar 周健威

修改问题

parent 542ccd85
......@@ -750,6 +750,23 @@ public class GtDataRestClient {
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环境使用)
......
......@@ -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.CommonBaseController;
import com.upyuns.platform.rs.datacenter.entity.RscpAreaInfo;
import com.upyuns.platform.rs.gtdata.GtDataRestClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -25,13 +27,18 @@ import java.net.URLEncoder;
@Slf4j
@RequestMapping("/web/gtdata/")
public class GtdataController extends CommonBaseController {
@Autowired
GtDataRestClient gtDataRestClient;
@RequestMapping(value = "/app/unauth/image/**", method = RequestMethod.GET)
@IgnoreUserToken
public void queryAreaInfoByAreaId() throws Exception {
String url = request.getRequestURI();
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;
}
......
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