diff --git a/.gitignore b/.gitignore index b28673a4e..a482c7f6a 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ out/ target/ build/ logs/ +# jrebel +rebel.xml diff --git a/Dockerfile b/Dockerfile index 9785b4c80..e6f9ba72c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,14 +2,20 @@ FROM registry.cn-beijing.aliyuncs.com/xxm1995/java8 # 作者信息 -MAINTAINER xxm1995@outlook.com +MAINTAINER bootx # 时区设置 ENV TZ=Asia/Shanghai RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone -# jvm启动参数, 启动内存256M,最大内存1G,使用G1垃圾回收器 -ENV JAVA_OPTS="-Xms256m -Xmx1G -XX:+UseG1GC -Djava.security.egd=file:/dev/./urandom" +# 启动命令 +ENV JAVA_COMM="-Djava.security.egd=file:/dev/./urandom -Dfile.encoding=UTF-8" +# 启动选项配置 +ENV JAVA_OPTS="" +# Agent配置 +ENV JAVA_AGENT="" +# 参数配置 +ENV JAVA_ARGS="" # 工作目录 WORKDIR / @@ -21,4 +27,5 @@ EXPOSE 9999 ADD bootx-start/target/bootx-start.jar bootx-start.jar # 执行启动命令 -CMD java $JAVA_OPTS -jar bootx-start.jar +CMD java -jar $JAVA_OPTS $JAVA_AGENT $JAVA_COMM bootx-start.jar $JAVA_ARGS + diff --git a/README.md b/README.md index 2b8a1e094..01a801841 100644 --- a/README.md +++ b/README.md @@ -1,91 +1,82 @@ -# Bootx-Platform (v1.2.3) +# Bootx-Platform (v1.3.6-园博园)
-
+
-
+
-
-
+
sdfsdfsdf
三扥广丰和扥撒扥撒扥东方
', 1399985191002447872, '小小明', '2022-08-21 22:59:45', 'all', 'draft', '2022-09-20 00:00:00', NULL, 1399985191002447872, '2022-08-21 22:43:11', 1399985191002447872, '2022-08-21 23:23:03', 4, 1); - -INSERT INTO `notice_site_message`(`id`, `title`, `content`, `sender_id`, `sender_name`, `sender_time`, `receive_type`, `send_state`, `efficient_time`, `cancel_time`, `creator`, `create_time`, `last_modifier`, `last_modified_time`, `version`, `deleted`) VALUES (1561365894804766720, '测试数据', '234554通扥广森
', 1399985191002447872, '小小明', '2022-08-21 23:48:55', 'all', 'sent', '2022-09-20 00:00:00', NULL, 1399985191002447872, '2022-08-21 22:53:33', 1399985191002447872, '2022-08-21 23:48:55', 1, 0); - -INSERT INTO `notice_site_message`(`id`, `title`, `content`, `sender_id`, `sender_name`, `sender_time`, `receive_type`, `send_state`, `efficient_time`, `cancel_time`, `creator`, `create_time`, `last_modifier`, `last_modified_time`, `version`, `deleted`) VALUES (1561368170558623744, '测试数据', '234554通扥广森
撒扥萨芬的
sdfsdfsdf
三扥广丰和扥撒扥撒扥东方
', 1399985191002447872, '小小明', '2022-08-21 22:59:45', 'all', 'draft', '2022-09-20 00:00:00', NULL, 1399985191002447872, '2022-08-21 22:43:11', 1399985191002447872, '2022-08-21 23:23:03', 4, 1); -INSERT INTO `notice_site_message` VALUES (1561365894804766720, '测试数据', '234554通扥广森
', 1399985191002447872, '小小明', '2022-08-21 23:48:55', 'all', 'sent', '2022-09-20 00:00:00', NULL, 1399985191002447872, '2022-08-21 22:53:33', 1399985191002447872, '2022-08-21 23:48:55', 1, 0); -INSERT INTO `notice_site_message` VALUES (1561368170558623744, '测试数据', '234554通扥广森
撒扥萨芬的
- * 如果设置了名字例如union_name,系统会默认在名字前加actable_idx_前缀,也就是actable_idx_union_name - * @return - */ - String value() default ""; - - /** - * 要建立索引的字段名,不设置默认为当前标记字段名@Column的name - *
- * 可设置多个建立联合索引{"login_mobile","login_name"} - * @return - */ - String[] columns() default {}; - -} diff --git a/bootx-common-core/src/main/java/cn/bootx/common/core/annotation/actable/IsNativeDefValue.java b/bootx-common-core/src/main/java/cn/bootx/common/core/annotation/actable/IsNativeDefValue.java deleted file mode 100644 index 3f1e70c19..000000000 --- a/bootx-common-core/src/main/java/cn/bootx/common/core/annotation/actable/IsNativeDefValue.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.bootx.common.core.annotation.actable; - -import java.lang.annotation.*; - -/** - * 开启默认值原生模式 原生模式介绍:默认是false表示非原生,此时value只支持字符串形式,会将value值以字符串的形式设置到字段的默认值,例如value="aa" - * 即sql为 DEFAULT "aa" 如果设置true,此时如果value="CURRENT_TIMESTAMP",即sql为 DEFAULT - * CURRENT_TIMESTAMP - * - * @author sunchenbin - * @version 2020年5月26日 下午6:13:15 - */ -// 该注解用于方法声明 -@Target(ElementType.FIELD) -// VM将在运行期也保留注释,因此可以通过反射机制读取注解的信息 -@Retention(RetentionPolicy.RUNTIME) -// 将此注解包含在javadoc中 -@Documented -public @interface IsNativeDefValue { - - /** - * 开启默认值原生模式 - * 原生模式介绍:默认是false表示非原生,此时value只支持字符串形式,会将value值以字符串的形式设置到字段的默认值,例如value="aa" 即sql为 - * DEFAULT "aa" 如果设置true,此时如果默认值为="CURRENT_TIMESTAMP",即sql为 DEFAULT CURRENT_TIMESTAMP - * @return - */ - boolean value() default true; - -} diff --git a/bootx-common-core/src/main/java/cn/bootx/common/core/annotation/actable/Table.java b/bootx-common-core/src/main/java/cn/bootx/common/core/annotation/actable/Table.java deleted file mode 100644 index 4979f444c..000000000 --- a/bootx-common-core/src/main/java/cn/bootx/common/core/annotation/actable/Table.java +++ /dev/null @@ -1,61 +0,0 @@ -package cn.bootx.common.core.annotation.actable; - -import cn.bootx.common.core.code.actable.MySqlCharset; -import cn.bootx.common.core.code.actable.MySqlEngine; - -import java.lang.annotation.*; - -/** - * 创建表时的表名 - * - * @author sunchenbin - * @version 2016年6月23日 下午6:13:37 - */ -// 表示注解加在接口、类、枚举等 -@Target(ElementType.TYPE) -// VM将在运行期也保留注释,因此可以通过反射机制读取注解的信息 -@Retention(RetentionPolicy.RUNTIME) -// 将此注解包含在javadoc中 -@Documented -public @interface Table { - - /** - * 表名 - * @return 表名 - */ - String name() default ""; - - /** - * 表名 - * @return 表名 - */ - String value() default ""; - - /** - * 表注释,也可以使用@TableComment注解代替 - */ - String comment() default ""; - - /** - * 表字符集,也可以使用@TableCharset注解代替 - * 仅支持cn.bootx.common.actable.constants.MySqlCharsetConstant中的枚举字符集 - */ - MySqlCharset charset() default MySqlCharset.UTF8MB4; - - /** - * 表引擎,也可以使用@TableEngine注解代替 - * 仅支持cn.bootx.common.actable.constants.MySqlEngineConstant中的存储引擎枚举 - */ - MySqlEngine engine() default MySqlEngine.InnoDB; - - /** - * 是否开启simple模式配置,开启后字段不写注解@Column也可以采用默认的驼峰转换法创建字段 - */ - boolean isSimple() default true; - - /** - * 需要排除的属性名,排除掉的属性不参与建表, 静态字段默认会被排除 - */ - String[] excludeFields() default {}; - -} diff --git a/bootx-common-core/src/main/java/cn/bootx/common/core/annotation/actable/Unique.java b/bootx-common-core/src/main/java/cn/bootx/common/core/annotation/actable/Unique.java deleted file mode 100644 index 8c04d8c9e..000000000 --- a/bootx-common-core/src/main/java/cn/bootx/common/core/annotation/actable/Unique.java +++ /dev/null @@ -1,30 +0,0 @@ -package cn.bootx.common.core.annotation.actable; - -import java.lang.annotation.*; - -/** - * 设置字段唯一约束 - * - * @author sunchenbin - * @version 2019年6月14日 下午6:12:48 - */ -@Target(ElementType.FIELD) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface Unique { - - /** - * 唯一约束的名字,不设置默认为{actable_uni_当前标记字段名@Column的name} - *
- * 如果设置了名字例如union_name,系统会默认在名字前加auni_前缀,也就是uni_union_name - */ - String value() default ""; - - /** - * 唯一约束的字段名,不设置默认为当前标记字段名@Column的name - *
- * 可设置多个建立联合唯一{"login_mobile","login_name"}
- */
- String[] columns() default {};
-
-}
diff --git a/bootx-common-core/src/main/java/cn/bootx/common/core/code/actable/DatabaseType.java b/bootx-common-core/src/main/java/cn/bootx/common/core/code/actable/DatabaseType.java
deleted file mode 100644
index e1cc69d5a..000000000
--- a/bootx-common-core/src/main/java/cn/bootx/common/core/code/actable/DatabaseType.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package cn.bootx.common.core.code.actable;
-
-/**
- * 数据库类型
- *
- * @author xxm
- * @date 2023/1/16
- */
-public enum DatabaseType {
-
- MYSQL, ORACLE, SQLSERVER, POSTGRESQL;
-
-}
diff --git a/bootx-common-core/src/main/java/cn/bootx/common/core/code/actable/MySqlCharset.java b/bootx-common-core/src/main/java/cn/bootx/common/core/code/actable/MySqlCharset.java
deleted file mode 100644
index 6f98677c6..000000000
--- a/bootx-common-core/src/main/java/cn/bootx/common/core/code/actable/MySqlCharset.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package cn.bootx.common.core.code.actable;
-
-/**
- * mysql支持的字符集
- */
-public enum MySqlCharset {
-
- DEFAULT, ARMSCII8, ASCII, BIG5, BINARY, CP850, CP852, CP866, CP932, CP1250, CP1251, CP1256, CP1257, DEC8, EUCJPMS,
- EUCKR, GB2312, GBK, GEOSTD8, GREEK, HEBREW, HP8, KEYBCS2, KOI8R, KOI8U, LATIN1, LATIN2, LATIN5, LATIN7, MACCE,
- MACROMAN, SJIS, SWE7, TIS620, UCS2, UJIS, UTF8, UTF8MB4, UTF16, UTF32;
-
-}
diff --git a/bootx-common-core/src/main/java/cn/bootx/common/core/code/actable/MySqlEngine.java b/bootx-common-core/src/main/java/cn/bootx/common/core/code/actable/MySqlEngine.java
deleted file mode 100644
index f82e4d0b1..000000000
--- a/bootx-common-core/src/main/java/cn/bootx/common/core/code/actable/MySqlEngine.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package cn.bootx.common.core.code.actable;
-
-/**
- * mysql支持的引擎
- */
-public enum MySqlEngine {
-
- DEFAULT, ARCHIVE, BLACKHOLE, CSV, InnoDB, MEMORY, MRG_MYISAM, MyISAM, PERFORMANCE_SCHEMA;
-
-}
diff --git a/bootx-common-core/src/main/java/cn/bootx/common/core/code/actable/MySqlFieldType.java b/bootx-common-core/src/main/java/cn/bootx/common/core/code/actable/MySqlFieldType.java
deleted file mode 100644
index 964b9ad1c..000000000
--- a/bootx-common-core/src/main/java/cn/bootx/common/core/code/actable/MySqlFieldType.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package cn.bootx.common.core.code.actable;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * 用于配置Mysql数据库中类型,并且该类型需要设置几个长度 这里配置多少个类型决定了,创建表能使用多少类型 例如:varchar(1) decimal(5,2)
- * datetime
- *
- * @author sunchenbin
- * @version 2016年6月23日 下午5:59:33
- */
-@Getter
-@AllArgsConstructor
-public enum MySqlFieldType {
-
- DEFAULT(null, null, null), INT(1, 11, null), VARCHAR(1, 255, null), BINARY(1, 1, null), CHAR(1, 255, null),
- BIGINT(1, 20, null), BIT(1, 1, null), TINYINT(1, 4, null), SMALLINT(1, 6, null), MEDIUMINT(1, 9, null),
- DECIMAL(2, 10, 2), DOUBLE(2, 10, 0), TEXT(0, null, null), MEDIUMTEXT(0, null, null), LONGTEXT(0, null, null),
- DATETIME(0, null, null), TIMESTAMP(0, null, null), DATE(0, null, null), TIME(0, null, null), FLOAT(2, 10, 0),
- YEAR(0, null, null), BLOB(0, null, null), LONGBLOB(0, null, null), MEDIUMBLOB(0, null, null),
- TINYTEXT(0, null, null), TINYBLOB(0, null, null), JSON(0, null, null);
-
- private final Integer lengthCount;
-
- private final Integer lengthDefault;
-
- private final Integer decimalLengthDefault;
-
-}
diff --git a/bootx-common-core/src/main/java/cn/bootx/common/core/exception/DangerSqlException.java b/bootx-common-core/src/main/java/cn/bootx/common/core/exception/DangerSqlException.java
deleted file mode 100644
index 110747ff9..000000000
--- a/bootx-common-core/src/main/java/cn/bootx/common/core/exception/DangerSqlException.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package cn.bootx.common.core.exception;
-
-import static cn.bootx.common.core.code.CommonErrorCode.DANGER_SQL;
-
-/**
- * SQL相关异常
- *
- * @author xxm
- * @date 2023/3/9
- */
-public class DangerSqlException extends BizException {
-
- public DangerSqlException(String msg) {
- super(DANGER_SQL, msg);
- }
-
- public DangerSqlException() {
- super(DANGER_SQL, "危险SQL异常");
- }
-
-}
diff --git a/bootx-common-core/src/main/java/cn/bootx/common/core/exception/DataNotExistException.java b/bootx-common-core/src/main/java/cn/bootx/common/core/exception/DataNotExistException.java
deleted file mode 100644
index a3e2fd7be..000000000
--- a/bootx-common-core/src/main/java/cn/bootx/common/core/exception/DataNotExistException.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package cn.bootx.common.core.exception;
-
-import static cn.bootx.common.core.code.CommonErrorCode.DATA_NOT_EXIST;
-
-/**
- * 数据不存在异常
- *
- * @author xxm
- * @date 2022/1/10
- */
-public class DataNotExistException extends BizException {
-
- public DataNotExistException(String msg) {
- super(DATA_NOT_EXIST, msg);
- }
-
- public DataNotExistException() {
- super(DATA_NOT_EXIST, "数据不存在");
- }
-
-}
diff --git a/bootx-common-core/src/main/java/cn/bootx/common/core/exception/OptimisticLockException.java b/bootx-common-core/src/main/java/cn/bootx/common/core/exception/OptimisticLockException.java
deleted file mode 100644
index 416f1aa6c..000000000
--- a/bootx-common-core/src/main/java/cn/bootx/common/core/exception/OptimisticLockException.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package cn.bootx.common.core.exception;
-
-import java.io.Serializable;
-
-import static cn.bootx.common.core.code.CommonErrorCode.DATA_OUT_OF_DATE;
-
-/**
- * 乐观锁异常
- *
- * @author xxm
- * @date 2020/4/15 14:11
- */
-public class OptimisticLockException extends SystemException implements Serializable {
-
- private static final long serialVersionUID = -1605410024618499135L;
-
- public OptimisticLockException() {
- super(DATA_OUT_OF_DATE, "数据不存在或者已过期");
- }
-
-}
diff --git a/bootx-common-core/src/main/java/cn/bootx/common/core/exception/RepetitiveOperationException.java b/bootx-common-core/src/main/java/cn/bootx/common/core/exception/RepetitiveOperationException.java
deleted file mode 100644
index 5c864cfc2..000000000
--- a/bootx-common-core/src/main/java/cn/bootx/common/core/exception/RepetitiveOperationException.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package cn.bootx.common.core.exception;
-
-import java.io.Serializable;
-
-import static cn.bootx.common.core.code.CommonErrorCode.REPETITIVE_OPERATION_ERROR;
-
-/**
- * 重复操作异常
- *
- * @author xxm
- * @date 2021/1/2
- */
-public class RepetitiveOperationException extends SystemException implements Serializable {
-
- private static final long serialVersionUID = 2120383728758502943L;
-
- public RepetitiveOperationException() {
- super(REPETITIVE_OPERATION_ERROR, "重复操作异常");
- }
-
- public RepetitiveOperationException(String msg) {
- super(REPETITIVE_OPERATION_ERROR, msg);
- }
-
-}
diff --git a/bootx-common-core/src/main/java/cn/bootx/common/core/exception/UnSupportOperateException.java b/bootx-common-core/src/main/java/cn/bootx/common/core/exception/UnSupportOperateException.java
deleted file mode 100644
index 461ece47a..000000000
--- a/bootx-common-core/src/main/java/cn/bootx/common/core/exception/UnSupportOperateException.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package cn.bootx.common.core.exception;
-
-import java.io.Serializable;
-
-import static cn.bootx.common.core.code.CommonErrorCode.UN_SUPPORTED_OPERATE;
-
-/**
- * 不支持的操作异常
- *
- * @author xxm
- * @date 2022/7/27
- */
-public class UnSupportOperateException extends ErrorCodeRuntimeException implements Serializable {
-
- public UnSupportOperateException(String message) {
- super(UN_SUPPORTED_OPERATE, message);
- }
-
- public UnSupportOperateException() {
- super(UN_SUPPORTED_OPERATE, "不支持的操作异常");
- }
-
-}
diff --git a/bootx-common-core/src/main/java/cn/bootx/common/core/exception/UnSupportReadException.java b/bootx-common-core/src/main/java/cn/bootx/common/core/exception/UnSupportReadException.java
deleted file mode 100644
index 54993a93c..000000000
--- a/bootx-common-core/src/main/java/cn/bootx/common/core/exception/UnSupportReadException.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package cn.bootx.common.core.exception;
-
-import java.io.Serializable;
-
-import static cn.bootx.common.core.code.CommonErrorCode.UN_SUPPORTED_READ;
-
-/**
- * 不支持的读取操作
- *
- * @author xxm
- * @date 2020/4/10 14:05
- */
-public class UnSupportReadException extends BizException implements Serializable {
-
- private static final long serialVersionUID = -743586662489535860L;
-
- public UnSupportReadException() {
- super(UN_SUPPORTED_READ, "不支持的读取下载响应");
- }
-
-}
diff --git a/bootx-common-core/src/main/java/cn/bootx/common/core/function/EntityBaseFunction.java b/bootx-common-core/src/main/java/cn/bootx/common/core/function/EntityBaseFunction.java
deleted file mode 100644
index 7ab8e1c7a..000000000
--- a/bootx-common-core/src/main/java/cn/bootx/common/core/function/EntityBaseFunction.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package cn.bootx.common.core.function;
-
-/**
- * entity基础方法
- *
- * @author xxm
- * @date 2020/11/18
- */
-public interface EntityBaseFunction
+ * //方式一,通过字符串设置通用的 ACL 详情:{@link Constant.ACL }
+ * setFileAcl(ACL.PUBLIC_READ);
+ * //方式二,针对指定存储平台设置更复杂的权限控制,以华为云 OBS 为例
+ * AccessControlList acl = new AccessControlList();
+ * Owner owner = new Owner();
+ * owner.setId("ownerid");
+ * acl.setOwner(owner);
+ * // 保留Owner的完全控制权限(注:如果不设置该权限,该对象Owner自身将没有访问权限)
+ * acl.grantPermission(new CanonicalGrantee("ownerid"), Permission.PERMISSION_FULL_CONTROL);
+ * // 为指定用户设置完全控制权限
+ * acl.grantPermission(new CanonicalGrantee("userid"), Permission.PERMISSION_FULL_CONTROL);
+ * // 为所有用户设置读权限
+ * acl.grantPermission(GroupGrantee.ALL_USERS, Permission.PERMISSION_READ);
+ * setFileAcl(acl);
+ *
+ */
+ private Object fileAcl;
+
+ /**
+ * 缩略图的访问控制列表,一般情况下只有对象存储支持该功能
+ * 详情见{@link FileInfo#setFileAcl}
+ */
+ private Object thFileAcl;
+
+ /**
+ * 创建时间
+ */
+ private LocalDateTime createTime;
+
+
+ /**
+ * 文件大小
+ */
+ public String getFileSize() {
+ return FileUtil.readableFileSize(size);
+ }
+
+}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/entity/JdbcFileData.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/entity/JdbcFileData.java
new file mode 100644
index 000000000..7d8daf1e8
--- /dev/null
+++ b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/entity/JdbcFileData.java
@@ -0,0 +1,28 @@
+package cn.bootx.platform.starter.file.entity;
+
+import cn.bootx.platform.common.mybatisplus.base.MpIdEntity;
+import cn.bootx.table.modify.annotation.DbColumn;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * 数据库存储上传的文件数据
+ * @author xxm
+ * @since 2023/8/5
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Accessors(chain = true)
+@TableName("starter_file_data")
+public class JdbcFileData extends MpIdEntity {
+
+ /** base64方式存储 */
+ @DbColumn(comment = "base64方式存储")
+ private String base64;
+
+ /** 数据方式存储 */
+ @DbColumn(comment = "数据方式存储")
+ private byte[] data;
+}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/entity/UploadFileInfo.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/entity/UploadFileInfo.java
new file mode 100644
index 000000000..44db35a2c
--- /dev/null
+++ b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/entity/UploadFileInfo.java
@@ -0,0 +1,190 @@
+package cn.bootx.platform.starter.file.entity;
+
+import cn.bootx.platform.common.core.function.EntityBaseFunction;
+import cn.bootx.platform.common.mybatisplus.base.MpIdEntity;
+import cn.bootx.platform.common.mybatisplus.handler.JacksonRawTypeHandler;
+import cn.bootx.platform.starter.file.convert.FileConvert;
+import cn.bootx.platform.starter.file.dto.UploadFileDto;
+import cn.hutool.core.lang.Dict;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.dromara.x.file.storage.core.FileInfo;
+import org.dromara.x.file.storage.core.constant.Constant;
+
+import java.time.LocalDateTime;
+import java.util.Map;
+
+/**
+ * 上传文件信息
+ *
+ * @author xxm
+ * @since 2022/1/12
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Accessors(chain = true)
+@TableName(value = "starter_file_upload_info", autoResultMap = true)
+public class UploadFileInfo extends MpIdEntity implements EntityBaseFunction {
+
+ /**
+ * 文件访问地址
+ */
+ private String url;
+
+ /**
+ * 文件大小,单位字节
+ */
+ private Long size;
+
+ /**
+ * 文件名称
+ */
+ private String filename;
+
+ /**
+ * 原始文件名
+ */
+ private String originalFilename;
+
+ /**
+ * 基础存储路径
+ */
+ private String basePath;
+
+ /**
+ * 存储路径
+ */
+ private String path;
+
+ /**
+ * 文件扩展名
+ */
+ private String ext;
+
+ /**
+ * MIME 类型
+ */
+ private String contentType;
+
+ /**
+ * 存储平台
+ */
+ private String platform;
+
+ /**
+ * 缩略图访问路径
+ */
+ private String thUrl;
+
+ /**
+ * 缩略图名称
+ */
+ private String thFilename;
+
+ /**
+ * 缩略图大小,单位字节
+ */
+ private Long thSize;
+
+ /**
+ * 缩略图 MIME 类型
+ */
+ private String thContentType;
+
+ /**
+ * 文件所属对象id
+ */
+ private String objectId;
+
+ /**
+ * 文件所属对象类型,例如用户头像,评价图片
+ */
+ private String objectType;
+
+ /**
+ * 文件元数据
+ */
+ @TableField(typeHandler = JacksonRawTypeHandler.class)
+ private Map metadata;
+
+ /**
+ * 文件用户元数据
+ */
+ @TableField(typeHandler = JacksonRawTypeHandler.class)
+ private Map userMetadata;
+
+ /**
+ * 缩略图元数据
+ */
+ @TableField(typeHandler = JacksonRawTypeHandler.class)
+ private Map thMetadata;
+
+ /**
+ * 缩略图用户元数据
+ */
+ @TableField(typeHandler = JacksonRawTypeHandler.class)
+ private Map thUserMetadata;
+
+ /**
+ * 附加属性字典
+ */
+ @TableField(typeHandler = JacksonRawTypeHandler.class)
+ private Dict attr;
+
+ /**
+ * 文件的访问控制列表,一般情况下只有对象存储支持该功能,支持 String 或对应存储平台的 ACL 对象
+ *
+ * //方式一,通过字符串设置通用的 ACL 详情:{@link Constant.ACL }
+ * setFileAcl(ACL.PUBLIC_READ);
+ * //方式二,针对指定存储平台设置更复杂的权限控制,以华为云 OBS 为例
+ * AccessControlList acl = new AccessControlList();
+ * Owner owner = new Owner();
+ * owner.setId("ownerid");
+ * acl.setOwner(owner);
+ * // 保留Owner的完全控制权限(注:如果不设置该权限,该对象Owner自身将没有访问权限)
+ * acl.grantPermission(new CanonicalGrantee("ownerid"), Permission.PERMISSION_FULL_CONTROL);
+ * // 为指定用户设置完全控制权限
+ * acl.grantPermission(new CanonicalGrantee("userid"), Permission.PERMISSION_FULL_CONTROL);
+ * // 为所有用户设置读权限
+ * acl.grantPermission(GroupGrantee.ALL_USERS, Permission.PERMISSION_READ);
+ * setFileAcl(acl);
+ *
+ */
+ @TableField(typeHandler = JacksonRawTypeHandler.class)
+ private Object fileAcl;
+
+ /**
+ * 缩略图的访问控制列表,一般情况下只有对象存储支持该功能
+ * 详情见{@link FileInfo#setFileAcl}
+ */
+ @TableField(typeHandler = JacksonRawTypeHandler.class)
+ private Object thFileAcl;
+
+ /** 创建时间 */
+ @TableField(fill = FieldFill.INSERT)
+ private LocalDateTime createTime;
+
+ @Override
+ public UploadFileDto toDto() {
+ return FileConvert.CONVERT.convert(this);
+ }
+
+ /**
+ * 初始化创建
+ */
+ public static UploadFileInfo init(FileInfo fileInfo){
+ return FileConvert.CONVERT.convert(fileInfo);
+ }
+
+ /**
+ * 转换为 x.file.storage 的文件信息对象
+ */
+ public FileInfo toFileInfo(){
+ return FileConvert.CONVERT.toFileInfo(this);
+ }
+
+}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/handler/FileDetailRecordHandler.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/handler/FileDetailRecordHandler.java
new file mode 100644
index 000000000..ce5048eb7
--- /dev/null
+++ b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/handler/FileDetailRecordHandler.java
@@ -0,0 +1,58 @@
+package cn.bootx.platform.starter.file.handler;
+
+import cn.bootx.platform.common.core.exception.BizException;
+import cn.bootx.platform.starter.file.dao.UploadFileManager;
+import cn.bootx.platform.starter.file.entity.UploadFileInfo;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.dromara.x.file.storage.core.FileInfo;
+import org.dromara.x.file.storage.core.recorder.FileRecorder;
+import org.springframework.stereotype.Service;
+
+/**
+ * x.file.storage 文件上传信息储存
+ * @author xxm
+ * @since 2023/11/13
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class FileDetailRecordHandler implements FileRecorder {
+ private final UploadFileManager uploadFileManager;
+
+ /**
+ * 保存文件记录
+ */
+ @Override
+ public boolean save(FileInfo fileInfo) {
+ UploadFileInfo save = uploadFileManager.save(UploadFileInfo.init(fileInfo));
+ fileInfo.setId(String.valueOf(save.getId()));
+ return true;
+ }
+
+ /**
+ * 根据 ID(Long) 获取文件记录, 注意不是根据URL
+ */
+ @Override
+ public FileInfo getByUrl(String url) {
+ try {
+ Long id = Long.valueOf(url);
+ return uploadFileManager.findById(id).map(UploadFileInfo::toFileInfo).orElse(null);
+ } catch (NumberFormatException e) {
+ throw new BizException("URL是文件的ID,注意不要传错参数");
+ }
+ }
+
+ /**
+ * 根据 ID(Long) 删除文件记录, 注意不是根据URL
+ */
+ @Override
+ public boolean delete(String url) {
+ try {
+ Long id = Long.valueOf(url);
+ return uploadFileManager.deleteById(id);
+ } catch (NumberFormatException e) {
+ return false;
+ }
+ }
+}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/service/FileUploadService.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/service/FileUploadService.java
new file mode 100644
index 000000000..5a9daa174
--- /dev/null
+++ b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/platform/starter/file/service/FileUploadService.java
@@ -0,0 +1,157 @@
+package cn.bootx.platform.starter.file.service;
+
+import cn.bootx.platform.common.core.exception.DataNotExistException;
+import cn.bootx.platform.common.core.rest.PageResult;
+import cn.bootx.platform.common.core.rest.param.PageParam;
+import cn.bootx.platform.common.mybatisplus.util.MpUtil;
+import cn.bootx.platform.starter.file.UploadFileParam;
+import cn.bootx.platform.starter.file.configuration.FileUploadProperties;
+import cn.bootx.platform.starter.file.convert.FileConvert;
+import cn.bootx.platform.starter.file.dao.UploadFileManager;
+import cn.bootx.platform.starter.file.dto.UploadFileDto;
+import cn.bootx.platform.starter.file.entity.UploadFileInfo;
+import cn.hutool.core.io.IoUtil;
+import cn.hutool.core.util.CharsetUtil;
+import cn.hutool.core.util.StrUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.SneakyThrows;
+import lombok.extern.slf4j.Slf4j;
+import lombok.val;
+import org.dromara.x.file.storage.core.FileInfo;
+import org.dromara.x.file.storage.core.FileStorageService;
+import org.dromara.x.file.storage.core.UploadPretreatment;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+import java.io.ByteArrayInputStream;
+import java.net.URLEncoder;
+
+/**
+ * 文件上传管理类
+ *
+ * @author xxm
+ * @since 2022/1/14
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class FileUploadService {
+ private final UploadFileManager uploadFileManager;
+ private final FileStorageService fileStorageService;
+ private final FileUploadProperties fileUploadProperties;
+
+ /**
+ * 分页
+ */
+ public PageResult page(PageParam pageParam, UploadFileParam param) {
+ return MpUtil.convert2DtoPageResult(uploadFileManager.page(pageParam,param));
+ }
+
+ /**
+ * 获取单条详情
+ */
+ public UploadFileDto findById(Long id){
+ return uploadFileManager.findById(id)
+ .map(UploadFileInfo::toDto)
+ .orElseThrow(DataNotExistException::new);
+ }
+
+ /**
+ * 文件删除
+ */
+ @Transactional(rollbackFor = Exception.class)
+ public void delete(Long id){
+ UploadFileInfo uploadFileInfo = uploadFileManager.findById(id)
+ .orElseThrow(DataNotExistException::new);
+ fileStorageService.delete(FileConvert.CONVERT.toFileInfo(uploadFileInfo));
+ }
+
+ /**
+ * 文件上传
+ * @param file 文件
+ * @param fileName 文件名称
+ */
+ @Transactional(rollbackFor = Exception.class)
+ public UploadFileDto upload(MultipartFile file, String fileName) {
+ UploadPretreatment uploadPretreatment = fileStorageService.of(file);
+ if (StrUtil.isNotBlank(fileName)){
+ uploadPretreatment.setOriginalFilename(fileName);
+ }
+ FileInfo upload =uploadPretreatment.upload();
+ return FileConvert.CONVERT.toDto(upload);
+ }
+
+ /**
+ * 浏览
+ */
+ @SneakyThrows
+ public void preview(Long id, HttpServletResponse response) {
+ FileInfo info = fileStorageService.getFileInfoByUrl(String.valueOf(id));
+ byte[] bytes = fileStorageService.download(info).bytes();
+ val is = new ByteArrayInputStream(bytes);
+ // 获取响应输出流
+ ServletOutputStream os = response.getOutputStream();
+ IoUtil.copy(is, os);
+ response.addHeader(HttpHeaders.CONTENT_DISPOSITION, info.getContentType());
+ IoUtil.close(is);
+ IoUtil.close(os);
+ }
+
+ /**
+ * 文件下载
+ */
+ @SneakyThrows
+ public ResponseEntity download(Long id) {
+ FileInfo fileInfo = fileStorageService.getFileInfoByUrl(String.valueOf(id));
+ byte[] bytes = fileStorageService.download(fileInfo).bytes();
+ // 设置header信息
+ HttpHeaders headers = new HttpHeaders();
+ headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
+ String fileName = fileInfo.getOriginalFilename();
+ headers.setContentDispositionFormData("attachment", URLEncoder.encode(fileName, CharsetUtil.UTF_8));
+ return new ResponseEntity<>(bytes,headers,HttpStatus.OK);
+ }
+
+ /**
+ * 获取文件预览地址
+ */
+ public String getFilePreviewUrl(Long id) {
+ if (fileUploadProperties.isServiceProxy()){
+ return this.getServerUrl() + "/file/preview/" + id;
+ } else {
+ return "";
+ }
+ }
+
+ /**
+ * 获取文件预览地址前缀
+ */
+ public String getFilePreviewUrlPrefix() {
+ return this.getServerUrl() + "/file/preview/";
+ }
+
+ /**
+ * 获取文件地址
+ */
+ public String getFileDownloadUrl(Long id) {
+ if (fileUploadProperties.isServiceProxy()){
+ return this.getServerUrl() + "/file/download/" + id;
+ } else {
+ return "";
+ }
+ }
+
+ /**
+ * 服务地址
+ */
+ private String getServerUrl() {
+ return fileUploadProperties.getServerUrl();
+ }
+}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/code/FileUploadTypeEnum.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/code/FileUploadTypeEnum.java
deleted file mode 100644
index 5e6b022c9..000000000
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/code/FileUploadTypeEnum.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package cn.bootx.starter.file.code;
-
-/**
- * 文件上传类型
- *
- * @author xxm
- * @date 2022/1/14
- */
-public enum FileUploadTypeEnum {
-
- /** 本地存储 */
- LOCAL,
- /** Mongo存储 */
- MONGO,
- /** minio存储 */
- MINIO,
- /** 阿里云 oss存储 */
- ALIYUN_OSS
-
-}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/configuration/FileUploadConfiguration.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/configuration/FileUploadConfiguration.java
deleted file mode 100644
index 009e2bc44..000000000
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/configuration/FileUploadConfiguration.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package cn.bootx.starter.file.configuration;
-
-import lombok.RequiredArgsConstructor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.data.mongodb.MongoDatabaseFactory;
-import org.springframework.data.mongodb.core.convert.MongoConverter;
-import org.springframework.data.mongodb.gridfs.GridFsTemplate;
-
-/**
- * 文件上传配置
- *
- * @author xxm
- * @date 2022/2/15
- */
-@Configuration
-@RequiredArgsConstructor
-public class FileUploadConfiguration {
-
- private final FileUploadProperties properties;
-
- /**
- * 自定义 GridFsTemplate
- */
- @Bean
- public GridFsTemplate gridFsTemplate(MongoDatabaseFactory dbFactory, MongoConverter converter) {
- return new GridFsTemplate(dbFactory, converter, properties.getMongo().getBucket());
- }
-
-}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/configuration/FileUploadProperties.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/configuration/FileUploadProperties.java
deleted file mode 100644
index d65d27e3a..000000000
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/configuration/FileUploadProperties.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package cn.bootx.starter.file.configuration;
-
-import cn.bootx.starter.file.code.FileUploadTypeEnum;
-import lombok.Data;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.experimental.Accessors;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * 文件上传配置
- *
- * @author xxm
- * @date 2022/1/14
- */
-@Data
-@Accessors(chain = true)
-@ConfigurationProperties(prefix = "bootx.starter.file-upload")
-public class FileUploadProperties {
-
- /**
- * 上传文件类型 默认为本地
- */
- private FileUploadTypeEnum uploadType = FileUploadTypeEnum.LOCAL;
-
- /** 服务器地址,优先级低于系统参数配置 */
- private String serverUrl = "http://127.0.0.1:9999";
-
- /** 本地存储 */
- private Local local = new Local();
-
- /** mongo存储配置 */
- private Mongo mongo = new Mongo();
-
- /** minio存储配置 */
- private Minio minio = new Minio();
-
- /**
- * 本地存储
- */
- @Getter
- @Setter
- public static class Local {
-
- /** 本地存储路径 */
- private String localPath = "/data/file/";
-
- }
-
- /**
- * mongo存储配置
- */
- @Getter
- @Setter
- public static class Mongo {
-
- /** 存储桶 */
- private String bucket = "fs";
-
- }
-
- /**
- * Minio存储配置
- */
- @Getter
- @Setter
- public static class Minio {
-
- /** 端点地址 */
- private String endpoint;
-
- /** 区域 */
- private String region;
-
- /** 访问 key */
- private String accessKey;
-
- /** 访问 Secret */
- private String accessSecret;
-
- /** 存储桶 需要至少三位 */
- private String bucket = "bootx";
-
- }
-
-}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/controller/FIleUpLoadController.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/controller/FIleUpLoadController.java
deleted file mode 100644
index b89c2fe43..000000000
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/controller/FIleUpLoadController.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package cn.bootx.starter.file.controller;
-
-import cn.bootx.common.core.annotation.IgnoreAuth;
-import cn.bootx.common.core.rest.PageResult;
-import cn.bootx.common.core.rest.Res;
-import cn.bootx.common.core.rest.ResResult;
-import cn.bootx.common.core.rest.param.PageParam;
-import cn.bootx.starter.file.dto.UpdateFileDto;
-import cn.bootx.starter.file.service.FileUploadService;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.RequiredArgsConstructor;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-/**
- * 文件上传
- *
- * @author xxm
- * @date 2022/1/12
- */
-@IgnoreAuth
-@Tag(name = "文件上传")
-@RestController
-@RequestMapping("/file")
-@RequiredArgsConstructor
-public class FIleUpLoadController {
-
- private final FileUploadService uploadService;
-
- @IgnoreAuth(ignore = false)
- @Operation(summary = "分页")
- @GetMapping("/page")
- public ResResult> page(PageParam pageParam) {
- return Res.ok(uploadService.page(pageParam));
- }
-
- @IgnoreAuth(ignore = false, login = true)
- @Operation(summary = "上传")
- @PostMapping("/upload")
- public ResResult local(MultipartFile file, String fileName) throws IOException {
- return Res.ok(uploadService.upload(file, fileName));
- }
-
- @Operation(summary = "获取文件预览地址")
- @GetMapping("getFilePreviewUrl")
- public ResResult getFilePreviewUrl(Long id) {
- return Res.ok(uploadService.getFilePreviewUrl(id));
- }
-
- @Operation(summary = "获取文件预览地址前缀")
- @GetMapping("getFilePreviewUrlPrefix")
- public ResResult getFilePreviewUrlPrefix() {
- return Res.ok(uploadService.getFilePreviewUrlPrefix());
- }
-
- @Operation(summary = "获取文件下载地址")
- @GetMapping("getFileDownloadUrl")
- public ResResult getFileDownloadUrl(Long id) {
- return Res.ok(uploadService.getFileDownloadUrl(id));
- }
-
- @Operation(summary = "预览文件")
- @GetMapping("/preview/{id}")
- public void preview(@PathVariable Long id, HttpServletResponse response) {
- uploadService.preview(id, response);
- }
-
- @Operation(summary = "下载文件")
- @GetMapping("/download/{id}")
- public ResponseEntity download(@PathVariable Long id) {
- return uploadService.download(id);
- }
-
-}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/convert/FileConvert.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/convert/FileConvert.java
deleted file mode 100644
index 429c34ee2..000000000
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/convert/FileConvert.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package cn.bootx.starter.file.convert;
-
-import cn.bootx.starter.file.dto.UpdateFileDto;
-import cn.bootx.starter.file.entity.UpdateFileInfo;
-import org.mapstruct.Mapper;
-import org.mapstruct.factory.Mappers;
-
-/**
- * @author xxm
- * @date 2022/1/12
- */
-@Mapper
-public interface FileConvert {
-
- FileConvert CONVERT = Mappers.getMapper(FileConvert.class);
-
- UpdateFileDto convert(UpdateFileInfo in);
-
-}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/dao/UpdateFileManager.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/dao/UpdateFileManager.java
deleted file mode 100644
index e4d072164..000000000
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/dao/UpdateFileManager.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package cn.bootx.starter.file.dao;
-
-import cn.bootx.common.core.rest.param.PageParam;
-import cn.bootx.common.mybatisplus.impl.BaseManager;
-import cn.bootx.common.mybatisplus.util.MpUtil;
-import cn.bootx.starter.file.entity.UpdateFileInfo;
-import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Repository;
-
-/**
- * @author xxm
- * @date 2022/1/12
- */
-@Slf4j
-@Repository
-@RequiredArgsConstructor
-public class UpdateFileManager extends BaseManager {
-
- /**
- * 分页
- */
- public Page page(PageParam pageParam) {
- Page mpPage = MpUtil.getMpPage(pageParam, UpdateFileInfo.class);
- return lambdaQuery().orderByDesc(UpdateFileInfo::getId).page(mpPage);
- }
-
-}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/dao/UpdateFileMapper.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/dao/UpdateFileMapper.java
deleted file mode 100644
index 8795669c7..000000000
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/dao/UpdateFileMapper.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package cn.bootx.starter.file.dao;
-
-import cn.bootx.starter.file.entity.UpdateFileInfo;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * @author xxm
- * @date 2022/1/12
- */
-@Mapper
-public interface UpdateFileMapper extends BaseMapper {
-
-}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/dto/UpdateFileDto.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/dto/UpdateFileDto.java
deleted file mode 100644
index 359bf6c90..000000000
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/dto/UpdateFileDto.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package cn.bootx.starter.file.dto;
-
-import cn.hutool.core.io.FileUtil;
-import com.baomidou.mybatisplus.annotation.FieldFill;
-import com.baomidou.mybatisplus.annotation.TableField;
-import lombok.Data;
-import lombok.experimental.Accessors;
-
-import java.time.LocalDateTime;
-
-/**
- * 上传文件信息
- *
- * @author xxm
- * @date 2022/1/12
- */
-@Data
-@Accessors(chain = true)
-public class UpdateFileDto {
-
- /** 主键 */
- private Long id;
-
- /** 存储位置 */
- private String filePath;
-
- /** 文件名称 */
- private String fileName;
-
- /** 文件后缀 */
- private String fileSuffix;
-
- /** 文件类型 */
- private String fileType;
-
- /** 文件大小 */
- private Long fileSize;
-
- /** 外部存储id */
- private String externalStorageId;
-
- /** 创建者ID */
- @TableField(fill = FieldFill.INSERT)
- private Long creator;
-
- /** 创建时间 */
- @TableField(fill = FieldFill.INSERT)
- private LocalDateTime createTime;
-
- public String getFileSize() {
- return FileUtil.readableFileSize(fileSize);
- }
-
-}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/entity/UpdateFileInfo.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/entity/UpdateFileInfo.java
deleted file mode 100644
index 0ec5c16ce..000000000
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/entity/UpdateFileInfo.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package cn.bootx.starter.file.entity;
-
-import cn.bootx.common.core.function.EntityBaseFunction;
-import cn.bootx.common.mybatisplus.base.MpIdEntity;
-import cn.bootx.starter.file.convert.FileConvert;
-import cn.bootx.starter.file.dto.UpdateFileDto;
-import com.baomidou.mybatisplus.annotation.FieldFill;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-
-import java.time.LocalDateTime;
-
-/**
- * 上传文件信息
- *
- * @author xxm
- * @date 2022/1/12
- */
-@EqualsAndHashCode(callSuper = true)
-@Data
-@Accessors(chain = true)
-@TableName("starter_file_upload_info")
-public class UpdateFileInfo extends MpIdEntity implements EntityBaseFunction {
-
- /** 存储位置 */
- private String filePath;
-
- /** 文件名称 */
- private String fileName;
-
- /** 文件类型 */
- private String fileType;
-
- /** 文件后缀 */
- private String fileSuffix;
-
- /** 文件大小 */
- private Long fileSize;
-
- /** 外部存储id */
- private String externalStorageId;
-
- /** 创建者ID */
- @TableField(fill = FieldFill.INSERT)
- private Long creator;
-
- /** 创建时间 */
- @TableField(fill = FieldFill.INSERT)
- private LocalDateTime createTime;
-
- @Override
- public UpdateFileDto toDto() {
- return FileConvert.CONVERT.convert(this);
- }
-
-}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/entity/UploadFileContext.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/entity/UploadFileContext.java
deleted file mode 100644
index 3349d86eb..000000000
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/entity/UploadFileContext.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package cn.bootx.starter.file.entity;
-
-import lombok.Data;
-import lombok.experimental.Accessors;
-
-/**
- * 上传文件上下文
- *
- * @author xxm
- * @date 2022/1/20
- */
-@Data
-@Accessors(chain = true)
-public class UploadFileContext {
-
- /** 文件id */
- private Long fileId;
-
- /** 文件名称 */
- private String fileName;
-
- /** 文件后缀名 */
- private String fileSuffix;
-
-}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/service/FileUploadService.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/service/FileUploadService.java
deleted file mode 100644
index 7ad60e59a..000000000
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/service/FileUploadService.java
+++ /dev/null
@@ -1,175 +0,0 @@
-package cn.bootx.starter.file.service;
-
-import cn.bootx.common.core.exception.BizException;
-import cn.bootx.common.core.function.ParamService;
-import cn.bootx.common.core.rest.PageResult;
-import cn.bootx.common.core.rest.param.PageParam;
-import cn.bootx.common.mybatisplus.util.MpUtil;
-import cn.bootx.starter.file.configuration.FileUploadProperties;
-import cn.bootx.starter.file.dao.UpdateFileManager;
-import cn.bootx.starter.file.dto.UpdateFileDto;
-import cn.bootx.starter.file.entity.UpdateFileInfo;
-import cn.bootx.starter.file.entity.UploadFileContext;
-import cn.hutool.core.io.FileTypeUtil;
-import cn.hutool.core.io.IoUtil;
-import cn.hutool.core.util.IdUtil;
-import cn.hutool.core.util.StrUtil;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import lombok.val;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.charset.StandardCharsets;
-import java.util.List;
-
-/**
- * 文件上传管理类
- *
- * @author xxm
- * @date 2022/1/14
- */
-@Slf4j
-@Service
-@RequiredArgsConstructor
-public class FileUploadService {
-
- private final List uploadServices;
-
- private final UpdateFileManager updateFileManager;
-
- private final FileUploadProperties fileUploadProperties;
-
- private final ParamService paramService;
-
- /**
- * 文件上传
- * @param file 文件
- * @param fileName 文件名称
- */
- @Transactional(rollbackFor = Exception.class)
- public UpdateFileDto upload(MultipartFile file, String fileName) throws IOException {
- val uploadType = fileUploadProperties.getUploadType();
- UploadService uploadService = uploadServices.stream()
- .filter(s -> s.enable(uploadType))
- .findFirst()
- .orElseThrow(() -> new BizException("未找到该类的上传处理器"));
- if (file.isEmpty()) {
- throw new BizException("文件不可为空");
- }
- // 上传文件信息
- if (StrUtil.isBlank(fileName)) {
- fileName = file.getOriginalFilename();
- }
- String fileType = FileTypeUtil.getType(file.getInputStream(), fileName);
- String fileSuffix = fileType;
-
- // 获取不到类型名,后缀名使用上传文件名称的后缀
- if (StrUtil.isBlank(fileSuffix)) {
- fileSuffix = StrUtil.subAfter(fileName, ".", true);
- }
- UploadFileContext context = new UploadFileContext().setFileId(IdUtil.getSnowflakeNextId())
- .setFileName(fileName)
- .setFileSuffix(fileSuffix);
-
- UpdateFileInfo uploadInfo = uploadService.upload(file, context);
- uploadInfo.setFileSuffix(fileSuffix).setFileType(fileType).setFileName(fileName);
- uploadInfo.setId(context.getFileId());
- updateFileManager.save(uploadInfo);
- return uploadInfo.toDto();
- }
-
- /**
- * 浏览
- */
- public void preview(Long id, HttpServletResponse response) {
- val uploadType = fileUploadProperties.getUploadType();
- UploadService uploadService = uploadServices.stream()
- .filter(s -> s.enable(uploadType))
- .findFirst()
- .orElseThrow(() -> new BizException("未找到该类的上传处理器"));
- UpdateFileInfo updateFileInfo = updateFileManager.findById(id).orElseThrow(() -> new BizException("文件不存在"));
- uploadService.preview(updateFileInfo, response);
- }
-
- /**
- * 文件下载
- */
- public ResponseEntity download(Long id) {
- val uploadType = fileUploadProperties.getUploadType();
- UploadService uploadService = uploadServices.stream()
- .filter(s -> s.enable(uploadType))
- .findFirst()
- .orElseThrow(() -> new BizException("未找到该类文件的处理器"));
- UpdateFileInfo updateFileInfo = updateFileManager.findById(id).orElseThrow(() -> new BizException("文件不存在"));
- InputStream inputStream = uploadService.download(updateFileInfo);
- // 设置header信息
- HttpHeaders headers = new HttpHeaders();
- headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
- headers.setContentDispositionFormData("attachment",
- new String(updateFileInfo.getFileName().getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1));
- return new ResponseEntity<>(IoUtil.readBytes(inputStream), headers, HttpStatus.OK);
- }
-
- /**
- * 获取文件字节数组
- */
- public byte[] getFileBytes(Long id) {
- val uploadType = fileUploadProperties.getUploadType();
- UploadService uploadService = uploadServices.stream()
- .filter(s -> s.enable(uploadType))
- .findFirst()
- .orElseThrow(() -> new BizException("未找到该类文件的处理器"));
- UpdateFileInfo updateFileInfo = updateFileManager.findById(id).orElseThrow(() -> new BizException("文件不存在"));
- InputStream inputStream = uploadService.download(updateFileInfo);
- return IoUtil.readBytes(inputStream);
- }
-
- /**
- * 分页
- */
- public PageResult page(PageParam pageParam) {
- return MpUtil.convert2DtoPageResult(updateFileManager.page(pageParam));
- }
-
- /**
- * 获取文件预览地址
- */
- public String getFilePreviewUrl(Long id) {
- return this.getServerUrl() + "/file/preview/" + id;
- }
-
- /**
- * 获取文件预览地址前缀
- */
- public String getFilePreviewUrlPrefix() {
- return this.getServerUrl() + "/file/preview/";
- }
-
- /**
- * 获取文件地址
- */
- public String getFileDownloadUrl(Long id) {
- return this.getServerUrl() + "/file/download/" + id;
- }
-
- /**
- * 服务地址
- */
- private String getServerUrl() {
- String serverUrl = paramService.getValue("FileServerUrl");
- if (StrUtil.isBlank(serverUrl)) {
- serverUrl = fileUploadProperties.getServerUrl();
- }
- return serverUrl;
- }
-
-}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/service/UploadService.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/service/UploadService.java
deleted file mode 100644
index 648893f52..000000000
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/service/UploadService.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package cn.bootx.starter.file.service;
-
-import cn.bootx.starter.file.code.FileUploadTypeEnum;
-import cn.bootx.starter.file.entity.UpdateFileInfo;
-import cn.bootx.starter.file.entity.UploadFileContext;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.InputStream;
-
-/**
- * 文件上传接口
- *
- * @author xxm
- * @date 2022/1/14
- */
-public interface UploadService {
-
- /**
- * 判断启用
- */
- boolean enable(FileUploadTypeEnum type);
-
- /**
- * 上传文件
- */
- UpdateFileInfo upload(MultipartFile file, UploadFileContext context);
-
- /**
- * 预览文件
- */
- void preview(UpdateFileInfo updateFileInfo, HttpServletResponse response);
-
- /**
- * 下载文件
- */
- InputStream download(UpdateFileInfo updateFileInfo);
-
- /**
- * 删除文件
- */
- void delete(UpdateFileInfo updateFileInfo);
-
-}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/service/impl/LocalUploadService.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/service/impl/LocalUploadService.java
deleted file mode 100644
index 99a8a1b15..000000000
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/service/impl/LocalUploadService.java
+++ /dev/null
@@ -1,102 +0,0 @@
-package cn.bootx.starter.file.service.impl;
-
-import cn.bootx.common.core.exception.BizException;
-import cn.bootx.starter.file.code.FileUploadTypeEnum;
-import cn.bootx.starter.file.configuration.FileUploadProperties;
-import cn.bootx.starter.file.entity.UpdateFileInfo;
-import cn.bootx.starter.file.entity.UploadFileContext;
-import cn.bootx.starter.file.service.UploadService;
-import cn.hutool.core.date.DateUtil;
-import cn.hutool.core.io.FileUtil;
-import cn.hutool.core.io.IoUtil;
-import cn.hutool.core.util.IdUtil;
-import lombok.RequiredArgsConstructor;
-import lombok.SneakyThrows;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.http.HttpHeaders;
-import org.springframework.stereotype.Service;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletResponse;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.nio.file.Files;
-import java.util.Optional;
-
-/**
- * 上传文件本地存储
- *
- * @author xxm
- * @date 2022/1/12
- */
-@Slf4j
-@Service
-@RequiredArgsConstructor
-public class LocalUploadService implements UploadService {
-
- private final FileUploadProperties fileUploadProperties;
-
- @Override
- public boolean enable(FileUploadTypeEnum type) {
- return type == FileUploadTypeEnum.LOCAL;
- }
-
- /**
- * 文件上传
- */
- @SneakyThrows
- @Override
- public UpdateFileInfo upload(MultipartFile file, UploadFileContext context) {
- String fileSuffix = Optional.ofNullable(context.getFileSuffix()).map(s -> "." + s).orElse("");
- String filePath = DateUtil.today() + "/" + IdUtil.getSnowflakeNextIdStr() + fileSuffix;
- String storePath = fileUploadProperties.getLocal().getLocalPath() + filePath;
- FileUtil.writeFromStream(file.getInputStream(), storePath);
- return new UpdateFileInfo().setFilePath(filePath).setFileSize(file.getSize());
- }
-
- /**
- * 浏览
- */
- @SneakyThrows
- @Override
- public void preview(UpdateFileInfo updateFileInfo, HttpServletResponse response) {
- String storePath = fileUploadProperties.getLocal().getLocalPath() + updateFileInfo.getFilePath();
- File file = new File(storePath);
- if (!file.exists()) {
- throw new BizException("文件不存在");
- }
- FileInputStream is = new FileInputStream(file);
- // 获取响应输出流
- ServletOutputStream os = response.getOutputStream();
- IoUtil.copy(is, os);
- response.addHeader(HttpHeaders.CONTENT_DISPOSITION, updateFileInfo.getFileType());
- IoUtil.close(is);
- IoUtil.close(os);
- }
-
- /**
- * 下载
- */
- @SneakyThrows
- @Override
- public InputStream download(UpdateFileInfo updateFileInfo) {
- String storePath = fileUploadProperties.getLocal().getLocalPath() + updateFileInfo.getFilePath();
- File file = new File(storePath);
- if (!file.exists()) {
- throw new BizException("文件不存在");
- }
- return Files.newInputStream(file.toPath());
- }
-
- /**
- * 删除文件
- */
- @Override
- public void delete(UpdateFileInfo updateFileInfo) {
- String storePath = fileUploadProperties.getLocal().getLocalPath() + updateFileInfo.getFilePath();
- FileUtil.del(storePath);
- }
-
-}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/service/impl/MinioUploadService.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/service/impl/MinioUploadService.java
deleted file mode 100644
index d1ae8ef6c..000000000
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/service/impl/MinioUploadService.java
+++ /dev/null
@@ -1,131 +0,0 @@
-package cn.bootx.starter.file.service.impl;
-
-import cn.bootx.starter.file.code.FileUploadTypeEnum;
-import cn.bootx.starter.file.configuration.FileUploadProperties;
-import cn.bootx.starter.file.entity.UpdateFileInfo;
-import cn.bootx.starter.file.entity.UploadFileContext;
-import cn.bootx.starter.file.service.UploadService;
-import cn.hutool.core.io.IoUtil;
-import io.minio.*;
-import lombok.RequiredArgsConstructor;
-import lombok.SneakyThrows;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.http.HttpHeaders;
-import org.springframework.stereotype.Service;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletResponse;
-import java.io.InputStream;
-import java.util.Objects;
-
-/**
- * minio方式存储文件
- *
- * @author xxm
- * @date 2022/1/12
- */
-@Slf4j
-@Service
-@RequiredArgsConstructor
-public class MinioUploadService implements UploadService {
-
- private final FileUploadProperties fileUploadProperties;
-
- private MinioClient client;
-
- /**
- * 判断启用
- */
- @Override
- public boolean enable(FileUploadTypeEnum type) {
- boolean b = type == FileUploadTypeEnum.MINIO;
- if (b) {
- this.doInit();
- }
- return b;
- }
-
- /**
- * 上传文件
- */
- @SneakyThrows
- @Override
- public UpdateFileInfo upload(MultipartFile file, UploadFileContext context) {
- FileUploadProperties.Minio minio = fileUploadProperties.getMinio();
- PutObjectArgs putObjectArgs = PutObjectArgs.builder()
- .bucket(minio.getBucket()) // bucket
- // 必须传递
- .contentType(file.getContentType())
- .object(context.getFileId() + "." + context.getFileSuffix())
- .stream(file.getInputStream(), file.getSize(), -1) // 文件内容
- .build();
- // 执行上传
- client.putObject(putObjectArgs);
- return new UpdateFileInfo().setExternalStorageId(putObjectArgs.object()).setFileSize(file.getSize());
- }
-
- /**
- * 预览文件
- */
- @SneakyThrows
- @Override
- public void preview(UpdateFileInfo updateFileInfo, HttpServletResponse response) {
- FileUploadProperties.Minio minio = fileUploadProperties.getMinio();
- String storageId = updateFileInfo.getExternalStorageId();
- GetObjectResponse inputStream = client
- .getObject(GetObjectArgs.builder().bucket(minio.getBucket()).object(storageId).build());
- // 获取响应输出流
- ServletOutputStream os = response.getOutputStream();
- IoUtil.copy(inputStream, os);
- response.addHeader(HttpHeaders.CONTENT_DISPOSITION, updateFileInfo.getFileType());
- IoUtil.close(inputStream);
- IoUtil.close(os);
- }
-
- /**
- * 下载文件
- */
- @SneakyThrows
- @Override
- public InputStream download(UpdateFileInfo updateFileInfo) {
- FileUploadProperties.Minio minio = fileUploadProperties.getMinio();
- String storageId = updateFileInfo.getExternalStorageId();
- return client.getObject(GetObjectArgs.builder()
- .bucket(minio.getBucket()) // bucket
- // 必须传递
- .object(storageId) // 相对路径作为 key
- .build());
- }
-
- /**
- * 删除文件
- */
- @SneakyThrows
- @Override
- public void delete(UpdateFileInfo updateFileInfo) {
- FileUploadProperties.Minio minio = fileUploadProperties.getMinio();
- client.removeObject(RemoveObjectArgs.builder()
- .bucket(minio.getBucket()) // bucket
- // 必须传递
- .object(updateFileInfo.getExternalStorageId()) // 相对路径作为 key
- .build());
- }
-
- /**
- * 初始化
- */
- protected void doInit() {
- if (Objects.nonNull(client)) {
- return;
- }
- FileUploadProperties.Minio minio = fileUploadProperties.getMinio();
- // 初始化客户端
- client = MinioClient.builder()
- .endpoint(minio.getEndpoint()) // Endpoint URL
- .region(minio.getRegion()) // Region
- .credentials(minio.getAccessKey(), minio.getAccessSecret()) // 认证密钥
- .build();
- }
-
-}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/service/impl/MongoUploadService.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/service/impl/MongoUploadService.java
deleted file mode 100644
index fda3531ff..000000000
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/service/impl/MongoUploadService.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package cn.bootx.starter.file.service.impl;
-
-import cn.bootx.common.core.exception.DataNotExistException;
-import cn.bootx.starter.file.code.FileUploadTypeEnum;
-import cn.bootx.starter.file.entity.UpdateFileInfo;
-import cn.bootx.starter.file.entity.UploadFileContext;
-import cn.bootx.starter.file.service.UploadService;
-import cn.hutool.core.io.IoUtil;
-import com.mongodb.client.gridfs.model.GridFSFile;
-import lombok.RequiredArgsConstructor;
-import lombok.SneakyThrows;
-import lombok.extern.slf4j.Slf4j;
-import org.bson.types.ObjectId;
-import org.springframework.data.mongodb.core.query.Criteria;
-import org.springframework.data.mongodb.core.query.Query;
-import org.springframework.data.mongodb.gridfs.GridFsResource;
-import org.springframework.data.mongodb.gridfs.GridFsTemplate;
-import org.springframework.http.HttpHeaders;
-import org.springframework.stereotype.Service;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletResponse;
-import java.io.InputStream;
-import java.util.Optional;
-
-/**
- * mongo方式存储文件
- *
- * @author xxm
- * @date 2022/1/12
- */
-@Slf4j
-@Service
-@RequiredArgsConstructor
-public class MongoUploadService implements UploadService {
-
- private final GridFsTemplate gridFsTemplate;
-
- @Override
- public boolean enable(FileUploadTypeEnum type) {
- return type == FileUploadTypeEnum.MONGO;
- }
-
- /**
- * 上传
- */
- @SneakyThrows
- @Override
- public UpdateFileInfo upload(MultipartFile file, UploadFileContext context) {
- ObjectId store = gridFsTemplate.store(file.getInputStream(), context.getFileName(), file.getContentType());
- return new UpdateFileInfo().setExternalStorageId(store.toString()).setFileSize(file.getSize());
- }
-
- @SneakyThrows
- @Override
- public void preview(UpdateFileInfo updateFileInfo, HttpServletResponse response) {
- Criteria criteria = Criteria.where("_id").is(updateFileInfo.getExternalStorageId());
- Query query = new Query(criteria);
-
- GridFSFile gridFSFile = Optional.ofNullable(gridFsTemplate.findOne(query))
- .orElseThrow(DataNotExistException::new);
- GridFsResource resource = gridFsTemplate.getResource(gridFSFile);
- InputStream inputStream = resource.getInputStream();
-
- // 获取响应输出流
- ServletOutputStream os = response.getOutputStream();
- IoUtil.copy(inputStream, os);
- response.addHeader(HttpHeaders.CONTENT_DISPOSITION, updateFileInfo.getFileType());
- IoUtil.close(inputStream);
- IoUtil.close(os);
- }
-
- @SneakyThrows
- @Override
- public InputStream download(UpdateFileInfo updateFileInfo) {
- Criteria criteria = Criteria.where("_id").is(new ObjectId(updateFileInfo.getExternalStorageId()));
- Query query = new Query(criteria);
-
- GridFSFile gridFSFile = Optional.ofNullable(gridFsTemplate.findOne(query))
- .orElseThrow(DataNotExistException::new);
- GridFsResource resource = gridFsTemplate.getResource(gridFSFile);
- return resource.getInputStream();
- }
-
- /**
- * 删除文件
- */
- @Override
- public void delete(UpdateFileInfo updateFileInfo) {
- Criteria criteria = Criteria.where("_id").is(new ObjectId(updateFileInfo.getExternalStorageId()));
- Query query = new Query(criteria);
- gridFsTemplate.delete(query);
- }
-
-}
diff --git a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/service/impl/OssUploadService.java b/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/service/impl/OssUploadService.java
deleted file mode 100644
index 7e3a43f24..000000000
--- a/bootx-common-starters/common-starter-file/src/main/java/cn/bootx/starter/file/service/impl/OssUploadService.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package cn.bootx.starter.file.service.impl;
-
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-/**
- * 阿里云OSS上传文件
- *
- * @author xxm
- * @date 2022/1/12
- */
-@Slf4j
-@Service
-@RequiredArgsConstructor
-public class OssUploadService {
-
-}
diff --git a/bootx-common-starters/common-starter-file/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/bootx-common-starters/common-starter-file/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 08cbdeedc..279f8e239 100644
--- a/bootx-common-starters/common-starter-file/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/bootx-common-starters/common-starter-file/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -1 +1 @@
-cn.bootx.starter.file.FileAutoConfiguration
\ No newline at end of file
+cn.bootx.platform.starter.file.FileAutoConfiguration
diff --git a/bootx-common-starters/common-starter-flowable/pom.xml b/bootx-common-starters/common-starter-flowable/pom.xml
deleted file mode 100644
index 73bb2135c..000000000
--- a/bootx-common-starters/common-starter-flowable/pom.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
- bootx-common-starters
- cn.bootx.platform
- 1.2.3
-
- 4.0.0
-
- common-starter-flowable
-
-
-
-
- cn.bootx.platform
- common-starter-auth
-
-
-
- cn.bootx.platform
- common-mybatis-plus
-
-
-
- org.flowable
- flowable-spring-boot-starter-process
- ${flowable.version}
-
-
- org.mybatis
- mybatis
-
-
-
-
- org.flowable
- flowable-spring-boot-starter-actuator
- ${flowable.version}
-
-
-
diff --git a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/FlowableAutoConfiguration.java b/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/FlowableAutoConfiguration.java
deleted file mode 100644
index 706dd31ab..000000000
--- a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/FlowableAutoConfiguration.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package cn.bootx.starter.flowable;
-
-import org.apache.ibatis.annotations.Mapper;
-import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.boot.autoconfigure.AutoConfiguration;
-import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
-import org.springframework.context.annotation.ComponentScan;
-
-/**
- * 工作流
- *
- * @author xxm
- * @date 2022/8/22
- */
-@ComponentScan
-@ConfigurationPropertiesScan
-@AutoConfiguration
-@MapperScan(annotationClass = Mapper.class)
-public class FlowableAutoConfiguration {
-
-}
diff --git a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/code/BpmnCode.java b/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/code/BpmnCode.java
deleted file mode 100644
index c71ca9fb0..000000000
--- a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/code/BpmnCode.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package cn.bootx.starter.flowable.code;
-
-/**
- * 流程
- *
- * @author xxm
- * @date 2022/9/6
- */
-public interface BpmnCode {
-
- /** collectionString(候选人集合) */
- String MULTI_COLLECTION = "assignees";
-
- /** collectionElementVariable(迭代出来的处理人) */
- String MULTI_COLLECTION_ELEMENT = "assign";
-
- /** 下一步标志 */
- String NEXT_NODE_FLAG = "nextNode";
-
- /** 多实例任务标示 */
- String MULTI_TASK_ID = "multiId";
-
-}
diff --git a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/code/CachingCode.java b/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/code/CachingCode.java
deleted file mode 100644
index a16ff4c87..000000000
--- a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/code/CachingCode.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package cn.bootx.starter.flowable.code;
-
-/**
- * 缓存key常量
- *
- * @author xxm
- * @date 2022/9/4
- */
-public interface CachingCode {
-
- /* 流程节点扩展 */
- /** 定义和节点id */
- String NODE_DEF_AND_NODE = "flowable:model:node";
-
- /** 缓存列表, 使用模型id/modelId */
- String NODE_MODEL_ID = "flowable:model:nodes";
-
-}
diff --git a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/code/InstanceCode.java b/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/code/InstanceCode.java
deleted file mode 100644
index 8e39d850b..000000000
--- a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/code/InstanceCode.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package cn.bootx.starter.flowable.code;
-
-/**
- * 流程实例的状态
- *
- * @author xxm
- * @date 2022/8/23
- */
-public interface InstanceCode {
-
- /** 运行中 */
- String STATE_RUNNING = "running";
-
- /** 已完成 */
- String STATE_FINISH = "finish";
-
- /** 取消 */
- String STATE_CANCEL = "cancel";
-
-}
diff --git a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/code/ModelCode.java b/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/code/ModelCode.java
deleted file mode 100644
index b1cb80baa..000000000
--- a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/code/ModelCode.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package cn.bootx.starter.flowable.code;
-
-/**
- * 工作流模型代码
- *
- * @author xxm
- * @date 2022/8/23
- */
-public interface ModelCode {
-
- /** 流程定义已发布 */
- String PUBLISHED = "published";
-
- /** 流程定义未发布 */
- String UNPUBLISHED = "unpublished";
-
- /** 默认的bpmn20.xml */
- String DEFAULT_XML = "\n"
- + "\n"
- + " \n" + " \n"
- + " \n"
- + " \n" + " ";
-
-}
diff --git a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/code/ModelNodeCode.java b/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/code/ModelNodeCode.java
deleted file mode 100644
index 64fda90b5..000000000
--- a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/code/ModelNodeCode.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package cn.bootx.starter.flowable.code;
-
-/**
- * 模型节点配置
- *
- * @author xxm
- * @date 2022/9/4
- */
-public interface ModelNodeCode {
-
- /* 用户分配类型 */
- /** 发起人 */
- String ASSIGN_SPONSOR = "sponsor";
-
- /** 用户手动选择 */
- String ASSIGN_SELECT = "select";
-
- /** 单用户 */
- String ASSIGN_USER = "user";
-
- /** 用户组 */
- String ASSIGN_USER_GROUP = "userGroup";
-
- /** 角色 */
- String ASSIGN_ROLE = "role";
-
- /** 角色组 */
- String ASSIGN_GROUP = "roleGroup";
-
- /** 部门成员 */
- String ASSIGN_DEPT_MEMBER = "deptMember";
-
- /** 部门的负责人 */
- String ASSIGN_DEPT_LEADER = "deptLeader";
-
-}
diff --git a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/code/TaskCode.java b/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/code/TaskCode.java
deleted file mode 100644
index 15b676599..000000000
--- a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/code/TaskCode.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package cn.bootx.starter.flowable.code;
-
-/**
- * 流程任务常量
- *
- * @author xxm
- * @date 2022/9/4
- */
-public interface TaskCode {
-
- /* 处理状态 */
- /** 处理中 */
- String STATE_PROCESS = "running";
-
- /** 通过 */
- String STATE_PASS = "pass";
-
- /** 驳回 */
- String STATE_REJECT = "reject";
-
- /** 退回 */
- String STATE_BACK = "back";
-
- /** 取回 */
- String STATE_RETRIEVE = "retrieve";
-
- /** 跳过 */
- String STATE_SKIP = "skip";
-
- /** 取消 */
- String STATE_CANCEL = "cancel";
-
- /* 处理结果 */
- /** 通过 */
- String RESULT_PASS = "pass";
-
- /** 不通过 */
- String RESULT_NOT_PASS = "notPass";
-
- /** 弃权 */
- String RESULT_ABSTAIN = "abstain";
-
- /** 驳回 */
- String RESULT_REJECT = "reject";
-
- /** 自动完成 */
- String RESULT_AUTO_FINISH = "autoFinish";
-
- /** 退回 */
- String RESULT_BACK = "back";
-
- /** 取回 */
- String RESULT_RETRIEVE = "retrieve";
-
- /** 取消 */
- String RESULT_CANCEL = "cancel";
-
-}
diff --git a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/config/FlowableConfiguration.java b/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/config/FlowableConfiguration.java
deleted file mode 100644
index 6753d3198..000000000
--- a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/config/FlowableConfiguration.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package cn.bootx.starter.flowable.config;
-
-import cn.bootx.starter.flowable.handler.behavior.BpmActivityBehaviorFactory;
-import cn.hutool.core.collection.ListUtil;
-import cn.hutool.core.util.IdUtil;
-import org.flowable.common.engine.api.delegate.event.FlowableEventListener;
-import org.flowable.spring.SpringProcessEngineConfiguration;
-import org.flowable.spring.boot.EngineConfigurationConfigurer;
-import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * Flowable 配置类
- *
- * @author xxm
- * @date 2022/8/24
- */
-@Configuration
-public class FlowableConfiguration {
-
- /**
- * 1. 设置各种监听器 2. 设置自定义的 ActivityBehaviorFactory 实现 3. 其他的一些配置
- */
- @Bean
- public EngineConfigurationConfigurer bpmProcessEngineConfigurationConfigurer(
- ObjectProvider listeners, BpmActivityBehaviorFactory bpmActivityBehaviorFactory) {
- return configuration -> {
- // 注册监听器
- configuration.setEventListeners(ListUtil.toList(listeners.iterator()));
- // 设置 ActivityBehaviorFactory 实现类,用于流程任务的审核人的自定义
- configuration.setActivityBehaviorFactory(bpmActivityBehaviorFactory);
- // 注册id生成器, 使用雪花id
- configuration.setIdGenerator(IdUtil::getSnowflakeNextIdStr);
- // 部署时不生成流程图图片
- configuration.setCreateDiagramOnDeploy(false);
- };
- }
-
-}
diff --git a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmAssistControl.java b/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmAssistControl.java
deleted file mode 100644
index 3d37b86bc..000000000
--- a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmAssistControl.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package cn.bootx.starter.flowable.controller;
-
-import cn.bootx.starter.flowable.core.model.service.BpmAssistService;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.RequiredArgsConstructor;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * 工作流基础支撑接口
- * @author xxm
- * @date 2023/3/28
- */
-@Tag(name = "工作流基础支撑接口")
-@RestController
-@RequestMapping("/bpm/assist")
-@RequiredArgsConstructor
-public class BpmAssistControl {
- private final BpmAssistService bpmAssistService;
-}
diff --git a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmInstanceAdminController.java b/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmInstanceAdminController.java
deleted file mode 100644
index afa32de9a..000000000
--- a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmInstanceAdminController.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package cn.bootx.starter.flowable.controller;
-
-import cn.bootx.common.core.rest.PageResult;
-import cn.bootx.common.core.rest.Res;
-import cn.bootx.common.core.rest.ResResult;
-import cn.bootx.common.core.rest.param.PageParam;
-import cn.bootx.starter.flowable.core.instance.service.BpmInstanceAdminService;
-import cn.bootx.starter.flowable.dto.instance.InstanceInfo;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.RequiredArgsConstructor;
-import org.springdoc.api.annotations.ParameterObject;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * 流程实例管理服务
- *
- * @author xxm
- * @date 2022/9/17
- */
-@Tag(name = "流程实例管理服务")
-@RestController
-@RequestMapping("/bpm/admin/instance")
-@RequiredArgsConstructor
-public class BpmInstanceAdminController {
-
- private final BpmInstanceAdminService adminService;
-
- @Operation(summary = "分页")
- @GetMapping("/page")
- public ResResult> page(@ParameterObject PageParam pageParam) {
- return Res.ok(adminService.page(pageParam));
- }
-
-}
diff --git a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmInstanceController.java b/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmInstanceController.java
deleted file mode 100644
index c853ca8cb..000000000
--- a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmInstanceController.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package cn.bootx.starter.flowable.controller;
-
-import cn.bootx.common.core.rest.PageResult;
-import cn.bootx.common.core.rest.Res;
-import cn.bootx.common.core.rest.ResResult;
-import cn.bootx.common.core.rest.dto.LabelValue;
-import cn.bootx.common.core.rest.param.PageParam;
-import cn.bootx.starter.flowable.core.instance.service.BpmInstanceQueryService;
-import cn.bootx.starter.flowable.core.instance.service.BpmInstanceOperateService;
-import cn.bootx.starter.flowable.dto.instance.ActivityInstanceChart;
-import cn.bootx.starter.flowable.dto.instance.BpmInstanceDto;
-import cn.bootx.starter.flowable.dto.instance.InstanceInfo;
-import cn.bootx.starter.flowable.param.instance.InstanceStartParam;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.RequiredArgsConstructor;
-import org.springdoc.api.annotations.ParameterObject;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- * 流程实例
- *
- * @author xxm
- * @date 2022/8/24
- */
-@Tag(name = "流程实例")
-@RestController
-@RequestMapping("/bpm/instance")
-@RequiredArgsConstructor
-public class BpmInstanceController {
-
- private final BpmInstanceOperateService operateService;
-
- private final BpmInstanceQueryService queryService;
-
- @Operation(summary = "启动任务")
- @PostMapping("/start")
- public ResResult start(@RequestBody InstanceStartParam instanceParam) {
- operateService.start(instanceParam);
- return Res.ok();
- }
-
- @Operation(summary = "挂起流程")
- @PostMapping("/suspend")
- public ResResult suspend(String instanceId) {
- operateService.suspend(instanceId);
- return Res.ok();
- }
-
- @Operation(summary = "激活流程")
- @PostMapping("/activate")
- public ResResult activate(String instanceId) {
- operateService.activate(instanceId);
- return Res.ok();
- }
-
- @Operation(summary = "关闭流程")
- @PostMapping("/close")
- public ResResult close(String instanceId) {
- operateService.close(instanceId);
- return Res.ok();
- }
-
- @Operation(summary = "根据流程Id获取详情")
- @GetMapping("/findByInstanceId")
- public ResResult findByInstanceId(String instanceId) {
- return Res.ok(queryService.findByInstanceId(instanceId));
- }
-
- @Operation(summary = "获取当前正在执行的节点")
- @GetMapping("/getCurrentNodes")
- public ResResult> getCurrentNodes(String instanceId) {
- return Res.ok(queryService.getCurrentNodes(instanceId));
- }
-
- @Operation(summary = "获取可回退节点")
- @GetMapping("/getBackNodes")
- public ResResult> getBackNodes(String instanceId) {
- return Res.ok(queryService.getBackNodes(instanceId));
- }
-
- @Operation(summary = "获取流程执行的节点, 用于绘制流程图")
- @GetMapping("/getFlowNodes")
- public ResResult> getFlowNodes(String instanceId) {
- return Res.ok(queryService.getFlowNodes(instanceId));
- }
-
- @Operation(summary = "我发起的流程(分页)")
- @GetMapping("/pageMyApply")
- public ResResult> pageMyApply(@ParameterObject PageParam pageParam) {
- return Res.ok(queryService.pageMyApply(pageParam));
- }
-
-}
diff --git a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmModelController.java b/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmModelController.java
deleted file mode 100644
index fa323969d..000000000
--- a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmModelController.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package cn.bootx.starter.flowable.controller;
-
-import cn.bootx.common.core.rest.PageResult;
-import cn.bootx.common.core.rest.Res;
-import cn.bootx.common.core.rest.ResResult;
-import cn.bootx.common.core.rest.dto.LabelValue;
-import cn.bootx.common.core.rest.param.PageParam;
-import cn.bootx.starter.flowable.core.model.service.BpmModelService;
-import cn.bootx.starter.flowable.dto.model.BpmModelDto;
-import cn.bootx.starter.flowable.param.model.BpmModelParam;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.RequiredArgsConstructor;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- * 流程模型
- *
- * @author xxm
- * @date 2022-08-23
- */
-@Tag(name = "流程模型")
-@RestController
-@RequestMapping("/bpm/model")
-@RequiredArgsConstructor
-public class BpmModelController {
-
- private final BpmModelService bpmModelService;
-
- @Operation(summary = "增加流程模型")
- @PostMapping("/add")
- public ResResult add(@RequestBody BpmModelParam flowModelParam) {
- bpmModelService.add(flowModelParam);
- return Res.ok();
- }
-
- @Operation(summary = "上传BPMN文件")
- @PostMapping("/uploadBpmn")
- public ResResult uploadBpmn(@RequestBody BpmModelParam bpmModelParam) {
- bpmModelService.uploadBpmn(bpmModelParam);
- return Res.ok();
- }
-
- @Operation(summary = "上传BPMN文件")
- @PostMapping("/copy")
- public ResResult uploadBpmn(Long id) {
- bpmModelService.copy(id);
- return Res.ok();
- }
-
- @Operation(summary = "发布")
- @PostMapping("/publish")
- public ResResult publish(Long id) {
- bpmModelService.publish(id);
- return Res.ok();
- }
-
- @Operation(summary = "校验流程")
- @GetMapping("/verifyModel")
- public ResResult verifyModel(Long id) {
- bpmModelService.verifyModel(id);
- return Res.ok();
- }
-
- @Operation(summary = "更新")
- @PostMapping("/update")
- public ResResult update(@RequestBody BpmModelParam param) {
- bpmModelService.update(param);
- return Res.ok();
- }
-
- @Operation(summary = "删除")
- @DeleteMapping(value = "/delete")
- public ResResult delete(Long id) {
- bpmModelService.delete(id);
- return Res.ok();
- }
-
- @Operation(summary = "通过ID查询")
- @GetMapping(value = "/findById")
- public ResResult findById(Long id) {
- return Res.ok(bpmModelService.findById(id));
- }
-
- @Operation(summary = "分页查询")
- @GetMapping(value = "/page")
- public ResResult> page(PageParam pageParam, BpmModelParam bpmModelParam) {
- return Res.ok(bpmModelService.page(pageParam, bpmModelParam));
- }
-
- @Operation(summary = "获取生效并部署的主流程列表")
- @GetMapping("/findMainProcess")
- public ResResult> findMainProcess() {
- return Res.ok(bpmModelService.findMainProcess());
- }
-
- @Operation(summary = "根据流程定义id获取模型信息")
- @GetMapping("/findByDefId")
- public ResResult findByDefId(String defId) {
- return Res.ok(bpmModelService.findByDefId(defId));
- }
-
-}
\ No newline at end of file
diff --git a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmModelNodeController.java b/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmModelNodeController.java
deleted file mode 100644
index f099718a2..000000000
--- a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmModelNodeController.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package cn.bootx.starter.flowable.controller;
-
-import cn.bootx.common.core.rest.Res;
-import cn.bootx.common.core.rest.ResResult;
-import cn.bootx.common.core.rest.dto.LabelValue;
-import cn.bootx.starter.flowable.core.model.service.BpmModelNodeService;
-import cn.bootx.starter.flowable.dto.model.BpmModelNodeDto;
-import cn.bootx.starter.flowable.param.model.BpmModelNodeParam;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.RequiredArgsConstructor;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import javax.validation.constraints.NotNull;
-import java.util.List;
-
-/**
- * 模型任务节点配置
- *
- * @author xxm
- * @date 2022-08-25
- */
-@Validated
-@Tag(name = "模型任务节点配置")
-@RestController
-@RequestMapping("/bpm/model/node")
-@RequiredArgsConstructor
-public class BpmModelNodeController {
-
- private final BpmModelNodeService bpmModelNodeService;
-
- @Operation(summary = "添加")
- @PostMapping(value = "/add")
- public ResResult add(@RequestBody BpmModelNodeParam param) {
- bpmModelNodeService.add(param);
- return Res.ok();
- }
-
- @Operation(summary = "修改")
- @PostMapping(value = "/update")
- public ResResult update(@RequestBody BpmModelNodeParam param) {
- bpmModelNodeService.update(param);
- return Res.ok();
- }
-
- @Operation(summary = "删除")
- @DeleteMapping(value = "/delete")
- public ResResult delete(Long id) {
- bpmModelNodeService.delete(id);
- return Res.ok();
- }
-
- @Operation(summary = "通过ID查询")
- @GetMapping(value = "/findById")
- public ResResult findById(Long id) {
- return Res.ok(bpmModelNodeService.findById(id));
- }
-
- @Operation(summary = "查询任务节点配置项")
- @GetMapping(value = "/findByDefIdAndTaskId")
- public ResResult findByDefIdAndTaskId(String defId, String nodeId) {
- return Res.ok(bpmModelNodeService.findByDefIdAndTaskId(defId, nodeId));
- }
-
- @Operation(summary = "获取下一步节点列表")
- @GetMapping(value = "/getNextNodes")
- public ResResult> getNextNodes(String defId, String nodeId) {
- return Res.ok(bpmModelNodeService.getNextNodes(defId, nodeId));
- }
-
- @Operation(summary = "根据模型Id查询所有")
- @GetMapping(value = "/findAllByModelId")
- public ResResult> findAllByModelId(@NotNull(message = "模型ID不能为空") Long modelId) {
- return Res.ok(bpmModelNodeService.findAllByModelId(modelId));
- }
-
- @Operation(summary = "同步")
- @PostMapping("/sync")
- public ResResult sync(Long modelId) {
- bpmModelNodeService.sync(modelId);
- return Res.ok();
- }
-
-}
\ No newline at end of file
diff --git a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmTaskAdminController.java b/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmTaskAdminController.java
deleted file mode 100644
index 9105be184..000000000
--- a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmTaskAdminController.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package cn.bootx.starter.flowable.controller;
-
-import cn.bootx.common.core.rest.PageResult;
-import cn.bootx.common.core.rest.Res;
-import cn.bootx.common.core.rest.ResResult;
-import cn.bootx.common.core.rest.param.PageParam;
-import cn.bootx.starter.flowable.core.instance.service.BpmTaskAdminService;
-import cn.bootx.starter.flowable.dto.task.TaskInfo;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.RequiredArgsConstructor;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * 流程任务管理服务
- *
- * @author xxm
- * @date 2022/9/13
- */
-@Tag(name = "流程任务管理服务")
-@RestController
-@RequestMapping("/bpm/admin/task")
-@RequiredArgsConstructor
-public class BpmTaskAdminController {
-
- private final BpmTaskAdminService bpmTaskAdminService;
-
- @Operation(summary = "待处理任务")
- @GetMapping("/pageByTodo")
- public ResResult> pageByTodo(PageParam pageParam) {
- return Res.ok(bpmTaskAdminService.pageByTodo(pageParam));
- }
-
- @Operation(summary = "已处理任务")
- @GetMapping("/pageByDone")
- public ResResult> pageByDone(PageParam pageParam) {
- return Res.ok(bpmTaskAdminService.pageByDone(pageParam));
- }
-
-}
diff --git a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmTaskController.java b/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmTaskController.java
deleted file mode 100644
index fc2af613d..000000000
--- a/bootx-common-starters/common-starter-flowable/src/main/java/cn/bootx/starter/flowable/controller/BpmTaskController.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package cn.bootx.starter.flowable.controller;
-
-import cn.bootx.common.core.rest.PageResult;
-import cn.bootx.common.core.rest.Res;
-import cn.bootx.common.core.rest.ResResult;
-import cn.bootx.common.core.rest.param.PageParam;
-import cn.bootx.starter.flowable.core.instance.service.BpmTaskOperateService;
-import cn.bootx.starter.flowable.core.instance.service.BpmTaskQueryService;
-import cn.bootx.starter.flowable.dto.task.BpmTaskDto;
-import cn.bootx.starter.flowable.dto.task.TaskInfo;
-import cn.bootx.starter.flowable.param.task.TaskApproveParam;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.RequiredArgsConstructor;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author xxm
- * @date 2022/8/24
- */
-@Tag(name = "流程任务")
-@RestController
-@RequestMapping("/bpm/task")
-@RequiredArgsConstructor
-public class BpmTaskController {
-
- private final BpmTaskOperateService operateService;
-
- private final BpmTaskQueryService queryService;
-
- @Operation(summary = "我的待办")
- @GetMapping("/pageMyTodo")
- public ResResult> pageMyTodo(PageParam pageParam) {
- return Res.ok(queryService.pageMyTodo(pageParam));
- }
-
- @Operation(summary = "我的已办")
- @GetMapping("/pageMyDone")
- public ResResult> pageMyDone(PageParam pageParam) {
- return Res.ok(queryService.pageMyDone(pageParam));
- }
-
- @Operation(summary = "处理任务")
- @PostMapping("/approve")
- public ResResult approve(@RequestBody TaskApproveParam param) {
- operateService.approve(param);
- return Res.ok();
- }
-
- @Operation(summary = "根据任务实例ID查询任务列表")
- @GetMapping("/findAllByInstanceId")
- public ResResult> findAllByInstanceId(String instanceId) {
- return Res.ok(queryService.findAllByInstanceId(instanceId));
- }
-
- @Operation(summary = "获取流程节点的分组任务信息")
- @GetMapping("/getNodeTasks")
- public ResResult