浏览代码

uploadBallScreenVideo

lyhzzz 3 年之前
父节点
当前提交
2f56a79003

+ 2 - 1
src/main/java/com/cdf/config/WebAppConfig.java

@@ -31,7 +31,8 @@ public class WebAppConfig implements WebMvcConfigurer {
 				.excludePathPatterns("/service/scene/edit/tag/save","/service/scene/edit/tag/delete",
 						"/service/scene/edit/tag/list","/service/scene/edit/tag/getHotJson",
 						"/service/scene/edit/publicScene","/service/scene/edit/upload/files",
-						"/service/scene/getInfo","/service/scene/edit/getAuth","/service/scene/edit/uploadBallScreenVideo");
+						"/service/scene/getInfo","/service/scene/edit/getAuth",
+						"/service/scene/edit/down/qrCode");
 		WebMvcConfigurer.super.addInterceptors(registry);
 	}
 

+ 1 - 7
src/main/java/com/cdf/controller/service/FdkkSceneEditController.java

@@ -8,6 +8,7 @@ import com.cdf.httpClient.request.FdkkUploadRequest;
 import com.cdf.httpClient.response.FdkkResponse;
 import com.cdf.service.impl.FdkkSceneEditService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -62,13 +63,6 @@ public class FdkkSceneEditController {
         FdkkResponse fdkkResponse = fdkkSceneEditService.uploadFiles(fdkkUploadRequest, files, token);
         return ResultData.ok(fdkkResponse.getMsg(),fdkkResponse.getData());
     }
