From 8d927491ef5c637dcef8364bf8ba48e359c2ff4e Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Fri, 30 Aug 2024 17:30:45 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-?= =?UTF-8?q?=E5=BA=9F=E5=BC=83public=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1234808854773760]后端-废弃public接口 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1234808854773760 --- ...tInspectAccessEndPointScriptPublicApi.java | 73 ------------------- 1 file changed, 73 deletions(-) delete mode 100644 src/main/java/neatlogic/module/inspect/api/report/GetInspectAccessEndPointScriptPublicApi.java diff --git a/src/main/java/neatlogic/module/inspect/api/report/GetInspectAccessEndPointScriptPublicApi.java b/src/main/java/neatlogic/module/inspect/api/report/GetInspectAccessEndPointScriptPublicApi.java deleted file mode 100644 index 855cd2d..0000000 --- a/src/main/java/neatlogic/module/inspect/api/report/GetInspectAccessEndPointScriptPublicApi.java +++ /dev/null @@ -1,73 +0,0 @@ -package neatlogic.module.inspect.api.report; - -import neatlogic.framework.cmdb.crossover.IResourceCrossoverMapper; -import neatlogic.framework.cmdb.exception.resourcecenter.ResourceNotFoundException; -import neatlogic.framework.common.constvalue.ApiParamType; -import neatlogic.framework.crossover.CrossoverServiceFactory; -import neatlogic.framework.inspect.dao.mapper.InspectMapper; -import neatlogic.framework.inspect.dto.InspectResourceScriptVo; -import neatlogic.framework.restful.annotation.*; -import neatlogic.framework.restful.constvalue.OperationTypeEnum; -import neatlogic.framework.restful.core.publicapi.PublicApiComponentBase; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.collections4.MapUtils; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -@Service -@OperationType(type = OperationTypeEnum.SEARCH) -public class GetInspectAccessEndPointScriptPublicApi extends PublicApiComponentBase { - - @Resource - private InspectMapper inspectMapper; - - @Override - public String getName() { - return "根据资源id获取对应访问入口脚本信息"; - } - - @Override - public String getToken() { - return "inspect/accessendpoint/script/get/public"; - } - - @Override - public String getConfig() { - return null; - } - - @Input({ - @Param(name = "resourceId", isRequired = true, type = ApiParamType.LONG, desc = "资源id") - }) - @Output({ - @Param(explode = InspectResourceScriptVo.class) - }) - @Description(desc = "根据资源id获取对应访问入口脚本信息") - @Override - public Object myDoService(JSONObject paramObj) throws Exception { - JSONObject returnObject = new JSONObject(); - Long resourceId = paramObj.getLong("resourceId"); - IResourceCrossoverMapper resourceCrossoverMapper = CrossoverServiceFactory.getApi(IResourceCrossoverMapper.class); - if (resourceCrossoverMapper.checkResourceIsExists(resourceId) == 0) { - throw new ResourceNotFoundException(resourceId); - } - InspectResourceScriptVo resourceScriptVo = inspectMapper.getResourceScriptByResourceId(resourceId); - if (resourceScriptVo == null) { - return new JSONObject(); - } - JSONObject config = resourceScriptVo.getConfig(); - if (MapUtils.isNotEmpty(config)) { - String type = config.getString("type"); - if (StringUtils.equals(type, "urlConfig")) { - returnObject.put("config", config.getJSONArray("config")); - } else if (StringUtils.equals(type, "script")) { - returnObject.put("config", config.getJSONObject("config")); - } - } - returnObject.put("scriptId", resourceScriptVo.getScriptId()); - returnObject.put("resourceId", resourceScriptVo.getResourceId()); - return returnObject; - } -} -- Gitee