管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-11-18 26906f9b876b28be864a6dd16b1bd1ebab176a0f
1
已重命名1个文件
已修改4个文件
29 ■■■■■ 文件已修改
src/main/java/com/lf/server/controller/data/StyleController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/sys/ResController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/helper/FileHelper.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/all/UploadAttachService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/data/UploaderService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/data/StyleController.java
@@ -5,7 +5,7 @@
import com.lf.server.entity.all.ResponseMsg;
import com.lf.server.entity.data.StyleEntity;
import com.lf.server.entity.sys.UserEntity;
import com.lf.server.service.all.UploadService;
import com.lf.server.service.all.UploadAttachService;
import com.lf.server.service.data.StyleService;
import com.lf.server.service.sys.TokenService;
import io.swagger.annotations.Api;
@@ -36,7 +36,7 @@
    TokenService tokenService;
    @Autowired
    UploadService uploadService;
    UploadAttachService uploadAttachService;
    private final static String TAB_NAME = "sys_style";
@@ -244,7 +244,7 @@
    public ResponseMsg<String> upload(@RequestParam("file") MultipartFile file, HttpServletRequest req) {
        UserEntity ue = tokenService.getCurrentUser(req);
        return uploadService.upload(ue, TAB_NAME, file, this);
        return uploadAttachService.upload(ue, TAB_NAME, file, this);
    }
    @SysLog()
@@ -254,6 +254,6 @@
    })
    @GetMapping(value = "/download")
    public void download(String guid, HttpServletResponse res) {
        uploadService.download(guid, res);
        uploadAttachService.download(guid, res);
    }
}
src/main/java/com/lf/server/controller/sys/ResController.java
@@ -6,7 +6,7 @@
import com.lf.server.entity.sys.ResEntity;
import com.lf.server.entity.sys.UserEntity;
import com.lf.server.service.all.PermsService;
import com.lf.server.service.all.UploadService;
import com.lf.server.service.all.UploadAttachService;
import com.lf.server.service.sys.ResService;
import com.lf.server.service.sys.TokenService;
import io.swagger.annotations.Api;
@@ -37,7 +37,7 @@
    TokenService tokenService;
    @Autowired
    UploadService uploadService;
    UploadAttachService uploadAttachService;
    @Autowired
    PermsService permsService;
@@ -287,7 +287,7 @@
    public ResponseMsg<String> upload(@RequestParam("file") MultipartFile file, HttpServletRequest req) {
        UserEntity ue = tokenService.getCurrentUser(req);
        return uploadService.upload(ue, TAB_NAME, file, this);
        return uploadAttachService.upload(ue, TAB_NAME, file, this);
    }
    @SysLog()
@@ -297,6 +297,6 @@
    })
    @GetMapping(value = "/download")
    public void download(String guid, HttpServletResponse res) {
        uploadService.download(guid, res);
        uploadAttachService.download(guid, res);
    }
}
src/main/java/com/lf/server/helper/FileHelper.java
@@ -1,7 +1,6 @@
package com.lf.server.helper;
import com.lf.server.entity.data.MetaFileEntity;
import com.lf.server.service.data.UploaderService;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
src/main/java/com/lf/server/service/all/UploadAttachService.java
ÎļþÃû´Ó src/main/java/com/lf/server/service/all/UploadService.java ÐÞ¸Ä
@@ -18,26 +18,22 @@
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URLEncoder;
/**
 * ä¸Šä¼ æœåŠ¡ç±»
 * ä¸Šä¼ é™„件服务类
 * @author WWW
 */
@Service
public class UploadService {
public class UploadAttachService {
    @Autowired
    PathHelper pathHelper;
    @Autowired
    AttachService attachService;
    private final static Log log = LogFactory.getLog(UploadService.class);
    private final static Log log = LogFactory.getLog(UploadAttachService.class);
    private static final String NO_FILE = JSON.toJSONString(new ResponseMsg<String>(HttpStatus.NOT_FOUND, "文件找不到"));
src/main/java/com/lf/server/service/data/UploaderService.java
@@ -20,7 +20,7 @@
import java.util.*;
/**
 * æ•°æ®ä¸Šä¼ æœåŠ¡ç±»
 * ä¸Šä¼ æœåŠ¡ç±»
 * @author WWW
 */
@Service