- * 例如: ruoyi.txt, 返回: txt - * - * @param file 文件名 - * @return 后缀(不含".") - */ - public static String getFileType(File file) { - if (null == file) { - return StringUtils.EMPTY; - } - return getFileType(file.getName()); - } - - /** - * 获取文件类型 - *
- * 例如: ruoyi.txt, 返回: txt
- *
- * @param fileName 文件名
- * @return 后缀(不含".")
- */
- public static String getFileType(String fileName) {
- int separatorIndex = fileName.lastIndexOf(".");
- if (separatorIndex < 0) {
- return "";
- }
- return fileName.substring(separatorIndex + 1).toLowerCase();
- }
-
- /**
- * 获取文件类型
- *
- * @param photoByte 文件字节码
- * @return 后缀(不含".")
- */
- public static String getFileExtendName(byte[] photoByte) {
- String strFileExtendName = "JPG";
- if ((photoByte[0] == 71) && (photoByte[1] == 73) && (photoByte[2] == 70) && (photoByte[3] == 56)
- && ((photoByte[4] == 55) || (photoByte[4] == 57)) && (photoByte[5] == 97)) {
- strFileExtendName = "GIF";
- } else if ((photoByte[6] == 74) && (photoByte[7] == 70) && (photoByte[8] == 73) && (photoByte[9] == 70)) {
- strFileExtendName = "JPG";
- } else if ((photoByte[0] == 66) && (photoByte[1] == 77)) {
- strFileExtendName = "BMP";
- } else if ((photoByte[1] == 80) && (photoByte[2] == 78) && (photoByte[3] == 71)) {
- strFileExtendName = "PNG";
- }
- return strFileExtendName;
- }
-}
\ No newline at end of file
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/ImageUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/ImageUtils.java
deleted file mode 100644
index ce00f5054..000000000
--- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/ImageUtils.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package com.ruoyi.common.core.utils.file;
-
-import org.apache.commons.io.IOUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.Arrays;
-
-/**
- * 图片处理工具类
- *
- * @author ruoyi
- */
-public class ImageUtils {
- private static final Logger log = LoggerFactory.getLogger(ImageUtils.class);
-
- public static byte[] getImage(String imagePath) {
- InputStream is = getFile(imagePath);
- try {
- return IOUtils.toByteArray(is);
- } catch (Exception e) {
- log.error("图片加载异常 {}", e);
- return null;
- } finally {
- IOUtils.closeQuietly(is);
- }
- }
-
- public static InputStream getFile(String imagePath) {
- try {
- byte[] result = readFile(imagePath);
- result = Arrays.copyOf(result, result.length);
- return new ByteArrayInputStream(result);
- } catch (Exception e) {
- log.error("获取图片异常 {}", e);
- }
- return null;
- }
-
- /**
- * 读取文件为字节数据
- *
- * @param key 地址
- * @return 字节数据
- */
- public static byte[] readFile(String url) {
- InputStream in = null;
- ByteArrayOutputStream baos = null;
- try {
- // 网络地址
- URL urlObj = new URL(url);
- URLConnection urlConnection = urlObj.openConnection();
- urlConnection.setConnectTimeout(30 * 1000);
- urlConnection.setReadTimeout(60 * 1000);
- urlConnection.setDoInput(true);
- in = urlConnection.getInputStream();
- return IOUtils.toByteArray(in);
- } catch (Exception e) {
- log.error("访问文件异常 {}", e);
- return null;
- } finally {
- IOUtils.closeQuietly(in);
- IOUtils.closeQuietly(baos);
- }
- }
-}
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/MimeTypeUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/MimeTypeUtils.java
deleted file mode 100644
index d3466cda9..000000000
--- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/MimeTypeUtils.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package com.ruoyi.common.core.utils.file;
-
-/**
- * 媒体类型工具类
- *
- * @author ruoyi
- */
-public class MimeTypeUtils {
- public static final String IMAGE_PNG = "image/png";
-
- public static final String IMAGE_JPG = "image/jpg";
-
- public static final String IMAGE_JPEG = "image/jpeg";
-
- public static final String IMAGE_BMP = "image/bmp";
-
- public static final String IMAGE_GIF = "image/gif";
-
- public static final String[] IMAGE_EXTENSION = {"bmp", "gif", "jpg", "jpeg", "png"};
-
- public static final String[] FLASH_EXTENSION = {"swf", "flv"};
-
- public static final String[] MEDIA_EXTENSION = {"swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg",
- "asf", "rm", "rmvb"};
-
- public static final String[] VIDEO_EXTENSION = {"mp4", "avi", "rmvb"};
-
- public static final String[] DEFAULT_ALLOWED_EXTENSION = {
- // 图片
- "bmp", "gif", "jpg", "jpeg", "png",
- // word excel powerpoint
- "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt",
- // 压缩文件
- "rar", "zip", "gz", "bz2",
- // 视频格式
- "mp4", "avi", "rmvb",
- // pdf
- "pdf"};
-
- public static String getExtension(String prefix) {
- switch (prefix) {
- case IMAGE_PNG:
- return "png";
- case IMAGE_JPG:
- return "jpg";
- case IMAGE_JPEG:
- return "jpeg";
- case IMAGE_BMP:
- return "bmp";
- case IMAGE_GIF:
- return "gif";
- default:
- return "";
- }
- }
-}
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/validate/AddGroup.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/validate/AddGroup.java
new file mode 100644
index 000000000..e1934e1ed
--- /dev/null
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/validate/AddGroup.java
@@ -0,0 +1,9 @@
+package com.ruoyi.common.core.validate;
+
+/**
+ * 校验分组 add
+ *
+ * @author Lion Li
+ */
+public interface AddGroup {
+}
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/validate/EditGroup.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/validate/EditGroup.java
new file mode 100644
index 000000000..3c6ca7f83
--- /dev/null
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/validate/EditGroup.java
@@ -0,0 +1,9 @@
+package com.ruoyi.common.core.validate;
+
+/**
+ * 校验分组 edit
+ *
+ * @author Lion Li
+ */
+public interface EditGroup {
+}
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/validate/QueryGroup.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/validate/QueryGroup.java
new file mode 100644
index 000000000..bbbfe0388
--- /dev/null
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/validate/QueryGroup.java
@@ -0,0 +1,9 @@
+package com.ruoyi.common.core.validate;
+
+/**
+ * 校验分组 query
+ *
+ * @author Lion Li
+ */
+public interface QueryGroup {
+}
diff --git a/ruoyi-common/ruoyi-common-datasource/pom.xml b/ruoyi-common/ruoyi-common-datasource/pom.xml
deleted file mode 100644
index 86ea781e3..000000000
--- a/ruoyi-common/ruoyi-common-datasource/pom.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-