From fc03a64522e6c6e0f47eeb82c8900e1910a0a363 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期四, 01 二月 2024 09:11:11 +0800
Subject: [PATCH] 111

---
 server/company/src/main/java/com/doumee/api/common/PublicController.java |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 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..81b84f4 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
@@ -129,6 +129,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 +150,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","璇锋眰鎴愬姛");

--
Gitblit v1.9.3