文件修改

This commit is contained in:
zhn
2022-06-09 15:52:56 +08:00
parent f417a51861
commit 722817b5c4
6 changed files with 76 additions and 31 deletions
@@ -32,6 +32,8 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
@Value(value = "${jero.path.upload}")
private String uploadpath;
@Value(value = "${jero.path.uploadCos}")
private String uploadCospath;
/**
* 文件后缀黑名单
@@ -188,7 +190,7 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
OSSFile oSSFile = new OSSFile();
try {
String ctxPath = uploadpath;
String ctxPath = uploadCospath;
String fileName = null;
String fileType = null;
@@ -285,7 +287,7 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
OSSFile oSSFile = new OSSFile();
try {
String ctxPath = uploadpath;
String ctxPath = uploadCospath;
String fileName = null;
String fileType = null;
File file = new File(ctxPath + File.separator + bizPath + File.separator);
@@ -167,8 +167,8 @@ public class CommonController {
// bizPath = "";
// }
}
OSSFile oSSFile = ossFileService.uploadLocal(file, bizPath,state,cut);
// OSSFile oSSFile = ossFileService.uploadLocalOfCos(file, bizPath,state,cut); // 切换cos
// OSSFile oSSFile = ossFileService.uploadLocal(file, bizPath,state,cut);
OSSFile oSSFile = ossFileService.uploadLocalOfCos(file, bizPath,state,cut); // 切换cos
if (oConvertUtils.isNotEmpty(oSSFile)) {
result.setResult(oSSFile);
result.setSuccess(true);
@@ -343,7 +343,7 @@ public class CommonController {
* @param request
* @param response
*/
// @GetMapping(value = "/downLoadFile")
@GetMapping(value = "/downLoadFile")
public void downLoadFromCos(String id,HttpServletRequest request, HttpServletResponse response) {
if(StringUtils.isBlank(id)){
throw new JeroBootException("参数信息不全");
@@ -408,7 +408,7 @@ public class CommonController {
* @param request
* @param response
*/
@GetMapping(value = "/downLoadFile")
// @GetMapping(value = "/downLoadFile")
public void downLoadFile(String id,HttpServletRequest request, HttpServletResponse response) {
// 查询数据表数据是否存在
LambdaQueryWrapper<OSSFile> queryWrapper = new LambdaQueryWrapper<>();