|
|
@@ -3,11 +3,11 @@ package com.vber.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.IdUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.vber.common.core.constant.CacheNames;
|
|
|
import com.vber.common.core.domain.dto.OssDTO;
|
|
|
import com.vber.common.core.exception.ServiceException;
|
|
|
import com.vber.common.core.service.OssService;
|
|
|
@@ -34,6 +34,7 @@ import com.vber.system.service.ISysOssService;
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
+import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
@@ -60,7 +61,7 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
|
|
|
|
|
|
private final SysOssMapper baseMapper;
|
|
|
|
|
|
- private final String[] SysFileSuffix = new String[] { "avatar", "system" };
|
|
|
+ private final String[] SysFileSuffix = new String[]{"avatar", "system"};
|
|
|
|
|
|
/**
|
|
|
* 查询OSS对象存储列表
|
|
|
@@ -177,7 +178,7 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
|
|
|
* @param ossId 文件在数据库中的唯一标识
|
|
|
* @return SysOssVo 对象,包含文件信息
|
|
|
*/
|
|
|
- // @Cacheable(cacheNames = CacheNames.SYS_OSS, key = "#ossId")
|
|
|
+ @Cacheable(cacheNames = CacheNames.SYS_OSS, key = "#ossId")
|
|
|
@Override
|
|
|
public SysOssVo getById(Long ossId) {
|
|
|
return baseMapper.selectVoById(ossId);
|
|
|
@@ -189,7 +190,7 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
|
|
|
* @param objectId 文件唯一标识
|
|
|
* @return SysOssVo 对象,包含文件信息
|
|
|
*/
|
|
|
- // @Cacheable(cacheNames = CacheNames.SYS_OSS, key = "#objectId")
|
|
|
+ @Cacheable(cacheNames = CacheNames.SYS_OSS, key = "#objectId")
|
|
|
@Override
|
|
|
public SysOssVo getByObjectId(String objectId) {
|
|
|
TenantHelper.enableIgnore();
|
|
|
@@ -340,7 +341,7 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
|
|
|
|
|
|
@NotNull
|
|
|
private SysOssVo buildResultEntity(String originalFileName, String suffix, String configKey,
|
|
|
- PutObjectResult uploadResult, SysOssExt ext1) {
|
|
|
+ PutObjectResult uploadResult, SysOssExt ext1) {
|
|
|
SysOss oss = new SysOss();
|
|
|
oss.setUrl(uploadResult.url());
|
|
|
oss.setFileSuffix(suffix);
|