From 74b61e313ac206a25ea8eb81e0b402adbb79eaa9 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 21 Oct 2022 10:32:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E4=B8=8B=E8=AF=95=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/utils/ScanContentUtils.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java index 6427301a18..728263e229 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java @@ -3,6 +3,7 @@ package com.epmet.commons.tools.utils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.TypeReference; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.scan.param.*; @@ -16,6 +17,7 @@ import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; /** * 扫描内容工具类 @@ -31,6 +33,15 @@ public class ScanContentUtils { * @return */ public static Result imgSyncScan(String url, ImgScanParamDTO param) { + //start 测试环境停机了,先这样改试试 + EnvEnum currentEnv = EnvEnum.getCurrentEnv(); + if(EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())){ + SyncScanResult syncScanResult=new SyncScanResult(); + syncScanResult.setSuccessDataIds(param.getTasks().stream().map(c -> c.getDataId()).collect(Collectors.toList())); + syncScanResult.setAllPass(true); + return new Result().ok(syncScanResult); + }//end + log.debug("imgSyncScan param:{}", JSON.toJSONString(param)); if (StringUtils.isBlank(url) || param == null) { throw new RenException("参数错误"); @@ -57,6 +68,15 @@ public class ScanContentUtils { * @return */ public static Result textSyncScan(String url, TextScanParamDTO param) { + //start 测试环境停机了,先这样改试试 + EnvEnum currentEnv = EnvEnum.getCurrentEnv(); + if(EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())){ + SyncScanResult syncScanResult=new SyncScanResult(); + syncScanResult.setSuccessDataIds(param.getTasks().stream().map(c -> c.getDataId()).collect(Collectors.toList())); + syncScanResult.setAllPass(true); + return new Result().ok(syncScanResult); + }//end + log.debug("textSyncScan param:{}", JSON.toJSONString(param)); if (StringUtils.isBlank(url) || param == null) { throw new RenException("参数错误");