From 95db36f778d5a6f4197cc2cde4390c84e57b26b6 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期三, 31 一月 2024 09:36:53 +0800
Subject: [PATCH] 开发业务接口

---
 server/platform/src/main/java/com/doumee/api/common/PublicController.java |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/server/platform/src/main/java/com/doumee/api/common/PublicController.java b/server/platform/src/main/java/com/doumee/api/common/PublicController.java
index 24111aa..990ab93 100644
--- a/server/platform/src/main/java/com/doumee/api/common/PublicController.java
+++ b/server/platform/src/main/java/com/doumee/api/common/PublicController.java
@@ -171,6 +171,16 @@
                     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,".jpeg")
+                            || StringUtils.endsWith(key,".JPEG")){
+                        type =0;
+                    }
                     if (obs.uploadOnlineObject(file.getInputStream(),bucketName, key,null)) {
                         // 绉诲姩鎴愬姛,杩斿洖鏂囦欢鍚�
                         // sendSuccessMessage(response, resourcePath+key);
@@ -180,6 +190,7 @@
                         JSONObject fileJSON = new JSONObject();
                         fileJSON.put("url", resourcePath + key);
                         fileJSON.put("imgaddr", tempFileName);
+                        fileJSON.put("type", type);
                         fileJSON.put("imgname", fileName);
                         fileJSON.put("originname", originname);
                         context.put("data",fileJSON);

--
Gitblit v1.9.3