-    @PostMapping("/uploadBallScreenVideo")
-    public ResultData uploadBallScreenVideo(FdkkUploadRequest fdkkUploadRequest,
-                                            MultipartFile file,
-                                            @RequestHeader String token) throws IOException {
-        FdkkResponse fdkkResponse = fdkkSceneEditService.uploadBallScreenVideo(fdkkUploadRequest,file, token);
-        return ResultData.ok(fdkkResponse.getMsg(),fdkkResponse.getData());
-    }
 
     @GetMapping("/down/qrCode")
     public void downQrcode (HttpServletRequest request, HttpServletResponse response,

+ 0 - 3
src/main/java/com/cdf/httpClient/client/FdkkClient.java

@@ -115,9 +115,6 @@ public interface FdkkClient {
     @Address(source = FdkkSceneAddressSource.class)
     FdkkResponse uploadFiles(@Query FdkkUploadRequest fdkkUploadRequest, @Header("token")String token);
 
-    @Post("/service/scene/edit/uploadBallScreenVideo")
-    @Address(source = FdkkSceneAddressSource.class)
-    FdkkResponse uploadBallScreenVideo(@Query FdkkUploadRequest fdkkUploadRequest, @DataFile("file") String file, @Header("token")String token);
     /**
      * 获取场景详情-查看页面
      */

+ 4 - 22
src/main/java/com/cdf/service/impl/FdkkSceneEditService.java

@@ -48,6 +48,8 @@ public class FdkkSceneEditService {
     private String hotCdfPath;
     @Value("${fdkk.hot-local-path}")
     private String hotLocalPath;
+    @Value("${fdkk.qr-code-url}")
+    private String qrCodeUrl;
     @Resource
     private FdkkClient fdkkClient;
     @Resource
@@ -170,24 +172,6 @@ public class FdkkSceneEditService {
         }
         return fdkkResponse;
     }
-    public FdkkResponse uploadBallScreenVideo(FdkkUploadRequest param,
-                                              MultipartFile file, String token) throws IOException {
-        String path = null;
-        if(file !=null && file.getSize() >0){
-            String fileName = file.getOriginalFilename();
-            assert fileName != null;
-            String newFilePath = String.format(hotLocalPath,param.getNum()) + "/"+fileName ;
-            File newFile = new File(newFilePath);
-            file.transferTo(newFile);
-            path = newFile.getPath();
-        }
-        FdkkResponse fdkkResponse = fdkkClient.uploadBallScreenVideo(param,path,fdkkSceneService.getFdkkToken(token));
-        if(fdkkResponse.getCode() !=0){
-            throw new BusinessException(fdkkResponse.getCode(),fdkkResponse.getMsg());
-        }
-        return fdkkResponse;
-    }
-
 
     private JSONArray getProductByJsonObj(JSONArray tags){
         HashMap<String,JSONArray> resultMap = new HashMap<>();      //sid, productId array
@@ -263,11 +247,9 @@ public class FdkkSceneEditService {
     public void downQrCode(HttpServletRequest request, HttpServletResponse response, String num) {
         String longUrl;
         try {
-            longUrl = "http://vr.cdfmembers.com/index.html?m=" +num;
-            // 转换成短url
-            String shortUrl = ShortNetAddressUtil.generateShortUrl(longUrl);
+            longUrl = qrCodeUrl +num;
             // 生成二维码
-            BitMatrix qRcodeImg = QRCodeUtil.generateQRCodeStream(shortUrl, response);
+            BitMatrix qRcodeImg = QRCodeUtil.generateQRCodeStream(longUrl, response);
             // 将二维码输出到页面中
             MatrixToImageWriter.writeToStream(qRcodeImg, "png", response.getOutputStream());
         } catch (Exception e) {

文件差异内容过多而无法显示
+ 0 - 48
src/main/java/com/cdf/util/ShortNetAddressUtil.java


+ 1 - 0
src/main/resources/application-dev.yaml

@@ -19,6 +19,7 @@ fdkk:
   hot-path: scene_view_data/%s/user/hot.json
   hot-cdf-path: cdf/hot/%s/hot.json
   hot-local-path: /home/cdf/fdkk/%s
+  qr-code-url: http://vr.cdfmembers.com/index.html?m=
 #    type: oss      阿里云 oss
 #    type: aws      亚马逊 s3
 #    type: local    本地化

+ 3 - 1
src/main/resources/application-local.yaml

@@ -18,7 +18,9 @@ fdkk:
   scene-path: http://v4-test.4dkankan.com
   hot-path: scene_view_data/%s/user/hot.json
   hot-cdf-path: cdf/hot/%s/hot.json
-  hot-local-path: D:\temp/%s/hot.json
+  hot-local-path: D:\temp/%s
+  qr-code-url: http://vr.cdfmembers.com/index.html?m=
+
 #    type: oss      阿里云 oss
 #    type: aws      亚马逊 s3
 #    type: local    本地化

+ 0 - 33
src/main/resources/application-prod.yaml

@@ -1,33 +0,0 @@
-spring:
-  datasource:
-    name: druidDataSource
-    type: com.alibaba.druid.pool.DruidDataSource
-    druid:
-      url: jdbc:mysql://127.0.0.1:3306/cdf_gm?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&allowMultiQueries=true
-      username: root
-      password: 4Dage@zhongmian#@168
-logging:
-  config: classpath:logback-spring.xml
-mybatis-plus:
-  configuration:
-    log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl #开启sql日志
-
-
-fdkk:
-  login-path: http://eur.4dkankan.com
-  scene-path: http://eur.4dkankan.com
-  hot-path: scene_view_data/%s/user/hot.json
-  hot-cdf-path: cdf/hot/%s/hot.json
-  hot-local-path: /home/fdkk/temp/%s/hot.json
-#    type: oss      阿里云 oss
-#    type: aws      亚马逊 s3
-#    type: local    本地化
-upload:
-  type: aws
-  file-path: cdf/file/
-  bucket: 4dkankan
-  query-path: https://eurs3.4dkankan.com/
-aws:
-  s3key: AKIAWCV5QFZ3ZNELKYUY
-  s3secrey: epS5ghyR4LJ7rxk/qJO9ZYh6m9Oz6g5haKDu4yws
-  s3bucket: 4dkankan