| | |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.service.DownLoadFileService; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | */ |
| | | @Service |
| | | public class DownLoadFileServiceImpl implements DownLoadFileService { |
| | | @Override |
| | | public AjaxResult downLoadFile(String path, HttpServletResponse response) { |
| | | |
| | | @Value("${ruoyi.profile}") |
| | | private String basePath; |
| | | |
| | | @Override |
| | | public void downLoadFile(String path, HttpServletResponse response) { |
| | | |
| | | path=basePath+path.substring(8); |
| | | File file = new File(path); |
| | | byte[] buffer = new byte[1024]; |
| | | BufferedInputStream bis = null; |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | return AjaxResult.success("操作成功"); |
| | | } |
| | | } |