feat: update
This commit is contained in:
@@ -87,7 +87,6 @@ public interface SchisandraAuthUserDomainService {
|
||||
* @author: landaiqing
|
||||
* @date: 2024/5/26 17:27
|
||||
*/
|
||||
@Cacheable(value = "userInfo", key = "#userId")
|
||||
SchisandraAuthUserBO queryById(String userId);
|
||||
|
||||
/**
|
||||
|
@@ -167,12 +167,12 @@ public class SchisandraOssMinioController {
|
||||
Preconditions.checkNotNull(userId, "不能为空");
|
||||
MinioOssClient bean = SpringUtil.getBean(OssConstant.OssType.MINIO + userId);
|
||||
bean.getMinioOssConfig().setBucketName(bucket);
|
||||
List<OssInfo> object = (List<OssInfo>) caffeineUtil.caffeineBuild().getIfPresent(userId + bucket + dirName);
|
||||
List<OssInfo> object = (List<OssInfo>) caffeineUtil.caffeineBuild().getIfPresent("MinioListDir" + userId + bucket + dirName);
|
||||
if (object != null) {
|
||||
return Result.ok(object);
|
||||
} else {
|
||||
List<OssInfo> list = bean.listDir(bucket, dirName);
|
||||
caffeineUtil.caffeineBuild().put(userId + bucket + dirName, list);
|
||||
caffeineUtil.caffeineBuild().put("MinioListDir" + userId + bucket + dirName, list);
|
||||
return Result.ok(list);
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ public class SchisandraOssMinioController {
|
||||
Preconditions.checkNotNull(userId, "不能为空");
|
||||
Preconditions.checkNotNull(filePath, "不能为空");
|
||||
int index = filePath.lastIndexOf("/");
|
||||
String fileName = filePath.substring(index + 1);
|
||||
String fileName = filePath.substring(0,index + 1);
|
||||
caffeineUtil.caffeineBuild().invalidate("MinioListDir" + userId + bucket + fileName);
|
||||
MinioOssClient bean = SpringUtil.getBean(OssConstant.OssType.MINIO + userId);
|
||||
bean.getMinioOssConfig().setBucketName(bucket);
|
||||
@@ -255,14 +255,15 @@ public class SchisandraOssMinioController {
|
||||
String path = schisandraOssMinioDTO.getPath();
|
||||
String bucket = schisandraOssMinioDTO.getBucketName();
|
||||
String userId = schisandraOssMinioDTO.getUserId();
|
||||
Preconditions.checkNotNull(path, "path不能为空");
|
||||
Preconditions.checkNotNull(bucket, "bucket不能为空");
|
||||
Preconditions.checkNotNull(userId, "userId不能为空");
|
||||
if (path.lastIndexOf("") == path.length() - 1) {
|
||||
path = path + file.getName();
|
||||
} else {
|
||||
if (path == null || "".equals(path)) {
|
||||
path = "/";
|
||||
}
|
||||
if (path.lastIndexOf("/") < path.length() - 1) {
|
||||
path = path + "/" + file.getOriginalFilename();
|
||||
}
|
||||
path=path+file.getOriginalFilename();
|
||||
// 获取文件输入流
|
||||
InputStream is = file.getInputStream();
|
||||
MinioOssClient bean = SpringUtil.getBean(OssConstant.OssType.MINIO + userId);
|
||||
|
@@ -31,7 +31,7 @@ public class OssConstant {
|
||||
*/
|
||||
public static final Integer DEFAULT_TASK_NUM = Runtime.getRuntime().availableProcessors();
|
||||
|
||||
public static final Long DEFAULT_CONNECTION_TIMEOUT = TimeUnit.MINUTES.toMillis(5);
|
||||
public static final Long DEFAULT_CONNECTION_TIMEOUT = TimeUnit.MINUTES.toMillis(10);
|
||||
|
||||
/**
|
||||
* OSS存储类型
|
||||
|
@@ -44,7 +44,7 @@ public class MinioOssClientConfig implements Serializable {
|
||||
/**
|
||||
* 是否开始连接失败重试,默认不支持
|
||||
*/
|
||||
private boolean retryOnConnectionFailure = false;
|
||||
private boolean retryOnConnectionFailure = true;
|
||||
/**
|
||||
* 连接健康检测间隔时长(单位:毫秒)
|
||||
*/
|
||||
|
@@ -1,6 +1,10 @@
|
||||
server:
|
||||
port: 4000
|
||||
spring:
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 100MB # 设置单个文件最大大小为10MB
|
||||
max-request-size: 100MB # 设置多个文件大小为100MB
|
||||
datasource:
|
||||
username: root
|
||||
password: BZbVbGDBePiA2q8/mt0eMxKNpHniDzxBtOxFadQiAOTDzCDlopC4qOKwwBEi9CAZcuFsCrRJdwn0wP6jwsnzxw==
|
||||
|
Reference in New Issue
Block a user