Prechádzať zdrojové kódy

上传文件至本地

xujiawei 5 rokov pred
rodič
commit
43485df586

+ 2 - 1
src/main/java/edu/nju/controller/OssController.java

@@ -50,7 +50,8 @@ public class OssController {
     @RequestMapping(value = "/ossUpload", method = RequestMethod.POST)
     @ResponseBody
     public String ossUpload(@RequestParam("file") MultipartFile file, String path) {
-        File dest = new File("/Users/hannatao/Downloads" + path);
+//        File dest = new File("/Users/xujiawei/crowd/crowdsource-backend/src/main/java/edu/nju/controller" + path);
+        File dest = new File("/back_end" + path);
         if(!dest.getParentFile().exists()) { dest.getParentFile().mkdirs(); }
         try {
             if(!file.isEmpty()) { file.transferTo(dest); }

+ 4 - 6
src/main/resources/bootstrap.yml

@@ -7,15 +7,13 @@ server:
 spring:
   data:
     mongodb:
-#      database: ${MONGO_DBNAME:co-enterprise-test}
-#      host: ${MONGO_HOST:10.81.65.118}
-#      port: ${MONGO_PORT:29019}
-      uri: mongodb://localhost:27017/test
+      database: ${MONGO_DBNAME:co-enterprise-test}
+      host: ${MONGO_HOST:10.81.65.118}
+      port: ${MONGO_PORT:29019}
+#      uri: mongodb://localhost:27017/test
   http:
     encoding:
       charset: UTF-8
       enabled: true
       force: true
 
-report:
-  port:9090