|
|
@@ -2,15 +2,15 @@ package cn.reghao.autodop.dmaster.app.controller.crud;
|
|
|
|
|
|
import cn.reghao.autodop.common.result.WebResult;
|
|
|
import cn.reghao.autodop.dmaster.app.entity.config.build.BuildDir;
|
|
|
-import cn.reghao.autodop.dmaster.app.service.crud.BuildDirService;
|
|
|
+import cn.reghao.autodop.dmaster.app.db.config.BuildDirCrudService;
|
|
|
import cn.reghao.autodop.dmaster.common.db.PageList;
|
|
|
import cn.reghao.autodop.common.utils.serializer.JsonConverter;
|
|
|
import cn.reghao.autodop.dmaster.app.entity.config.build.CompilerConfig;
|
|
|
import cn.reghao.autodop.dmaster.app.entity.config.build.PackerConfig;
|
|
|
import cn.reghao.autodop.dmaster.app.entity.config.build.RepoAuthConfig;
|
|
|
-import cn.reghao.autodop.dmaster.app.service.crud.CompilerConfigService;
|
|
|
-import cn.reghao.autodop.dmaster.app.service.crud.PackerConfigService;
|
|
|
-import cn.reghao.autodop.dmaster.app.service.crud.RepoAuthConfigService;
|
|
|
+import cn.reghao.autodop.dmaster.app.db.config.CompilerConfigCrudService;
|
|
|
+import cn.reghao.autodop.dmaster.app.db.config.PackerConfigCrudService;
|
|
|
+import cn.reghao.autodop.dmaster.app.db.config.RepoAuthConfigCrudService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -26,26 +26,26 @@ import org.springframework.web.bind.annotation.*;
|
|
|
@RestController
|
|
|
@RequestMapping("/api/config/build")
|
|
|
public class BuildConfigController {
|
|
|
- private BuildDirService buildDirService;
|
|
|
- private RepoAuthConfigService repoAuthConfigService;
|
|
|
- private CompilerConfigService compilerConfigService;
|
|
|
- private PackerConfigService packerConfigService;
|
|
|
-
|
|
|
- public BuildConfigController(BuildDirService buildDirService,
|
|
|
- RepoAuthConfigService repoAuthConfigService,
|
|
|
- CompilerConfigService compilerConfigService,
|
|
|
- PackerConfigService packerConfigService) {
|
|
|
- this.buildDirService = buildDirService;
|
|
|
- this.repoAuthConfigService = repoAuthConfigService;
|
|
|
- this.compilerConfigService = compilerConfigService;
|
|
|
- this.packerConfigService = packerConfigService;
|
|
|
+ private BuildDirCrudService buildDirCrudService;
|
|
|
+ private RepoAuthConfigCrudService repoAuthConfigCrudService;
|
|
|
+ private CompilerConfigCrudService compilerConfigCrudService;
|
|
|
+ private PackerConfigCrudService packerConfigCrudService;
|
|
|
+
|
|
|
+ public BuildConfigController(BuildDirCrudService buildDirCrudService,
|
|
|
+ RepoAuthConfigCrudService repoAuthConfigCrudService,
|
|
|
+ CompilerConfigCrudService compilerConfigCrudService,
|
|
|
+ PackerConfigCrudService packerConfigCrudService) {
|
|
|
+ this.buildDirCrudService = buildDirCrudService;
|
|
|
+ this.repoAuthConfigCrudService = repoAuthConfigCrudService;
|
|
|
+ this.compilerConfigCrudService = compilerConfigCrudService;
|
|
|
+ this.packerConfigCrudService = packerConfigCrudService;
|
|
|
}
|
|
|
|
|
|
/* 构建配置 */
|
|
|
@ApiOperation(value = "分页获取构建目录配置")
|
|
|
@GetMapping("/dir")
|
|
|
public ResponseEntity<String> getBuildDirByPage(@RequestParam("page") int page, @RequestParam("size") int size) {
|
|
|
- PageList<BuildDir> pageList = buildDirService.getByPage(page, size, "");
|
|
|
+ PageList<BuildDir> pageList = buildDirCrudService.getByPage(page, size, "");
|
|
|
return ResponseEntity.ok().body(WebResult.success(pageList));
|
|
|
}
|
|
|
|
|
|
@@ -61,7 +61,7 @@ public class BuildConfigController {
|
|
|
@PostMapping(value = "/repo", consumes = "application/json")
|
|
|
public ResponseEntity<String> addRepoConfig(@RequestBody String json) throws Exception {
|
|
|
RepoAuthConfig repoAuthConfig = JsonConverter.jsonToObject(json, RepoAuthConfig.class);
|
|
|
- repoAuthConfigService.insert(repoAuthConfig);
|
|
|
+ repoAuthConfigCrudService.insert(repoAuthConfig);
|
|
|
return ResponseEntity.ok().body(WebResult.success("ok"));
|
|
|
}
|
|
|
|
|
|
@@ -69,21 +69,21 @@ public class BuildConfigController {
|
|
|
@PutMapping("/repo")
|
|
|
public ResponseEntity<String> modifyRepoConfig(@RequestBody String json) throws Exception {
|
|
|
RepoAuthConfig repoAuthConfig = JsonConverter.jsonToObject(json, RepoAuthConfig.class);
|
|
|
- repoAuthConfigService.insert(repoAuthConfig);
|
|
|
+ repoAuthConfigCrudService.insert(repoAuthConfig);
|
|
|
return ResponseEntity.ok().body(WebResult.success("ok"));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "删除仓库认证配置")
|
|
|
@DeleteMapping("/repo/{uniqueKey}")
|
|
|
public ResponseEntity<String> deleteRepoConfig(@PathVariable("uniqueKey") String uniqueKey) throws Exception {
|
|
|
- repoAuthConfigService.delete(uniqueKey);
|
|
|
+ repoAuthConfigCrudService.delete(uniqueKey);
|
|
|
return ResponseEntity.ok().body(WebResult.success("ok"));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "分页获取仓库认证配置")
|
|
|
@GetMapping("/repo")
|
|
|
public ResponseEntity<String> getRepoConfigByPage(@RequestParam("page") int page, @RequestParam("size") int size) {
|
|
|
- PageList<RepoAuthConfig> pageList = repoAuthConfigService.getByPage(page, size, "");
|
|
|
+ PageList<RepoAuthConfig> pageList = repoAuthConfigCrudService.getByPage(page, size, "");
|
|
|
return ResponseEntity.ok().body(WebResult.success(pageList));
|
|
|
}
|
|
|
|
|
|
@@ -92,7 +92,7 @@ public class BuildConfigController {
|
|
|
@PostMapping(value = "/compiler", consumes = "application/json")
|
|
|
public ResponseEntity<String> addCompileConfig(@RequestBody String json) throws Exception {
|
|
|
CompilerConfig compilerConfig = JsonConverter.jsonToObject(json, CompilerConfig.class);
|
|
|
- compilerConfigService.insert(compilerConfig);
|
|
|
+ compilerConfigCrudService.insert(compilerConfig);
|
|
|
return ResponseEntity.ok().body(WebResult.success("ok"));
|
|
|
}
|
|
|
|
|
|
@@ -100,21 +100,21 @@ public class BuildConfigController {
|
|
|
@PutMapping("/compiler")
|
|
|
public ResponseEntity<String> modifyCompileConfig(@RequestBody String json) throws Exception {
|
|
|
CompilerConfig compilerConfig = JsonConverter.jsonToObject(json, CompilerConfig.class);
|
|
|
- compilerConfigService.insert(compilerConfig);
|
|
|
+ compilerConfigCrudService.insert(compilerConfig);
|
|
|
return ResponseEntity.ok().body(WebResult.success("ok"));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "删除应用编译配置")
|
|
|
@DeleteMapping("/compiler/{uniqueKey}")
|
|
|
public ResponseEntity<String> deleteCompileConfig(@PathVariable("uniqueKey") String uniqueKey) throws Exception {
|
|
|
- compilerConfigService.delete(uniqueKey);
|
|
|
+ compilerConfigCrudService.delete(uniqueKey);
|
|
|
return ResponseEntity.ok().body(WebResult.success("ok"));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "分页获取应用编译配置")
|
|
|
@GetMapping("/compiler")
|
|
|
public ResponseEntity<String> getCompileConfigByPage(@RequestParam("page") int page, @RequestParam("size") int size) {
|
|
|
- PageList<CompilerConfig> pageList = compilerConfigService.getByPage(page, size, "");
|
|
|
+ PageList<CompilerConfig> pageList = compilerConfigCrudService.getByPage(page, size, "");
|
|
|
return ResponseEntity.ok().body(WebResult.success(pageList));
|
|
|
}
|
|
|
|
|
|
@@ -123,7 +123,7 @@ public class BuildConfigController {
|
|
|
@PostMapping(value = "/packer", consumes = "application/json")
|
|
|
public ResponseEntity<String> addPackConfig(@RequestBody String json) throws Exception {
|
|
|
PackerConfig packerConfig = JsonConverter.jsonToObject(json, PackerConfig.class);
|
|
|
- packerConfigService.insert(packerConfig);
|
|
|
+ packerConfigCrudService.insert(packerConfig);
|
|
|
return ResponseEntity.ok().body(WebResult.success("ok"));
|
|
|
}
|
|
|
|
|
|
@@ -131,21 +131,21 @@ public class BuildConfigController {
|
|
|
@PutMapping("/packer")
|
|
|
public ResponseEntity<String> modifyPackConfig(@RequestBody String json) throws Exception {
|
|
|
PackerConfig packerConfig = JsonConverter.jsonToObject(json, PackerConfig.class);
|
|
|
- packerConfigService.insert(packerConfig);
|
|
|
+ packerConfigCrudService.insert(packerConfig);
|
|
|
return ResponseEntity.ok().body(WebResult.success("ok"));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "删除应用打包配置")
|
|
|
@DeleteMapping("/packer/{uniqueKey}")
|
|
|
public ResponseEntity<String> deletePackConfig(@PathVariable("uniqueKey") String uniqueKey) throws Exception {
|
|
|
- packerConfigService.delete(uniqueKey);
|
|
|
+ packerConfigCrudService.delete(uniqueKey);
|
|
|
return ResponseEntity.ok().body(WebResult.success("ok"));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "分页获取应用打包配置")
|
|
|
@GetMapping("/packer")
|
|
|
public ResponseEntity<String> getPackConfigByPage(@RequestParam("page") int page, @RequestParam("size") int size) {
|
|
|
- PageList<PackerConfig> pageList = packerConfigService.getByPage(page, size, "");
|
|
|
+ PageList<PackerConfig> pageList = packerConfigCrudService.getByPage(page, size, "");
|
|
|
return ResponseEntity.ok().body(WebResult.success(pageList));
|
|
|
}
|
|
|
}
|