From af6a08398e2bc22f3c8a3a615cbd9e23190be906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Thu, 12 May 2022 10:55:44 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=8E=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=20=E4=BD=BF=E7=94=A8id=E5=AD=98=E5=82=A8=E5=9B=9E?= =?UTF-8?q?=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/SysOssController.java | 14 ++++++++ .../ruoyi/system/service/ISysOssService.java | 3 ++ .../service/impl/SysOssServiceImpl.java | 5 +++ ruoyi-ui/src/api/system/oss.js | 8 +++++ ruoyi-ui/src/components/FileUpload/index.vue | 36 +++++++++++++------ ruoyi-ui/src/components/ImageUpload/index.vue | 35 +++++++++++------- 6 files changed, 78 insertions(+), 23 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java index a128a15f..d4e52acc 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java @@ -32,6 +32,7 @@ import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -58,6 +59,19 @@ public class SysOssController extends BaseController { return iSysOssService.queryPageList(bo, pageQuery); } + /** + * 查询OSS对象基于id串 + */ + @ApiOperation("查询OSS对象基于ID") + @SaCheckPermission("system:oss:list") + @GetMapping("/listByIds/{ossIds}") + public R> listByIds(@ApiParam("OSS对象ID串") + @NotEmpty(message = "主键不能为空") + @PathVariable Long[] ossIds) { + List list = iSysOssService.listByIds(Arrays.asList(ossIds)); + return R.ok(list); + } + /** * 上传OSS对象存储 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOssService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOssService.java index b444e6d0..c55e5bc1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOssService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOssService.java @@ -8,6 +8,7 @@ import com.ruoyi.system.domain.vo.SysOssVo; import org.springframework.web.multipart.MultipartFile; import java.util.Collection; +import java.util.List; /** * 文件上传 服务层 @@ -18,6 +19,8 @@ public interface ISysOssService { TableDataInfo queryPageList(SysOssBo sysOss, PageQuery pageQuery); + List listByIds(Collection ossIds); + SysOss getById(Long ossId); SysOss upload(MultipartFile file); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssServiceImpl.java index 25dfd5cb..28bee3d2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOssServiceImpl.java @@ -42,6 +42,11 @@ public class SysOssServiceImpl implements ISysOssService { return TableDataInfo.build(result); } + @Override + public List listByIds(Collection ossIds) { + return baseMapper.selectVoById(ossIds); + } + private LambdaQueryWrapper buildQueryWrapper(SysOssBo bo) { Map params = bo.getParams(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); diff --git a/ruoyi-ui/src/api/system/oss.js b/ruoyi-ui/src/api/system/oss.js index 83adca54..7d800260 100644 --- a/ruoyi-ui/src/api/system/oss.js +++ b/ruoyi-ui/src/api/system/oss.js @@ -9,6 +9,14 @@ export function listOss(query) { }) } +// 查询OSS对象基于id串 +export function listByIds(ossId) { + return request({ + url: '/system/oss/listByIds/' + ossId, + method: 'get' + }) +} + // 删除OSS对象存储 export function delOss(ossId) { return request({ diff --git a/ruoyi-ui/src/components/FileUpload/index.vue b/ruoyi-ui/src/components/FileUpload/index.vue index f41a712c..e999f14f 100644 --- a/ruoyi-ui/src/components/FileUpload/index.vue +++ b/ruoyi-ui/src/components/FileUpload/index.vue @@ -41,7 +41,7 @@ diff --git a/ruoyi-ui/src/components/ImageUpload/index.vue b/ruoyi-ui/src/components/ImageUpload/index.vue index 2d1ed577..62199795 100644 --- a/ruoyi-ui/src/components/ImageUpload/index.vue +++ b/ruoyi-ui/src/components/ImageUpload/index.vue @@ -44,7 +44,7 @@