mirror of
https://github.com/zfile-dev/zfile.git
synced 2025-04-19 05:34:52 +00:00
✨ 清洁代码
This commit is contained in:
@@ -27,14 +27,15 @@ public class AliyunServiceImpl extends AbstractS3FileService implements FileServ
|
||||
@Override
|
||||
public void init() {
|
||||
try {
|
||||
Map<String, StorageConfig> stringStorageConfigMap = storageConfigService.selectStorageConfigMapByKey(StorageTypeEnum.ALIYUN);
|
||||
Map<String, StorageConfig> stringStorageConfigMap =
|
||||
storageConfigService.selectStorageConfigMapByKey(getStorageTypeEnum());
|
||||
String accessKey = stringStorageConfigMap.get(StorageConfigConstant.ACCESS_KEY).getValue();
|
||||
String secretKey = stringStorageConfigMap.get(StorageConfigConstant.SECRET_KEY).getValue();
|
||||
String endPoint = stringStorageConfigMap.get(StorageConfigConstant.ENDPOINT_KEY).getValue();
|
||||
|
||||
super.bucketName = stringStorageConfigMap.get(StorageConfigConstant.BUCKET_NAME_KEY).getValue();
|
||||
super.domain = stringStorageConfigMap.get(StorageConfigConstant.DOMAIN_KEY).getValue();
|
||||
super.basePath = stringStorageConfigMap.get(StorageConfigConstant.BASE_PATH).getValue();
|
||||
super.bucketName = stringStorageConfigMap.get(StorageConfigConstant.BUCKET_NAME_KEY).getValue();
|
||||
|
||||
if (Objects.isNull(accessKey) || Objects.isNull(secretKey) || Objects.isNull(endPoint) || Objects.isNull(bucketName)) {
|
||||
log.debug("初始化存储策略 [{}] 失败: 参数不完整", getStorageTypeEnum().getDescription());
|
||||
|
||||
@@ -16,7 +16,6 @@ import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author zhaojun
|
||||
* @date 2020/1/11 14:03
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/cache")
|
||||
|
||||
@@ -10,7 +10,6 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author zhaojun
|
||||
* @date 2020/1/13 21:40
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/common")
|
||||
|
||||
@@ -2,7 +2,6 @@ package im.zhaojun.common.exception;
|
||||
|
||||
/**
|
||||
* @author zhaojun
|
||||
* @date 2020/1/20 22:15
|
||||
*/
|
||||
public class NotExistFileException extends RuntimeException {
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package im.zhaojun.common.model.constant;
|
||||
|
||||
/**
|
||||
* @author zhaojun
|
||||
* @date 2019/12/28 18:47
|
||||
*/
|
||||
public class StorageConfigConstant {
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author zhaojun
|
||||
* @date 2020/1/3 12:39
|
||||
*/
|
||||
@Data
|
||||
public class CacheConfigDTO {
|
||||
|
||||
@@ -31,7 +31,6 @@ import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhaojun
|
||||
* @date 2019/12/28 19:27
|
||||
*/
|
||||
@Slf4j
|
||||
public abstract class AbstractFileService extends FileCacheService implements FileService {
|
||||
|
||||
@@ -7,7 +7,6 @@ import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author zhaojun
|
||||
* @date 2020/1/11 14:08
|
||||
*/
|
||||
@Service
|
||||
public class FileCacheService {
|
||||
|
||||
@@ -19,7 +19,6 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author zhaojun
|
||||
* @date 2020/1/12 13:53
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
|
||||
@@ -17,7 +17,6 @@ import java.util.Collections;
|
||||
|
||||
/**
|
||||
* @author zhaojun
|
||||
* @date 2020/1/18 17:13
|
||||
*/
|
||||
@Configuration
|
||||
public class OneDriveConfig {
|
||||
|
||||
@@ -5,7 +5,6 @@ import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author zhaojun
|
||||
* @date 2020/1/18 17:28
|
||||
*/
|
||||
@Data
|
||||
public class OneDriveToken {
|
||||
|
||||
@@ -19,7 +19,6 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author zhaojun
|
||||
* @date 2020/1/12 13:53
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
|
||||
Reference in New Issue
Block a user