|
@@ -27,13 +27,13 @@ public class AliOssServiceImpl implements AliOssService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Result batchDownload(List<String> code) {
|
|
|
+ public Result batchDownload(List<String> code, String bucket) {
|
|
|
log.info("输入场景码数量: {}", code.size());
|
|
|
String outPath = configConstant.serverBasePath + "720yun_" + StrUtils.getTimeStr();
|
|
|
log.info("下载目录: {}", outPath);
|
|
|
int i = 1;
|
|
|
for (String sceneCode : code) {
|
|
|
- downloadOss(sceneCode, outPath);
|
|
|
+ downloadOss(sceneCode, outPath, bucket);
|
|
|
log.info("第:{} 下载完成, 场景为:{}", i, sceneCode);
|
|
|
i++;
|
|
|
}
|
|
@@ -46,11 +46,12 @@ public class AliOssServiceImpl implements AliOssService {
|
|
|
* 下载oss目录
|
|
|
* @outPath 下载时会以目录形式下载, 指定输出根目录
|
|
|
*/
|
|
|
- private void downloadOss(String sceneCode, String outPath){
|
|
|
+ private void downloadOss(String sceneCode, String outPath, String bucket){
|
|
|
String cmd = CmdConstant.OSSUTIL_DOWNLOAD_DIR;
|
|
|
String inPath = PathConstant.OSS_720YUN_MANAGE + File.separator + sceneCode;
|
|
|
cmd = cmd.replaceAll("@inPath", inPath);
|
|
|
cmd = cmd.replaceAll("@outPath", outPath);
|
|
|
+ cmd = cmd.replaceAll("@bucket", bucket);
|
|
|
log.info("ossCmd: " + cmd);
|
|
|
long start = System.currentTimeMillis();
|
|
|
CmdUtils.callshell(cmd);
|