clean code
This commit is contained in:
parent
1b71543cb6
commit
b840c659a0
|
|
@ -5,7 +5,6 @@ import org.springframework.http.ResponseEntity;
|
|||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
public interface FileService {
|
||||
|
||||
|
|
|
|||
|
|
@ -58,16 +58,6 @@ public class CommonService {
|
|||
@Resource
|
||||
private FileFormatService fileFormatService;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
PATH_MAP.put(DataOwnEnum.SYS_FILE.code, elePropertyConfig.getSysPrjPath());
|
||||
PATH_MAP.put(DataOwnEnum.SYS_PRJ.code, elePropertyConfig.getSysPrjPath());
|
||||
PATH_MAP.put(DataOwnEnum.USER_PRJ.code, elePropertyConfig.getUserPrjPath());
|
||||
PATH_MAP.put(DataOwnEnum.USER_FILE.code, elePropertyConfig.getUserPrjPath());
|
||||
PATH_MAP.put(DataOwnEnum.REPO_FILE.code, elePropertyConfig.getRepoPrjPath());
|
||||
PATH_MAP.put(DataOwnEnum.REPO_PRJ.code, elePropertyConfig.getRepoPrjPath());
|
||||
}
|
||||
|
||||
private static String createTree(List<EdFileInfo> edFileInfos, Object object) {
|
||||
|
||||
TreeNodeConfig config = new TreeNodeConfig();
|
||||
|
|
@ -120,6 +110,16 @@ public class CommonService {
|
|||
}
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
PATH_MAP.put(DataOwnEnum.SYS_FILE.code, elePropertyConfig.getSysPrjPath());
|
||||
PATH_MAP.put(DataOwnEnum.SYS_PRJ.code, elePropertyConfig.getSysPrjPath());
|
||||
PATH_MAP.put(DataOwnEnum.USER_PRJ.code, elePropertyConfig.getUserPrjPath());
|
||||
PATH_MAP.put(DataOwnEnum.USER_FILE.code, elePropertyConfig.getUserPrjPath());
|
||||
PATH_MAP.put(DataOwnEnum.REPO_FILE.code, elePropertyConfig.getRepoPrjPath());
|
||||
PATH_MAP.put(DataOwnEnum.REPO_PRJ.code, elePropertyConfig.getRepoPrjPath());
|
||||
}
|
||||
|
||||
public String getEleDataPath(int dataOwnCode) {
|
||||
return PATH_MAP.get(dataOwnCode);
|
||||
}
|
||||
|
|
@ -534,10 +534,4 @@ public class CommonService {
|
|||
return "";
|
||||
}
|
||||
|
||||
public String getFileCode(String path) {
|
||||
int index = path.lastIndexOf(".");
|
||||
return path.substring(index + 1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,10 @@ import cn.hutool.core.util.StrUtil;
|
|||
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.electromagnetic.industry.software.common.enums.*;
|
||||
import com.electromagnetic.industry.software.common.enums.AdminTypeEnum;
|
||||
import com.electromagnetic.industry.software.common.enums.DataOwnEnum;
|
||||
import com.electromagnetic.industry.software.common.enums.EffectFlagEnum;
|
||||
import com.electromagnetic.industry.software.common.enums.EleDataTypeEnum;
|
||||
import com.electromagnetic.industry.software.common.pojo.BackupFileResLog;
|
||||
import com.electromagnetic.industry.software.common.resp.ElectromagneticResult;
|
||||
import com.electromagnetic.industry.software.common.util.EleCommonUtil;
|
||||
|
|
|
|||
|
|
@ -9,16 +9,13 @@ spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
|
|||
spring.jackson.time-zone=GMT+8
|
||||
spring.servlet.multipart.max-file-size=500MB
|
||||
spring.servlet.multipart.max-request-size=500MB
|
||||
|
||||
# mybatis
|
||||
mybatis-plus.mapper-locations=classpath:sqlmapper/*.xml
|
||||
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
pagehelper.helperDialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
|
||||
# app
|
||||
server.port=12396
|
||||
|
||||
winPrefix:D:/tmp
|
||||
data.ele.tmp.path=/szsd/data/eleData/dev/tmp
|
||||
# sys path
|
||||
|
|
@ -33,12 +30,9 @@ data.user.download.path=/szsd/data/eleData/dev/user_download/
|
|||
data.repo.prj.path=/szsd/data/eleData/dev/repo_project/
|
||||
data.repo.upload.path=/szsd/data/eleData/dev/repo_upload/
|
||||
data.repo.download.path=/szsd/data/eleData/dev/repo_download/
|
||||
|
||||
prj.folder.max.length=6
|
||||
|
||||
# backupFiles
|
||||
tmp.file.store.days=7
|
||||
backup.remote.host=127.0.0.1
|
||||
backup.remote.port=1111
|
||||
|
||||
backup.mysql.path=/workspace/mysqlbak/test
|
||||
|
|
@ -15,10 +15,17 @@ public enum DataOwnEnum {
|
|||
REPO_FILE(3, "库文件"),
|
||||
REPO_PRJ(5, "库工程");
|
||||
|
||||
private static final Map<Integer, Integer> FILE_PRJ_MAP = new HashMap<>();
|
||||
|
||||
static {
|
||||
FILE_PRJ_MAP.put(DataOwnEnum.SYS_FILE.code, DataOwnEnum.SYS_PRJ.code);
|
||||
FILE_PRJ_MAP.put(DataOwnEnum.USER_FILE.code, DataOwnEnum.USER_PRJ.code);
|
||||
FILE_PRJ_MAP.put(DataOwnEnum.REPO_FILE.code, DataOwnEnum.REPO_PRJ.code);
|
||||
}
|
||||
|
||||
public final int code;
|
||||
public final String desc;
|
||||
|
||||
|
||||
public static boolean isPrjCode(int code) {
|
||||
return code == SYS_PRJ.code || code == USER_PRJ.code || code == REPO_PRJ.code;
|
||||
}
|
||||
|
|
@ -27,14 +34,6 @@ public enum DataOwnEnum {
|
|||
return code == SYS_FILE.code || code == USER_FILE.code || code == REPO_FILE.code;
|
||||
}
|
||||
|
||||
private static final Map<Integer, Integer> FILE_PRJ_MAP = new HashMap<>();
|
||||
|
||||
static {
|
||||
FILE_PRJ_MAP.put(DataOwnEnum.SYS_FILE.code, DataOwnEnum.SYS_PRJ.code);
|
||||
FILE_PRJ_MAP.put(DataOwnEnum.USER_FILE.code, DataOwnEnum.USER_PRJ.code);
|
||||
FILE_PRJ_MAP.put(DataOwnEnum.REPO_FILE.code, DataOwnEnum.REPO_PRJ.code);
|
||||
}
|
||||
|
||||
public static int getPrjCodeByFileCode(int fileCode) {
|
||||
return FILE_PRJ_MAP.get(fileCode);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue