feat: 接口管理新增完成

This commit is contained in:
clay
2024-04-18 23:29:47 +08:00
parent 7f8ceb3e25
commit ab8e2f7b87
39 changed files with 645 additions and 223 deletions

View File

@@ -228,4 +228,24 @@ public class JavaCodeEngine {
throw new RuntimeException(e);
}
}
/**
* 删除类
* @param className 删除类
* @return 删除结果
*/
public Boolean remove(String className) {
return SegmentLock.lock(className, () -> {
classCache.remove(className);
File javaFile = new File(CLASS_PATH + className + JAVA_SUFFIX);
if (javaFile.exists()) {
javaFile.delete();
}
File classFile = new File(CLASS_PATH + className + CLASS_SUFFIX);
if (classFile.exists()) {
classFile.delete();
}
return true;
});
}
}