|
|
@@ -3,9 +3,9 @@ package cn.reghao.autodop.dmaster.app.controller.crud;
|
|
|
import cn.reghao.autodop.common.result.WebResult;
|
|
|
import cn.reghao.autodop.common.utils.data.db.PageList;
|
|
|
import cn.reghao.autodop.common.utils.data.serializer.JsonConverter;
|
|
|
-import cn.reghao.autodop.dmaster.app.entity.build.tools.CompilerConfig;
|
|
|
-import cn.reghao.autodop.dmaster.app.entity.build.tools.PackerConfig;
|
|
|
-import cn.reghao.autodop.dmaster.app.entity.build.tools.RepoConfig;
|
|
|
+import cn.reghao.autodop.dmaster.app.entity.config.build.tools.CompilerConfig;
|
|
|
+import cn.reghao.autodop.dmaster.app.entity.config.build.tools.PackerConfig;
|
|
|
+import cn.reghao.autodop.dmaster.app.entity.config.build.tools.RepoConfig;
|
|
|
import cn.reghao.autodop.dmaster.app.service.crud.build.CompilerConfigCrudService;
|
|
|
import cn.reghao.autodop.dmaster.app.service.crud.build.PackerConfigCrudService;
|
|
|
import cn.reghao.autodop.dmaster.app.service.crud.build.RepoConfigCrudService;
|
|
|
@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
* @date 2019-08-30 18:49:15
|
|
|
*/
|
|
|
@Slf4j
|
|
|
-@Api(tags = "应用构建配置 CRUD 接口")
|
|
|
+@Api(tags = "构建配置 CRUD 接口")
|
|
|
@RestController
|
|
|
@RequestMapping("/api/config/build")
|
|
|
public class BuildConfigCrudController {
|
|
|
@@ -36,94 +36,94 @@ public class BuildConfigCrudController {
|
|
|
this.packerConfigCrudService = packerConfigCrudService;
|
|
|
}
|
|
|
|
|
|
- /* 应用更新配置 */
|
|
|
- @ApiOperation(value = "添加应用更新配置")
|
|
|
- @PostMapping(value = "/update", consumes = "application/json")
|
|
|
- public ResponseEntity<String> addUpdateConfig(@RequestBody String json) throws Exception {
|
|
|
- RepoConfig appUpdate = (RepoConfig) JsonConverter.jsonToObject(json, RepoConfig.class);
|
|
|
- repoConfigCrudService.addOrModify(appUpdate);
|
|
|
+ /* 仓库配置 */
|
|
|
+ @ApiOperation(value = "添加仓库配置")
|
|
|
+ @PostMapping(value = "/repo", consumes = "application/json")
|
|
|
+ public ResponseEntity<String> addRepoConfig(@RequestBody String json) throws Exception {
|
|
|
+ RepoConfig repoConfig = (RepoConfig) JsonConverter.jsonToObject(json, RepoConfig.class);
|
|
|
+ repoConfigCrudService.addOrModify(repoConfig);
|
|
|
return ResponseEntity.ok().body(WebResult.success("ok"));
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "分页获取应用更新配置")
|
|
|
- @GetMapping("/update")
|
|
|
- public ResponseEntity<String> getUpdateConfigByPage(@RequestParam("page") int page, @RequestParam("size") int size) {
|
|
|
+ @ApiOperation(value = "分页获取仓库配置")
|
|
|
+ @GetMapping("/repo")
|
|
|
+ public ResponseEntity<String> getRepoConfigByPage(@RequestParam("page") int page, @RequestParam("size") int size) {
|
|
|
PageList<RepoConfig> pageList = repoConfigCrudService.getByPage(page, size);
|
|
|
return ResponseEntity.ok().body(WebResult.success(pageList));
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "修改应用更新配置")
|
|
|
- @PutMapping("/update")
|
|
|
- public ResponseEntity<String> modifyUpdateConfig(@RequestBody String json) throws Exception {
|
|
|
- RepoConfig appUpdate = (RepoConfig) JsonConverter.jsonToObject(json, RepoConfig.class);
|
|
|
- repoConfigCrudService.addOrModify(appUpdate);
|
|
|
+ @ApiOperation(value = "修改仓库配置")
|
|
|
+ @PutMapping("/repo")
|
|
|
+ public ResponseEntity<String> modifyRepoConfig(@RequestBody String json) throws Exception {
|
|
|
+ RepoConfig repoConfig = (RepoConfig) JsonConverter.jsonToObject(json, RepoConfig.class);
|
|
|
+ repoConfigCrudService.addOrModify(repoConfig);
|
|
|
return ResponseEntity.ok().body(WebResult.success("ok"));
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "删除应用更新配置")
|
|
|
- @DeleteMapping("/update/{uniqueKey}")
|
|
|
- public ResponseEntity<String> deleteUpdateConfig(@PathVariable("uniqueKey") String uniqueKey) throws Exception {
|
|
|
+ @ApiOperation(value = "删除仓库配置")
|
|
|
+ @DeleteMapping("/repo/{uniqueKey}")
|
|
|
+ public ResponseEntity<String> deleteRepoConfig(@PathVariable("uniqueKey") String uniqueKey) throws Exception {
|
|
|
repoConfigCrudService.delete(uniqueKey);
|
|
|
return ResponseEntity.ok().body(WebResult.success("ok"));
|
|
|
}
|
|
|
|
|
|
- /* 应用编译配置 */
|
|
|
- @ApiOperation(value = "添加应用编译配置")
|
|
|
- @PostMapping(value = "/compile", consumes = "application/json")
|
|
|
+ /* 编译器配置 */
|
|
|
+ @ApiOperation(value = "添加编译器配置")
|
|
|
+ @PostMapping(value = "/compiler", consumes = "application/json")
|
|
|
public ResponseEntity<String> addCompileConfig(@RequestBody String json) throws Exception {
|
|
|
- CompilerConfig appCompile = (CompilerConfig) JsonConverter.jsonToObject(json, CompilerConfig.class);
|
|
|
- compilerConfigCrudService.addOrModify(appCompile);
|
|
|
+ CompilerConfig compilerConfig = (CompilerConfig) JsonConverter.jsonToObject(json, CompilerConfig.class);
|
|
|
+ compilerConfigCrudService.addOrModify(compilerConfig);
|
|
|
return ResponseEntity.ok().body(WebResult.success("ok"));
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "分页获取应用编译配置")
|
|
|
- @GetMapping("/compile")
|
|
|
+ @ApiOperation(value = "分页获取编译器配置")
|
|
|
+ @GetMapping("/compiler")
|
|
|
public ResponseEntity<String> getCompileConfigByPage(@RequestParam("page") int page, @RequestParam("size") int size) {
|
|
|
PageList<CompilerConfig> pageList = compilerConfigCrudService.getByPage(page, size);
|
|
|
return ResponseEntity.ok().body(WebResult.success(pageList));
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "修改应用编译配置")
|
|
|
- @PutMapping("/compile")
|
|
|
+ @ApiOperation(value = "修改编译器配置")
|
|
|
+ @PutMapping("/compiler")
|
|
|
public ResponseEntity<String> modifyCompileConfig(@RequestBody String json) throws Exception {
|
|
|
- CompilerConfig appCompile = (CompilerConfig) JsonConverter.jsonToObject(json, CompilerConfig.class);
|
|
|
- compilerConfigCrudService.addOrModify(appCompile);
|
|
|
+ CompilerConfig compilerConfig = (CompilerConfig) JsonConverter.jsonToObject(json, CompilerConfig.class);
|
|
|
+ compilerConfigCrudService.addOrModify(compilerConfig);
|
|
|
return ResponseEntity.ok().body(WebResult.success("ok"));
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "删除应用编译配置")
|
|
|
- @DeleteMapping("/compile/{uniqueKey}")
|
|
|
+ @ApiOperation(value = "删除编译器配置")
|
|
|
+ @DeleteMapping("/compiler/{uniqueKey}")
|
|
|
public ResponseEntity<String> deleteCompileConfig(@PathVariable("uniqueKey") String uniqueKey) throws Exception {
|
|
|
compilerConfigCrudService.delete(uniqueKey);
|
|
|
return ResponseEntity.ok().body(WebResult.success("ok"));
|
|
|
}
|
|
|
|
|
|
- /* 应用打包配置 */
|
|
|
- @ApiOperation(value = "添加应用打包配置")
|
|
|
- @PostMapping(value = "/pack", consumes = "application/json")
|
|
|
+ /* 打包方式配置 */
|
|
|
+ @ApiOperation(value = "添加打包方式配置")
|
|
|
+ @PostMapping(value = "/packer", consumes = "application/json")
|
|
|
public ResponseEntity<String> addPackConfig(@RequestBody String json) throws Exception {
|
|
|
- PackerConfig appPack = (PackerConfig) JsonConverter.jsonToObject(json, PackerConfig.class);
|
|
|
- packerConfigCrudService.addOrModify(appPack);
|
|
|
+ PackerConfig packerConfig = (PackerConfig) JsonConverter.jsonToObject(json, PackerConfig.class);
|
|
|
+ packerConfigCrudService.addOrModify(packerConfig);
|
|
|
return ResponseEntity.ok().body(WebResult.success("ok"));
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "分页获取应用打包配置")
|
|
|
- @GetMapping("/pack")
|
|
|
+ @ApiOperation(value = "分页获取打包方式配置")
|
|
|
+ @GetMapping("/packer")
|
|
|
public ResponseEntity<String> getPackConfigByPage(@RequestParam("page") int page, @RequestParam("size") int size) {
|
|
|
PageList<PackerConfig> pageList = packerConfigCrudService.getByPage(page, size);
|
|
|
return ResponseEntity.ok().body(WebResult.success(pageList));
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "修改应用打包配置")
|
|
|
- @PutMapping("/pack")
|
|
|
+ @ApiOperation(value = "修改打包方式配置")
|
|
|
+ @PutMapping("/packer")
|
|
|
public ResponseEntity<String> modifyPackConfig(@RequestBody String json) throws Exception {
|
|
|
- PackerConfig appPack = (PackerConfig) JsonConverter.jsonToObject(json, PackerConfig.class);
|
|
|
- packerConfigCrudService.addOrModify(appPack);
|
|
|
+ PackerConfig packerConfig = (PackerConfig) JsonConverter.jsonToObject(json, PackerConfig.class);
|
|
|
+ packerConfigCrudService.addOrModify(packerConfig);
|
|
|
return ResponseEntity.ok().body(WebResult.success("ok"));
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "删除应用打包配置")
|
|
|
- @DeleteMapping("/pack/{uniqueKey}")
|
|
|
+ @ApiOperation(value = "删除打包方式配置")
|
|
|
+ @DeleteMapping("/packer/{uniqueKey}")
|
|
|
public ResponseEntity<String> deletePackConfig(@PathVariable("uniqueKey") String uniqueKey) throws Exception {
|
|
|
packerConfigCrudService.delete(uniqueKey);
|
|
|
return ResponseEntity.ok().body(WebResult.success("ok"));
|