| | |
| | | package org.dromara.system.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.convert.Convert; |
| | | import cn.hutool.core.io.IoUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.dromara.common.core.constant.CacheNames; |
| | | import org.dromara.common.core.domain.dto.OssDTO; |
| | | import org.dromara.common.core.exception.ServiceException; |
| | | import org.dromara.common.core.service.OssService; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | |
| | | return String.join(StringUtils.SEPARATOR, list); |
| | | } |
| | | |
| | | @Override |
| | | public List<OssDTO> selectByIds(String ossIds) { |
| | | List<OssDTO> list = new ArrayList<>(); |
| | | for (Long id : StringUtils.splitTo(ossIds, Convert::toLong)) { |
| | | SysOssVo vo = SpringUtils.getAopProxy(this).getById(id); |
| | | if (ObjectUtil.isNotNull(vo)) { |
| | | try { |
| | | vo.setUrl(this.matchingUrl(vo).getUrl()); |
| | | list.add(BeanUtil.toBean(vo, OssDTO.class)); |
| | | } catch (Exception ignored) { |
| | | // 如果oss异常无法连接则将数据直接返回 |
| | | list.add(BeanUtil.toBean(vo, OssDTO.class)); |
| | | } |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | private LambdaQueryWrapper<SysOss> buildQueryWrapper(SysOssBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<SysOss> lqw = Wrappers.lambdaQuery(); |