master
chentaisen 2024-09-03 10:01:35 +08:00
parent 256516e01b
commit 414ae7b95e
2 changed files with 9 additions and 15 deletions

View File

@ -1,16 +1,16 @@
package com.muyu.rule.load;
import com.muyu.rule.scan.JavaCodeScan;
import io.jsonwebtoken.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.Files;
import java.util.HashMap;
import java.util.Map;
/**
* @ClassName Java java
* @Description
@ -80,18 +80,10 @@ public class JavaBinaryClassLoader extends ClassLoader {
public byte[] loadClassData(String name, File location)throws IOException {
File classFile = new File(location, name + ".class");
if (!classFile.exists()) {
try {
throw new FileNotFoundException("找不到类文件: " + classFile.getAbsolutePath());
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
}
}
//FileNotFoundException
try {
return Files.readAllBytes(classFile.toPath());
} catch (java.io.IOException e) {
throw new RuntimeException(e);
}
}
}

View File

@ -25,7 +25,8 @@ import rule.domain.RuleEdition;
public class RuleEditionServiceImpl extends ServiceImpl<RuleEditionMapper, RuleEdition> implements RuleEditionService {
@Autowired
private RuleServiceImpl ruleServiceImpl;
// @Autowired
// private RuleService ruleService;;
/**
*
@ -61,7 +62,8 @@ public class RuleEditionServiceImpl extends ServiceImpl<RuleEditionMapper, RuleE
ruleEdition.setRuleEngine(GenerateConstant.generateConstant(rule, ruleEdition));
// LambdaQueryWrapper<RuleEdition> queryWrapper = new LambdaQueryWrapper<>();
// queryWrapper.eq(RuleEdition::getRuleKind, ruleEdition.getRuleKind());
// long count = ruleEditionServiceImpl.count(queryWrapper);
//
// long count = ruleService.count(queryWrapper);
// if (count > 0) {
// throw new ServiceException("版本类名称重复");
// }