提交 858618d5 authored 作者: 马晨俊's avatar 马晨俊

mcj:修改服务器规则查询

上级 e21cfd15
...@@ -59,7 +59,7 @@ public class EvaluationController { ...@@ -59,7 +59,7 @@ public class EvaluationController {
} }
@ApiOperation("根据id查询输入") @ApiOperation("根据id查询输入")
@GetMapping(value = "/in/{name}") @GetMapping(value = "/in/{name}")
@AuthAnnotation(code = {"000800"}) //@AuthAnnotation(code = {"000800"})
public ResponseEntity getInName(@PathVariable String name) { public ResponseEntity getInName(@PathVariable String name) {
Evaluation evaluation = evaluationService.findById(name); Evaluation evaluation = evaluationService.findById(name);
if(evaluation!=null){ if(evaluation!=null){
......
...@@ -159,10 +159,9 @@ public class Inspector { ...@@ -159,10 +159,9 @@ public class Inspector {
report.setFileLine(fileLine); report.setFileLine(fileLine);
log.info("inspect:源代码扫描完成,统计各个文件后缀完成"); log.info("inspect:源代码扫描完成,统计各个文件后缀完成");
//统计项目语言 //统计项目语言
CompletableFuture<Void> future = runAsync(this::setReportLanguageAndFrame); setReportLanguageAndFrame();
//根据扫描结果以及用户配置得出需要使用的规则及技术 //根据扫描结果以及用户配置得出需要使用的规则及技术
CompletableFuture<Void> future1 = runAsync(() -> ruleTransform(inspectParameter.getRecastMethod())); ruleTransform(inspectParameter.getRecastMethod());
allOf(future, future1);
//扫描配置文件 //扫描配置文件
forEachFilesMap(); forEachFilesMap();
//将得到的告警信息根据技术id进行转换 //将得到的告警信息根据技术id进行转换
...@@ -329,10 +328,7 @@ public class Inspector { ...@@ -329,10 +328,7 @@ public class Inspector {
private void initData() { private void initData() {
//查询技术,构造支持与非支持技术对象,3个对象 //查询技术,构造支持与非支持技术对象,3个对象
CompletableFuture<Void> future = runAsync(this::findExistTechnology);
//配置语言 map结构 //配置语言 map结构
CompletableFuture<Void> future1 = runAsync(this::statisticsLanguage);
CompletableFuture<Void> future2 = runAsync(this::initRule);
codeSize = 0; codeSize = 0;
fileLine = 0; fileLine = 0;
fileNum = 0; fileNum = 0;
...@@ -346,7 +342,9 @@ public class Inspector { ...@@ -346,7 +342,9 @@ public class Inspector {
//配置 config文件 结构 //配置 config文件 结构
statisticsConfigFile(); statisticsConfigFile();
initTechnology(); initTechnology();
CompletableFuture.allOf(future, future1, future2); statisticsLanguage();
findExistTechnology();
initRule();
} }
private void statisticsConfigFile() { private void statisticsConfigFile() {
...@@ -379,7 +377,7 @@ public class Inspector { ...@@ -379,7 +377,7 @@ public class Inspector {
*/ */
private void initRule() { private void initRule() {
//查询所有规则,第一遍扫描文件需要 //查询所有规则,第一遍扫描文件需要
this.ruleList = ruleService.findRules(); this.ruleList = ruleService.mcjAllRule();
//根据后缀名,收集文件进行操作 //根据后缀名,收集文件进行操作
for (Rule rule : ruleList) { for (Rule rule : ruleList) {
if (!ruleSuffixFilePathMap.containsKey(rule.getSuffix())) { if (!ruleSuffixFilePathMap.containsKey(rule.getSuffix())) {
......
...@@ -53,4 +53,6 @@ public interface RuleService { ...@@ -53,4 +53,6 @@ public interface RuleService {
List<Rule> findAllByTechnologyIdIn(List<String> technologyIds); List<Rule> findAllByTechnologyIdIn(List<String> technologyIds);
void importRules(MultipartFile file); void importRules(MultipartFile file);
List<Rule> mcjAllRule();
} }
...@@ -55,7 +55,7 @@ public class RuleServiceImpl implements RuleService { ...@@ -55,7 +55,7 @@ public class RuleServiceImpl implements RuleService {
@Autowired @Autowired
private RuleCollectionDao ruleCollectionDao; private RuleCollectionDao ruleCollectionDao;
@Override
public List<Rule> mcjAllRule() { public List<Rule> mcjAllRule() {
List<Rule> rules = ruleDao.findAll(); List<Rule> rules = ruleDao.findAll();
List<Rule> ruleList = new ArrayList<>(); List<Rule> ruleList = new ArrayList<>();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论