sast接口对接,差task创建
This commit is contained in:
parent
ce4a511462
commit
e9cdf3d686
@ -7,4 +7,10 @@ public class SastUrlConstant {
|
|||||||
// public static final String baseUrl="http://39.155.212.109:22880";
|
// public static final String baseUrl="http://39.155.212.109:22880";
|
||||||
// 获取token
|
// 获取token
|
||||||
public static final String getToken="/api/login/noCaptcha";
|
public static final String getToken="/api/login/noCaptcha";
|
||||||
|
public static final String applicationExist = "/invoke/application/exists";
|
||||||
|
public static final String fileUpload = "/invoke/file/upload";
|
||||||
|
public static final String createIdentifiedLanguageTask = "/invoke/file/createIdentifiedLanguageTask";
|
||||||
|
public static final String getIdentifiedLanguageTaskStatus = "/invoke/file/getIdentifiedLanguageTaskStatus";
|
||||||
|
public static final String engineConfig = "/invoke/engine/config";
|
||||||
|
public static final String detectionConfig = "/invoke/project/setting/getDetectionConfig";
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
package cd.casic.ci.process.dto.req.sast;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
@Data
|
||||||
|
public class SastIdentifiedLanguageTaskReq {
|
||||||
|
private List<String> fileIds;
|
||||||
|
private String taskId;
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
package cd.casic.ci.process.dto.resp.sast;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SastDetectionConfigResp {
|
||||||
|
private List<Template> templateList;
|
||||||
|
private CompileConfig compileConfig;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class Template {
|
||||||
|
private String templateName;
|
||||||
|
private String templateId;
|
||||||
|
private String codeType;
|
||||||
|
private String codeLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class CompileConfig {
|
||||||
|
private SourceConfig sourceConfig;
|
||||||
|
private BuildConfig buildConfig;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class SourceConfig {
|
||||||
|
private String name;
|
||||||
|
private List<String> version;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class BuildConfig {
|
||||||
|
private String name;
|
||||||
|
private List<String> compileTool;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package cd.casic.ci.process.dto.resp.sast;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SastEngineConfigResp {
|
||||||
|
private String id;
|
||||||
|
private String createdTime;
|
||||||
|
private String createdBy;
|
||||||
|
private String updatedTime;
|
||||||
|
private String updatedBy;
|
||||||
|
private String toolName;
|
||||||
|
private String toolType;
|
||||||
|
private String sourceFrom;
|
||||||
|
private String callType;
|
||||||
|
private Boolean status;
|
||||||
|
private String support;
|
||||||
|
private String version;
|
||||||
|
private String description;
|
||||||
|
private String baseUrl;
|
||||||
|
private String accessToken;
|
||||||
|
private String toolUserName;
|
||||||
|
private String toolPassword;
|
||||||
|
private Boolean integrated;
|
||||||
|
private String imageVersion;
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package cd.casic.ci.process.dto.resp.sast;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SastFileUploadResp {
|
||||||
|
private String id;
|
||||||
|
private String createdTime;
|
||||||
|
private String createdBy;
|
||||||
|
private String updatedTime;
|
||||||
|
private String updatedBy;
|
||||||
|
private String fileName;
|
||||||
|
private String bucketName;
|
||||||
|
private Object context; // 如果 context 结构复杂,可以进一步定义类
|
||||||
|
private String userId;
|
||||||
|
private String filePath;
|
||||||
|
private String repoId;
|
||||||
|
private String originalFileName;
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package cd.casic.ci.process.dto.resp.sast;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import net.bytebuddy.asm.Advice;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
@Data
|
||||||
|
public class SastIdentifiedLanguageTaskResp {
|
||||||
|
private LocalDateTime finishTime;
|
||||||
|
private List<SastLanguageTaskItem> languages;
|
||||||
|
private String part;
|
||||||
|
private String reason;
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
private String status;
|
||||||
|
private String taskId;
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
package cd.casic.ci.process.dto.resp.sast;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SastLanguageTaskItem {
|
||||||
|
private String id;
|
||||||
|
private String language;
|
||||||
|
private Boolean compileFlag;
|
||||||
|
}
|
@ -3,7 +3,7 @@ package cd.casic.ci.process.dto.resp.sast;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class TokenResp {
|
public class SastTokenResp {
|
||||||
private String accessToken;
|
private String accessToken;
|
||||||
private Integer expiresIn;
|
private Integer expiresIn;
|
||||||
private Integer refreshExpiresIn;
|
private Integer refreshExpiresIn;
|
@ -1,7 +1,20 @@
|
|||||||
package cd.casic.ci.process.process.service.sast;
|
package cd.casic.ci.process.process.service.sast;
|
||||||
|
|
||||||
import cd.casic.ci.process.dto.resp.sast.TokenResp;
|
import cd.casic.ci.process.dto.req.sast.SastIdentifiedLanguageTaskReq;
|
||||||
|
import cd.casic.ci.process.dto.resp.sast.SastDetectionConfigResp;
|
||||||
|
import cd.casic.ci.process.dto.resp.sast.SastEngineConfigResp;
|
||||||
|
import cd.casic.ci.process.dto.resp.sast.SastFileUploadResp;
|
||||||
|
import cd.casic.ci.process.dto.resp.sast.SastIdentifiedLanguageTaskResp;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface SastService {
|
public interface SastService {
|
||||||
String getToken();
|
String getToken();
|
||||||
|
Boolean applicationExist(String applicationName);
|
||||||
|
public SastFileUploadResp uploadFile(File multipartFile);
|
||||||
|
public SastIdentifiedLanguageTaskResp createIdentifiedLanguageTask(SastIdentifiedLanguageTaskReq req);
|
||||||
|
public SastIdentifiedLanguageTaskResp getIdentifiedLanguageTaskStatus(String taskId);
|
||||||
|
List<SastEngineConfigResp> engineConfig(List<String> languageIdList);
|
||||||
|
SastDetectionConfigResp detectionConfig(String languageId);
|
||||||
}
|
}
|
||||||
|
@ -1,22 +1,31 @@
|
|||||||
package cd.casic.ci.process.process.service.sast.impl;
|
package cd.casic.ci.process.process.service.sast.impl;
|
||||||
|
|
||||||
import cd.casic.ci.process.constant.SastUrlConstant;
|
import cd.casic.ci.process.dto.req.sast.SastIdentifiedLanguageTaskReq;
|
||||||
import cd.casic.ci.process.dto.resp.sast.TokenResp;
|
import cd.casic.ci.process.dto.resp.sast.*;
|
||||||
import cd.casic.ci.process.process.service.sast.SastService;
|
import cd.casic.ci.process.process.service.sast.SastService;
|
||||||
import cd.casic.ci.process.properties.SastProperties;
|
import cd.casic.ci.process.properties.SastProperties;
|
||||||
import cd.casic.framework.redis.core.RedisTemplateUtils;
|
import cd.casic.framework.redis.core.RedisTemplateUtils;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import kotlin.text.Charsets;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.http.HttpEntity;
|
import org.luaj.vm2.ast.Str;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.core.io.FileSystemResource;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.*;
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.LinkedMultiValueMap;
|
||||||
|
import org.springframework.util.MultiValueMap;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
import org.springframework.web.util.UriComponentsBuilder;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static cd.casic.ci.process.constant.SastUrlConstant.*;
|
import static cd.casic.ci.process.constant.SastUrlConstant.*;
|
||||||
@ -29,17 +38,17 @@ public class SastServiceImpl implements SastService {
|
|||||||
private SastProperties sastProperties;
|
private SastProperties sastProperties;
|
||||||
@Resource
|
@Resource
|
||||||
private RestTemplate restTemplate;
|
private RestTemplate restTemplate;
|
||||||
public static final String tokenPrefix = "Bearer";
|
public static final String TOKEN_PREFIX = "Bearer ";
|
||||||
public static final String tokenHeaderKey = "authorization";
|
public static final String TOKEN_HEADER_KEY = "authorization";
|
||||||
public static final String REDIS_SAST_TOKEN_KEY = "REDIS_SAST_TOKEN_KEY";
|
public static final String REDIS_SAST_TOKEN_KEY = "REDIS_SAST_TOKEN_KEY";
|
||||||
|
|
||||||
private TokenResp getTokenRemote(){
|
private SastTokenResp getTokenRemote(){
|
||||||
HttpHeaders httpHeaders = new HttpHeaders();
|
HttpHeaders httpHeaders = new HttpHeaders();
|
||||||
HttpEntity<SastProperties> httpEntity = new HttpEntity<SastProperties>(sastProperties,httpHeaders);
|
HttpEntity<SastProperties> httpEntity = new HttpEntity<SastProperties>(sastProperties,httpHeaders);
|
||||||
ResponseEntity<String> exchange = restTemplate.exchange(baseUrl+getToken, HttpMethod.POST, httpEntity, String.class, new HashMap<>());
|
ResponseEntity<String> exchange = restTemplate.exchange(baseUrl+getToken, HttpMethod.POST, httpEntity, String.class, new HashMap<>());
|
||||||
String body = exchange.getBody();
|
String body = exchange.getBody();
|
||||||
JSONObject bodyObject = JSON.parseObject(body);
|
JSONObject bodyObject = JSON.parseObject(body);
|
||||||
TokenResp tokenResp = new TokenResp();
|
SastTokenResp tokenResp = new SastTokenResp();
|
||||||
tokenResp.setAccessToken(bodyObject.getString("access_token"));
|
tokenResp.setAccessToken(bodyObject.getString("access_token"));
|
||||||
tokenResp.setExpiresIn(bodyObject.getInteger("expires_in"));
|
tokenResp.setExpiresIn(bodyObject.getInteger("expires_in"));
|
||||||
tokenResp.setRefreshExpiresIn(bodyObject.getInteger("refresh_expires_in"));
|
tokenResp.setRefreshExpiresIn(bodyObject.getInteger("refresh_expires_in"));
|
||||||
@ -57,7 +66,7 @@ public class SastServiceImpl implements SastService {
|
|||||||
o = redisTemplateUtils.get(REDIS_SAST_TOKEN_KEY);
|
o = redisTemplateUtils.get(REDIS_SAST_TOKEN_KEY);
|
||||||
token = o instanceof String ? ((String) o) : "";
|
token = o instanceof String ? ((String) o) : "";
|
||||||
if (StringUtils.isEmpty(token)) {
|
if (StringUtils.isEmpty(token)) {
|
||||||
TokenResp tokenRemote = getTokenRemote();
|
SastTokenResp tokenRemote = getTokenRemote();
|
||||||
String accessToken = tokenRemote.getAccessToken();
|
String accessToken = tokenRemote.getAccessToken();
|
||||||
redisTemplateUtils.set(REDIS_SAST_TOKEN_KEY,accessToken,tokenRemote.getExpiresIn()*1000);
|
redisTemplateUtils.set(REDIS_SAST_TOKEN_KEY,accessToken,tokenRemote.getExpiresIn()*1000);
|
||||||
token = accessToken;
|
token = accessToken;
|
||||||
@ -66,4 +75,79 @@ public class SastServiceImpl implements SastService {
|
|||||||
}
|
}
|
||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean applicationExist(String applicationName) {
|
||||||
|
HttpHeaders headers = getHeaders();
|
||||||
|
HttpEntity<Boolean> entity = new HttpEntity<>(null,headers);
|
||||||
|
Map<String,Object> httpParams = new HashMap<>();
|
||||||
|
String uriString = UriComponentsBuilder.fromHttpUrl(baseUrl + applicationExist)
|
||||||
|
.queryParam("applicationName", applicationName)
|
||||||
|
.queryParam("applicationId", "").toUriString();
|
||||||
|
ResponseEntity<Boolean> exchange = restTemplate.exchange(uriString, HttpMethod.GET, entity, Boolean.class, httpParams);
|
||||||
|
return exchange.getBody();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SastFileUploadResp uploadFile(File multipartFile) {
|
||||||
|
HttpHeaders httpHeaders = getHeaders();
|
||||||
|
MultiValueMap<String, Object> entityMap = new LinkedMultiValueMap<>();
|
||||||
|
httpHeaders.setContentType(MediaType.MULTIPART_FORM_DATA);
|
||||||
|
FileSystemResource fileSystemResource = new FileSystemResource(multipartFile);
|
||||||
|
entityMap.add("multipartFile",fileSystemResource);
|
||||||
|
HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity<>(entityMap,httpHeaders);
|
||||||
|
ResponseEntity<String> exchange = restTemplate.exchange(baseUrl+fileUpload, HttpMethod.POST, httpEntity, String.class, new HashMap<>());
|
||||||
|
return JSON.parseObject(exchange.getBody(), SastFileUploadResp.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SastIdentifiedLanguageTaskResp createIdentifiedLanguageTask(SastIdentifiedLanguageTaskReq req) {
|
||||||
|
HttpHeaders httpHeaders = getHeaders();
|
||||||
|
Map<String, List<String>> entityMap = new HashMap<>();
|
||||||
|
entityMap.put("fileIds",req.getFileIds());
|
||||||
|
HttpEntity<Map<String, List<String>>> entity = new HttpEntity<>(entityMap,httpHeaders);
|
||||||
|
httpHeaders.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
ResponseEntity<SastIdentifiedLanguageTaskResp> exchange = restTemplate.exchange(baseUrl+createIdentifiedLanguageTask, HttpMethod.POST,entity,SastIdentifiedLanguageTaskResp.class,new HashMap<>());
|
||||||
|
return exchange.getBody();
|
||||||
|
}
|
||||||
|
|
||||||
|
public SastIdentifiedLanguageTaskResp getIdentifiedLanguageTaskStatus(String taskId){
|
||||||
|
HttpHeaders httpHeaders = getHeaders();
|
||||||
|
Map<String, String> entityMap = new HashMap<>();
|
||||||
|
// entityMap.put("taskId",taskId);
|
||||||
|
HttpEntity<Map<String, String>> entity = new HttpEntity<>(entityMap,httpHeaders);
|
||||||
|
// httpHeaders.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
String uriString = UriComponentsBuilder.fromHttpUrl(baseUrl + getIdentifiedLanguageTaskStatus).queryParam("taskId", taskId).toUriString();
|
||||||
|
System.out.println(uriString);
|
||||||
|
ResponseEntity<SastIdentifiedLanguageTaskResp> exchange = restTemplate.exchange(uriString, HttpMethod.GET,entity,SastIdentifiedLanguageTaskResp.class,new HashMap<>());
|
||||||
|
return exchange.getBody();
|
||||||
|
}
|
||||||
|
public List<SastEngineConfigResp> engineConfig(List<String> languageIdList){
|
||||||
|
HttpHeaders httpHeaders = getHeaders();
|
||||||
|
Map<String, String> entityMap = new HashMap<>();
|
||||||
|
HttpEntity<Map<String, String>> entity = new HttpEntity<>(entityMap,httpHeaders);
|
||||||
|
String uriString = UriComponentsBuilder.fromHttpUrl(baseUrl + engineConfig).queryParam("languageIds", StringUtils.joinWith(",", languageIdList.toArray())).toUriString();
|
||||||
|
|
||||||
|
// 别问我为啥要解码。坑爹的不支持Uri encode识别
|
||||||
|
String decode = URLDecoder.decode(uriString, StandardCharsets.UTF_8);
|
||||||
|
System.out.println(decode);
|
||||||
|
ResponseEntity<String> exchange = restTemplate.exchange(decode, HttpMethod.GET,entity, String.class,new HashMap<>());
|
||||||
|
return JSON.parseArray(exchange.getBody(), SastEngineConfigResp.class);
|
||||||
|
}
|
||||||
|
public SastDetectionConfigResp detectionConfig(String languageId){
|
||||||
|
HttpHeaders httpHeaders = getHeaders();
|
||||||
|
Map<String, String> entityMap = new HashMap<>();
|
||||||
|
// entityMap.put("taskId",taskId);
|
||||||
|
HttpEntity<Map<String, String>> entity = new HttpEntity<>(entityMap,httpHeaders);
|
||||||
|
String uriString = UriComponentsBuilder.fromHttpUrl(baseUrl + detectionConfig).queryParam("languageId", languageId).toUriString();
|
||||||
|
System.out.println(uriString);
|
||||||
|
ResponseEntity<SastDetectionConfigResp> exchange = restTemplate.exchange(uriString, HttpMethod.GET,entity,SastDetectionConfigResp.class,new HashMap<>());
|
||||||
|
return exchange.getBody();
|
||||||
|
}
|
||||||
|
|
||||||
|
private HttpHeaders getHeaders(){
|
||||||
|
HttpHeaders httpHeaders = new HttpHeaders();
|
||||||
|
httpHeaders.set(TOKEN_HEADER_KEY,TOKEN_PREFIX+getToken());
|
||||||
|
return httpHeaders;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
package cd.casic.server;
|
package cd.casic.server;
|
||||||
|
|
||||||
import cd.casic.ci.process.dto.resp.sast.TokenResp;
|
import cd.casic.ci.process.dto.req.sast.SastIdentifiedLanguageTaskReq;
|
||||||
|
import cd.casic.ci.process.dto.resp.sast.SastDetectionConfigResp;
|
||||||
|
import cd.casic.ci.process.dto.resp.sast.SastEngineConfigResp;
|
||||||
|
import cd.casic.ci.process.dto.resp.sast.SastIdentifiedLanguageTaskResp;
|
||||||
import cd.casic.ci.process.process.service.sast.SastService;
|
import cd.casic.ci.process.process.service.sast.SastService;
|
||||||
import cd.casic.ci.process.properties.SastProperties;
|
import cd.casic.ci.process.properties.SastProperties;
|
||||||
import cd.casic.framework.redis.core.RedisTemplateUtils;
|
import cd.casic.framework.redis.core.RedisTemplateUtils;
|
||||||
@ -8,12 +11,13 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.core.task.TaskExecutor;
|
|
||||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
import org.springframework.test.context.ActiveProfiles;
|
import org.springframework.test.context.ActiveProfiles;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.concurrent.BrokenBarrierException;
|
import java.util.concurrent.BrokenBarrierException;
|
||||||
import java.util.concurrent.CyclicBarrier;
|
import java.util.concurrent.CyclicBarrier;
|
||||||
|
|
||||||
@ -66,5 +70,45 @@ public class SastTest {
|
|||||||
log.info(sastService.getToken());
|
log.info(sastService.getToken());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@Test
|
||||||
|
public void applicationExist(){
|
||||||
|
Boolean b = sastService.applicationExist("测试");
|
||||||
|
System.out.println(b);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
public void fileUpload(){
|
||||||
|
File file = new File("C:\\Users\\admin\\Desktop\\新建文件夹\\Java.zip");
|
||||||
|
sastService.uploadFile(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void createIdentify(){
|
||||||
|
SastIdentifiedLanguageTaskReq req = new SastIdentifiedLanguageTaskReq();
|
||||||
|
List<String> fileIds = new ArrayList<>();
|
||||||
|
|
||||||
|
fileIds.add("ed49de43-e2e9-402e-ab10-c6f00d434f43");
|
||||||
|
req.setFileIds(fileIds);
|
||||||
|
SastIdentifiedLanguageTaskResp resp = sastService.createIdentifiedLanguageTask(req);
|
||||||
|
System.out.println(resp);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getIdentify(){
|
||||||
|
SastIdentifiedLanguageTaskResp resp = sastService.getIdentifiedLanguageTaskStatus("ab8c8ff1-7c07-4787-9107-6624ba0ede02");
|
||||||
|
System.out.println(JSON.toJSONString(resp));
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
public void getEngineConfig(){
|
||||||
|
List<String> languageIdList= new ArrayList<>();
|
||||||
|
languageIdList.add("17417899-2c50-11ee-a171-e2d048d4b7ce");
|
||||||
|
languageIdList.add("17417989-2c50-11ee-a171-e2d048d4b7ce");
|
||||||
|
languageIdList.add("17417992-2c50-11ee-a171-e2d048d4b7ce");
|
||||||
|
List<SastEngineConfigResp> resp = sastService.engineConfig(languageIdList);
|
||||||
|
System.out.println(resp);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
public void detectionConfig(){
|
||||||
|
SastDetectionConfigResp resp = sastService.detectionConfig("17417989-2c50-11ee-a171-e2d048d4b7ce");
|
||||||
|
System.out.println(resp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user