From a43f9d75a9e0ba2720b3c438a0c5ece7be0eb110 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期三, 28 五月 2025 18:23:45 +0800
Subject: [PATCH] git ch

---
 server/company/src/main/java/com/doumee/api/common/PublicController.java |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/server/company/src/main/java/com/doumee/api/common/PublicController.java b/server/company/src/main/java/com/doumee/api/common/PublicController.java
index 10c9278..017b0f3 100644
--- a/server/company/src/main/java/com/doumee/api/common/PublicController.java
+++ b/server/company/src/main/java/com/doumee/api/common/PublicController.java
@@ -3,6 +3,7 @@
 import com.alibaba.fastjson.JSONObject;
 import com.doumee.api.BaseController;
 import com.doumee.biz.system.SystemDictDataBiz;
+import com.doumee.core.annotation.excel.ExcelToPdfTool;
 import com.doumee.core.annotation.trace.Trace;
 import com.doumee.core.utils.Constants;
 import com.doumee.core.utils.DateUtil;
@@ -16,6 +17,7 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
@@ -46,7 +48,6 @@
     @Autowired
     private SystemDictDataBiz systemDictDataBiz;
 
-
     @ApiOperation(value = "涓婁紶", notes = "涓婁紶", httpMethod = "POST", position = 6)
     @ApiImplicitParams({
         @ApiImplicitParam(name = "folder", value = "鏂囦欢澶�", required = true, paramType = "query", dataType = "String", dataTypeClass = String.class),
@@ -61,8 +62,6 @@
             systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode(),
             systemDictDataBiz.queryByCode(Constants.OSS,Constants.ENDPOINT).getCode());
     }
-
-
     @ApiOperation(value = "涓婁紶鍥剧墖", notes = "涓婁紶鍥剧墖", httpMethod = "POST", position = 6)
     @ApiImplicitParams({
             @ApiImplicitParam(name = "folder", value = "鏂囦欢澶�", required = true, paramType = "query", dataType = "String", dataTypeClass = String.class),
@@ -129,6 +128,17 @@
                     String tempFileName =  nowDate + "/" + fileName;
                     String key = folder + tempFileName;// 鏂囦欢鍚�
                     ALiYunUtil obs = new ALiYunUtil(endpoint,access_id, access_key);
+                    int type = 2;
+                    if(StringUtils.endsWith(key,".mp4")){
+                        type =1;
+                    }else if(StringUtils.endsWith(key,".jpg")
+                            || StringUtils.endsWith(key,".JPG")
+                            || StringUtils.endsWith(key,".png")
+                            || StringUtils.endsWith(key,".PNG")
+                            || StringUtils.endsWith(key,".jpeg")
+                            || StringUtils.endsWith(key,".JPEG")){
+                        type =0;
+                    }
                     if (obs.uploadOnlineObject(file.getInputStream(),bucketName, key,null)) {
                         // 绉诲姩鎴愬姛,杩斿洖鏂囦欢鍚�
                         // sendSuccessMessage(response, resourcePath+key);
@@ -139,6 +149,7 @@
                         fileJSON.put("url", resourcePath + key);
                         fileJSON.put("imgaddr", tempFileName);
                         fileJSON.put("imgname", fileName);
+                        fileJSON.put("type", type);
                         fileJSON.put("originname", originname);
                         context.put("data",fileJSON);
                         context.put("message","璇锋眰鎴愬姛");
@@ -286,7 +297,6 @@
                     if (true) {
                         // 鍏抽棴FTP娴�
                         // 绉诲姩鎴愬姛,杩斿洖鏂囦欢鍚�
-
                         /*context.put("error", 0);
                         context.put("url", remoteFileName);
                         context.put("fullurl", remoteFileName);

--
Gitblit v1.9.3