From a97a44ec43dd84942451ca09e7863eb3e61cbae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A5=BF=E5=A4=A7=E9=94=90?= <1070211640@qq.com> Date: Wed, 6 Mar 2024 16:49:35 +0800 Subject: [PATCH] =?UTF-8?q?=E9=95=9C=E5=83=8F=E7=AE=A1=E7=90=86=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E5=90=8D=E5=AD=97=E6=A8=A1=E7=B3=8A=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platform/controller/image/ImageController.java | 12 ++++++++++++ .../controller/workflow/WorkflowController.java | 2 +- .../java/com/ruoyi/platform/mapper/ImageDao.java | 1 + .../com/ruoyi/platform/service/ImageService.java | 3 +++ .../platform/service/impl/ImageServiceImpl.java | 6 ++++++ .../mapper/managementPlatform/ImageDaoMapper.xml | 13 +++++++++++++ 6 files changed, 36 insertions(+), 1 deletion(-) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/image/ImageController.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/image/ImageController.java index 54cd404e..df1985f2 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/image/ImageController.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/image/ImageController.java @@ -51,10 +51,22 @@ public class ImageController { * @return 单条数据 */ @GetMapping("{id}") + @ApiOperation("按id查询镜像") public AjaxResult queryById(@PathVariable("id") Integer id) { return AjaxResult.success(this.imageService.queryById(id)); } + /** + * 按镜像名字模糊查询 + * + * @param name 筛选条件 + * @return 查询结果 + */ + @GetMapping("name/{name}") + @ApiOperation("按名字模糊查询镜像") + public AjaxResult queryByName(@PathVariable("name") String name) { + return AjaxResult.success(this.imageService.queryByName(name)); + } /** * 新增数据 * diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/workflow/WorkflowController.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/workflow/WorkflowController.java index 816247eb..4d40f6cd 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/workflow/WorkflowController.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/workflow/WorkflowController.java @@ -76,7 +76,7 @@ public class WorkflowController { * @return 新增结果 */ @PostMapping - @ApiOperation("新增") + @ApiOperation("新增流水线") public AjaxResult add(@RequestBody Workflow workflow) { return AjaxResult.success(this.workflowService.insert(workflow)); } diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/mapper/ImageDao.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/mapper/ImageDao.java index 8f6402e6..d0aa74c4 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/mapper/ImageDao.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/mapper/ImageDao.java @@ -79,5 +79,6 @@ public interface ImageDao { */ int deleteById(Integer id); + List queryByName(String name); } diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/ImageService.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/ImageService.java index cf5cdff7..297ea454 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/ImageService.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/ImageService.java @@ -1,6 +1,7 @@ package com.ruoyi.platform.service; import com.ruoyi.platform.domain.Image; +import com.ruoyi.platform.domain.Workflow; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; @@ -58,4 +59,6 @@ public interface ImageService { boolean deleteById(Integer id); String removeById(Integer id); + + Page queryByName(String name); } diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ImageServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ImageServiceImpl.java index e1ee727a..a2ee3e02 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ImageServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ImageServiceImpl.java @@ -4,6 +4,7 @@ import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.platform.domain.Image; import com.ruoyi.platform.domain.ImageVersion; import com.ruoyi.platform.domain.Models; +import com.ruoyi.platform.domain.Workflow; import com.ruoyi.platform.mapper.ImageDao; import com.ruoyi.platform.mapper.ImageVersionDao; import com.ruoyi.platform.service.ImageService; @@ -136,4 +137,9 @@ public class ImageServiceImpl implements ImageService { } + + @Override + public Page queryByName(String name) { + return new PageImpl<>(this.imageDao.queryByName(name)); + } } diff --git a/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ImageDaoMapper.xml b/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ImageDaoMapper.xml index 64661a99..3d58d2e8 100644 --- a/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ImageDaoMapper.xml +++ b/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ImageDaoMapper.xml @@ -60,6 +60,19 @@ limit #{pageable.offset}, #{pageable.pageSize} + + +