|
|
@@ -61,6 +61,7 @@ public class CompilerController {
|
|
|
@GetMapping(value = "/types", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public String addCompilerPage() {
|
|
|
List<SelectOption> compileTypes = Arrays.stream(CompileType.values())
|
|
|
+ .filter(compileType -> !compileType.name().equals(CompileType.none.name()))
|
|
|
.map(compileType -> new SelectOption(compileType.getName(), compileType.getName()))
|
|
|
.collect(Collectors.toList());
|
|
|
return WebResult.success(compileTypes);
|
|
|
@@ -80,15 +81,34 @@ public class CompilerController {
|
|
|
return WebResult.success();
|
|
|
}
|
|
|
|
|
|
- @Operation(summary = "docker 编译器映射目录页面", description = "N")
|
|
|
+ @Operation(summary = "编译器的容器映射目录页面", description = "N")
|
|
|
@GetMapping(value = "/bind/list", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public String compilerBindPage(@RequestParam("id") int id) {
|
|
|
CompilerConfig compilerConfig = compilerConfigRepository.findById(id).orElse(null);
|
|
|
if (compilerConfig != null && compilerConfig.getType().equals(CompileType.dockerRun.getName())) {
|
|
|
return WebResult.success(compilerConfig.getCompilerBinds());
|
|
|
}
|
|
|
+ return WebResult.failWithMsg("compiler not dockerRun type");
|
|
|
+ }
|
|
|
|
|
|
- return WebResult.failWithMsg("compiler not docker type");
|
|
|
+ @Operation(summary = "编译器的容器环境变量页面", description = "N")
|
|
|
+ @GetMapping(value = "/env/list", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
+ public String compilerEnvPage(@RequestParam("id") int id) {
|
|
|
+ CompilerConfig compilerConfig = compilerConfigRepository.findById(id).orElse(null);
|
|
|
+ if (compilerConfig != null && compilerConfig.getType().equals(CompileType.dockerRun.getName())) {
|
|
|
+ return WebResult.success(compilerConfig.getCompilerBinds());
|
|
|
+ }
|
|
|
+ return WebResult.failWithMsg("compiler not dockerRun type");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "编译器的 dockerfile 变量页面", description = "N")
|
|
|
+ @GetMapping(value = "/dockerfile/list", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
+ public String compilerDockerfilePage(@RequestParam("id") int id) {
|
|
|
+ CompilerConfig compilerConfig = compilerConfigRepository.findById(id).orElse(null);
|
|
|
+ if (compilerConfig != null && compilerConfig.getType().equals(CompileType.dockerBuild.getName())) {
|
|
|
+ return WebResult.success(compilerConfig.getCompilerArgs());
|
|
|
+ }
|
|
|
+ return WebResult.failWithMsg("compiler not dockerBuild type");
|
|
|
}
|
|
|
|
|
|
@Operation(summary = "添加编译配置", description = "N")
|