Changes
parent
836e58e7cf
commit
c6f12be638
|
@ -6,6 +6,7 @@ import com.muyu.rule.compile.SourceCodeCompiler;
|
|||
import com.muyu.rule.service.RuleEditionService;
|
||||
import com.muyu.rule.test.OSSFileDownload;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -23,6 +24,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ruleEdition")
|
||||
@Log4j2
|
||||
public class RuleEditionController {
|
||||
@Autowired
|
||||
private RuleEditionService ruleEditionService;
|
||||
|
@ -66,26 +68,24 @@ public class RuleEditionController {
|
|||
OSSFileDownload.streamingDownload(ruleEdition.getRuleKind());
|
||||
|
||||
//对路径里的.java文件进行编译
|
||||
|
||||
SourceCodeCompiler.javaCompilerPath("/home");
|
||||
System.out.println("===================");
|
||||
log.info("第一步");
|
||||
File outputDir = new File("/home"); // 或者是你指定的其他输出目录
|
||||
System.out.println("__________________");
|
||||
log.info("第一步");
|
||||
File[] classFiles = outputDir.listFiles(); // 获取输出目录中的所有文件
|
||||
System.out.println("23456789");
|
||||
log.info("第三步");
|
||||
if (classFiles != null) {
|
||||
for (File classFile : classFiles) {
|
||||
if (classFile.getName().endsWith(".class")) {
|
||||
// 这里可以处理每个.class文件,例如读取、复制或移动
|
||||
System.out.println("找到class文件 " + classFile.getName());
|
||||
log.info("找到class文件 " + classFile.getName());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
System.out.println("没有找到文件");
|
||||
log.info("没有找到文件");
|
||||
}
|
||||
|
||||
|
||||
|
||||
return Result.success(ruleEditionService.save(ruleEdition));
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue