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

mcj:代码结构优化,新增http异常处理

上级 b90b187d
package com.zjty.inspect.config;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
/**
* @author Mcj
* @date 2020-03-16 10:33
*/
@ControllerAdvice
@Slf4j
public class ExceptionHandlerConfig {
@ExceptionHandler(value = HttpMessageNotReadableException.class)
public ResponseEntity defaultErrorHandler(Exception e) {
log.error("异常{}",e);
return ResponseEntity.badRequest().build();
}
@ExceptionHandler(value = IOException.class)
public ResponseEntity defaultIOHandler(Exception e) {
log.error("IO异常{}",e);
return ResponseEntity.status(500).build();
}
}
...@@ -45,9 +45,6 @@ public class InspectController { ...@@ -45,9 +45,6 @@ public class InspectController {
@Autowired @Autowired
private TechnologyService technologyService; private TechnologyService technologyService;
@Autowired
private ParameterService parameterService;
@Autowired @Autowired
private ReportService reportService; private ReportService reportService;
...@@ -135,7 +132,7 @@ public class InspectController { ...@@ -135,7 +132,7 @@ public class InspectController {
} }
@PostMapping("/rapidAssessment") @PostMapping("/rapidAssessment")
public ResponseEntity rapidAssessment(@RequestBody Reform reform){ public ResponseEntity rapidAssessment(@RequestBody Reform reform) throws IOException {
//输入参数 //输入参数
String in = JSON.toJSONString(reform); String in = JSON.toJSONString(reform);
Evaluation evaluation=new Evaluation(); Evaluation evaluation=new Evaluation();
......
...@@ -35,7 +35,7 @@ public class InspectParameter { ...@@ -35,7 +35,7 @@ public class InspectParameter {
private Double proportion; private Double proportion;
/** /**
* 利率 * 利率
*/ */
private Double moneyRate; private Double moneyRate;
......
...@@ -13,30 +13,18 @@ public enum Language { ...@@ -13,30 +13,18 @@ public enum Language {
*/ */
JAVA("java",1), JAVA("java",1),
VUE("js",2),
PYTHON("python",3), PYTHON("python",3),
ASP("asp",4),
/**
* js
*/
JAVASCRIPT("js",5), JAVASCRIPT("js",5),
/**
* go
*/
GO("go",6), GO("go",6),
/**
* html
*/
HTML("html",7), HTML("html",7),
C("c#",8), C("c#",8),
C("c++",9), C("c++",9),
UNKNOW("unknowun",10); UNKNOW("unknowun",10);
...@@ -56,9 +44,4 @@ public enum Language { ...@@ -56,9 +44,4 @@ public enum Language {
public Integer getStatus() { public Integer getStatus() {
return status; return status;
} }
public static void main(String[] args) {
Language language = Language.valueOf("VUE");
System.out.println(language.name);
}
} }
...@@ -138,182 +138,19 @@ public class Inspector { ...@@ -138,182 +138,19 @@ public class Inspector {
private Map<String, Technology> technologyHashMap = new HashMap<>(64); private Map<String, Technology> technologyHashMap = new HashMap<>(64);
/** /**
* 统计各后缀文件路径与出现次数,顺便解析jar与js文件 * 评估
* FileVisitResult.CONTINUE 继续遍历 * @return 报告
* FileVisitResult.TERMINATE 中止访问
* FileVisitResult.SKIP_SIBLINGS 不访问同级的文件或目录
* FileVisitResult.SKIP_SUBTREE 不访问子目录
* 准备工作
* 1.解析文件
* 2/记录文件地址
* 3/统计各个规则文件后缀
*
* @return
*/ */
public ReportVo inspect() { public ReportVo inspect() throws IOException {
//初始化值 //初始化值
initData(); initData();
//查询技术,构造支持与非支持技术对象,3个对象 scanFiles();
findExistTechnology();
//配置语言 map结构
statisticsLanguage();
//配置 config文件 结构
statisticsConfigFile();
//查询所有规则,第一遍扫描文件需要
this.ruleList = ruleDao.findAll();
//根据后缀名,收集文件进行操作
for (Rule rule : ruleList) {
if (!ruleSuffixFilePathMap.containsKey(rule.getSuffix())) {
ruleSuffixFilePathMap.put(rule.getSuffix(), new ArrayList<>());
}
if (!ruleMap.containsKey(rule.getTarget() + ":" + rule.getSuffix())) {
ruleMap.put(rule.getTarget() + ":" + rule.getSuffix(), rule);
}
}
//查询所有技术,第一遍扫描文件需要
List<Technology> technologies = technologyDao.findAll();
for (Technology technology : technologies) {
technologyHashMap.put(technology.getId(), technology);
}
try {
//以下为计算文件名称匹配正则表达式
FileSystem aDefault = FileSystems.getDefault();
Map<String, PathMatcher> languageSuffixMatcherMapping = new HashMap<>(16);
//构造各个语言后缀文件的正则表达式
for (String s : suffixLanguageMapping.keySet()) {
languageSuffixMatcherMapping.put(s, aDefault.getPathMatcher("glob:**/*." + s));
}
//构造各个配置文件的正则表达式,用于解析依赖
Map<PathMatcher, String> configFileMatcherSuffixMapping = new HashMap<>(16);
for (String s : configFileTypePathsMapping.keySet()) {
configFileMatcherSuffixMapping.put(aDefault.getPathMatcher("glob:**/*." + s), s);
}
//构造规则后缀的正则表达式
Map<PathMatcher, String> ruleSuffixMap = new HashMap<>(16);
for (String s : ruleSuffixFilePathMap.keySet()) {
ruleSuffixMap.put(aDefault.getPathMatcher("glob:**/*." + s), s);
}
//文件读取
Files.walkFileTree(Paths.get(inspectParameter.getSourceAddress()), new FileVisitor<Path>() {
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
//扫描jar文件时
if (file.getFileName().toString().endsWith(".jar")) {
//新建一个pom对象
ProjectPom projectPom = new ProjectPom();
//截取jar名称
String patten = RegexUtil.patten(file.getFileName().toString());
//新建一个依赖对象
PomDependency pomDependency = new PomDependency();
pomDependency.setArtifactId(patten);
projectPom.getDependencies().add(pomDependency);
// TODO: 2020-03-04 界定rule唯一,修改数据,一条数据绑定两种技术
//当参数为1时代表上传者管理员,代码可绝对信任,将jar名称当作可支持依赖添加进规则库中
if (inspectParameter.getAdmin() == 1) {
//新建规则对象
Rule rule = new Rule();
//设置适配技术id
rule.setTechnologyId(techJavaSupport.getId());
rule.setTarget(patten);
//设置文件后缀
rule.setSuffix("*");
rule.setId(UUIDUtil.getUUID());
rule.setTechnologyName(techJavaSupport.getTechnologyName());
//做规则查询,不用去数据库查询
if (!ruleMap.containsKey(patten + ":" + rule.getSuffix())) {
rules.add(rule);
ruleMap.put(patten + ":" + rule.getSuffix(), rule);
}
//设置当前依赖为可支持
pomDependency.setSupport(1);
} else {
//为普通用户上传,依赖需要检查是否支持。
int i = valiWarn(ruleList, file, patten, 0);
//如果值为0则代表是有不支持技术到匹配
pomDependency.setSupport(i);
}
dependencyVo.add(projectPom);
}
fileNum += 1;
try {
List<String> allLines = Files.readAllLines(file);
fileLine += allLines.size();
} catch (MalformedInputException e) {
return FileVisitResult.CONTINUE;
} catch (IOException e) {
e.printStackTrace();
}
for (Map.Entry<String, PathMatcher> entry : languageSuffixMatcherMapping.entrySet()) {
//通过正则表达式匹配.java类型后缀文件,并+1
if (entry.getValue().matches(file)) {
long length = file.toFile().length();
codeSize += length / 1024;
languageMatchMap.get(entry.getKey()).plus();
}
}
for (Map.Entry<PathMatcher, String> entry : configFileMatcherSuffixMapping.entrySet()) {
//通过配置文件正则表达式匹配.xml文件,记录文件地址
if (entry.getKey().matches(file)) {
configFileTypePathsMapping.get(entry.getValue()).add(file);
}
}
for (Map.Entry<PathMatcher, String> entry : ruleSuffixMap.entrySet()) {
//通过规则匹配后缀正则表达式匹配,记录匹配上的文件地址
if (entry.getKey().matches(file)) {
ruleSuffixFilePathMap.get(entry.getValue()).add(file);
}
}
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult visitFileFailed(Path file, IOException exc) {
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult postVisitDirectory(Path dir, IOException exc) {
return FileVisitResult.CONTINUE;
}
});
} catch (IOException e) {
e.printStackTrace();
}
inspectParameter.setCodeSize((int) codeSize); inspectParameter.setCodeSize((int) codeSize);
report.setFileNum(fileNum); report.setFileNum(fileNum);
report.setFileLine(fileLine); report.setFileLine(fileLine);
log.info("inspect:源代码扫描完成,统计各个文件后缀完成"); log.info("inspect:源代码扫描完成,统计各个文件后缀完成");
return analysis();
}
private void initData() {
codeSize = 0;
ruleSuffixFilePathMap = new HashMap<>();
ruleSuffixMap = new HashMap<>();
technologyHashMap = new HashMap<>();
warns.clear();
rules.clear();
}
/**
* 解析数据
*
* @return Report
*/
@Transactional
public ReportVo analysis() {
DependencyVo dependencyVo = new DependencyVo();
setReportLanguageAndFrame(); setReportLanguageAndFrame();
//查询所有规则 //根据扫描结果以及用户配置得出需要使用的规则及技术
ruleTransform(report.getRecastMethod()); ruleTransform(report.getRecastMethod());
//解析配置文件集合 //解析配置文件集合
for (Map.Entry<String, List<Path>> entry : configFileTypePathsMapping.entrySet()) { for (Map.Entry<String, List<Path>> entry : configFileTypePathsMapping.entrySet()) {
...@@ -327,7 +164,6 @@ public class Inspector { ...@@ -327,7 +164,6 @@ public class Inspector {
// TODO: 2020-02-28 解析maven树文件,设置依赖保存到redis // TODO: 2020-02-28 解析maven树文件,设置依赖保存到redis
report.setManager(DependenceManagement.MAVEN.getStatus()); report.setManager(DependenceManagement.MAVEN.getStatus());
ProjectPom projectPom = analysisFile.analysisPom(path); ProjectPom projectPom = analysisFile.analysisPom(path);
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
for (PomDependency dependency : projectPom.getDependencies()) { for (PomDependency dependency : projectPom.getDependencies()) {
setRule(path, stringBuilder, dependency); setRule(path, stringBuilder, dependency);
...@@ -336,26 +172,6 @@ public class Inspector { ...@@ -336,26 +172,6 @@ public class Inspector {
} }
} }
break; break;
case "gradle":
// for (Path path : entry.getValue()) {
// if (path.getFileName().endsWith("build.gradle")) {
// try {
// ProjectPom projectPom = new ProjectPom();
// report.setManager(DependenceManagement.GRADLE.getStatus());
// List<PomDependency> pomDependencies = AnalysisFile.analysisGradle(path);
// projectPom.setDependencies(pomDependencies);
// //设置依赖
// StringBuilder stringBuilder = new StringBuilder();
// for (PomDependency dependency : pomDependencies) {
// setRule(path, stringBuilder, dependency);
// }
// dependencyVo.add(projectPom);
// }catch (Exception e){
// e.printStackTrace();
// }
// }
// }
break;
default: default:
} }
} }
...@@ -383,25 +199,24 @@ public class Inspector { ...@@ -383,25 +199,24 @@ public class Inspector {
} }
} }
//将得到的告警信息根据技术id进行转换 //将得到的告警信息根据技术id进行转换
Set<String> collect = warns.stream().map(Warn::getTechnologyId).collect(Collectors.toSet()); Set<String> idSet = warns.stream().map(Warn::getTechnologyId).collect(Collectors.toSet());
List<Technology> allById = technologyDao.findAllById(collect); List<Technology> technologies = technologyDao.findAllById(idSet);
//计算技术金额 //计算技术金额
Integer fund = 0; Integer technologyFund = 0;
for (Technology tech : allById) { for (Technology tech : technologies) {
fund += tech.getFund(); technologyFund += tech.getFund();
} }
//计算预算 //计算预算
if (inspectParameter.getValid() != null) { if (inspectParameter.getValid() != null) {
BudgetVo budget = budgetUitl.getBudget(fund, report, inspectParameter); BudgetVo budget = budgetUitl.getBudget(technologyFund, report, inspectParameter);
report.setBudgets(budget); report.setBudgets(budget);
} }
parameterDao.save(inspectParameter); parameterDao.save(inspectParameter);
//填充地址(如果有) //填充地址(如果有)
report.setGitAddress(inspectParameter.getGitAddress()); report.setGitAddress(inspectParameter.getGitAddress());
//填充适配技术 //填充适配技术
report.setTechnologies(allById); report.setTechnologies(technologies);
//填充依赖 //填充依赖
report.setDependencyVo(dependencyVo); report.setDependencyVo(dependencyVo);
//数据转换 //数据转换
...@@ -409,14 +224,12 @@ public class Inspector { ...@@ -409,14 +224,12 @@ public class Inspector {
ruleDao.saveAll(rules); ruleDao.saveAll(rules);
report.setWarnDetails(warnMap); report.setWarnDetails(warnMap);
log.info("评估报告关键技术,{}", warnMap); log.info("评估报告关键技术,{}", warnMap);
fileLine = 0;
fileNum = 0;
return report; return report;
} }
/** /**
* 比对源文件数量 * 比对源文件数量得出语言架构
*/ */
private void setReportLanguageAndFrame() { private void setReportLanguageAndFrame() {
String most = null; String most = null;
...@@ -448,8 +261,8 @@ public class Inspector { ...@@ -448,8 +261,8 @@ public class Inspector {
/** /**
* rule所需要数据装配 * rule所需要数据装配
*/ */
private void ruleTransform(Integer i) { private void ruleTransform(Integer status) {
if (i == 1) { if (status == 1) {
List<Technology> front = technologyDao.findAllByBackorfrontEquals(1); List<Technology> front = technologyDao.findAllByBackorfrontEquals(1);
List<String> ids = front.stream().map(Technology::getId).collect(Collectors.toList()); List<String> ids = front.stream().map(Technology::getId).collect(Collectors.toList());
this.ruleList = ruleDao.findAllByTechnologyIdIn(ids); this.ruleList = ruleDao.findAllByTechnologyIdIn(ids);
...@@ -476,17 +289,37 @@ public class Inspector { ...@@ -476,17 +289,37 @@ public class Inspector {
ruleSuffixMap.get(rule.getSuffix()).add(rule); ruleSuffixMap.get(rule.getSuffix()).add(rule);
} }
} }
ArrayList<String> keys = new ArrayList<>(); ArrayList<String> ruleSuffixKeys = new ArrayList<>();
for (String s : ruleSuffixFilePathMap.keySet()) { for (String s : ruleSuffixFilePathMap.keySet()) {
if (!ruleSuffixMap.containsKey(s)) { if (!ruleSuffixMap.containsKey(s)) {
keys.add(s); ruleSuffixKeys.add(s);
} }
} }
for (String key : keys) { for (String key : ruleSuffixKeys) {
ruleSuffixFilePathMap.remove(key); ruleSuffixFilePathMap.remove(key);
} }
} }
private void initData() {
codeSize = 0;
fileLine = 0;
fileNum = 0;
dependencyVo = new DependencyVo();
ruleSuffixFilePathMap = new HashMap<>();
ruleSuffixMap = new HashMap<>();
technologyHashMap = new HashMap<>();
warns.clear();
rules.clear();
//查询技术,构造支持与非支持技术对象,3个对象
findExistTechnology();
//配置语言 map结构
statisticsLanguage();
//配置 config文件 结构
statisticsConfigFile();
initRule();
initTechnology();
}
private void statisticsConfigFile() { private void statisticsConfigFile() {
this.configFileTypePathsMapping = new HashMap<>(); this.configFileTypePathsMapping = new HashMap<>();
configFileTypePathsMapping.put("xml", new ArrayList<>()); configFileTypePathsMapping.put("xml", new ArrayList<>());
...@@ -512,6 +345,33 @@ public class Inspector { ...@@ -512,6 +345,33 @@ public class Inspector {
techUnKnowSupport = technologyDao.findAllByTechnologyNameEquals("未知依赖(未知)"); techUnKnowSupport = technologyDao.findAllByTechnologyNameEquals("未知依赖(未知)");
} }
/**
* 初始化规则
*/
private void initRule() {
//查询所有规则,第一遍扫描文件需要
this.ruleList = ruleDao.findAll();
//根据后缀名,收集文件进行操作
for (Rule rule : ruleList) {
if (!ruleSuffixFilePathMap.containsKey(rule.getSuffix())) {
ruleSuffixFilePathMap.put(rule.getSuffix(), new ArrayList<>());
}
if (!ruleMap.containsKey(rule.getTarget() + ":" + rule.getSuffix())) {
ruleMap.put(rule.getTarget() + ":" + rule.getSuffix(), rule);
}
}
}
/**
* 初始化技术
*/
private void initTechnology() {
//查询所有技术,第一遍扫描文件需要
List<Technology> technologies = technologyDao.findAll();
for (Technology technology : technologies) {
technologyHashMap.put(technology.getId(), technology);
}
}
/** /**
* 数据转换 * 数据转换
...@@ -643,12 +503,12 @@ public class Inspector { ...@@ -643,12 +503,12 @@ public class Inspector {
warns.add(warn); warns.add(warn);
//设置a=0代表当前依赖有问题 //设置a=0代表当前依赖有问题
supportStatus = technology.getSupport(); supportStatus = technology.getSupport();
} else{ } else {
if(supportWarns.size()!=10){ if (supportWarns.size() != 10) {
supportWarns.add(warn); supportWarns.add(warn);
} }
Integer size = report.getSupportSize(); Integer size = report.getSupportSize();
Integer integer = size+1; Integer integer = size + 1;
report.setSupportSize(integer); report.setSupportSize(integer);
supportStatus = 1; supportStatus = 1;
} }
...@@ -657,6 +517,115 @@ public class Inspector { ...@@ -657,6 +517,115 @@ public class Inspector {
return supportStatus; return supportStatus;
} }
public void scanFiles() throws IOException {
//以下为计算文件名称匹配正则表达式
FileSystem aDefault = FileSystems.getDefault();
Map<String, PathMatcher> languageSuffixMatcherMapping = new HashMap<>(16);
//构造各个语言后缀文件的正则表达式
for (String s : suffixLanguageMapping.keySet()) {
languageSuffixMatcherMapping.put(s, aDefault.getPathMatcher("glob:**/*." + s));
}
//构造各个配置文件的正则表达式,用于解析依赖
Map<PathMatcher, String> configFileMatcherSuffixMapping = new HashMap<>(16);
for (String s : configFileTypePathsMapping.keySet()) {
configFileMatcherSuffixMapping.put(aDefault.getPathMatcher("glob:**/*." + s), s);
}
//构造规则后缀的正则表达式
Map<PathMatcher, String> ruleSuffixMap = new HashMap<>(16);
for (String s : ruleSuffixFilePathMap.keySet()) {
ruleSuffixMap.put(aDefault.getPathMatcher("glob:**/*." + s), s);
}
//文件读取
Files.walkFileTree(Paths.get(inspectParameter.getSourceAddress()), new FileVisitor<Path>() {
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
//扫描jar文件时
if (file.getFileName().toString().endsWith(".jar")) {
//新建一个pom对象
ProjectPom projectPom = new ProjectPom();
//截取jar名称
String patten = RegexUtil.patten(file.getFileName().toString());
//新建一个依赖对象
PomDependency pomDependency = new PomDependency();
pomDependency.setArtifactId(patten);
projectPom.getDependencies().add(pomDependency);
//当参数为1时代表上传者管理员,代码可绝对信任,将jar名称当作可支持依赖添加进规则库中
if (inspectParameter.getAdmin() == 1) {
//新建规则对象
Rule rule = new Rule();
//设置适配技术id
rule.setTechnologyId(techJavaSupport.getId());
rule.setTarget(patten);
//设置文件后缀
rule.setSuffix("*");
rule.setId(UUIDUtil.getUUID());
rule.setTechnologyName(techJavaSupport.getTechnologyName());
//做规则查询,不用去数据库查询
if (!ruleMap.containsKey(patten + ":" + rule.getSuffix())) {
rules.add(rule);
ruleMap.put(patten + ":" + rule.getSuffix(), rule);
}
//设置当前依赖为可支持
pomDependency.setSupport(1);
} else {
//为普通用户上传,依赖需要检查是否支持。
int i = valiWarn(ruleList, file, patten, 0);
//如果值为0则代表是有不支持技术到匹配
pomDependency.setSupport(i);
}
dependencyVo.add(projectPom);
}
fileNum += 1;
try {
List<String> allLines = Files.readAllLines(file);
fileLine += allLines.size();
} catch (MalformedInputException e) {
return FileVisitResult.CONTINUE;
} catch (IOException e) {
e.printStackTrace();
}
for (Map.Entry<String, PathMatcher> entry : languageSuffixMatcherMapping.entrySet()) {
//通过正则表达式匹配.java类型后缀文件,并+1
if (entry.getValue().matches(file)) {
long length = file.toFile().length();
codeSize += length / 1024;
languageMatchMap.get(entry.getKey()).plus();
}
}
for (Map.Entry<PathMatcher, String> entry : configFileMatcherSuffixMapping.entrySet()) {
//通过配置文件正则表达式匹配.xml文件,记录文件地址
if (entry.getKey().matches(file)) {
configFileTypePathsMapping.get(entry.getValue()).add(file);
}
}
for (Map.Entry<PathMatcher, String> entry : ruleSuffixMap.entrySet()) {
//通过规则匹配后缀正则表达式匹配,记录匹配上的文件地址
if (entry.getKey().matches(file)) {
ruleSuffixFilePathMap.get(entry.getValue()).add(file);
}
}
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult visitFileFailed(Path file, IOException exc) {
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult postVisitDirectory(Path dir, IOException exc) {
return FileVisitResult.CONTINUE;
}
});
}
public class Counter { public class Counter {
private int i = 0; private int i = 0;
......
...@@ -4,6 +4,7 @@ import com.zjty.inspect.entity.InspectParameter; ...@@ -4,6 +4,7 @@ import com.zjty.inspect.entity.InspectParameter;
import com.zjty.inspect.entity.Report; import com.zjty.inspect.entity.Report;
import com.zjty.inspect.entity.ReportVo; import com.zjty.inspect.entity.ReportVo;
import java.io.IOException;
import java.util.Map; import java.util.Map;
public interface InspectService { public interface InspectService {
...@@ -12,7 +13,7 @@ public interface InspectService { ...@@ -12,7 +13,7 @@ public interface InspectService {
* @param inspectParameter * @param inspectParameter
* @return * @return
*/ */
ReportVo inspect(ReportVo reportVo,InspectParameter inspectParameter); ReportVo inspect(ReportVo reportVo,InspectParameter inspectParameter) throws IOException;
String generateHtml(String templateContent, Map model ); String generateHtml(String templateContent, Map model );
......
...@@ -21,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -21,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.freemarker.FreeMarkerTemplateUtils; import org.springframework.ui.freemarker.FreeMarkerTemplateUtils;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -45,7 +46,7 @@ public class InspectServiceImpl implements InspectService { ...@@ -45,7 +46,7 @@ public class InspectServiceImpl implements InspectService {
@Transactional @Transactional
@Override @Override
public ReportVo inspect(ReportVo reportVo,InspectParameter inspectParameter) { public ReportVo inspect(ReportVo reportVo,InspectParameter inspectParameter) throws IOException {
//统计文件后缀数量 //统计文件后缀数量
Map<String, Language> suffixLanguageMapping = new HashMap<>(); Map<String, Language> suffixLanguageMapping = new HashMap<>();
suffixLanguageMapping.put("java", Language.JAVA); suffixLanguageMapping.put("java", Language.JAVA);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论