精简util模块,ReturenResponse重构

This commit is contained in:
chenkailing
2020-12-27 14:06:06 +08:00
committed by kl
parent 594bd895ec
commit 1f1970232b
24 changed files with 251 additions and 262 deletions

View File

@@ -27,7 +27,7 @@ public class SimTextFilePreviewImpl implements FilePreview {
public String filePreviewHandle(String url, Model model, FileAttribute fileAttribute) {
String fileName = fileAttribute.getName();
ReturnResponse<String> response = DownloadUtils.downLoad(fileAttribute, fileName);
if (0 != response.getCode()) {
if (response.isFailure()) {
model.addAttribute("msg", response.getMsg());
model.addAttribute("fileType", fileAttribute.getSuffix());
return "fileNotSupported";