管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-10-12 b8283ee76c7d02347118c21fcdddabc598143e03
src/main/java/com/lf/server/service/all/FileService.java
@@ -4,6 +4,7 @@
import com.lf.server.controller.all.BaseController;
import com.lf.server.entity.all.HttpStatus;
import com.lf.server.entity.all.ResponseMsg;
import com.lf.server.entity.all.SettingData;
import com.lf.server.entity.sys.AttachEntity;
import com.lf.server.entity.sys.UserEntity;
import com.lf.server.helper.FileHelper;
@@ -45,8 +46,6 @@
    @Autowired
    AttachService attachService;
    private static long MAX_FILE_SIZE = 20 * 1024 * 1024;
    private final static Log log = LogFactory.getLog(FileService.class);
    private static final String NO_FILE = JSON.toJSONString(new ResponseMsg<String>(HttpStatus.NOT_FOUND, "文件找不到"));
@@ -59,8 +58,8 @@
            if (file == null && file.isEmpty()) {
                return ctrl.fail("文件上传为空", null);
            }
            if (file.getSize() > MAX_FILE_SIZE) {
                return ctrl.fail(String.format("文件大于 %d MB", MAX_FILE_SIZE / 1024 / 1024), null);
            if (file.getSize() > SettingData.MAX_FILE_SIZE) {
                return ctrl.fail(String.format("文件大于 %d MB", SettingData.MAX_FILE_SIZE / 1024 / 1024), null);
            }
            // 传输文件