♻️ 重构代码, 新增全局异常处理器, 优化类名

This commit is contained in:
zhaojun1998
2019-10-01 09:00:48 +08:00
parent 8fa3d7934d
commit 8aefee9cdf
18 changed files with 342 additions and 130 deletions

View File

@@ -38,27 +38,6 @@ public interface FileService {
@Cacheable
String getDownloadUrl(String path) throws Exception;
/**
* 构建指定路径下标题, 页头, 页尾
* @param path 路径
*/
@Cacheable
default SiteConfig getConfig(String path) throws Exception {
SiteConfig siteConfig = new SiteConfig();
FileService fileService = (FileService) AopContext.currentProxy();
List<FileItem> fileItemList = fileService.fileList(path);
path = StringUtils.removeLastSeparator(path);
for (FileItem fileItem : fileItemList) {
if (ZfileConstant.README_FILE_NAME.equalsIgnoreCase(fileItem.getName())) {
siteConfig.setFooter(getTextContent(path + "/" + fileItem.getName()));
} else if (ZfileConstant.HEADER_FILE_NAME.equalsIgnoreCase(fileItem.getName())) {
siteConfig.setHeader(getTextContent(path + "/" + fileItem.getName()));
}
}
return siteConfig;
}
/**
* 获取文件内容.
*/