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

View File

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