|
|
|
@@ -45,7 +45,7 @@ public class ImageController extends BaseController { |
|
|
|
@RequestParam("size") int size, |
|
|
|
@RequestParam(value = "image_type") int imageType) { |
|
|
|
image.setImageType(imageType); |
|
|
|
PageRequest pageRequest = PageRequest.of(page,size); |
|
|
|
PageRequest pageRequest = PageRequest.of(page, size); |
|
|
|
return genericsSuccess(this.imageService.queryByPage(image, pageRequest)); |
|
|
|
} |
|
|
|
|
|
|
|
@@ -72,6 +72,7 @@ public class ImageController extends BaseController { |
|
|
|
public GenericsAjaxResult<Page<Image>> queryByName(@PathVariable("name") String name) { |
|
|
|
return genericsSuccess(this.imageService.queryByName(name)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 新增数据 |
|
|
|
* |
|
|
|
@@ -84,9 +85,8 @@ public class ImageController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* |
|
|
|
* @param imageVo 实体 |
|
|
|
* 新增镜像和版本 @PostMapping |
|
|
|
* 新增镜像和版本 @PostMapping |
|
|
|
* @return 新增结果 |
|
|
|
*/ |
|
|
|
@PostMapping("/addImageAndVersion") |
|
|
|
@@ -122,21 +122,20 @@ public class ImageController extends BaseController { |
|
|
|
@PostMapping("/net") |
|
|
|
@ApiOperation("从网络上传构建镜像") |
|
|
|
public GenericsAjaxResult<Map<String, String>> createImageFromNet(@RequestParam("name") String imageName, |
|
|
|
@RequestParam("tag") String imageTag, |
|
|
|
@RequestParam("path") String path) throws Exception { |
|
|
|
return genericsSuccess(this.imageService.createImageFromNet(imageName,imageTag,path)); |
|
|
|
@RequestParam("tag") String imageTag, |
|
|
|
@RequestParam("path") String path) throws Exception { |
|
|
|
return genericsSuccess(this.imageService.createImageFromNet(imageName, imageTag, path)); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/local") |
|
|
|
@ApiOperation("从本地上传构建镜像") |
|
|
|
public GenericsAjaxResult<Map<String, String>> createImageFromLocal(@RequestParam("name") String imageName, |
|
|
|
@RequestParam("tag") String imageTag, |
|
|
|
@RequestParam("path") String path) throws Exception { |
|
|
|
return genericsSuccess(this.imageService.createImageFromLocal(imageName,imageTag,path)); |
|
|
|
@RequestParam("tag") String imageTag, |
|
|
|
@RequestParam("path") String path) throws Exception { |
|
|
|
return genericsSuccess(this.imageService.createImageFromLocal(imageName, imageTag, path)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 镜像上传 |
|
|
|
* |
|
|
|
@@ -145,14 +144,14 @@ public class ImageController extends BaseController { |
|
|
|
@PostMapping("/upload") |
|
|
|
@ApiOperation(value = "上传镜像文件", notes = "上传镜像tar包,返回存储路径") |
|
|
|
public GenericsAjaxResult<Map<String, String>> uploadImageFiles(@RequestParam("file") MultipartFile file) throws Exception { |
|
|
|
return genericsSuccess(this.imageService.uploadImageFiles(file)); |
|
|
|
return genericsSuccess(this.imageService.uploadImageFiles(file)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/saveImage") |
|
|
|
@ApiOperation(value = "保存环境为镜像", notes = "docker commit方式保存,并推送到horbor") |
|
|
|
public GenericsAjaxResult<String> saveImage(@RequestBody ImageVo imageVo){ |
|
|
|
return genericsSuccess(this.imageService.saveImage(imageVo)); |
|
|
|
public void saveImage(@RequestBody ImageVo imageVo) { |
|
|
|
this.imageService.saveImage(imageVo); |
|
|
|
} |
|
|
|
} |
|
|
|
|