瀏覽代碼

图片上传变更

zdm 6 年之前
父節點
當前提交
55acb1eb59

+ 3 - 4
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/controller/dfs/FastDFSController.java

@ -75,7 +75,7 @@ public class FastDFSController extends EnvelopRestEndpoint {
        fileResource.setCreateUser(creator);
        fileResource=  fileResourceService.save(fileResource);
        path = groupName.substring(1, groupName.length() - 1) + "/" + remoteFileName.substring(1, remoteFileName.length() - 1);
        fileResource.setStoragePath( fastdfs_file_url + path);
        fileResource.setStoragePath(path);
        return success(fileResource);
    }
@ -107,14 +107,13 @@ public class FastDFSController extends EnvelopRestEndpoint {
        String path = groupName.substring(1, groupName.length() - 1) + ":" + remoteFileName.substring(1, remoteFileName.length() - 1);
        //路径存储到mysql数据库
        FileResource fileResource =new FileResource();
        //TODO
        fileResource.setObjectId("111");
        fileResource.setObjectId(paramMap.get("object"));
        fileResource.setStoragePath(path);
        fileResource.setFileSize(String.valueOf(fileSize));
        fileResource.setFileName(fileName);
        fileResource=  fileResourceService.save(fileResource);
         path = groupName.substring(1, groupName.length() - 1) + "/" + remoteFileName.substring(1, remoteFileName.length() - 1);
        fileResource.setStoragePath( fastdfs_file_url + path);
        fileResource.setStoragePath( path);
        return success(fileResource);
    }

+ 4 - 0
svr/svr-healthy-house/src/main/resources/application.yml

@ -7,6 +7,10 @@ security:
    enabled: false
spring:
  http:
    multipart:
      maxRequestSize: 1024MB  #配置最大上传为1G
      maxFileSize: 1024MB  #配置最大上传为1G
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    max-active: 50