From b7d83328c1d4cf65f0dc9ec7c17e957afc7e3c76 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期一, 13 一月 2025 17:07:33 +0800
Subject: [PATCH] web文件系统,文件上传返回增加一个属性filePath ;//文件在服务端存储相对路径

---
 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/webCtrls/WebFileCtrl.java |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/webCtrls/WebFileCtrl.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/webCtrls/WebFileCtrl.java
index 1f0faac..44f8956 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/webCtrls/WebFileCtrl.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/webCtrls/WebFileCtrl.java
@@ -1,7 +1,5 @@
 package com.dy.pipIrrGlobal.webCtrls;
 
-
-import com.dy.common.aop.SsoAop;
 import com.dy.common.webUtil.BaseResponse;
 import com.dy.common.webUtil.BaseResponseUtils;
 import com.dy.pipIrrGlobal.dyFile.FileConstant;
@@ -18,7 +16,6 @@
 import org.springframework.web.multipart.MultipartFile;
 
 import java.util.Date;
-
 /**
  * web鏂囦欢涓婁紶
  */
@@ -40,13 +37,15 @@
     @Value("${dy.webFile.supportedFileTypes}")
     private String supportedFileTypes ;
 
+    //瑙嗛鐨勭缉鐣ュ浘鐨勬墿灞曞悕
+    private static final String VideoZipPicFileType = "jpg";
+
     /**
      * 涓婁紶鐓х墖鍥剧墖鏂囦欢 锛堝綋鍓嶅彧瀵筽ng jpg鏍煎紡鍥剧墖鏀寔缂╃暐鍥撅級
      * @param file web绔笂浼犳枃浠剁殑post瀵硅薄
      * @return 杩斿洖缁撴灉
      */
     @PostMapping("/upPhoto")
-    @SsoAop()
     //鍙傝�冿細https://blog.zhengru.top/posts/33486.html#%E5%8D%95%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0
     public BaseResponse<?> upPhoto(MultipartFile file) {
         try {
@@ -67,6 +66,7 @@
                                 frVo.fileNameHash,
                                 fileNameGrp[0],
                                 fileNameGrp[1],
+                                frVo.getFileWebPath(),
                                 (frVo.getFileWebUrl() + frVo.getFileWebPath()),
                                 fileOp.getImgFileZipPath(frVo.getFileWebUrl() + frVo.getFileWebPath()),
                                 frVo.fileWebDownloadPath + id) ;
@@ -92,7 +92,6 @@
      * @return 杩斿洖缁撴灉
      */
     @PostMapping("/upPhone")
-    @SsoAop()
     public BaseResponse<?> upPhone(MultipartFile file) {
         try {
             if (file != null) {
@@ -112,6 +111,7 @@
                                 frVo.fileNameHash,
                                 fileNameGrp[0],
                                 fileNameGrp[1],
+                                frVo.getFileWebPath(),
                                 frVo.getFileWebUrl() + frVo.getFileWebPath(),
                                 null,
                                 frVo.fileWebDownloadPath + id) ;
@@ -138,7 +138,6 @@
      * @return 杩斿洖缁撴灉
      */
     @PostMapping("/upVideo")
-    @SsoAop()
     public BaseResponse<?> upVideo(MultipartFile file) {
         try {
             if (file != null) {
@@ -158,8 +157,9 @@
                                 frVo.fileNameHash,
                                 fileNameGrp[0],
                                 fileNameGrp[1],
+                                frVo.getFileWebPath(),
                                 frVo.getFileWebUrl() + frVo.getFileWebPath(),
-                                null,
+                                fileOp.getVideoFileZipPath(frVo.getFileWebUrl() + frVo.getFileWebPath(), VideoZipPicFileType),
                                 frVo.fileWebDownloadPath + id) ;
                         return  BaseResponseUtils.buildSuccess(fvo) ;
                     }else {
@@ -184,7 +184,6 @@
      * @return 杩斿洖缁撴灉
      */
     @PostMapping("/upDocument")
-    @SsoAop()
     public BaseResponse<?> upDocument(MultipartFile file) {
         try {
             if (file != null) {
@@ -206,7 +205,9 @@
                         Long id = this.saveFileInfo(fileNameGrp[0], fileNameGrp[1], fileMainName, frVo.fileNameHash, frVo.fileWebPath);
                         FileVo fvo = new FileVo(id,
                                 frVo.fileNameHash,
-                                fileNameGrp[0], fileNameGrp[1],
+                                fileNameGrp[0],
+                                fileNameGrp[1],
+                                frVo.getFileWebPath(),
                                 frVo.getFileWebUrl() + frVo.getFileWebPath(),
                                 null,
                                 frVo.fileWebDownloadPath + id) ;

--
Gitblit v1.8.0