🔨 移动无用代码

This commit is contained in:
zhaojun
2022-08-05 15:24:46 +08:00
parent 49806221b4
commit 8460d17b07
6 changed files with 3 additions and 99 deletions

View File

@@ -42,12 +42,7 @@ public enum FileOperatorTypeEnum {
/**
* 移动文件&文件夹操作
*/
MOVE("移动", "move"),
/**
* 搜索操作
*/
SEARCH("搜索", "search");
MOVE("移动", "move");
private final String name;

View File

@@ -1,7 +1,6 @@
package im.zhaojun.zfile.common.cache;
import cn.hutool.cache.impl.CacheObj;
import cn.hutool.core.util.StrUtil;
import im.zhaojun.zfile.admin.model.dto.StorageSourceCacheKey;
import im.zhaojun.zfile.admin.model.entity.StorageSource;
import im.zhaojun.zfile.admin.service.StorageSourceService;
@@ -13,7 +12,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -113,45 +111,6 @@ public class ZFileCache {
}
/**
* 获取指定存储源中已缓存文件夹数量
*
* @param storageId
* 存储源 ID
*
* @return 已缓存文件夹数量
*/
public int cacheCount(Integer storageId) {
return getCacheByStorageId(storageId).size();
}
/**
* 指定存储源, 根据文件及文件名查找相关的文件
*
* @param storageId
* 存储源 ID
*
* @param key
* 搜索键, 可匹配文件夹名称和文件名称.
*
* @return 搜索结果, 包含文件夹和文件.
*/
public List<FileItemResult> find(Integer storageId, String key) {
return new ArrayList<>();
}
private boolean testMatch(String searchKey, boolean ignoreCase, FileItemResult fileItemResult) {
// 根据是否需要忽略大小写来匹配文件(夹)名
if (ignoreCase) {
return StrUtil.containsIgnoreCase(fileItemResult.getName(), searchKey);
} else {
return StrUtil.contains(fileItemResult.getName(), searchKey);
}
}
/**
* 获取所有缓存 key (文件夹名称)

View File

@@ -79,19 +79,6 @@ public class FileOperatorCheckAspect {
return check(point, FileOperatorTypeEnum.RENAME);
}
/**
* 搜索功能权限校验
*
* @param point
* 连接点
*
* @return 方法运行结果
*/
@Around("execution(public * im.zhaojun.zfile.home.service.base.AbstractBaseFileService.search(..))")
public Object searchAround(ProceedingJoinPoint point) throws Throwable {
return check(point, FileOperatorTypeEnum.SEARCH);
}
/**
* 校验是否有此文件操作的权限
*

View File

@@ -22,7 +22,7 @@ import java.util.List;
/**
* 校验 referer 防盗链.
*
* <p>
* 校验所有标注了 {@link RefererCheck} 的注解
*
* @author zhaojun
@@ -51,7 +51,7 @@ public class RefererCheckAspect {
*
* @return 方法运行结果
*/
@Around(value = "@annotation(im.zhaojun.zfile.admin.annoation.RefererCheck)")
@Around(value = "@annotation(im.zhaojun.zfile.admin.annotation.RefererCheck)")
public Object around(ProceedingJoinPoint point) throws Throwable {
// 获取配置的 referer 类型
SystemConfigDTO systemConfig = systemConfigService.getSystemConfig();

View File

@@ -1,26 +0,0 @@
package im.zhaojun.zfile.home.model.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* 搜索存储源中文件请求参数
*
* @author zhaojun
*/
@Data
@ApiModel(description = "搜索存储源中文件请求类")
public class SearchStorageRequest {
@ApiModelProperty(value = "存储源 key", required = true, example = "local")
@NotBlank(message = "存储源 key 不能为空")
private String storageKey;
@ApiModelProperty(value = "搜索 key", required = true, example = "png")
@NotBlank(message = "搜索 key 不能为空")
private String searchVal;
}

View File

@@ -195,17 +195,6 @@ public abstract class AbstractBaseFileService<P extends IStorageParam> implement
}
/**
* 搜索文件
*
* @param name 文件名
* @return 包含该文件名的所有文件或文件夹
*/
public synchronized List<FileItemResult> search(String name) {
return zFileCache.find(storageId, name);
}
/**
* 获取单个文件信息
*