From 92027c9960c8e4e8d84db11c2c422254a5b7d38c Mon Sep 17 00:00:00 2001
From: Administrator <2863138610@qq.com>
Date: 星期二, 06 十二月 2022 16:00:03 +0800
Subject: [PATCH] 华为云obs上传

---
 src/main/java/com/qxueyou/scc/teach/res/service/impl/FileService.java |   41 ++++++++++++++++++++++++++++++++++++-----
 1 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/qxueyou/scc/teach/res/service/impl/FileService.java b/src/main/java/com/qxueyou/scc/teach/res/service/impl/FileService.java
index a992382..6f14ba5 100644
--- a/src/main/java/com/qxueyou/scc/teach/res/service/impl/FileService.java
+++ b/src/main/java/com/qxueyou/scc/teach/res/service/impl/FileService.java
@@ -27,7 +27,7 @@
 
 /**
  * 鎵�鏈夋枃浠朵笂浼犵殑鎿嶄綔锛屽崟鐙埌鏂囦欢涓婁紶宸ョ▼鍚庯紝鍚庣画涓氬姟鎿嶄綔闇�瑕佷笅杞芥枃浠惰皟鐢ㄧ殑鏂规硶
- * 
+ *
  * @author xiadehu
  *
  */
@@ -96,7 +96,7 @@
 
 	/**
 	 * 鎻掑叆鏂囦欢淇℃伅鍒版暟鎹簱
-	 * 
+	 *
 	 * @param name
 	 * @param fullPath
 	 *            鍏ㄨ矾寰�
@@ -106,7 +106,7 @@
 	 *            鏂囦欢绫诲瀷锛岄潪鏂囦欢鏍煎紡
 	 * @return
 	 */
-	private ResFile insertFileToDB(String name, String fullPath, String relativePath, String type) {
+	public ResFile insertFileToDB(String name, String fullPath, String relativePath, String type) {
 
 		ResFile file = new ResFile();
 
@@ -127,10 +127,41 @@
 		return file;
 
 	}
+	/**
+	 * 鎻掑叆鏂囦欢淇℃伅鍒版暟鎹簱
+	 *
+	 * @param name
+	 * @param relativePath
+	 *            鐩稿璺緞
+	 * @param type
+	 *            鏂囦欢绫诲瀷锛岄潪鏂囦欢鏍煎紡
+	 * @return
+	 */
+	public ResFile insertFileToDBTwo(String name, Long Size, String relativePath, String type) {
+
+		ResFile file = new ResFile();
+
+		TraceUtils.setCreateTrace(file);
+		file.setFileName(name);
+		file.setFileFormat(QFileUtils.getFileFormat(name));
+		file.setFileType(type);
+		// TODO
+		file.setMd5Hash(null);
+		file.setPath(relativePath);
+		file.setSize(Size);
+		// TODO
+		file.setTenantId(null);
+		file.setDeleteFlag(false);
+
+		save(file);
+
+		return file;
+
+	}
 
 	/**
 	 * 鑾峰彇鏂囦欢绫诲瀷
-	 * 
+	 *
 	 * @param name
 	 * @return
 	 */
@@ -141,7 +172,7 @@
 
 	/**
 	 * 鑾峰彇鏂囦欢鐩爣璺緞
-	 * 
+	 *
 	 * @param name
 	 * @return
 	 */

--
Gitblit v1.8.0