diff --git a/pom.xml b/pom.xml
index d8814a05f3..a1f51bfa16 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,13 +32,13 @@
https://github.com/YunaiV/ruoyi-vue-pro
- 2.5.0-SNAPSHOT
+ 2.6.0-SNAPSHOT
17
${java.version}
${java.version}
3.2.2
- 3.13.0
+ 3.14.0
1.6.0
1.18.36
diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml
index f3e69c7d6e..bea4fccf2c 100644
--- a/yudao-dependencies/pom.xml
+++ b/yudao-dependencies/pom.xml
@@ -14,7 +14,7 @@
https://github.com/YunaiV/ruoyi-vue-pro
- 2.5.0-SNAPSHOT
+ 2.6.0-SNAPSHOT
1.6.0
3.4.5
diff --git a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiAccessLogApi.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/infra/logger/ApiAccessLogCommonApi.java
similarity index 75%
rename from yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiAccessLogApi.java
rename to yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/infra/logger/ApiAccessLogCommonApi.java
index 84f5989591..efa9ca1838 100644
--- a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiAccessLogApi.java
+++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/infra/logger/ApiAccessLogCommonApi.java
@@ -1,7 +1,6 @@
-package cn.iocoder.yudao.module.infra.api.logger;
-
-import cn.iocoder.yudao.module.infra.api.logger.dto.ApiAccessLogCreateReqDTO;
+package cn.iocoder.yudao.framework.common.biz.infra.logger;
+import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiAccessLogCreateReqDTO;
import jakarta.validation.Valid;
import org.springframework.scheduling.annotation.Async;
@@ -10,7 +9,7 @@ import org.springframework.scheduling.annotation.Async;
*
* @author 芋道源码
*/
-public interface ApiAccessLogApi {
+public interface ApiAccessLogCommonApi {
/**
* 创建 API 访问日志
diff --git a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiErrorLogApi.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/infra/logger/ApiErrorLogCommonApi.java
similarity index 75%
rename from yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiErrorLogApi.java
rename to yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/infra/logger/ApiErrorLogCommonApi.java
index 23ce3bd0d1..98743be31f 100644
--- a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiErrorLogApi.java
+++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/infra/logger/ApiErrorLogCommonApi.java
@@ -1,6 +1,6 @@
-package cn.iocoder.yudao.module.infra.api.logger;
+package cn.iocoder.yudao.framework.common.biz.infra.logger;
-import cn.iocoder.yudao.module.infra.api.logger.dto.ApiErrorLogCreateReqDTO;
+import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO;
import jakarta.validation.Valid;
import org.springframework.scheduling.annotation.Async;
@@ -10,7 +10,7 @@ import org.springframework.scheduling.annotation.Async;
*
* @author 芋道源码
*/
-public interface ApiErrorLogApi {
+public interface ApiErrorLogCommonApi {
/**
* 创建 API 错误日志
diff --git a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/dto/ApiAccessLogCreateReqDTO.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/infra/logger/dto/ApiAccessLogCreateReqDTO.java
similarity index 96%
rename from yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/dto/ApiAccessLogCreateReqDTO.java
rename to yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/infra/logger/dto/ApiAccessLogCreateReqDTO.java
index 88add1ab63..b579cd31bc 100644
--- a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/dto/ApiAccessLogCreateReqDTO.java
+++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/infra/logger/dto/ApiAccessLogCreateReqDTO.java
@@ -1,8 +1,8 @@
-package cn.iocoder.yudao.module.infra.api.logger.dto;
-
-import lombok.Data;
+package cn.iocoder.yudao.framework.common.biz.infra.logger.dto;
import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
import java.time.LocalDateTime;
/**
diff --git a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/dto/ApiErrorLogCreateReqDTO.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/infra/logger/dto/ApiErrorLogCreateReqDTO.java
similarity index 97%
rename from yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/dto/ApiErrorLogCreateReqDTO.java
rename to yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/infra/logger/dto/ApiErrorLogCreateReqDTO.java
index a856cf66fb..ae5cd1d4da 100644
--- a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/logger/dto/ApiErrorLogCreateReqDTO.java
+++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/infra/logger/dto/ApiErrorLogCreateReqDTO.java
@@ -1,4 +1,4 @@
-package cn.iocoder.yudao.module.infra.api.logger.dto;
+package cn.iocoder.yudao.framework.common.biz.infra.logger.dto;
import lombok.Data;
diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/infra/package-info.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/infra/package-info.java
new file mode 100644
index 0000000000..d7d8a3bea2
--- /dev/null
+++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/infra/package-info.java
@@ -0,0 +1,4 @@
+/**
+ * 针对 infra 模块的 api 包
+ */
+package cn.iocoder.yudao.framework.common.biz.infra;
\ No newline at end of file
diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/package-info.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/package-info.java
new file mode 100644
index 0000000000..2134e4886d
--- /dev/null
+++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/package-info.java
@@ -0,0 +1,4 @@
+/**
+ * 特殊:用于 framework 下,starter 需要调用 biz 业务模块的接口定义!
+ */
+package cn.iocoder.yudao.framework.common.biz;
\ No newline at end of file
diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/dict/DictDataCommonApi.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/dict/DictDataCommonApi.java
new file mode 100644
index 0000000000..92c87af3c6
--- /dev/null
+++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/dict/DictDataCommonApi.java
@@ -0,0 +1,22 @@
+package cn.iocoder.yudao.framework.common.biz.system.dict;
+
+import cn.iocoder.yudao.framework.common.biz.system.dict.dto.DictDataRespDTO;
+
+import java.util.List;
+
+/**
+ * 字典数据 API 接口
+ *
+ * @author 芋道源码
+ */
+public interface DictDataCommonApi {
+
+ /**
+ * 获得指定字典类型的字典数据列表
+ *
+ * @param dictType 字典类型
+ * @return 字典数据列表
+ */
+ List getDictDataList(String dictType);
+
+}
diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/dto/DictDataRespDTO.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/dict/dto/DictDataRespDTO.java
similarity index 88%
rename from yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/dto/DictDataRespDTO.java
rename to yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/dict/dto/DictDataRespDTO.java
index fe5ab6a212..bf32e7ee72 100644
--- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/dto/DictDataRespDTO.java
+++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/dict/dto/DictDataRespDTO.java
@@ -1,4 +1,4 @@
-package cn.iocoder.yudao.module.system.api.dict.dto;
+package cn.iocoder.yudao.framework.common.biz.system.dict.dto;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import lombok.Data;
diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/logger/OperateLogCommonApi.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/logger/OperateLogCommonApi.java
new file mode 100644
index 0000000000..96753e0f6a
--- /dev/null
+++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/logger/OperateLogCommonApi.java
@@ -0,0 +1,31 @@
+package cn.iocoder.yudao.framework.common.biz.system.logger;
+
+import cn.iocoder.yudao.framework.common.biz.system.logger.dto.OperateLogCreateReqDTO;
+import jakarta.validation.Valid;
+import org.springframework.scheduling.annotation.Async;
+
+/**
+ * 操作日志 API 接口
+ *
+ * @author 芋道源码
+ */
+public interface OperateLogCommonApi {
+
+ /**
+ * 创建操作日志
+ *
+ * @param createReqDTO 请求
+ */
+ void createOperateLog(@Valid OperateLogCreateReqDTO createReqDTO);
+
+ /**
+ * 【异步】创建操作日志
+ *
+ * @param createReqDTO 请求
+ */
+ @Async
+ default void createOperateLogAsync(OperateLogCreateReqDTO createReqDTO) {
+ createOperateLog(createReqDTO);
+ }
+
+}
diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/logger/dto/OperateLogCreateReqDTO.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/logger/dto/OperateLogCreateReqDTO.java
similarity index 97%
rename from yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/logger/dto/OperateLogCreateReqDTO.java
rename to yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/logger/dto/OperateLogCreateReqDTO.java
index 87c0254b73..a2d7990251 100644
--- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/logger/dto/OperateLogCreateReqDTO.java
+++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/logger/dto/OperateLogCreateReqDTO.java
@@ -1,4 +1,4 @@
-package cn.iocoder.yudao.module.system.api.logger.dto;
+package cn.iocoder.yudao.framework.common.biz.system.logger.dto;
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import jakarta.validation.constraints.NotEmpty;
diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/OAuth2TokenApi.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/oauth2/OAuth2TokenCommonApi.java
similarity index 72%
rename from yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/OAuth2TokenApi.java
rename to yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/oauth2/OAuth2TokenCommonApi.java
index eedf5aef03..c23d936c9a 100644
--- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/OAuth2TokenApi.java
+++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/oauth2/OAuth2TokenCommonApi.java
@@ -1,8 +1,8 @@
-package cn.iocoder.yudao.module.system.api.oauth2;
+package cn.iocoder.yudao.framework.common.biz.system.oauth2;
-import cn.iocoder.yudao.module.system.api.oauth2.dto.OAuth2AccessTokenCheckRespDTO;
-import cn.iocoder.yudao.module.system.api.oauth2.dto.OAuth2AccessTokenCreateReqDTO;
-import cn.iocoder.yudao.module.system.api.oauth2.dto.OAuth2AccessTokenRespDTO;
+import cn.iocoder.yudao.framework.common.biz.system.oauth2.dto.OAuth2AccessTokenCheckRespDTO;
+import cn.iocoder.yudao.framework.common.biz.system.oauth2.dto.OAuth2AccessTokenCreateReqDTO;
+import cn.iocoder.yudao.framework.common.biz.system.oauth2.dto.OAuth2AccessTokenRespDTO;
import jakarta.validation.Valid;
@@ -11,7 +11,7 @@ import jakarta.validation.Valid;
*
* @author 芋道源码
*/
-public interface OAuth2TokenApi {
+public interface OAuth2TokenCommonApi {
/**
* 创建访问令牌
diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenCheckRespDTO.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/oauth2/dto/OAuth2AccessTokenCheckRespDTO.java
similarity index 91%
rename from yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenCheckRespDTO.java
rename to yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/oauth2/dto/OAuth2AccessTokenCheckRespDTO.java
index c678b48a6e..a3c70ee499 100644
--- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenCheckRespDTO.java
+++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/oauth2/dto/OAuth2AccessTokenCheckRespDTO.java
@@ -1,4 +1,4 @@
-package cn.iocoder.yudao.module.system.api.oauth2.dto;
+package cn.iocoder.yudao.framework.common.biz.system.oauth2.dto;
import lombok.Data;
diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenCreateReqDTO.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/oauth2/dto/OAuth2AccessTokenCreateReqDTO.java
similarity index 93%
rename from yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenCreateReqDTO.java
rename to yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/oauth2/dto/OAuth2AccessTokenCreateReqDTO.java
index b5765f98cb..72dcd9be82 100644
--- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenCreateReqDTO.java
+++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/oauth2/dto/OAuth2AccessTokenCreateReqDTO.java
@@ -1,4 +1,4 @@
-package cn.iocoder.yudao.module.system.api.oauth2.dto;
+package cn.iocoder.yudao.framework.common.biz.system.oauth2.dto;
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.common.validation.InEnum;
diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenRespDTO.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/oauth2/dto/OAuth2AccessTokenRespDTO.java
similarity index 90%
rename from yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenRespDTO.java
rename to yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/oauth2/dto/OAuth2AccessTokenRespDTO.java
index 4c826325a7..c7b49f64fd 100644
--- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/oauth2/dto/OAuth2AccessTokenRespDTO.java
+++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/oauth2/dto/OAuth2AccessTokenRespDTO.java
@@ -1,4 +1,4 @@
-package cn.iocoder.yudao.module.system.api.oauth2.dto;
+package cn.iocoder.yudao.framework.common.biz.system.oauth2.dto;
import lombok.Data;
import lombok.experimental.Accessors;
diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/package-info.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/package-info.java
new file mode 100644
index 0000000000..9589ee19ec
--- /dev/null
+++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/package-info.java
@@ -0,0 +1,4 @@
+/**
+ * 针对 system 模块的 api 包
+ */
+package cn.iocoder.yudao.framework.common.biz.system;
\ No newline at end of file
diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApi.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/permission/PermissionCommonApi.java
similarity index 61%
rename from yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApi.java
rename to yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/permission/PermissionCommonApi.java
index ea16fe4eaf..f842ed0eea 100644
--- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApi.java
+++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/permission/PermissionCommonApi.java
@@ -1,24 +1,13 @@
-package cn.iocoder.yudao.module.system.api.permission;
+package cn.iocoder.yudao.framework.common.biz.system.permission;
-import cn.iocoder.yudao.module.system.api.permission.dto.DeptDataPermissionRespDTO;
-
-import java.util.Collection;
-import java.util.Set;
+import cn.iocoder.yudao.framework.common.biz.system.permission.dto.DeptDataPermissionRespDTO;
/**
* 权限 API 接口
*
* @author 芋道源码
*/
-public interface PermissionApi {
-
- /**
- * 获得拥有多个角色的用户编号集合
- *
- * @param roleIds 角色编号集合
- * @return 用户编号集合
- */
- Set getUserRoleIdListByRoleIds(Collection roleIds);
+public interface PermissionCommonApi {
/**
* 判断是否有权限,任一一个即可
diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/dto/DeptDataPermissionRespDTO.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/permission/dto/DeptDataPermissionRespDTO.java
similarity index 89%
rename from yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/dto/DeptDataPermissionRespDTO.java
rename to yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/permission/dto/DeptDataPermissionRespDTO.java
index 5650e89b94..952c84daa5 100644
--- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/dto/DeptDataPermissionRespDTO.java
+++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/permission/dto/DeptDataPermissionRespDTO.java
@@ -1,4 +1,4 @@
-package cn.iocoder.yudao.module.system.api.permission.dto;
+package cn.iocoder.yudao.framework.common.biz.system.permission.dto;
import lombok.Data;
diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApi.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/tenant/TenantCommonApi.java
similarity index 77%
rename from yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApi.java
rename to yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/tenant/TenantCommonApi.java
index 1fad83ed6d..809597e85d 100644
--- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApi.java
+++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/tenant/TenantCommonApi.java
@@ -1,4 +1,4 @@
-package cn.iocoder.yudao.module.system.api.tenant;
+package cn.iocoder.yudao.framework.common.biz.system.tenant;
import java.util.List;
@@ -7,7 +7,7 @@ import java.util.List;
*
* @author 芋道源码
*/
-public interface TenantApi {
+public interface TenantCommonApi {
/**
* 获得所有租户
diff --git a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/config/YudaoDeptDataPermissionAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/config/YudaoDeptDataPermissionAutoConfiguration.java
index 6016fcdadf..ab5b3bc7ec 100644
--- a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/config/YudaoDeptDataPermissionAutoConfiguration.java
+++ b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/config/YudaoDeptDataPermissionAutoConfiguration.java
@@ -1,9 +1,9 @@
package cn.iocoder.yudao.framework.datapermission.config;
+import cn.iocoder.yudao.framework.common.biz.system.permission.PermissionCommonApi;
import cn.iocoder.yudao.framework.datapermission.core.rule.dept.DeptDataPermissionRule;
import cn.iocoder.yudao.framework.datapermission.core.rule.dept.DeptDataPermissionRuleCustomizer;
import cn.iocoder.yudao.framework.security.core.LoginUser;
-import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
@@ -18,11 +18,11 @@ import java.util.List;
*/
@AutoConfiguration
@ConditionalOnClass(LoginUser.class)
-@ConditionalOnBean(value = {PermissionApi.class, DeptDataPermissionRuleCustomizer.class})
+@ConditionalOnBean(value = {PermissionCommonApi.class, DeptDataPermissionRuleCustomizer.class})
public class YudaoDeptDataPermissionAutoConfiguration {
@Bean
- public DeptDataPermissionRule deptDataPermissionRule(PermissionApi permissionApi,
+ public DeptDataPermissionRule deptDataPermissionRule(PermissionCommonApi permissionApi,
List customizers) {
// 创建 DeptDataPermissionRule 对象
DeptDataPermissionRule rule = new DeptDataPermissionRule(permissionApi);
diff --git a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/dept/DeptDataPermissionRule.java b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/dept/DeptDataPermissionRule.java
index 8703819ff6..56b6ea4504 100644
--- a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/dept/DeptDataPermissionRule.java
+++ b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/dept/DeptDataPermissionRule.java
@@ -3,6 +3,8 @@ package cn.iocoder.yudao.framework.datapermission.core.rule.dept;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
+import cn.iocoder.yudao.framework.common.biz.system.permission.PermissionCommonApi;
+import cn.iocoder.yudao.framework.common.biz.system.permission.dto.DeptDataPermissionRespDTO;
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
@@ -11,12 +13,13 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
-import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
-import cn.iocoder.yudao.module.system.api.permission.dto.DeptDataPermissionRespDTO;
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
-import net.sf.jsqlparser.expression.*;
+import net.sf.jsqlparser.expression.Alias;
+import net.sf.jsqlparser.expression.Expression;
+import net.sf.jsqlparser.expression.LongValue;
+import net.sf.jsqlparser.expression.NullValue;
import net.sf.jsqlparser.expression.operators.conditional.OrExpression;
import net.sf.jsqlparser.expression.operators.relational.EqualsTo;
import net.sf.jsqlparser.expression.operators.relational.ExpressionList;
@@ -59,7 +62,7 @@ public class DeptDataPermissionRule implements DataPermissionRule {
static final Expression EXPRESSION_NULL = new NullValue();
- private final PermissionApi permissionApi;
+ private final PermissionCommonApi permissionApi;
/**
* 基于部门的表字段配置
diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/config/YudaoTenantAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/config/YudaoTenantAutoConfiguration.java
index 2027da77f6..0d9783ef9e 100644
--- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/config/YudaoTenantAutoConfiguration.java
+++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/config/YudaoTenantAutoConfiguration.java
@@ -1,5 +1,6 @@
package cn.iocoder.yudao.framework.tenant.config;
+import cn.iocoder.yudao.framework.common.biz.system.tenant.TenantCommonApi;
import cn.iocoder.yudao.framework.common.enums.WebFilterOrderEnum;
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.yudao.framework.redis.config.YudaoCacheProperties;
@@ -19,7 +20,6 @@ import cn.iocoder.yudao.framework.tenant.core.web.TenantContextWebFilter;
import cn.iocoder.yudao.framework.tenant.core.web.TenantVisitContextInterceptor;
import cn.iocoder.yudao.framework.web.config.WebProperties;
import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler;
-import cn.iocoder.yudao.module.system.api.tenant.TenantApi;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor;
import jakarta.annotation.Resource;
@@ -58,7 +58,7 @@ public class YudaoTenantAutoConfiguration {
private ApplicationContext applicationContext;
@Bean
- public TenantFrameworkService tenantFrameworkService(TenantApi tenantApi) {
+ public TenantFrameworkService tenantFrameworkService(TenantCommonApi tenantApi) {
return new TenantFrameworkServiceImpl(tenantApi);
}
diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/service/TenantFrameworkServiceImpl.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/service/TenantFrameworkServiceImpl.java
index f2b7b27a86..970b88affd 100644
--- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/service/TenantFrameworkServiceImpl.java
+++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/service/TenantFrameworkServiceImpl.java
@@ -1,8 +1,8 @@
package cn.iocoder.yudao.framework.tenant.core.service;
+import cn.iocoder.yudao.framework.common.biz.system.tenant.TenantCommonApi;
import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.framework.common.util.cache.CacheUtils;
-import cn.iocoder.yudao.module.system.api.tenant.TenantApi;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import lombok.RequiredArgsConstructor;
@@ -21,7 +21,7 @@ public class TenantFrameworkServiceImpl implements TenantFrameworkService {
private static final ServiceException SERVICE_EXCEPTION_NULL = new ServiceException();
- private final TenantApi tenantApi;
+ private final TenantCommonApi tenantApi;
/**
* 针对 {@link #getTenantIds()} 的缓存
diff --git a/yudao-framework/yudao-spring-boot-starter-excel/pom.xml b/yudao-framework/yudao-spring-boot-starter-excel/pom.xml
index c5f4a38905..5fc5d7fd26 100644
--- a/yudao-framework/yudao-spring-boot-starter-excel/pom.xml
+++ b/yudao-framework/yudao-spring-boot-starter-excel/pom.xml
@@ -27,13 +27,6 @@
spring-boot-starter
-
-
- cn.iocoder.boot
- yudao-module-system-api
- ${revision}
-
-
org.springframework
diff --git a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictAutoConfiguration.java
index 8a6075efff..5dea47ff27 100644
--- a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictAutoConfiguration.java
+++ b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictAutoConfiguration.java
@@ -1,7 +1,7 @@
package cn.iocoder.yudao.framework.dict.config;
+import cn.iocoder.yudao.framework.common.biz.system.dict.DictDataCommonApi;
import cn.iocoder.yudao.framework.dict.core.DictFrameworkUtils;
-import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
@@ -10,7 +10,7 @@ public class YudaoDictAutoConfiguration {
@Bean
@SuppressWarnings("InstantiationOfUtilityClass")
- public DictFrameworkUtils dictUtils(DictDataApi dictDataApi) {
+ public DictFrameworkUtils dictUtils(DictDataCommonApi dictDataApi) {
DictFrameworkUtils.init(dictDataApi);
return new DictFrameworkUtils();
}
diff --git a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/core/DictFrameworkUtils.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/core/DictFrameworkUtils.java
index 8dada3f752..9fc67bfe7f 100644
--- a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/core/DictFrameworkUtils.java
+++ b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/core/DictFrameworkUtils.java
@@ -1,10 +1,9 @@
package cn.iocoder.yudao.framework.dict.core;
-import cn.hutool.core.util.ObjectUtil;
-import cn.iocoder.yudao.framework.common.core.KeyValue;
+import cn.hutool.core.collection.CollUtil;
+import cn.iocoder.yudao.framework.common.biz.system.dict.DictDataCommonApi;
import cn.iocoder.yudao.framework.common.util.cache.CacheUtils;
-import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
-import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO;
+import cn.iocoder.yudao.framework.common.biz.system.dict.dto.DictDataRespDTO;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import lombok.SneakyThrows;
@@ -12,6 +11,9 @@ import lombok.extern.slf4j.Slf4j;
import java.time.Duration;
import java.util.List;
+import java.util.Objects;
+
+import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
/**
* 字典工具类
@@ -21,76 +23,57 @@ import java.util.List;
@Slf4j
public class DictFrameworkUtils {
- private static DictDataApi dictDataApi;
+ private static DictDataCommonApi dictDataApi;
- private static final DictDataRespDTO DICT_DATA_NULL = new DictDataRespDTO();
-
- // TODO @puhui999:GET_DICT_DATA_CACHE、GET_DICT_DATA_LIST_CACHE、PARSE_DICT_DATA_CACHE 这 3 个缓存是有点重叠,可以思考下,有没可能减少 1 个。微信讨论好私聊,再具体改哈
/**
- * 针对 {@link #getDictDataLabel(String, String)} 的缓存
+ * 针对 dictType 的字段数据缓存
*/
- private static final LoadingCache, DictDataRespDTO> GET_DICT_DATA_CACHE = CacheUtils.buildAsyncReloadingCache(
+ private static final LoadingCache> GET_DICT_DATA_CACHE = CacheUtils.buildAsyncReloadingCache(
Duration.ofMinutes(1L), // 过期时间 1 分钟
- new CacheLoader, DictDataRespDTO>() {
+ new CacheLoader>() {
@Override
- public DictDataRespDTO load(KeyValue key) {
- return ObjectUtil.defaultIfNull(dictDataApi.getDictData(key.getKey(), key.getValue()), DICT_DATA_NULL);
+ public List load(String dictType) {
+ return dictDataApi.getDictDataList(dictType);
}
});
- /**
- * 针对 {@link #getDictDataLabelList(String)} 的缓存
- */
- private static final LoadingCache> GET_DICT_DATA_LIST_CACHE = CacheUtils.buildAsyncReloadingCache(
- Duration.ofMinutes(1L), // 过期时间 1 分钟
- new CacheLoader>() {
-
- @Override
- public List load(String dictType) {
- return dictDataApi.getDictDataLabelList(dictType);
- }
-
- });
-
- /**
- * 针对 {@link #parseDictDataValue(String, String)} 的缓存
- */
- private static final LoadingCache, DictDataRespDTO> PARSE_DICT_DATA_CACHE = CacheUtils.buildAsyncReloadingCache(
- Duration.ofMinutes(1L), // 过期时间 1 分钟
- new CacheLoader, DictDataRespDTO>() {
-
- @Override
- public DictDataRespDTO load(KeyValue key) {
- return ObjectUtil.defaultIfNull(dictDataApi.parseDictData(key.getKey(), key.getValue()), DICT_DATA_NULL);
- }
-
- });
-
- public static void init(DictDataApi dictDataApi) {
+ public static void init(DictDataCommonApi dictDataApi) {
DictFrameworkUtils.dictDataApi = dictDataApi;
log.info("[init][初始化 DictFrameworkUtils 成功]");
}
- @SneakyThrows
- public static String getDictDataLabel(String dictType, Integer value) {
- return GET_DICT_DATA_CACHE.get(new KeyValue<>(dictType, String.valueOf(value))).getLabel();
+ public static void clearCache() {
+ GET_DICT_DATA_CACHE.invalidateAll();
}
@SneakyThrows
- public static String getDictDataLabel(String dictType, String value) {
- return GET_DICT_DATA_CACHE.get(new KeyValue<>(dictType, value)).getLabel();
+ public static String parseDictDataLabel(String dictType, Integer value) {
+ if (value == null) {
+ return null;
+ }
+ return parseDictDataLabel(dictType, String.valueOf(value));
+ }
+
+ @SneakyThrows
+ public static String parseDictDataLabel(String dictType, String value) {
+ List dictDatas = GET_DICT_DATA_CACHE.get(dictType);
+ DictDataRespDTO dictData = CollUtil.findOne(dictDatas, data -> Objects.equals(data.getValue(), value));
+ return dictData != null ? dictData.getLabel(): null;
}
@SneakyThrows
public static List getDictDataLabelList(String dictType) {
- return GET_DICT_DATA_LIST_CACHE.get(dictType);
+ List dictDatas = GET_DICT_DATA_CACHE.get(dictType);
+ return convertList(dictDatas, DictDataRespDTO::getLabel);
}
@SneakyThrows
public static String parseDictDataValue(String dictType, String label) {
- return PARSE_DICT_DATA_CACHE.get(new KeyValue<>(dictType, label)).getValue();
+ List dictDatas = GET_DICT_DATA_CACHE.get(dictType);
+ DictDataRespDTO dictData = CollUtil.findOne(dictDatas, data -> Objects.equals(data.getLabel(), label));
+ return dictData!= null ? dictData.getValue(): null;
}
}
diff --git a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/DictConvert.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/DictConvert.java
index fc79585148..e393195ed1 100644
--- a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/DictConvert.java
+++ b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/DictConvert.java
@@ -56,7 +56,7 @@ public class DictConvert implements Converter
-
-
-
- cn.iocoder.boot
- yudao-module-system-api
- ${revision}
-
diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/operatelog/core/service/LogRecordServiceImpl.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/operatelog/core/service/LogRecordServiceImpl.java
index 68cdf65ade..7000f6ede3 100644
--- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/operatelog/core/service/LogRecordServiceImpl.java
+++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/operatelog/core/service/LogRecordServiceImpl.java
@@ -1,11 +1,11 @@
package cn.iocoder.yudao.framework.operatelog.core.service;
+import cn.iocoder.yudao.framework.common.biz.system.logger.OperateLogCommonApi;
+import cn.iocoder.yudao.framework.common.biz.system.logger.dto.OperateLogCreateReqDTO;
import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils;
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
-import cn.iocoder.yudao.module.system.api.logger.OperateLogApi;
-import cn.iocoder.yudao.module.system.api.logger.dto.OperateLogCreateReqDTO;
import com.mzt.logapi.beans.LogRecord;
import com.mzt.logapi.service.ILogRecordService;
import jakarta.annotation.Resource;
@@ -17,7 +17,7 @@ import java.util.List;
/**
* 操作日志 ILogRecordService 实现类
*
- * 基于 {@link OperateLogApi} 实现,记录操作日志
+ * 基于 {@link OperateLogCommonApi} 实现,记录操作日志
*
* @author HUIHUI
*/
@@ -25,7 +25,7 @@ import java.util.List;
public class LogRecordServiceImpl implements ILogRecordService {
@Resource
- private OperateLogApi operateLogApi;
+ private OperateLogCommonApi operateLogApi;
@Override
public void record(LogRecord logRecord) {
diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoSecurityAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoSecurityAutoConfiguration.java
index 694164556a..8874b15593 100644
--- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoSecurityAutoConfiguration.java
+++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoSecurityAutoConfiguration.java
@@ -1,5 +1,7 @@
package cn.iocoder.yudao.framework.security.config;
+import cn.iocoder.yudao.framework.common.biz.system.oauth2.OAuth2TokenCommonApi;
+import cn.iocoder.yudao.framework.common.biz.system.permission.PermissionCommonApi;
import cn.iocoder.yudao.framework.security.core.context.TransmittableThreadLocalSecurityContextHolderStrategy;
import cn.iocoder.yudao.framework.security.core.filter.TokenAuthenticationFilter;
import cn.iocoder.yudao.framework.security.core.handler.AccessDeniedHandlerImpl;
@@ -7,8 +9,6 @@ import cn.iocoder.yudao.framework.security.core.handler.AuthenticationEntryPoint
import cn.iocoder.yudao.framework.security.core.service.SecurityFrameworkService;
import cn.iocoder.yudao.framework.security.core.service.SecurityFrameworkServiceImpl;
import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler;
-import cn.iocoder.yudao.module.system.api.oauth2.OAuth2TokenApi;
-import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.config.MethodInvokingFactoryBean;
import org.springframework.boot.autoconfigure.AutoConfiguration;
@@ -69,12 +69,12 @@ public class YudaoSecurityAutoConfiguration {
*/
@Bean
public TokenAuthenticationFilter authenticationTokenFilter(GlobalExceptionHandler globalExceptionHandler,
- OAuth2TokenApi oauth2TokenApi) {
+ OAuth2TokenCommonApi oauth2TokenApi) {
return new TokenAuthenticationFilter(securityProperties, globalExceptionHandler, oauth2TokenApi);
}
@Bean("ss") // 使用 Spring Security 的缩写,方便使用
- public SecurityFrameworkService securityFrameworkService(PermissionApi permissionApi) {
+ public SecurityFrameworkService securityFrameworkService(PermissionCommonApi permissionApi) {
return new SecurityFrameworkServiceImpl(permissionApi);
}
diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/filter/TokenAuthenticationFilter.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/filter/TokenAuthenticationFilter.java
index cbd91ee575..8aaea2e654 100644
--- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/filter/TokenAuthenticationFilter.java
+++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/filter/TokenAuthenticationFilter.java
@@ -2,6 +2,8 @@ package cn.iocoder.yudao.framework.security.core.filter;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
+import cn.iocoder.yudao.framework.common.biz.system.oauth2.OAuth2TokenCommonApi;
+import cn.iocoder.yudao.framework.common.biz.system.oauth2.dto.OAuth2AccessTokenCheckRespDTO;
import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
@@ -10,16 +12,14 @@ import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler;
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
-import cn.iocoder.yudao.module.system.api.oauth2.OAuth2TokenApi;
-import cn.iocoder.yudao.module.system.api.oauth2.dto.OAuth2AccessTokenCheckRespDTO;
-import lombok.RequiredArgsConstructor;
-import org.springframework.security.access.AccessDeniedException;
-import org.springframework.web.filter.OncePerRequestFilter;
-
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
+import lombok.RequiredArgsConstructor;
+import org.springframework.security.access.AccessDeniedException;
+import org.springframework.web.filter.OncePerRequestFilter;
+
import java.io.IOException;
/**
@@ -35,7 +35,7 @@ public class TokenAuthenticationFilter extends OncePerRequestFilter {
private final GlobalExceptionHandler globalExceptionHandler;
- private final OAuth2TokenApi oauth2TokenApi;
+ private final OAuth2TokenCommonApi oauth2TokenApi;
@Override
@SuppressWarnings("NullableProblems")
diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/service/SecurityFrameworkServiceImpl.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/service/SecurityFrameworkServiceImpl.java
index b72ab382da..197118a71e 100644
--- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/service/SecurityFrameworkServiceImpl.java
+++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/service/SecurityFrameworkServiceImpl.java
@@ -1,9 +1,9 @@
package cn.iocoder.yudao.framework.security.core.service;
import cn.hutool.core.collection.CollUtil;
+import cn.iocoder.yudao.framework.common.biz.system.permission.PermissionCommonApi;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
-import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
import lombok.AllArgsConstructor;
import java.util.Arrays;
@@ -19,7 +19,7 @@ import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUti
@AllArgsConstructor
public class SecurityFrameworkServiceImpl implements SecurityFrameworkService {
- private final PermissionApi permissionApi;
+ private final PermissionCommonApi permissionApi;
@Override
public boolean hasPermission(String permission) {
diff --git a/yudao-framework/yudao-spring-boot-starter-web/pom.xml b/yudao-framework/yudao-spring-boot-starter-web/pom.xml
index 6e3527de7e..d04db57c47 100644
--- a/yudao-framework/yudao-spring-boot-starter-web/pom.xml
+++ b/yudao-framework/yudao-spring-boot-starter-web/pom.xml
@@ -53,18 +53,6 @@
provided
-
-
- cn.iocoder.boot
- yudao-module-infra-api
- ${revision}
-
-
- cn.iocoder.boot
- yudao-module-system-api
- ${revision}
-
-
org.jsoup
diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/config/YudaoApiLogAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/config/YudaoApiLogAutoConfiguration.java
index cf76036c87..156004be3e 100644
--- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/config/YudaoApiLogAutoConfiguration.java
+++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/config/YudaoApiLogAutoConfiguration.java
@@ -2,10 +2,10 @@ package cn.iocoder.yudao.framework.apilog.config;
import cn.iocoder.yudao.framework.apilog.core.filter.ApiAccessLogFilter;
import cn.iocoder.yudao.framework.apilog.core.interceptor.ApiAccessLogInterceptor;
+import cn.iocoder.yudao.framework.common.biz.infra.logger.ApiAccessLogCommonApi;
import cn.iocoder.yudao.framework.common.enums.WebFilterOrderEnum;
import cn.iocoder.yudao.framework.web.config.WebProperties;
import cn.iocoder.yudao.framework.web.config.YudaoWebAutoConfiguration;
-import cn.iocoder.yudao.module.infra.api.logger.ApiAccessLogApi;
import jakarta.servlet.Filter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfiguration;
@@ -25,7 +25,7 @@ public class YudaoApiLogAutoConfiguration implements WebMvcConfigurer {
@ConditionalOnProperty(prefix = "yudao.access-log", value = "enable", matchIfMissing = true) // 允许使用 yudao.access-log.enable=false 禁用访问日志
public FilterRegistrationBean apiAccessLogFilter(WebProperties webProperties,
@Value("${spring.application.name}") String applicationName,
- ApiAccessLogApi apiAccessLogApi) {
+ ApiAccessLogCommonApi apiAccessLogApi) {
ApiAccessLogFilter filter = new ApiAccessLogFilter(webProperties, applicationName, apiAccessLogApi);
return createFilterBean(filter, WebFilterOrderEnum.API_ACCESS_LOG_FILTER);
}
diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/filter/ApiAccessLogFilter.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/filter/ApiAccessLogFilter.java
index 8539fccd78..1094ebdad7 100644
--- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/filter/ApiAccessLogFilter.java
+++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/filter/ApiAccessLogFilter.java
@@ -9,6 +9,8 @@ import cn.hutool.core.util.BooleanUtil;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum;
+import cn.iocoder.yudao.framework.common.biz.infra.logger.ApiAccessLogCommonApi;
+import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiAccessLogCreateReqDTO;
import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
@@ -17,8 +19,6 @@ import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
import cn.iocoder.yudao.framework.web.config.WebProperties;
import cn.iocoder.yudao.framework.web.core.filter.ApiRequestFilter;
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
-import cn.iocoder.yudao.module.infra.api.logger.ApiAccessLogApi;
-import cn.iocoder.yudao.module.infra.api.logger.dto.ApiAccessLogCreateReqDTO;
import com.fasterxml.jackson.databind.JsonNode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -53,9 +53,9 @@ public class ApiAccessLogFilter extends ApiRequestFilter {
private final String applicationName;
- private final ApiAccessLogApi apiAccessLogApi;
+ private final ApiAccessLogCommonApi apiAccessLogApi;
- public ApiAccessLogFilter(WebProperties webProperties, String applicationName, ApiAccessLogApi apiAccessLogApi) {
+ public ApiAccessLogFilter(WebProperties webProperties, String applicationName, ApiAccessLogCommonApi apiAccessLogApi) {
super(webProperties);
this.applicationName = applicationName;
this.apiAccessLogApi = apiAccessLogApi;
diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/YudaoWebAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/YudaoWebAutoConfiguration.java
index e3684dfac0..9126c7e8ea 100644
--- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/YudaoWebAutoConfiguration.java
+++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/YudaoWebAutoConfiguration.java
@@ -1,12 +1,12 @@
package cn.iocoder.yudao.framework.web.config;
+import cn.iocoder.yudao.framework.common.biz.infra.logger.ApiErrorLogCommonApi;
import cn.iocoder.yudao.framework.common.enums.WebFilterOrderEnum;
import cn.iocoder.yudao.framework.web.core.filter.CacheRequestBodyFilter;
import cn.iocoder.yudao.framework.web.core.filter.DemoFilter;
import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler;
import cn.iocoder.yudao.framework.web.core.handler.GlobalResponseBodyHandler;
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
-import cn.iocoder.yudao.module.infra.api.logger.ApiErrorLogApi;
import jakarta.annotation.Resource;
import jakarta.servlet.Filter;
import org.springframework.beans.factory.annotation.Value;
@@ -59,7 +59,7 @@ public class YudaoWebAutoConfiguration implements WebMvcConfigurer {
@Bean
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
- public GlobalExceptionHandler globalExceptionHandler(ApiErrorLogApi apiErrorLogApi) {
+ public GlobalExceptionHandler globalExceptionHandler(ApiErrorLogCommonApi apiErrorLogApi) {
return new GlobalExceptionHandler(applicationName, apiErrorLogApi);
}
diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java
index 073824815c..e27d04ec68 100644
--- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java
+++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java
@@ -14,8 +14,8 @@ import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils;
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
-import cn.iocoder.yudao.module.infra.api.logger.ApiErrorLogApi;
-import cn.iocoder.yudao.module.infra.api.logger.dto.ApiErrorLogCreateReqDTO;
+import cn.iocoder.yudao.framework.common.biz.infra.logger.ApiErrorLogCommonApi;
+import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO;
import com.fasterxml.jackson.databind.exc.InvalidFormatException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.ConstraintViolation;
@@ -63,7 +63,7 @@ public class GlobalExceptionHandler {
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
private final String applicationName;
- private final ApiErrorLogApi apiErrorLogApi;
+ private final ApiErrorLogCommonApi apiErrorLogApi;
/**
* 处理所有异常,主要是提供给 Filter 使用
diff --git a/yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/api/package-info.java b/yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/api/package-info.java
new file mode 100644
index 0000000000..def88bd2f3
--- /dev/null
+++ b/yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/api/package-info.java
@@ -0,0 +1,4 @@
+/**
+ * bpm API 包,定义并实现提供给其它模块的 API
+ */
+package cn.iocoder.yudao.module.bpm.api;
diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/api/package-info.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/api/package-info.java
new file mode 100644
index 0000000000..84cf922ea6
--- /dev/null
+++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/api/package-info.java
@@ -0,0 +1,4 @@
+/**
+ * crm API 包,定义并实现提供给其它模块的 API
+ */
+package cn.iocoder.yudao.module.crm.api;
diff --git a/yudao-module-infra/pom.xml b/yudao-module-infra/pom.xml
index c517e88a43..8b983cfe4b 100644
--- a/yudao-module-infra/pom.xml
+++ b/yudao-module-infra/pom.xml
@@ -8,18 +8,112 @@
${revision}
4.0.0
-
- yudao-module-infra-api
- yudao-module-infra-biz
-
yudao-module-infra
- pom
+ jar
${project.artifactId}
infra 模块,主要提供两块能力:
- 1. 我们放基础设施的运维与管理,支撑上层的通用与核心业务。 例如说:定时任务的管理、服务器的信息等等
- 2. 研发工具,提升研发效率与质量。 例如说:代码生成器、接口文档等等
+ 1. 我们放基础设施的运维与管理,支撑上层的通用与核心业务。 例如说:定时任务的管理、服务器的信息等等
+ 2. 研发工具,提升研发效率与质量。 例如说:代码生成器、接口文档等等
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-biz-tenant
+
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-security
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-websocket
+
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-mybatis
+
+
+ com.baomidou
+ mybatis-plus-generator
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-redis
+
+
+
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-job
+
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-mq
+
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-test
+ test
+
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-excel
+
+
+
+ org.apache.velocity
+ velocity-engine-core
+
+
+
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-monitor
+
+
+
+ de.codecentric
+ spring-boot-admin-starter-server
+
+
+
+
+ commons-net
+ commons-net
+
+
+ com.jcraft
+ jsch
+
+
+
+ software.amazon.awssdk
+ s3
+
+
+
+ org.apache.tika
+ tika-core
+
+
+
+
diff --git a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/config/ConfigApi.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/config/ConfigApi.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/config/ConfigApi.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/config/ConfigApi.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/config/ConfigApiImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/config/ConfigApiImpl.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/config/ConfigApiImpl.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/config/ConfigApiImpl.java
diff --git a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApi.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApi.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApi.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApi.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApiImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApiImpl.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApiImpl.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/file/FileApiImpl.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiAccessLogApiImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiAccessLogApiImpl.java
similarity index 71%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiAccessLogApiImpl.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiAccessLogApiImpl.java
index 1d0cd0530d..69f8062e96 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiAccessLogApiImpl.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiAccessLogApiImpl.java
@@ -1,12 +1,12 @@
package cn.iocoder.yudao.module.infra.api.logger;
-import cn.iocoder.yudao.module.infra.api.logger.dto.ApiAccessLogCreateReqDTO;
+import cn.iocoder.yudao.framework.common.biz.infra.logger.ApiAccessLogCommonApi;
+import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiAccessLogCreateReqDTO;
import cn.iocoder.yudao.module.infra.service.logger.ApiAccessLogService;
+import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
-import jakarta.annotation.Resource;
-
/**
* API 访问日志的 API 实现类
*
@@ -14,7 +14,7 @@ import jakarta.annotation.Resource;
*/
@Service
@Validated
-public class ApiAccessLogApiImpl implements ApiAccessLogApi {
+public class ApiAccessLogApiImpl implements ApiAccessLogCommonApi {
@Resource
private ApiAccessLogService apiAccessLogService;
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiErrorLogApiImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiErrorLogApiImpl.java
similarity index 71%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiErrorLogApiImpl.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiErrorLogApiImpl.java
index 99abc59862..f782768662 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiErrorLogApiImpl.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/logger/ApiErrorLogApiImpl.java
@@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.infra.api.logger;
-import cn.iocoder.yudao.module.infra.api.logger.dto.ApiErrorLogCreateReqDTO;
+import cn.iocoder.yudao.framework.common.biz.infra.logger.ApiErrorLogCommonApi;
+import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO;
import cn.iocoder.yudao.module.infra.service.logger.ApiErrorLogService;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
@@ -14,7 +15,7 @@ import jakarta.annotation.Resource;
*/
@Service
@Validated
-public class ApiErrorLogApiImpl implements ApiErrorLogApi {
+public class ApiErrorLogApiImpl implements ApiErrorLogCommonApi {
@Resource
private ApiErrorLogService apiErrorLogService;
diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/package-info.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/package-info.java
new file mode 100644
index 0000000000..9831fe7df9
--- /dev/null
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/package-info.java
@@ -0,0 +1,4 @@
+/**
+ * infra API 包,定义并实现提供给其它模块的 API
+ */
+package cn.iocoder.yudao.module.infra.api;
diff --git a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/websocket/WebSocketSenderApi.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/websocket/WebSocketSenderApi.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/websocket/WebSocketSenderApi.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/websocket/WebSocketSenderApi.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/websocket/WebSocketSenderApiImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/websocket/WebSocketSenderApiImpl.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/websocket/WebSocketSenderApiImpl.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/websocket/WebSocketSenderApiImpl.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/CodegenController.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/CodegenController.java
similarity index 99%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/CodegenController.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/CodegenController.java
index ed4c34446e..93d47f517f 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/CodegenController.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/CodegenController.java
@@ -34,7 +34,7 @@ import java.util.List;
import java.util.Map;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
-import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
+import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserNickname;
import static cn.iocoder.yudao.module.infra.framework.file.core.utils.FileTypeUtils.writeAttachment;
@Tag(name = "管理后台 - 代码生成器")
@@ -93,7 +93,7 @@ public class CodegenController {
@PostMapping("/create-list")
@PreAuthorize("@ss.hasPermission('infra:codegen:create')")
public CommonResult> createCodegenList(@Valid @RequestBody CodegenCreateListReqVO reqVO) {
- return success(codegenService.createCodegenList(getLoginUserId(), reqVO));
+ return success(codegenService.createCodegenList(getLoginUserNickname(), reqVO));
}
@Operation(summary = "更新数据库的表和字段定义")
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenCreateListReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenCreateListReqVO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenCreateListReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenCreateListReqVO.java
index 5e73377d76..cd00e8a91b 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenCreateListReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenCreateListReqVO.java
@@ -1,9 +1,9 @@
package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo;
import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotNull;
import lombok.Data;
-import jakarta.validation.constraints.NotNull;
import java.util.List;
@Schema(description = "管理后台 - 基于数据库的表结构,创建代码生成器的表和字段定义 Request VO")
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenDetailRespVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenDetailRespVO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenDetailRespVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenDetailRespVO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenPreviewRespVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenPreviewRespVO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenPreviewRespVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenPreviewRespVO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenUpdateReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenUpdateReqVO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenUpdateReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenUpdateReqVO.java
index e8a8515cdb..d381ec6548 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenUpdateReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenUpdateReqVO.java
@@ -3,10 +3,10 @@ package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo;
import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column.CodegenColumnSaveReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table.CodegenTableSaveReqVO;
import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
import java.util.List;
@Schema(description = "管理后台 - 代码生成表和字段的修改 Request VO")
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/column/CodegenColumnRespVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/column/CodegenColumnRespVO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/column/CodegenColumnRespVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/column/CodegenColumnRespVO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/column/CodegenColumnSaveReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/column/CodegenColumnSaveReqVO.java
similarity index 99%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/column/CodegenColumnSaveReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/column/CodegenColumnSaveReqVO.java
index 18067c2fa8..9579d790b6 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/column/CodegenColumnSaveReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/column/CodegenColumnSaveReqVO.java
@@ -1,9 +1,8 @@
package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column;
import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
import jakarta.validation.constraints.NotNull;
+import lombok.Data;
@Schema(description = "管理后台 - 代码生成字段定义创建/修改 Request VO")
@Data
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTablePageReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTablePageReqVO.java
similarity index 89%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTablePageReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTablePageReqVO.java
index 032a9d82ff..7bd26d6ede 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTablePageReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTablePageReqVO.java
@@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@Schema(description = "管理后台 - 表定义分页 Request VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
public class CodegenTablePageReqVO extends PageParam {
@Schema(description = "表名称,模糊匹配", example = "yudao")
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTableRespVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTableRespVO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTableRespVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTableRespVO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTableSaveReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTableSaveReqVO.java
similarity index 99%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTableSaveReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTableSaveReqVO.java
index 201d94d2e2..5f12e3dc71 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTableSaveReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTableSaveReqVO.java
@@ -5,10 +5,9 @@ import cn.iocoder.yudao.module.infra.enums.codegen.CodegenSceneEnum;
import cn.iocoder.yudao.module.infra.enums.codegen.CodegenTemplateTypeEnum;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
import jakarta.validation.constraints.AssertTrue;
import jakarta.validation.constraints.NotNull;
+import lombok.Data;
@Schema(description = "管理后台 - 代码生成表定义创建/修改 Response VO")
@Data
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/DatabaseTableRespVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/DatabaseTableRespVO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/DatabaseTableRespVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/DatabaseTableRespVO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/ConfigController.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/ConfigController.java
similarity index 96%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/ConfigController.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/ConfigController.java
index 7de4138b54..43e64c02a9 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/ConfigController.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/ConfigController.java
@@ -5,7 +5,9 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
-import cn.iocoder.yudao.module.infra.controller.admin.config.vo.*;
+import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigPageReqVO;
+import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigRespVO;
+import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigSaveReqVO;
import cn.iocoder.yudao.module.infra.convert.config.ConfigConvert;
import cn.iocoder.yudao.module.infra.dal.dataobject.config.ConfigDO;
import cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants;
@@ -13,13 +15,13 @@ import cn.iocoder.yudao.module.infra.service.config.ConfigService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
-import jakarta.annotation.Resource;
-import jakarta.servlet.http.HttpServletResponse;
-import jakarta.validation.Valid;
import java.io.IOException;
import java.util.List;
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigPageReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigPageReqVO.java
similarity index 89%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigPageReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigPageReqVO.java
index 8caec39d11..1a8a139651 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigPageReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigPageReqVO.java
@@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.config.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@Schema(description = "管理后台 - 参数配置分页 Request VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
public class ConfigPageReqVO extends PageParam {
@Schema(description = "数据源名称,模糊匹配", example = "名称")
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigRespVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigRespVO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigRespVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigRespVO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigSaveReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigSaveReqVO.java
similarity index 99%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigSaveReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigSaveReqVO.java
index 0c791d6de6..bbde578ce4 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigSaveReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigSaveReqVO.java
@@ -1,12 +1,11 @@
package cn.iocoder.yudao.module.infra.controller.admin.config.vo;
import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
+import lombok.Data;
@Schema(description = "管理后台 - 参数配置创建/修改 Request VO")
@Data
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/DataSourceConfigController.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/DataSourceConfigController.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/DataSourceConfigController.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/DataSourceConfigController.java
index 7a897fa21e..ba952c9e93 100755
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/DataSourceConfigController.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/DataSourceConfigController.java
@@ -9,12 +9,12 @@ import cn.iocoder.yudao.module.infra.service.db.DataSourceConfigService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
-import jakarta.annotation.Resource;
-import jakarta.validation.Valid;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigRespVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigRespVO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigRespVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigRespVO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigSaveReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigSaveReqVO.java
similarity index 94%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigSaveReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigSaveReqVO.java
index 9a5b13c56b..def5eef575 100755
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigSaveReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigSaveReqVO.java
@@ -1,8 +1,8 @@
package cn.iocoder.yudao.module.infra.controller.admin.db.vo;
import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-import jakarta.validation.constraints.*;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
@Schema(description = "管理后台 - 数据源配置创建/修改 Request VO")
@Data
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/Demo01ContactController.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/Demo01ContactController.java
similarity index 88%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/Demo01ContactController.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/Demo01ContactController.java
index cf6935e505..69bf6faaf3 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/Demo01ContactController.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/Demo01ContactController.java
@@ -60,6 +60,15 @@ public class Demo01ContactController {
return success(true);
}
+ @DeleteMapping("/delete-list")
+ @Parameter(name = "ids", description = "编号", required = true)
+ @Operation(summary = "批量删除示例联系人")
+ @PreAuthorize("@ss.hasPermission('infra:demo01-contact:delete')")
+ public CommonResult deleteDemo0iContactList(@RequestParam("ids") List ids) {
+ demo01ContactService.deleteDemo0iContactListByIds(ids);
+ return success(true);
+ }
+
@GetMapping("/get")
@Operation(summary = "获得示例联系人")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@@ -82,12 +91,12 @@ public class Demo01ContactController {
@PreAuthorize("@ss.hasPermission('infra:demo01-contact:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportDemo01ContactExcel(@Valid Demo01ContactPageReqVO pageReqVO,
- HttpServletResponse response) throws IOException {
+ HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List list = demo01ContactService.getDemo01ContactPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "示例联系人.xls", "数据", Demo01ContactRespVO.class,
- BeanUtils.toBean(list, Demo01ContactRespVO.class));
+ BeanUtils.toBean(list, Demo01ContactRespVO.class));
}
}
\ No newline at end of file
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/vo/Demo01ContactPageReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/vo/Demo01ContactPageReqVO.java
similarity index 89%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/vo/Demo01ContactPageReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/vo/Demo01ContactPageReqVO.java
index d337d2d7db..07c4ba1756 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/vo/Demo01ContactPageReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/vo/Demo01ContactPageReqVO.java
@@ -1,18 +1,16 @@
package cn.iocoder.yudao.module.infra.controller.admin.demo.demo01.vo;
-import lombok.*;
-import java.util.*;
-import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
+
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 示例联系人分页 Request VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
public class Demo01ContactPageReqVO extends PageParam {
@Schema(description = "名字", example = "张三")
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/vo/Demo01ContactRespVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/vo/Demo01ContactRespVO.java
similarity index 91%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/vo/Demo01ContactRespVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/vo/Demo01ContactRespVO.java
index 5d176c262a..17ee9fef84 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/vo/Demo01ContactRespVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/vo/Demo01ContactRespVO.java
@@ -1,14 +1,13 @@
package cn.iocoder.yudao.module.infra.controller.admin.demo.demo01.vo;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-import java.util.*;
-import java.util.*;
-import org.springframework.format.annotation.DateTimeFormat;
-import java.time.LocalDateTime;
-import com.alibaba.excel.annotation.*;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
@Schema(description = "管理后台 - 示例联系人 Response VO")
@Data
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/vo/Demo01ContactSaveReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/vo/Demo01ContactSaveReqVO.java
similarity index 99%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/vo/Demo01ContactSaveReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/vo/Demo01ContactSaveReqVO.java
index 352e43178a..15d2727663 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/vo/Demo01ContactSaveReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/vo/Demo01ContactSaveReqVO.java
@@ -1,10 +1,10 @@
package cn.iocoder.yudao.module.infra.controller.admin.demo.demo01.vo;
import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 示例联系人新增/修改 Request VO")
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/Demo02CategoryController.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/Demo02CategoryController.java
similarity index 96%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/Demo02CategoryController.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/Demo02CategoryController.java
index 5cdc332219..95ed77262e 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/Demo02CategoryController.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/Demo02CategoryController.java
@@ -80,11 +80,11 @@ public class Demo02CategoryController {
@PreAuthorize("@ss.hasPermission('infra:demo02-category:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportDemo02CategoryExcel(@Valid Demo02CategoryListReqVO listReqVO,
- HttpServletResponse response) throws IOException {
+ HttpServletResponse response) throws IOException {
List list = demo02CategoryService.getDemo02CategoryList(listReqVO);
// 导出 Excel
ExcelUtils.write(response, "示例分类.xls", "数据", Demo02CategoryRespVO.class,
- BeanUtils.toBean(list, Demo02CategoryRespVO.class));
+ BeanUtils.toBean(list, Demo02CategoryRespVO.class));
}
}
\ No newline at end of file
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/vo/Demo02CategoryListReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/vo/Demo02CategoryListReqVO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/vo/Demo02CategoryListReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/vo/Demo02CategoryListReqVO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/vo/Demo02CategoryRespVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/vo/Demo02CategoryRespVO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/vo/Demo02CategoryRespVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/vo/Demo02CategoryRespVO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/vo/Demo02CategorySaveReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/vo/Demo02CategorySaveReqVO.java
similarity index 99%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/vo/Demo02CategorySaveReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/vo/Demo02CategorySaveReqVO.java
index fbb76ece90..0bc1a785e7 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/vo/Demo02CategorySaveReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/vo/Demo02CategorySaveReqVO.java
@@ -1,10 +1,9 @@
package cn.iocoder.yudao.module.infra.controller.admin.demo.demo02.vo;
import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
+import lombok.Data;
@Schema(description = "管理后台 - 示例分类新增/修改 Request VO")
@Data
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/Demo03StudentController.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/erp/Demo03StudentErpController.java
similarity index 65%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/Demo03StudentController.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/erp/Demo03StudentErpController.java
index bee5984751..c65f3a7d10 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/Demo03StudentController.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/erp/Demo03StudentErpController.java
@@ -1,4 +1,4 @@
-package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03;
+package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.erp;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
@@ -6,13 +6,13 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
-import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.vo.Demo03StudentPageReqVO;
-import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.vo.Demo03StudentRespVO;
-import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.vo.Demo03StudentSaveReqVO;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.erp.vo.Demo03StudentErpPageReqVO;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.erp.vo.Demo03StudentErpRespVO;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.erp.vo.Demo03StudentErpSaveReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03CourseDO;
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03GradeDO;
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03StudentDO;
-import cn.iocoder.yudao.module.infra.service.demo.demo03.Demo03StudentService;
+import cn.iocoder.yudao.module.infra.service.demo.demo03.erp.Demo03StudentErpService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -31,25 +31,25 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 学生")
@RestController
-@RequestMapping("/infra/demo03-student")
+@RequestMapping("/infra/demo03-student-erp")
@Validated
-public class Demo03StudentController {
+public class Demo03StudentErpController {
@Resource
- private Demo03StudentService demo03StudentService;
+ private Demo03StudentErpService demo03StudentErpService;
@PostMapping("/create")
@Operation(summary = "创建学生")
@PreAuthorize("@ss.hasPermission('infra:demo03-student:create')")
- public CommonResult createDemo03Student(@Valid @RequestBody Demo03StudentSaveReqVO createReqVO) {
- return success(demo03StudentService.createDemo03Student(createReqVO));
+ public CommonResult createDemo03Student(@Valid @RequestBody Demo03StudentErpSaveReqVO createReqVO) {
+ return success(demo03StudentErpService.createDemo03Student(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新学生")
@PreAuthorize("@ss.hasPermission('infra:demo03-student:update')")
- public CommonResult updateDemo03Student(@Valid @RequestBody Demo03StudentSaveReqVO updateReqVO) {
- demo03StudentService.updateDemo03Student(updateReqVO);
+ public CommonResult updateDemo03Student(@Valid @RequestBody Demo03StudentErpSaveReqVO updateReqVO) {
+ demo03StudentErpService.updateDemo03Student(updateReqVO);
return success(true);
}
@@ -58,7 +58,17 @@ public class Demo03StudentController {
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
public CommonResult deleteDemo03Student(@RequestParam("id") Long id) {
- demo03StudentService.deleteDemo03Student(id);
+ demo03StudentErpService.deleteDemo03Student(id);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete-list")
+ @Parameter(name = "ids", description = "编号", required = true)
+ @Operation(summary = "批量删除学生")
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
+ public CommonResult deleteDemo03StudentList(@RequestParam("ids") List ids) {
+ // TODO @puhui999:deleteDemo03StudentList
+ demo03StudentErpService.deleteDemo03StudentListByIds(ids);
return success(true);
}
@@ -66,30 +76,30 @@ public class Demo03StudentController {
@Operation(summary = "获得学生")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
- public CommonResult getDemo03Student(@RequestParam("id") Long id) {
- Demo03StudentDO demo03Student = demo03StudentService.getDemo03Student(id);
- return success(BeanUtils.toBean(demo03Student, Demo03StudentRespVO.class));
+ public CommonResult getDemo03Student(@RequestParam("id") Long id) {
+ Demo03StudentDO demo03Student = demo03StudentErpService.getDemo03Student(id);
+ return success(BeanUtils.toBean(demo03Student, Demo03StudentErpRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得学生分页")
@PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
- public CommonResult> getDemo03StudentPage(@Valid Demo03StudentPageReqVO pageReqVO) {
- PageResult pageResult = demo03StudentService.getDemo03StudentPage(pageReqVO);
- return success(BeanUtils.toBean(pageResult, Demo03StudentRespVO.class));
+ public CommonResult> getDemo03StudentPage(@Valid Demo03StudentErpPageReqVO pageReqVO) {
+ PageResult pageResult = demo03StudentErpService.getDemo03StudentPage(pageReqVO);
+ return success(BeanUtils.toBean(pageResult, Demo03StudentErpRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出学生 Excel")
@PreAuthorize("@ss.hasPermission('infra:demo03-student:export')")
@ApiAccessLog(operateType = EXPORT)
- public void exportDemo03StudentExcel(@Valid Demo03StudentPageReqVO pageReqVO,
- HttpServletResponse response) throws IOException {
+ public void exportDemo03StudentExcel(@Valid Demo03StudentErpPageReqVO pageReqVO,
+ HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
- List list = demo03StudentService.getDemo03StudentPage(pageReqVO).getList();
+ List list = demo03StudentErpService.getDemo03StudentPage(pageReqVO).getList();
// 导出 Excel
- ExcelUtils.write(response, "学生.xls", "数据", Demo03StudentRespVO.class,
- BeanUtils.toBean(list, Demo03StudentRespVO.class));
+ ExcelUtils.write(response, "学生.xls", "数据", Demo03StudentErpRespVO.class,
+ BeanUtils.toBean(list, Demo03StudentErpRespVO.class));
}
// ==================== 子表(学生课程) ====================
@@ -100,21 +110,21 @@ public class Demo03StudentController {
@PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
public CommonResult> getDemo03CoursePage(PageParam pageReqVO,
@RequestParam("studentId") Long studentId) {
- return success(demo03StudentService.getDemo03CoursePage(pageReqVO, studentId));
+ return success(demo03StudentErpService.getDemo03CoursePage(pageReqVO, studentId));
}
@PostMapping("/demo03-course/create")
@Operation(summary = "创建学生课程")
@PreAuthorize("@ss.hasPermission('infra:demo03-student:create')")
public CommonResult createDemo03Course(@Valid @RequestBody Demo03CourseDO demo03Course) {
- return success(demo03StudentService.createDemo03Course(demo03Course));
+ return success(demo03StudentErpService.createDemo03Course(demo03Course));
}
@PutMapping("/demo03-course/update")
@Operation(summary = "更新学生课程")
@PreAuthorize("@ss.hasPermission('infra:demo03-student:update')")
public CommonResult updateDemo03Course(@Valid @RequestBody Demo03CourseDO demo03Course) {
- demo03StudentService.updateDemo03Course(demo03Course);
+ demo03StudentErpService.updateDemo03Course(demo03Course);
return success(true);
}
@@ -123,7 +133,16 @@ public class Demo03StudentController {
@Operation(summary = "删除学生课程")
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
public CommonResult deleteDemo03Course(@RequestParam("id") Long id) {
- demo03StudentService.deleteDemo03Course(id);
+ demo03StudentErpService.deleteDemo03Course(id);
+ return success(true);
+ }
+
+ @DeleteMapping("/demo03-course/delete-list")
+ @Parameter(name = "ids", description = "编号", required = true)
+ @Operation(summary = "批量删除学生课程")
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
+ public CommonResult deleteDemo03CourseList(@RequestParam("ids") List ids) {
+ demo03StudentErpService.deleteDemo03CourseListByIds(ids);
return success(true);
}
@@ -132,15 +151,7 @@ public class Demo03StudentController {
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
public CommonResult getDemo03Course(@RequestParam("id") Long id) {
- return success(demo03StudentService.getDemo03Course(id));
- }
-
- @GetMapping("/demo03-course/list-by-student-id")
- @Operation(summary = "获得学生课程列表")
- @Parameter(name = "studentId", description = "学生编号")
- @PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
- public CommonResult> getDemo03CourseListByStudentId(@RequestParam("studentId") Long studentId) {
- return success(demo03StudentService.getDemo03CourseListByStudentId(studentId));
+ return success(demo03StudentErpService.getDemo03Course(id));
}
// ==================== 子表(学生班级) ====================
@@ -151,21 +162,21 @@ public class Demo03StudentController {
@PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
public CommonResult> getDemo03GradePage(PageParam pageReqVO,
@RequestParam("studentId") Long studentId) {
- return success(demo03StudentService.getDemo03GradePage(pageReqVO, studentId));
+ return success(demo03StudentErpService.getDemo03GradePage(pageReqVO, studentId));
}
@PostMapping("/demo03-grade/create")
@Operation(summary = "创建学生班级")
@PreAuthorize("@ss.hasPermission('infra:demo03-student:create')")
public CommonResult createDemo03Grade(@Valid @RequestBody Demo03GradeDO demo03Grade) {
- return success(demo03StudentService.createDemo03Grade(demo03Grade));
+ return success(demo03StudentErpService.createDemo03Grade(demo03Grade));
}
@PutMapping("/demo03-grade/update")
@Operation(summary = "更新学生班级")
@PreAuthorize("@ss.hasPermission('infra:demo03-student:update')")
public CommonResult updateDemo03Grade(@Valid @RequestBody Demo03GradeDO demo03Grade) {
- demo03StudentService.updateDemo03Grade(demo03Grade);
+ demo03StudentErpService.updateDemo03Grade(demo03Grade);
return success(true);
}
@@ -174,7 +185,16 @@ public class Demo03StudentController {
@Operation(summary = "删除学生班级")
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
public CommonResult deleteDemo03Grade(@RequestParam("id") Long id) {
- demo03StudentService.deleteDemo03Grade(id);
+ demo03StudentErpService.deleteDemo03Grade(id);
+ return success(true);
+ }
+
+ @DeleteMapping("/demo03-grade/delete-list")
+ @Parameter(name = "ids", description = "编号", required = true)
+ @Operation(summary = "批量删除学生班级")
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
+ public CommonResult deleteDemo03GradeList(@RequestParam("ids") List ids) {
+ demo03StudentErpService.deleteDemo03GradeListByIds(ids);
return success(true);
}
@@ -183,15 +203,7 @@ public class Demo03StudentController {
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
public CommonResult getDemo03Grade(@RequestParam("id") Long id) {
- return success(demo03StudentService.getDemo03Grade(id));
- }
-
- @GetMapping("/demo03-grade/get-by-student-id")
- @Operation(summary = "获得学生班级")
- @Parameter(name = "studentId", description = "学生编号")
- @PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
- public CommonResult getDemo03GradeByStudentId(@RequestParam("studentId") Long studentId) {
- return success(demo03StudentService.getDemo03GradeByStudentId(studentId));
+ return success(demo03StudentErpService.getDemo03Grade(id));
}
}
\ No newline at end of file
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/vo/Demo03StudentPageReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/erp/vo/Demo03StudentErpPageReqVO.java
similarity index 85%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/vo/Demo03StudentPageReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/erp/vo/Demo03StudentErpPageReqVO.java
index 6834991755..5fcb656789 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/vo/Demo03StudentPageReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/erp/vo/Demo03StudentErpPageReqVO.java
@@ -1,18 +1,17 @@
-package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.vo;
+package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.erp.vo;
-import lombok.*;
-import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
+
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 学生分页 Request VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class Demo03StudentPageReqVO extends PageParam {
+public class Demo03StudentErpPageReqVO extends PageParam {
@Schema(description = "名字", example = "芋艿")
private String name;
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/vo/Demo03StudentRespVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/erp/vo/Demo03StudentErpRespVO.java
similarity index 88%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/vo/Demo03StudentRespVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/erp/vo/Demo03StudentErpRespVO.java
index 5ae784fa04..84dfe6e037 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/vo/Demo03StudentRespVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/erp/vo/Demo03StudentErpRespVO.java
@@ -1,17 +1,18 @@
-package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.vo;
+package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.erp.vo;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-
-import java.time.LocalDateTime;
-import com.alibaba.excel.annotation.*;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
@Schema(description = "管理后台 - 学生 Response VO")
@Data
@ExcelIgnoreUnannotated
-public class Demo03StudentRespVO {
+public class Demo03StudentErpRespVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "8525")
@ExcelProperty("编号")
diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/erp/vo/Demo03StudentErpSaveReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/erp/vo/Demo03StudentErpSaveReqVO.java
new file mode 100644
index 0000000000..d68e9b5942
--- /dev/null
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/erp/vo/Demo03StudentErpSaveReqVO.java
@@ -0,0 +1,33 @@
+package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.erp.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 学生新增/修改 Request VO")
+@Data
+public class Demo03StudentErpSaveReqVO {
+
+ @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "8525")
+ private Long id;
+
+ @Schema(description = "名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
+ @NotEmpty(message = "名字不能为空")
+ private String name;
+
+ @Schema(description = "性别", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "性别不能为空")
+ private Integer sex;
+
+ @Schema(description = "出生日期", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "出生日期不能为空")
+ private LocalDateTime birthday;
+
+ @Schema(description = "简介", requiredMode = Schema.RequiredMode.REQUIRED, example = "随便")
+ @NotEmpty(message = "简介不能为空")
+ private String description;
+
+}
\ No newline at end of file
diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/inner/Demo03StudentInnerController.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/inner/Demo03StudentInnerController.java
new file mode 100644
index 0000000000..d76b3a89d0
--- /dev/null
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/inner/Demo03StudentInnerController.java
@@ -0,0 +1,124 @@
+package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.inner;
+
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.inner.vo.Demo03StudentInnerPageReqVO;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.inner.vo.Demo03StudentInnerRespVO;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.inner.vo.Demo03StudentInnerSaveReqVO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03CourseDO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03GradeDO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03StudentDO;
+import cn.iocoder.yudao.module.infra.service.demo.demo03.inner.Demo03StudentInnerService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.validation.Valid;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.io.IOException;
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+@Tag(name = "管理后台 - 学生")
+@RestController
+@RequestMapping("/infra/demo03-student-inner")
+@Validated
+public class Demo03StudentInnerController {
+
+ @Resource
+ private Demo03StudentInnerService demo03StudentInnerService;
+
+ @PostMapping("/create")
+ @Operation(summary = "创建学生")
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:create')")
+ public CommonResult createDemo03Student(@Valid @RequestBody Demo03StudentInnerSaveReqVO createReqVO) {
+ return success(demo03StudentInnerService.createDemo03Student(createReqVO));
+ }
+
+ @PutMapping("/update")
+ @Operation(summary = "更新学生")
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:update')")
+ public CommonResult updateDemo03Student(@Valid @RequestBody Demo03StudentInnerSaveReqVO updateReqVO) {
+ demo03StudentInnerService.updateDemo03Student(updateReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete")
+ @Operation(summary = "删除学生")
+ @Parameter(name = "id", description = "编号", required = true)
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
+ public CommonResult deleteDemo03Student(@RequestParam("id") Long id) {
+ demo03StudentInnerService.deleteDemo03Student(id);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete-list")
+ @Parameter(name = "ids", description = "编号", required = true)
+ @Operation(summary = "批量删除学生")
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
+ public CommonResult deleteDemo03StudentList(@RequestParam("ids") List ids) {
+ demo03StudentInnerService.deleteDemo03StudentListByIds(ids);
+ return success(true);
+ }
+
+ @GetMapping("/get")
+ @Operation(summary = "获得学生")
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
+ public CommonResult getDemo03Student(@RequestParam("id") Long id) {
+ Demo03StudentDO demo03Student = demo03StudentInnerService.getDemo03Student(id);
+ return success(BeanUtils.toBean(demo03Student, Demo03StudentInnerRespVO.class));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "获得学生分页")
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
+ public CommonResult> getDemo03StudentPage(@Valid Demo03StudentInnerPageReqVO pageReqVO) {
+ PageResult pageResult = demo03StudentInnerService.getDemo03StudentPage(pageReqVO);
+ return success(BeanUtils.toBean(pageResult, Demo03StudentInnerRespVO.class));
+ }
+
+ @GetMapping("/export-excel")
+ @Operation(summary = "导出学生 Excel")
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:export')")
+ @ApiAccessLog(operateType = EXPORT)
+ public void exportDemo03StudentExcel(@Valid Demo03StudentInnerPageReqVO pageReqVO,
+ HttpServletResponse response) throws IOException {
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+ List list = demo03StudentInnerService.getDemo03StudentPage(pageReqVO).getList();
+ // 导出 Excel
+ ExcelUtils.write(response, "学生.xls", "数据", Demo03StudentInnerRespVO.class,
+ BeanUtils.toBean(list, Demo03StudentInnerRespVO.class));
+ }
+
+ // ==================== 子表(学生课程) ====================
+
+ @GetMapping("/demo03-course/list-by-student-id")
+ @Operation(summary = "获得学生课程列表")
+ @Parameter(name = "studentId", description = "学生编号")
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
+ public CommonResult> getDemo03CourseListByStudentId(@RequestParam("studentId") Long studentId) {
+ return success(demo03StudentInnerService.getDemo03CourseListByStudentId(studentId));
+ }
+
+ // ==================== 子表(学生班级) ====================
+
+ @GetMapping("/demo03-grade/get-by-student-id")
+ @Operation(summary = "获得学生班级")
+ @Parameter(name = "studentId", description = "学生编号")
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
+ public CommonResult getDemo03GradeByStudentId(@RequestParam("studentId") Long studentId) {
+ return success(demo03StudentInnerService.getDemo03GradeByStudentId(studentId));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/inner/vo/Demo03StudentInnerPageReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/inner/vo/Demo03StudentInnerPageReqVO.java
new file mode 100644
index 0000000000..82c7265938
--- /dev/null
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/inner/vo/Demo03StudentInnerPageReqVO.java
@@ -0,0 +1,29 @@
+package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.inner.vo;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 学生分页 Request VO")
+@Data
+public class Demo03StudentInnerPageReqVO extends PageParam {
+
+ @Schema(description = "名字", example = "芋艿")
+ private String name;
+
+ @Schema(description = "性别")
+ private Integer sex;
+
+ @Schema(description = "简介", example = "随便")
+ private String description;
+
+ @Schema(description = "创建时间")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] createTime;
+
+}
\ No newline at end of file
diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/inner/vo/Demo03StudentInnerRespVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/inner/vo/Demo03StudentInnerRespVO.java
new file mode 100644
index 0000000000..48d5e4889a
--- /dev/null
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/inner/vo/Demo03StudentInnerRespVO.java
@@ -0,0 +1,42 @@
+package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.inner.vo;
+
+import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
+import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 学生 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class Demo03StudentInnerRespVO {
+
+ @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "8525")
+ @ExcelProperty("编号")
+ private Long id;
+
+ @Schema(description = "名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
+ @ExcelProperty("名字")
+ private String name;
+
+ @Schema(description = "性别", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty(value = "性别", converter = DictConvert.class)
+ @DictFormat("system_user_sex") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
+ private Integer sex;
+
+ @Schema(description = "出生日期", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("出生日期")
+ private LocalDateTime birthday;
+
+ @Schema(description = "简介", requiredMode = Schema.RequiredMode.REQUIRED, example = "随便")
+ @ExcelProperty("简介")
+ private String description;
+
+ @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("创建时间")
+ private LocalDateTime createTime;
+
+}
\ No newline at end of file
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/vo/Demo03StudentSaveReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/inner/vo/Demo03StudentInnerSaveReqVO.java
similarity index 81%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/vo/Demo03StudentSaveReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/inner/vo/Demo03StudentInnerSaveReqVO.java
index ec9f29cc9d..e181eeaea9 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/vo/Demo03StudentSaveReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/inner/vo/Demo03StudentInnerSaveReqVO.java
@@ -1,16 +1,18 @@
-package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.vo;
+package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.inner.vo;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-import java.util.*;
-import jakarta.validation.constraints.*;
-import java.time.LocalDateTime;
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03CourseDO;
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03GradeDO;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+import java.util.List;
@Schema(description = "管理后台 - 学生新增/修改 Request VO")
@Data
-public class Demo03StudentSaveReqVO {
+public class Demo03StudentInnerSaveReqVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "8525")
private Long id;
@@ -31,9 +33,10 @@ public class Demo03StudentSaveReqVO {
@NotEmpty(message = "简介不能为空")
private String description;
-
+ @Schema(description = "学生课程列表")
private List demo03Courses;
+ @Schema(description = "学生班级")
private Demo03GradeDO demo03Grade;
}
\ No newline at end of file
diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/normal/Demo03StudentNormalController.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/normal/Demo03StudentNormalController.java
new file mode 100644
index 0000000000..e52160ca77
--- /dev/null
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/normal/Demo03StudentNormalController.java
@@ -0,0 +1,124 @@
+package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.normal;
+
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.normal.vo.Demo03StudentNormalPageReqVO;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.normal.vo.Demo03StudentNormalRespVO;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.normal.vo.Demo03StudentNormalSaveReqVO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03CourseDO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03GradeDO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03StudentDO;
+import cn.iocoder.yudao.module.infra.service.demo.demo03.normal.Demo03StudentNormalService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.validation.Valid;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.io.IOException;
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+@Tag(name = "管理后台 - 学生")
+@RestController
+@RequestMapping("/infra/demo03-student-normal")
+@Validated
+public class Demo03StudentNormalController {
+
+ @Resource
+ private Demo03StudentNormalService demo03StudentNormalService;
+
+ @PostMapping("/create")
+ @Operation(summary = "创建学生")
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:create')")
+ public CommonResult createDemo03Student(@Valid @RequestBody Demo03StudentNormalSaveReqVO createReqVO) {
+ return success(demo03StudentNormalService.createDemo03Student(createReqVO));
+ }
+
+ @PutMapping("/update")
+ @Operation(summary = "更新学生")
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:update')")
+ public CommonResult updateDemo03Student(@Valid @RequestBody Demo03StudentNormalSaveReqVO updateReqVO) {
+ demo03StudentNormalService.updateDemo03Student(updateReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete")
+ @Operation(summary = "删除学生")
+ @Parameter(name = "id", description = "编号", required = true)
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
+ public CommonResult deleteDemo03Student(@RequestParam("id") Long id) {
+ demo03StudentNormalService.deleteDemo03Student(id);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete-list")
+ @Parameter(name = "ids", description = "编号", required = true)
+ @Operation(summary = "批量删除学生")
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
+ public CommonResult deleteDemo03StudentList(@RequestParam("ids") List ids) {
+ demo03StudentNormalService.deleteDemo03StudentListByIds(ids);
+ return success(true);
+ }
+
+ @GetMapping("/get")
+ @Operation(summary = "获得学生")
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
+ public CommonResult getDemo03Student(@RequestParam("id") Long id) {
+ Demo03StudentDO demo03Student = demo03StudentNormalService.getDemo03Student(id);
+ return success(BeanUtils.toBean(demo03Student, Demo03StudentNormalRespVO.class));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "获得学生分页")
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
+ public CommonResult> getDemo03StudentPage(@Valid Demo03StudentNormalPageReqVO pageReqVO) {
+ PageResult pageResult = demo03StudentNormalService.getDemo03StudentPage(pageReqVO);
+ return success(BeanUtils.toBean(pageResult, Demo03StudentNormalRespVO.class));
+ }
+
+ @GetMapping("/export-excel")
+ @Operation(summary = "导出学生 Excel")
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:export')")
+ @ApiAccessLog(operateType = EXPORT)
+ public void exportDemo03StudentExcel(@Valid Demo03StudentNormalPageReqVO pageReqVO,
+ HttpServletResponse response) throws IOException {
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+ List list = demo03StudentNormalService.getDemo03StudentPage(pageReqVO).getList();
+ // 导出 Excel
+ ExcelUtils.write(response, "学生.xls", "数据", Demo03StudentNormalRespVO.class,
+ BeanUtils.toBean(list, Demo03StudentNormalRespVO.class));
+ }
+
+ // ==================== 子表(学生课程) ====================
+
+ @GetMapping("/demo03-course/list-by-student-id")
+ @Operation(summary = "获得学生课程列表")
+ @Parameter(name = "studentId", description = "学生编号")
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
+ public CommonResult> getDemo03CourseListByStudentId(@RequestParam("studentId") Long studentId) {
+ return success(demo03StudentNormalService.getDemo03CourseListByStudentId(studentId));
+ }
+
+ // ==================== 子表(学生班级) ====================
+
+ @GetMapping("/demo03-grade/get-by-student-id")
+ @Operation(summary = "获得学生班级")
+ @Parameter(name = "studentId", description = "学生编号")
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
+ public CommonResult getDemo03GradeByStudentId(@RequestParam("studentId") Long studentId) {
+ return success(demo03StudentNormalService.getDemo03GradeByStudentId(studentId));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/normal/vo/Demo03StudentNormalPageReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/normal/vo/Demo03StudentNormalPageReqVO.java
new file mode 100644
index 0000000000..8d6c76c846
--- /dev/null
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/normal/vo/Demo03StudentNormalPageReqVO.java
@@ -0,0 +1,29 @@
+package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.normal.vo;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 学生分页 Request VO")
+@Data
+public class Demo03StudentNormalPageReqVO extends PageParam {
+
+ @Schema(description = "名字", example = "芋艿")
+ private String name;
+
+ @Schema(description = "性别")
+ private Integer sex;
+
+ @Schema(description = "简介", example = "随便")
+ private String description;
+
+ @Schema(description = "创建时间")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] createTime;
+
+}
\ No newline at end of file
diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/normal/vo/Demo03StudentNormalRespVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/normal/vo/Demo03StudentNormalRespVO.java
new file mode 100644
index 0000000000..e36a7965c1
--- /dev/null
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/normal/vo/Demo03StudentNormalRespVO.java
@@ -0,0 +1,42 @@
+package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.normal.vo;
+
+import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
+import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 学生 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class Demo03StudentNormalRespVO {
+
+ @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "8525")
+ @ExcelProperty("编号")
+ private Long id;
+
+ @Schema(description = "名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
+ @ExcelProperty("名字")
+ private String name;
+
+ @Schema(description = "性别", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty(value = "性别", converter = DictConvert.class)
+ @DictFormat("system_user_sex") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
+ private Integer sex;
+
+ @Schema(description = "出生日期", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("出生日期")
+ private LocalDateTime birthday;
+
+ @Schema(description = "简介", requiredMode = Schema.RequiredMode.REQUIRED, example = "随便")
+ @ExcelProperty("简介")
+ private String description;
+
+ @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("创建时间")
+ private LocalDateTime createTime;
+
+}
\ No newline at end of file
diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/normal/vo/Demo03StudentNormalSaveReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/normal/vo/Demo03StudentNormalSaveReqVO.java
new file mode 100644
index 0000000000..1b3edd9196
--- /dev/null
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/normal/vo/Demo03StudentNormalSaveReqVO.java
@@ -0,0 +1,42 @@
+package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.normal.vo;
+
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03CourseDO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03GradeDO;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+@Schema(description = "管理后台 - 学生新增/修改 Request VO")
+@Data
+public class Demo03StudentNormalSaveReqVO {
+
+ @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "8525")
+ private Long id;
+
+ @Schema(description = "名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
+ @NotEmpty(message = "名字不能为空")
+ private String name;
+
+ @Schema(description = "性别", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "性别不能为空")
+ private Integer sex;
+
+ @Schema(description = "出生日期", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "出生日期不能为空")
+ private LocalDateTime birthday;
+
+ @Schema(description = "简介", requiredMode = Schema.RequiredMode.REQUIRED, example = "随便")
+ @NotEmpty(message = "简介不能为空")
+ private String description;
+
+ @Schema(description = "学生课程列表")
+ private List demo03Courses;
+
+ @Schema(description = "学生班级")
+ private Demo03GradeDO demo03Grade;
+
+}
\ No newline at end of file
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/package-info.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/package-info.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/package-info.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/package-info.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileConfigController.http b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileConfigController.http
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileConfigController.http
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileConfigController.http
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileConfigController.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileConfigController.java
similarity index 99%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileConfigController.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileConfigController.java
index ecf6b6e073..a2e12c4e11 100755
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileConfigController.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileConfigController.java
@@ -11,13 +11,12 @@ import cn.iocoder.yudao.module.infra.service.file.FileConfigService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
-import jakarta.annotation.Resource;
-import jakarta.validation.Valid;
-
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 文件配置")
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigPageReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigPageReqVO.java
similarity index 88%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigPageReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigPageReqVO.java
index 481fa2af52..23b3077040 100755
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigPageReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigPageReqVO.java
@@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@Schema(description = "管理后台 - 文件配置分页 Request VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
public class FileConfigPageReqVO extends PageParam {
@Schema(description = "配置名", example = "S3 - 阿里云")
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigRespVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigRespVO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigRespVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigRespVO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigSaveReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigSaveReqVO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigSaveReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigSaveReqVO.java
index f4bf7c2c99..211bee5de6 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigSaveReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigSaveReqVO.java
@@ -1,9 +1,9 @@
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config;
import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotNull;
import lombok.Data;
-import jakarta.validation.constraints.NotNull;
import java.util.Map;
@Schema(description = "管理后台 - 文件配置创建/修改 Request VO")
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileCreateReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileCreateReqVO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileCreateReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileCreateReqVO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FilePageReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FilePageReqVO.java
similarity index 88%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FilePageReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FilePageReqVO.java
index 21c117867e..48d4c4377f 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FilePageReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FilePageReqVO.java
@@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.file.vo.file;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@Schema(description = "管理后台 - 文件分页 Request VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
public class FilePageReqVO extends PageParam {
@Schema(description = "文件路径,模糊匹配", example = "yudao")
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FilePresignedUrlRespVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FilePresignedUrlRespVO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FilePresignedUrlRespVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FilePresignedUrlRespVO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileRespVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileRespVO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileRespVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileRespVO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileUploadReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileUploadReqVO.java
similarity index 99%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileUploadReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileUploadReqVO.java
index 183462a892..4096f477e3 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileUploadReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileUploadReqVO.java
@@ -1,11 +1,10 @@
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.file;
import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;
-import jakarta.validation.constraints.NotNull;
-
@Schema(description = "管理后台 - 上传文件 Request VO")
@Data
public class FileUploadReqVO {
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobController.http b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobController.http
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobController.http
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobController.http
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobController.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobController.java
similarity index 98%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobController.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobController.java
index 372b6391b1..bf4506d34f 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobController.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobController.java
@@ -71,10 +71,10 @@ public class JobController {
return success(true);
}
- @DeleteMapping("/delete")
+ @DeleteMapping("/delete")
@Operation(summary = "删除定时任务")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
- @PreAuthorize("@ss.hasPermission('infra:job:delete')")
+ @PreAuthorize("@ss.hasPermission('infra:job:delete')")
public CommonResult deleteJob(@RequestParam("id") Long id)
throws SchedulerException {
jobService.deleteJob(id);
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobLogController.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobLogController.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobLogController.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobLogController.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobPageReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobPageReqVO.java
similarity index 84%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobPageReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobPageReqVO.java
index 332833519c..67a6aaeee0 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobPageReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobPageReqVO.java
@@ -3,13 +3,9 @@ package cn.iocoder.yudao.module.infra.controller.admin.job.vo.job;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
@Schema(description = "管理后台 - 定时任务分页 Request VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
public class JobPageReqVO extends PageParam {
@Schema(description = "任务名称,模糊匹配", example = "测试任务")
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobRespVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobRespVO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobRespVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobRespVO.java
index ea9cd5e3cd..aee0d9bcf1 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobRespVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobRespVO.java
@@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.infra.enums.DictTypeConstants;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotNull;
import lombok.Data;
-import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 定时任务 Response VO")
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobSaveReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobSaveReqVO.java
similarity index 99%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobSaveReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobSaveReqVO.java
index b22060b3dc..a8e20fc7de 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobSaveReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobSaveReqVO.java
@@ -1,10 +1,9 @@
package cn.iocoder.yudao.module.infra.controller.admin.job.vo.job;
import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
+import lombok.Data;
@Schema(description = "管理后台 - 定时任务创建/修改 Request VO")
@Data
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogPageReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogPageReqVO.java
similarity index 90%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogPageReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogPageReqVO.java
index 1d3d49600f..2d8c30e448 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogPageReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogPageReqVO.java
@@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.job.vo.log;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@Schema(description = "管理后台 - 定时任务日志分页 Request VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
public class JobLogPageReqVO extends PageParam {
@Schema(description = "任务编号", example = "10")
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogRespVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogRespVO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogRespVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogRespVO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiAccessLogController.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiAccessLogController.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiAccessLogController.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiAccessLogController.java
index b4ee86c0d8..513b3ef21b 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiAccessLogController.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiAccessLogController.java
@@ -12,15 +12,15 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiAccessLogDO;
import cn.iocoder.yudao.module.infra.service.logger.ApiAccessLogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-import jakarta.annotation.Resource;
-import jakarta.servlet.http.HttpServletResponse;
-import jakarta.validation.Valid;
import java.io.IOException;
import java.util.List;
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiErrorLogController.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiErrorLogController.java
similarity index 97%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiErrorLogController.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiErrorLogController.java
index 25eb2e99c2..525bb9eda8 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiErrorLogController.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiErrorLogController.java
@@ -14,13 +14,13 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
-import jakarta.annotation.Resource;
-import jakarta.servlet.http.HttpServletResponse;
-import jakarta.validation.Valid;
import java.io.IOException;
import java.util.List;
@@ -63,7 +63,7 @@ public class ApiErrorLogController {
@PreAuthorize("@ss.hasPermission('infra:api-error-log:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportApiErrorLogExcel(@Valid ApiErrorLogPageReqVO exportReqVO,
- HttpServletResponse response) throws IOException {
+ HttpServletResponse response) throws IOException {
exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List list = apiErrorLogService.getApiErrorLogPage(exportReqVO).getList();
// 导出 Excel
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogPageReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogPageReqVO.java
similarity index 91%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogPageReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogPageReqVO.java
index c17c111220..1da136bc5c 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogPageReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogPageReqVO.java
@@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@Schema(description = "管理后台 - API 访问日志分页 Request VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
public class ApiAccessLogPageReqVO extends PageParam {
@Schema(description = "用户编号", example = "666")
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogRespVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogRespVO.java
similarity index 98%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogRespVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogRespVO.java
index e991450a4c..d9e65c403c 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogRespVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogRespVO.java
@@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
-import cn.iocoder.yudao.module.system.enums.DictTypeConstants;
+import cn.iocoder.yudao.module.infra.enums.DictTypeConstants;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogPageReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogPageReqVO.java
similarity index 90%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogPageReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogPageReqVO.java
index 2ceb0d033d..9611f69c9b 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogPageReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogPageReqVO.java
@@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@Schema(description = "管理后台 - API 错误日志分页 Request VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
public class ApiErrorLogPageReqVO extends PageParam {
@Schema(description = "用户编号", example = "666")
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogRespVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogRespVO.java
similarity index 98%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogRespVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogRespVO.java
index 8029f1584e..a3f6f0e84c 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogRespVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogRespVO.java
@@ -29,7 +29,7 @@ public class ApiErrorLogRespVO {
@Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty(value = "用户类型", converter = DictConvert.class)
- @DictFormat(cn.iocoder.yudao.module.system.enums.DictTypeConstants.USER_TYPE)
+ @DictFormat(DictTypeConstants.USER_TYPE)
private Integer userType;
@Schema(description = "应用名", requiredMode = Schema.RequiredMode.REQUIRED, example = "dashboard")
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/RedisController.http b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/RedisController.http
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/RedisController.http
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/RedisController.http
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/RedisController.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/RedisController.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/RedisController.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/RedisController.java
index 88f29f9a82..7ddfc0bea7 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/RedisController.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/RedisController.java
@@ -5,6 +5,7 @@ import cn.iocoder.yudao.module.infra.controller.admin.redis.vo.RedisMonitorRespV
import cn.iocoder.yudao.module.infra.convert.redis.RedisConvert;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
import org.springframework.data.redis.connection.RedisServerCommands;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.StringRedisTemplate;
@@ -13,7 +14,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-import jakarta.annotation.Resource;
import java.util.Properties;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/vo/RedisMonitorRespVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/vo/RedisMonitorRespVO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/vo/RedisMonitorRespVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/vo/RedisMonitorRespVO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/app/file/AppFileController.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/app/file/AppFileController.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/app/file/AppFileController.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/app/file/AppFileController.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/app/file/vo/AppFileUploadReqVO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/app/file/vo/AppFileUploadReqVO.java
similarity index 99%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/app/file/vo/AppFileUploadReqVO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/app/file/vo/AppFileUploadReqVO.java
index fe01e03582..fde120a067 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/app/file/vo/AppFileUploadReqVO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/app/file/vo/AppFileUploadReqVO.java
@@ -1,11 +1,10 @@
package cn.iocoder.yudao.module.infra.controller.app.file.vo;
import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;
-import jakarta.validation.constraints.NotNull;
-
@Schema(description = "用户 App - 上传文件 Request VO")
@Data
public class AppFileUploadReqVO {
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/app/package-info.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/app/package-info.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/app/package-info.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/app/package-info.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/package-info.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/package-info.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/package-info.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/package-info.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/convert/codegen/CodegenConvert.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/convert/codegen/CodegenConvert.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/convert/codegen/CodegenConvert.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/convert/codegen/CodegenConvert.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/convert/config/ConfigConvert.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/convert/config/ConfigConvert.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/convert/config/ConfigConvert.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/convert/config/ConfigConvert.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/convert/file/FileConfigConvert.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/convert/file/FileConfigConvert.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/convert/file/FileConfigConvert.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/convert/file/FileConfigConvert.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/convert/package-info.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/convert/package-info.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/convert/package-info.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/convert/package-info.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/convert/redis/RedisConvert.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/convert/redis/RedisConvert.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/convert/redis/RedisConvert.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/convert/redis/RedisConvert.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/codegen/CodegenColumnDO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/codegen/CodegenColumnDO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/codegen/CodegenColumnDO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/codegen/CodegenColumnDO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/codegen/CodegenTableDO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/codegen/CodegenTableDO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/codegen/CodegenTableDO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/codegen/CodegenTableDO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/config/ConfigDO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/config/ConfigDO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/config/ConfigDO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/config/ConfigDO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/db/DataSourceConfigDO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/db/DataSourceConfigDO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/db/DataSourceConfigDO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/db/DataSourceConfigDO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/demo/demo01/Demo01ContactDO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/demo/demo01/Demo01ContactDO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/demo/demo01/Demo01ContactDO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/demo/demo01/Demo01ContactDO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/demo/demo02/Demo02CategoryDO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/demo/demo02/Demo02CategoryDO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/demo/demo02/Demo02CategoryDO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/demo/demo02/Demo02CategoryDO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/demo/demo03/Demo03CourseDO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/demo/demo03/Demo03CourseDO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/demo/demo03/Demo03CourseDO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/demo/demo03/Demo03CourseDO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/demo/demo03/Demo03GradeDO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/demo/demo03/Demo03GradeDO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/demo/demo03/Demo03GradeDO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/demo/demo03/Demo03GradeDO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/demo/demo03/Demo03StudentDO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/demo/demo03/Demo03StudentDO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/demo/demo03/Demo03StudentDO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/demo/demo03/Demo03StudentDO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileConfigDO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileConfigDO.java
similarity index 98%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileConfigDO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileConfigDO.java
index 92d617e330..4387983a0d 100755
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileConfigDO.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileConfigDO.java
@@ -79,7 +79,8 @@ public class FileConfigDO extends BaseDO {
@Override
public Object parse(String json) {
- FileClientConfig config = JsonUtils.parseObjectQuietly(json, new TypeReference<>() {});
+ FileClientConfig config = JsonUtils.parseObjectQuietly(json, new TypeReference<>() {
+ });
if (config != null) {
return config;
}
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileContentDO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileContentDO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileContentDO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileContentDO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileDO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileDO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileDO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileDO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/job/JobDO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/job/JobDO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/job/JobDO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/job/JobDO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/job/JobLogDO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/job/JobLogDO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/job/JobLogDO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/job/JobLogDO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/logger/ApiAccessLogDO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/logger/ApiAccessLogDO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/logger/ApiAccessLogDO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/logger/ApiAccessLogDO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/logger/ApiErrorLogDO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/logger/ApiErrorLogDO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/logger/ApiErrorLogDO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/logger/ApiErrorLogDO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/codegen/CodegenColumnMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/codegen/CodegenColumnMapper.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/codegen/CodegenColumnMapper.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/codegen/CodegenColumnMapper.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/codegen/CodegenTableMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/codegen/CodegenTableMapper.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/codegen/CodegenTableMapper.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/codegen/CodegenTableMapper.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/config/ConfigMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/config/ConfigMapper.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/config/ConfigMapper.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/config/ConfigMapper.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/db/DataSourceConfigMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/db/DataSourceConfigMapper.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/db/DataSourceConfigMapper.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/db/DataSourceConfigMapper.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo01/Demo01ContactMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo01/Demo01ContactMapper.java
similarity index 99%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo01/Demo01ContactMapper.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo01/Demo01ContactMapper.java
index f5f3cdbbe8..916dcfc2c2 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo01/Demo01ContactMapper.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo01/Demo01ContactMapper.java
@@ -1,8 +1,8 @@
package cn.iocoder.yudao.module.infra.dal.mysql.demo.demo01;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.infra.controller.admin.demo.demo01.vo.Demo01ContactPageReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo01.Demo01ContactDO;
import org.apache.ibatis.annotations.Mapper;
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo02/Demo02CategoryMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo02/Demo02CategoryMapper.java
similarity index 84%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo02/Demo02CategoryMapper.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo02/Demo02CategoryMapper.java
index b16e18feee..72dea775fa 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo02/Demo02CategoryMapper.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo02/Demo02CategoryMapper.java
@@ -1,13 +1,13 @@
package cn.iocoder.yudao.module.infra.dal.mysql.demo.demo02;
-import java.util.*;
-
-import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.infra.controller.admin.demo.demo02.vo.Demo02CategoryListReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo02.Demo02CategoryDO;
import org.apache.ibatis.annotations.Mapper;
+import java.util.List;
+
/**
* 示例分类 Mapper
*
@@ -24,9 +24,9 @@ public interface Demo02CategoryMapper extends BaseMapperX {
.orderByDesc(Demo02CategoryDO::getId));
}
- default Demo02CategoryDO selectByParentIdAndName(Long parentId, String name) {
- return selectOne(Demo02CategoryDO::getParentId, parentId, Demo02CategoryDO::getName, name);
- }
+ default Demo02CategoryDO selectByParentIdAndName(Long parentId, String name) {
+ return selectOne(Demo02CategoryDO::getParentId, parentId, Demo02CategoryDO::getName, name);
+ }
default Long selectCountByParentId(Long parentId) {
return selectCount(Demo02CategoryDO::getParentId, parentId);
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/Demo03CourseMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/erp/Demo03CourseErpMapper.java
similarity index 76%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/Demo03CourseMapper.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/erp/Demo03CourseErpMapper.java
index 3cb3aa5920..cbd8707fb1 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/Demo03CourseMapper.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/erp/Demo03CourseErpMapper.java
@@ -1,4 +1,4 @@
-package cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03;
+package cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.erp;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
@@ -15,7 +15,7 @@ import java.util.List;
* @author 芋道源码
*/
@Mapper
-public interface Demo03CourseMapper extends BaseMapperX {
+public interface Demo03CourseErpMapper extends BaseMapperX {
default PageResult selectPage(PageParam reqVO, Long studentId) {
return selectPage(reqVO, new LambdaQueryWrapperX()
@@ -23,12 +23,12 @@ public interface Demo03CourseMapper extends BaseMapperX {
.orderByDesc(Demo03CourseDO::getId));
}
- default List selectListByStudentId(Long studentId) {
- return selectList(Demo03CourseDO::getStudentId, studentId);
- }
-
default int deleteByStudentId(Long studentId) {
return delete(Demo03CourseDO::getStudentId, studentId);
}
-}
\ No newline at end of file
+ default int deleteByStudentIds(List studentIds) {
+ return deleteBatch(Demo03CourseDO::getStudentId, studentIds);
+ }
+
+}
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/Demo03GradeMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/erp/Demo03GradeErpMapper.java
similarity index 76%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/Demo03GradeMapper.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/erp/Demo03GradeErpMapper.java
index 0440cc49e3..cf61430817 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/Demo03GradeMapper.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/erp/Demo03GradeErpMapper.java
@@ -1,4 +1,4 @@
-package cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03;
+package cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.erp;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
@@ -7,13 +7,15 @@ import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03GradeDO;
import org.apache.ibatis.annotations.Mapper;
+import java.util.List;
+
/**
* 学生班级 Mapper
*
* @author 芋道源码
*/
@Mapper
-public interface Demo03GradeMapper extends BaseMapperX {
+public interface Demo03GradeErpMapper extends BaseMapperX {
default PageResult selectPage(PageParam reqVO, Long studentId) {
return selectPage(reqVO, new LambdaQueryWrapperX()
@@ -29,4 +31,8 @@ public interface Demo03GradeMapper extends BaseMapperX {
return delete(Demo03GradeDO::getStudentId, studentId);
}
-}
\ No newline at end of file
+ default int deleteByStudentIds(List studentIds) {
+ return deleteBatch(Demo03GradeDO::getStudentId, studentIds);
+ }
+
+}
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/Demo03StudentMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/erp/Demo03StudentErpMapper.java
similarity index 82%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/Demo03StudentMapper.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/erp/Demo03StudentErpMapper.java
index 00659d0520..4387ef5c69 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/Demo03StudentMapper.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/erp/Demo03StudentErpMapper.java
@@ -1,11 +1,11 @@
-package cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03;
+package cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.erp;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.erp.vo.Demo03StudentErpPageReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03StudentDO;
import org.apache.ibatis.annotations.Mapper;
-import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.vo.*;
/**
* 学生 Mapper
@@ -13,9 +13,9 @@ import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.vo.*;
* @author 芋道源码
*/
@Mapper
-public interface Demo03StudentMapper extends BaseMapperX {
+public interface Demo03StudentErpMapper extends BaseMapperX {
- default PageResult selectPage(Demo03StudentPageReqVO reqVO) {
+ default PageResult selectPage(Demo03StudentErpPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX()
.likeIfPresent(Demo03StudentDO::getName, reqVO.getName())
.eqIfPresent(Demo03StudentDO::getSex, reqVO.getSex())
diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/inner/Demo03CourseInnerMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/inner/Demo03CourseInnerMapper.java
new file mode 100644
index 0000000000..74e45c4d9f
--- /dev/null
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/inner/Demo03CourseInnerMapper.java
@@ -0,0 +1,29 @@
+package cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.inner;
+
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03CourseDO;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * 学生课程 Mapper
+ *
+ * @author 芋道源码
+ */
+@Mapper
+public interface Demo03CourseInnerMapper extends BaseMapperX {
+
+ default List selectListByStudentId(Long studentId) {
+ return selectList(Demo03CourseDO::getStudentId, studentId);
+ }
+
+ default int deleteByStudentId(Long studentId) {
+ return delete(Demo03CourseDO::getStudentId, studentId);
+ }
+
+ default int deleteByStudentIds(List studentIds) {
+ return deleteBatch(Demo03CourseDO::getStudentId, studentIds);
+ }
+
+}
diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/inner/Demo03GradeInnerMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/inner/Demo03GradeInnerMapper.java
new file mode 100644
index 0000000000..bb91d24330
--- /dev/null
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/inner/Demo03GradeInnerMapper.java
@@ -0,0 +1,29 @@
+package cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.inner;
+
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03GradeDO;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * 学生班级 Mapper
+ *
+ * @author 芋道源码
+ */
+@Mapper
+public interface Demo03GradeInnerMapper extends BaseMapperX {
+
+ default Demo03GradeDO selectByStudentId(Long studentId) {
+ return selectOne(Demo03GradeDO::getStudentId, studentId);
+ }
+
+ default int deleteByStudentId(Long studentId) {
+ return delete(Demo03GradeDO::getStudentId, studentId);
+ }
+
+ default int deleteByStudentIds(List studentIds) {
+ return deleteBatch(Demo03GradeDO::getStudentId, studentIds);
+ }
+
+}
diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/inner/Demo03StudentInnerMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/inner/Demo03StudentInnerMapper.java
new file mode 100644
index 0000000000..6a329fd1c3
--- /dev/null
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/inner/Demo03StudentInnerMapper.java
@@ -0,0 +1,27 @@
+package cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.inner;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.inner.vo.Demo03StudentInnerPageReqVO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03StudentDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 学生 Mapper
+ *
+ * @author 芋道源码
+ */
+@Mapper
+public interface Demo03StudentInnerMapper extends BaseMapperX {
+
+ default PageResult selectPage(Demo03StudentInnerPageReqVO reqVO) {
+ return selectPage(reqVO, new LambdaQueryWrapperX()
+ .likeIfPresent(Demo03StudentDO::getName, reqVO.getName())
+ .eqIfPresent(Demo03StudentDO::getSex, reqVO.getSex())
+ .eqIfPresent(Demo03StudentDO::getDescription, reqVO.getDescription())
+ .betweenIfPresent(Demo03StudentDO::getCreateTime, reqVO.getCreateTime())
+ .orderByDesc(Demo03StudentDO::getId));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/normal/Demo03CourseNormalMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/normal/Demo03CourseNormalMapper.java
new file mode 100644
index 0000000000..91ea89217a
--- /dev/null
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/normal/Demo03CourseNormalMapper.java
@@ -0,0 +1,29 @@
+package cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.normal;
+
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03CourseDO;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * 学生课程 Mapper
+ *
+ * @author 芋道源码
+ */
+@Mapper
+public interface Demo03CourseNormalMapper extends BaseMapperX {
+
+ default List selectListByStudentId(Long studentId) {
+ return selectList(Demo03CourseDO::getStudentId, studentId);
+ }
+
+ default int deleteByStudentId(Long studentId) {
+ return delete(Demo03CourseDO::getStudentId, studentId);
+ }
+
+ default int deleteByStudentIds(List studentIds) {
+ return deleteBatch(Demo03CourseDO::getStudentId, studentIds);
+ }
+
+}
diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/normal/Demo03GradeNormalMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/normal/Demo03GradeNormalMapper.java
new file mode 100644
index 0000000000..c883f90874
--- /dev/null
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/normal/Demo03GradeNormalMapper.java
@@ -0,0 +1,29 @@
+package cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.normal;
+
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03GradeDO;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * 学生班级 Mapper
+ *
+ * @author 芋道源码
+ */
+@Mapper
+public interface Demo03GradeNormalMapper extends BaseMapperX {
+
+ default Demo03GradeDO selectByStudentId(Long studentId) {
+ return selectOne(Demo03GradeDO::getStudentId, studentId);
+ }
+
+ default int deleteByStudentId(Long studentId) {
+ return delete(Demo03GradeDO::getStudentId, studentId);
+ }
+
+ default int deleteByStudentIds(List studentIds) {
+ return deleteBatch(Demo03GradeDO::getStudentId, studentIds);
+ }
+
+}
diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/normal/Demo03StudentNormalMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/normal/Demo03StudentNormalMapper.java
new file mode 100644
index 0000000000..268b1de50b
--- /dev/null
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/demo/demo03/normal/Demo03StudentNormalMapper.java
@@ -0,0 +1,27 @@
+package cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.normal;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.normal.vo.Demo03StudentNormalPageReqVO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03StudentDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 学生 Mapper
+ *
+ * @author 芋道源码
+ */
+@Mapper
+public interface Demo03StudentNormalMapper extends BaseMapperX {
+
+ default PageResult selectPage(Demo03StudentNormalPageReqVO reqVO) {
+ return selectPage(reqVO, new LambdaQueryWrapperX()
+ .likeIfPresent(Demo03StudentDO::getName, reqVO.getName())
+ .eqIfPresent(Demo03StudentDO::getSex, reqVO.getSex())
+ .eqIfPresent(Demo03StudentDO::getDescription, reqVO.getDescription())
+ .betweenIfPresent(Demo03StudentDO::getCreateTime, reqVO.getCreateTime())
+ .orderByDesc(Demo03StudentDO::getId));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileConfigMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileConfigMapper.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileConfigMapper.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileConfigMapper.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileContentMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileContentMapper.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileContentMapper.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileContentMapper.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileMapper.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileMapper.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileMapper.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/job/JobLogMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/job/JobLogMapper.java
similarity index 96%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/job/JobLogMapper.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/job/JobLogMapper.java
index 58ac6daf15..3902339aec 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/job/JobLogMapper.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/job/JobLogMapper.java
@@ -34,7 +34,7 @@ public interface JobLogMapper extends BaseMapperX {
* 物理删除指定时间之前的日志
*
* @param createTime 最大时间
- * @param limit 删除条数,防止一次删除太多
+ * @param limit 删除条数,防止一次删除太多
* @return 删除条数
*/
@Delete("DELETE FROM infra_job_log WHERE create_time < #{createTime} LIMIT #{limit}")
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/job/JobMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/job/JobMapper.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/job/JobMapper.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/job/JobMapper.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/logger/ApiAccessLogMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/logger/ApiAccessLogMapper.java
similarity index 96%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/logger/ApiAccessLogMapper.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/logger/ApiAccessLogMapper.java
index dce30829f5..820c4b1416 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/logger/ApiAccessLogMapper.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/logger/ApiAccessLogMapper.java
@@ -36,7 +36,7 @@ public interface ApiAccessLogMapper extends BaseMapperX {
* 物理删除指定时间之前的日志
*
* @param createTime 最大时间
- * @param limit 删除条数,防止一次删除太多
+ * @param limit 删除条数,防止一次删除太多
* @return 删除条数
*/
@Delete("DELETE FROM infra_api_access_log WHERE create_time < #{createTime} LIMIT #{limit}")
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/logger/ApiErrorLogMapper.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/logger/ApiErrorLogMapper.java
similarity index 93%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/logger/ApiErrorLogMapper.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/logger/ApiErrorLogMapper.java
index b597d79294..f220696aed 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/logger/ApiErrorLogMapper.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/logger/ApiErrorLogMapper.java
@@ -35,10 +35,10 @@ public interface ApiErrorLogMapper extends BaseMapperX {
* 物理删除指定时间之前的日志
*
* @param createTime 最大时间
- * @param limit 删除条数,防止一次删除太多
+ * @param limit 删除条数,防止一次删除太多
* @return 删除条数
*/
@Delete("DELETE FROM infra_api_error_log WHERE create_time < #{createTime} LIMIT #{limit}")
- Integer deleteByCreateTimeLt(@Param("createTime") LocalDateTime createTime, @Param("limit")Integer limit);
+ Integer deleteByCreateTimeLt(@Param("createTime") LocalDateTime createTime, @Param("limit") Integer limit);
}
diff --git a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/enums/DictTypeConstants.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/DictTypeConstants.java
similarity index 92%
rename from yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/enums/DictTypeConstants.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/DictTypeConstants.java
index 36ad63d561..fcab9e6694 100644
--- a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/enums/DictTypeConstants.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/DictTypeConstants.java
@@ -7,6 +7,8 @@ package cn.iocoder.yudao.module.infra.enums;
*/
public interface DictTypeConstants {
+ String USER_TYPE = "user_type"; // 用户类型
+
String JOB_STATUS = "infra_job_status"; // 定时任务状态的枚举
String JOB_LOG_STATUS = "infra_job_log_status"; // 定时任务日志状态的枚举
diff --git a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/enums/ErrorCodeConstants.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/ErrorCodeConstants.java
similarity index 96%
rename from yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/enums/ErrorCodeConstants.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/ErrorCodeConstants.java
index 4cce820b77..2233f353e7 100644
--- a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/enums/ErrorCodeConstants.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/ErrorCodeConstants.java
@@ -65,7 +65,8 @@ public interface ErrorCodeConstants {
ErrorCode DEMO02_CATEGORY_NAME_DUPLICATE = new ErrorCode(1_001_201_005, "已经存在该名字的示例分类");
ErrorCode DEMO02_CATEGORY_PARENT_IS_CHILD = new ErrorCode(1_001_201_006, "不能设置自己的子示例分类为父示例分类");
ErrorCode DEMO03_STUDENT_NOT_EXISTS = new ErrorCode(1_001_201_007, "学生不存在");
- ErrorCode DEMO03_GRADE_NOT_EXISTS = new ErrorCode(1_001_201_008, "学生班级不存在");
- ErrorCode DEMO03_GRADE_EXISTS = new ErrorCode(1_001_201_009, "学生班级已存在");
+ ErrorCode DEMO03_COURSE_NOT_EXISTS = new ErrorCode(1_001_201_008, "学生课程不存在");
+ ErrorCode DEMO03_GRADE_NOT_EXISTS = new ErrorCode(1_001_201_009, "学生班级不存在");
+ ErrorCode DEMO03_GRADE_EXISTS = new ErrorCode(1_001_201_010, "学生班级已存在");
}
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenColumnHtmlTypeEnum.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenColumnHtmlTypeEnum.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenColumnHtmlTypeEnum.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenColumnHtmlTypeEnum.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenColumnListConditionEnum.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenColumnListConditionEnum.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenColumnListConditionEnum.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenColumnListConditionEnum.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenFrontTypeEnum.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenFrontTypeEnum.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenFrontTypeEnum.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenFrontTypeEnum.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenSceneEnum.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenSceneEnum.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenSceneEnum.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenSceneEnum.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenTemplateTypeEnum.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenTemplateTypeEnum.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenTemplateTypeEnum.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenTemplateTypeEnum.java
diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenVOTypeEnum.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenVOTypeEnum.java
new file mode 100644
index 0000000000..60b4790533
--- /dev/null
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/codegen/CodegenVOTypeEnum.java
@@ -0,0 +1,30 @@
+package cn.iocoder.yudao.module.infra.enums.codegen;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 代码生成的 VO 类型枚举
+ *
+ * 目前的作用:Controller 新增、修改、响应时,使用 VO 还是 DO
+ * 注意:不包括 Controller 的分页参数!
+ *
+ * @author 芋道源码
+ */
+@AllArgsConstructor
+@Getter
+public enum CodegenVOTypeEnum {
+
+ VO(10, "VO"),
+ DO(20, "DO");
+
+ /**
+ * 场景
+ */
+ private final Integer type;
+ /**
+ * 场景名
+ */
+ private final String name;
+
+}
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/enums/config/ConfigTypeEnum.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/config/ConfigTypeEnum.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/enums/config/ConfigTypeEnum.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/config/ConfigTypeEnum.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/enums/job/JobLogStatusEnum.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/job/JobLogStatusEnum.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/enums/job/JobLogStatusEnum.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/job/JobLogStatusEnum.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/enums/job/JobStatusEnum.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/job/JobStatusEnum.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/enums/job/JobStatusEnum.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/job/JobStatusEnum.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/enums/logger/ApiErrorLogProcessStatusEnum.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/logger/ApiErrorLogProcessStatusEnum.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/enums/logger/ApiErrorLogProcessStatusEnum.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/logger/ApiErrorLogProcessStatusEnum.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/enums/package-info.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/package-info.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/enums/package-info.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/enums/package-info.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/codegen/config/CodegenConfiguration.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/codegen/config/CodegenConfiguration.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/codegen/config/CodegenConfiguration.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/codegen/config/CodegenConfiguration.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/codegen/config/CodegenProperties.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/codegen/config/CodegenProperties.java
similarity index 73%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/codegen/config/CodegenProperties.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/codegen/config/CodegenProperties.java
index cfa1fa2fbe..b764f5a0cd 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/codegen/config/CodegenProperties.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/codegen/config/CodegenProperties.java
@@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.infra.framework.codegen.config;
import cn.iocoder.yudao.module.infra.enums.codegen.CodegenFrontTypeEnum;
+import cn.iocoder.yudao.module.infra.enums.codegen.CodegenVOTypeEnum;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.validation.annotation.Validated;
@@ -34,6 +35,20 @@ public class CodegenProperties {
@NotNull(message = "代码生成的前端类型不能为空")
private Integer frontType;
+ /**
+ * 代码生成的 VO 类型
+ *
+ * 枚举 {@link CodegenVOTypeEnum#getType()}
+ */
+ @NotNull(message = "代码生成的 VO 类型不能为空")
+ private Integer voType;
+
+ /**
+ * 是否生成批量删除接口
+ */
+ @NotNull(message = "是否生成批量删除接口不能为空")
+ private Boolean deleteBatchEnable;
+
/**
* 是否生成单元测试
*/
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/codegen/package-info.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/codegen/package-info.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/codegen/package-info.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/codegen/package-info.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/config/YudaoFileAutoConfiguration.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/config/YudaoFileAutoConfiguration.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/config/YudaoFileAutoConfiguration.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/config/YudaoFileAutoConfiguration.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/AbstractFileClient.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/AbstractFileClient.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/AbstractFileClient.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/AbstractFileClient.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClient.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClient.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClient.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClient.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientConfig.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientConfig.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientConfig.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientConfig.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientFactory.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientFactory.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientFactory.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientFactory.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientFactoryImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientFactoryImpl.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientFactoryImpl.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientFactoryImpl.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/db/DBFileClient.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/db/DBFileClient.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/db/DBFileClient.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/db/DBFileClient.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/db/DBFileClientConfig.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/db/DBFileClientConfig.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/db/DBFileClientConfig.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/db/DBFileClientConfig.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/ftp/FtpFileClient.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/ftp/FtpFileClient.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/ftp/FtpFileClient.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/ftp/FtpFileClient.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/ftp/FtpFileClientConfig.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/ftp/FtpFileClientConfig.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/ftp/FtpFileClientConfig.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/ftp/FtpFileClientConfig.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/local/LocalFileClient.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/local/LocalFileClient.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/local/LocalFileClient.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/local/LocalFileClient.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/local/LocalFileClientConfig.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/local/LocalFileClientConfig.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/local/LocalFileClientConfig.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/local/LocalFileClientConfig.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/FilePresignedUrlRespDTO.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/FilePresignedUrlRespDTO.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/FilePresignedUrlRespDTO.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/FilePresignedUrlRespDTO.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/S3FileClient.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/S3FileClient.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/S3FileClient.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/S3FileClient.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/S3FileClientConfig.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/S3FileClientConfig.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/S3FileClientConfig.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/S3FileClientConfig.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/sftp/SftpFileClient.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/sftp/SftpFileClient.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/sftp/SftpFileClient.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/sftp/SftpFileClient.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/sftp/SftpFileClientConfig.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/sftp/SftpFileClientConfig.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/sftp/SftpFileClientConfig.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/sftp/SftpFileClientConfig.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/enums/FileStorageEnum.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/enums/FileStorageEnum.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/enums/FileStorageEnum.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/enums/FileStorageEnum.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/utils/FileTypeUtils.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/utils/FileTypeUtils.java
similarity index 93%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/utils/FileTypeUtils.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/utils/FileTypeUtils.java
index 5f9308ec65..e2c607842f 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/utils/FileTypeUtils.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/utils/FileTypeUtils.java
@@ -21,7 +21,7 @@ import java.io.IOException;
@Slf4j
public class FileTypeUtils {
- private static final ThreadLocal TIKA = TransmittableThreadLocal.withInitial(Tika::new);
+ private static final Tika TIKA = new Tika();
/**
* 获得文件的 mineType,对于 doc,jar 等文件会有误差
@@ -31,7 +31,7 @@ public class FileTypeUtils {
*/
@SneakyThrows
public static String getMineType(byte[] data) {
- return TIKA.get().detect(data);
+ return TIKA.detect(data);
}
/**
@@ -41,7 +41,7 @@ public class FileTypeUtils {
* @return mineType 无法识别时会返回“application/octet-stream”
*/
public static String getMineType(String name) {
- return TIKA.get().detect(name);
+ return TIKA.detect(name);
}
/**
@@ -52,7 +52,7 @@ public class FileTypeUtils {
* @return mineType 无法识别时会返回“application/octet-stream”
*/
public static String getMineType(byte[] data, String name) {
- return TIKA.get().detect(data, name);
+ return TIKA.detect(data, name);
}
/**
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/package-info.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/package-info.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/package-info.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/package-info.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/monitor/config/AdminServerConfiguration.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/monitor/config/AdminServerConfiguration.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/monitor/config/AdminServerConfiguration.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/monitor/config/AdminServerConfiguration.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/monitor/package-info.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/monitor/package-info.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/monitor/package-info.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/monitor/package-info.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/monitor/《芋道 Spring Boot 监控工具 Admin 入门》.md b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/monitor/《芋道 Spring Boot 监控工具 Admin 入门》.md
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/monitor/《芋道 Spring Boot 监控工具 Admin 入门》.md
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/monitor/《芋道 Spring Boot 监控工具 Admin 入门》.md
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/package-info.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/package-info.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/package-info.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/package-info.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/security/config/SecurityConfiguration.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/security/config/SecurityConfiguration.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/security/config/SecurityConfiguration.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/security/config/SecurityConfiguration.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/security/core/package-info.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/security/core/package-info.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/security/core/package-info.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/security/core/package-info.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/web/config/InfraWebConfiguration.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/web/config/InfraWebConfiguration.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/web/config/InfraWebConfiguration.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/web/config/InfraWebConfiguration.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/web/package-info.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/web/package-info.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/web/package-info.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/web/package-info.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/job/job/JobLogCleanJob.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/job/job/JobLogCleanJob.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/job/job/JobLogCleanJob.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/job/job/JobLogCleanJob.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/job/logger/AccessLogCleanJob.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/job/logger/AccessLogCleanJob.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/job/logger/AccessLogCleanJob.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/job/logger/AccessLogCleanJob.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/job/logger/ErrorLogCleanJob.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/job/logger/ErrorLogCleanJob.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/job/logger/ErrorLogCleanJob.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/job/logger/ErrorLogCleanJob.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/mq/consumer/package-info.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/mq/consumer/package-info.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/mq/consumer/package-info.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/mq/consumer/package-info.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/mq/message/package-info.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/mq/message/package-info.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/mq/message/package-info.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/mq/message/package-info.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/mq/producer/package-info.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/mq/producer/package-info.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/mq/producer/package-info.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/mq/producer/package-info.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/package-info.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/package-info.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/package-info.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/package-info.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenService.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenService.java
similarity index 92%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenService.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenService.java
index 00e36aff6b..7adc9f7f1c 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenService.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenService.java
@@ -21,11 +21,11 @@ public interface CodegenService {
/**
* 基于数据库的表结构,创建代码生成器的表定义
*
- * @param userId 用户编号
- * @param reqVO 表信息
+ * @param author 作者
+ * @param reqVO 表信息
* @return 创建的表定义的编号数组
*/
- List createCodegenList(Long userId, CodegenCreateListReqVO reqVO);
+ List createCodegenList(String author, CodegenCreateListReqVO reqVO);
/**
* 更新数据库的表和字段定义
@@ -92,8 +92,8 @@ public interface CodegenService {
* 获得数据库自带的表定义列表
*
* @param dataSourceConfigId 数据源的配置编号
- * @param name 表名称
- * @param comment 表描述
+ * @param name 表名称
+ * @param comment 表描述
* @return 表定义列表
*/
List getDatabaseTableList(Long dataSourceConfigId, String name, String comment);
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java
similarity index 95%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java
index 005eb8a1b3..d00971a836 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java
@@ -18,7 +18,6 @@ import cn.iocoder.yudao.module.infra.framework.codegen.config.CodegenProperties;
import cn.iocoder.yudao.module.infra.service.codegen.inner.CodegenBuilder;
import cn.iocoder.yudao.module.infra.service.codegen.inner.CodegenEngine;
import cn.iocoder.yudao.module.infra.service.db.DatabaseTableService;
-import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import com.baomidou.mybatisplus.generator.config.po.TableField;
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
import com.google.common.annotations.VisibleForTesting;
@@ -52,9 +51,6 @@ public class CodegenServiceImpl implements CodegenService {
@Resource
private CodegenColumnMapper codegenColumnMapper;
- @Resource
- private AdminUserApi userApi;
-
@Resource
private CodegenBuilder codegenBuilder;
@Resource
@@ -65,21 +61,21 @@ public class CodegenServiceImpl implements CodegenService {
@Override
@Transactional(rollbackFor = Exception.class)
- public List createCodegenList(Long userId, CodegenCreateListReqVO reqVO) {
+ public List createCodegenList(String author, CodegenCreateListReqVO reqVO) {
List ids = new ArrayList<>(reqVO.getTableNames().size());
// 遍历添加。虽然效率会低一点,但是没必要做成完全批量,因为不会这么大量
- reqVO.getTableNames().forEach(tableName -> ids.add(createCodegen(userId, reqVO.getDataSourceConfigId(), tableName)));
+ reqVO.getTableNames().forEach(tableName -> ids.add(createCodegen(author, reqVO.getDataSourceConfigId(), tableName)));
return ids;
}
- private Long createCodegen(Long userId, Long dataSourceConfigId, String tableName) {
+ private Long createCodegen(String author, Long dataSourceConfigId, String tableName) {
// 从数据库中,获得数据库表结构
TableInfo tableInfo = databaseTableService.getTable(dataSourceConfigId, tableName);
// 导入
- return createCodegen0(userId, dataSourceConfigId, tableInfo);
+ return createCodegen0(author, dataSourceConfigId, tableInfo);
}
- private Long createCodegen0(Long userId, Long dataSourceConfigId, TableInfo tableInfo) {
+ private Long createCodegen0(String author, Long dataSourceConfigId, TableInfo tableInfo) {
// 校验导入的表和字段非空
validateTableInfo(tableInfo);
// 校验是否已经存在
@@ -93,7 +89,7 @@ public class CodegenServiceImpl implements CodegenService {
table.setDataSourceConfigId(dataSourceConfigId);
table.setScene(CodegenSceneEnum.ADMIN.getScene()); // 默认配置下,使用管理后台的模板
table.setFrontType(codegenProperties.getFrontType());
- table.setAuthor(userApi.getUser(userId).getNickname());
+ table.setAuthor(author);
codegenTableMapper.insert(table);
// 构建 CodegenColumnDO 数组,插入到 DB 中
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenBuilder.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenBuilder.java
similarity index 99%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenBuilder.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenBuilder.java
index b529c49818..06f0478f7c 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenBuilder.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenBuilder.java
@@ -214,7 +214,6 @@ public class CodegenBuilder {
// description、memo、remark
if (StrUtil.endWithAnyIgnoreCase(column.getColumnName(), "description", "memo", "remark")) {
column.setExample(randomEle(new String[]{"你猜", "随便", "你说的对"}));
- return;
}
}
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngine.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngine.java
similarity index 90%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngine.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngine.java
index d0ba5aad04..7f71022039 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngine.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngine.java
@@ -31,6 +31,7 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.codegen.CodegenTableDO;
import cn.iocoder.yudao.module.infra.enums.codegen.CodegenFrontTypeEnum;
import cn.iocoder.yudao.module.infra.enums.codegen.CodegenSceneEnum;
import cn.iocoder.yudao.module.infra.enums.codegen.CodegenTemplateTypeEnum;
+import cn.iocoder.yudao.module.infra.enums.codegen.CodegenVOTypeEnum;
import cn.iocoder.yudao.module.infra.framework.codegen.config.CodegenProperties;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableTable;
@@ -40,6 +41,7 @@ import jakarta.annotation.PostConstruct;
import jakarta.annotation.Resource;
import lombok.Setter;
import org.springframework.stereotype.Component;
+import org.springframework.util.ClassUtils;
import java.util.*;
@@ -64,7 +66,7 @@ public class CodegenEngine {
* value:生成的路径
*/
private static final Map SERVER_TEMPLATES = MapUtil.builder(new LinkedHashMap<>()) // 有序
- // Java module-biz Main
+ // Java module-biz(server) Main
.put(javaTemplatePath("controller/vo/pageReqVO"), javaModuleImplVOFilePath("PageReqVO"))
.put(javaTemplatePath("controller/vo/listReqVO"), javaModuleImplVOFilePath("ListReqVO"))
.put(javaTemplatePath("controller/vo/respVO"), javaModuleImplVOFilePath("RespVO"))
@@ -83,7 +85,7 @@ public class CodegenEngine {
javaModuleImplMainFilePath("service/${table.businessName}/${table.className}ServiceImpl"))
.put(javaTemplatePath("service/service"),
javaModuleImplMainFilePath("service/${table.businessName}/${table.className}Service"))
- // Java module-biz Test
+ // Java module-biz(server) Test
.put(javaTemplatePath("test/serviceTest"),
javaModuleImplTestFilePath("service/${table.businessName}/${table.className}ServiceImplTest"))
// Java module-api Main
@@ -194,6 +196,15 @@ public class CodegenEngine {
@Setter // 允许设置的原因,是因为单测需要手动改变
private Boolean jakartaEnable;
+ /**
+ * 是否为 yudao-cloud 项目,用于解决 Boot 和 Cloud 的 api 模块兼容性问题
+ *
+ * true - 需要有 yudao-module-xxx-api 模块
+ * false - 不需要有,使用 api、enum 包即可
+ */
+ @Setter
+ private Boolean cloudEnable;
+
/**
* 模板引擎,由 hutool 实现
*/
@@ -209,7 +220,11 @@ public class CodegenEngine {
config.setResourceMode(TemplateConfig.ResourceMode.CLASSPATH);
this.templateEngine = new VelocityEngine(config);
// 设置 javaxEnable,按照是否使用 JDK17 来判断
- this.jakartaEnable = SystemUtil.getJavaInfo().isJavaVersionAtLeast(1700); // 17.00 * 100
+ this.jakartaEnable = SystemUtil.getJavaInfo().isJavaVersionAtLeast(1700) // 17.00 * 100
+ && ClassUtils.isPresent("jakarta.annotation.Resource", ClassUtils.getDefaultClassLoader());
+ // 设置 cloudEnable,按照是否使用 Spring Cloud 来判断
+ this.cloudEnable = ClassUtils.isPresent("cn.iocoder.yudao.module.infra.framework.rpc.config.RpcConfiguration",
+ ClassUtils.getDefaultClassLoader());
}
@PostConstruct
@@ -220,6 +235,8 @@ public class CodegenEngine {
globalBindingMap.put("baseFrameworkPackage", codegenProperties.getBasePackage()
+ '.' + "framework"); // 用于后续获取测试类的 package 地址
globalBindingMap.put("jakartaPackage", jakartaEnable ? "jakarta" : "javax");
+ globalBindingMap.put("voType", codegenProperties.getVoType());
+ globalBindingMap.put("deleteBatchEnable", codegenProperties.getDeleteBatchEnable());
// 全局 Java Bean
globalBindingMap.put("CommonResultClassName", CommonResult.class.getName());
globalBindingMap.put("PageResultClassName", PageResult.class.getName());
@@ -241,14 +258,15 @@ public class CodegenEngine {
globalBindingMap.put("ApiAccessLogClassName", ApiAccessLog.class.getName());
globalBindingMap.put("OperateTypeEnumClassName", OperateTypeEnum.class.getName());
globalBindingMap.put("BeanUtils", BeanUtils.class.getName());
+ globalBindingMap.put("CollectionUtilsClassName", CollectionUtils.class.getName());
}
/**
* 生成代码
*
- * @param table 表定义
- * @param columns table 的字段定义数组
- * @param subTables 子表数组,当且仅当主子表时使用
+ * @param table 表定义
+ * @param columns table 的字段定义数组
+ * @param subTables 子表数组,当且仅当主子表时使用
* @param subColumnsList subTables 的字段定义数组
* @return 生成的代码,key 是路径,value 是对应代码
*/
@@ -366,14 +384,15 @@ public class CodegenEngine {
bindingMap.put("columns", columns);
bindingMap.put("primaryColumn", CollectionUtils.findFirst(columns, CodegenColumnDO::getPrimaryKey)); // 主键字段
bindingMap.put("sceneEnum", CodegenSceneEnum.valueOf(table.getScene()));
-
// className 相关
// 去掉指定前缀,将 TestDictType 转换成 DictType. 因为在 create 等方法后,不需要带上 Test 前缀
+ String className = table.getClassName();
String simpleClassName = equalsAnyIgnoreCase(table.getClassName(), table.getModuleName()) ? table.getClassName()
: removePrefix(table.getClassName(), upperFirst(table.getModuleName()));
+ String classNameVar = lowerFirst(simpleClassName);
bindingMap.put("simpleClassName", simpleClassName);
bindingMap.put("simpleClassName_underlineCase", toUnderlineCase(simpleClassName)); // 将 DictType 转换成 dict_type
- bindingMap.put("classNameVar", lowerFirst(simpleClassName)); // 将 DictType 转换成 dictType,用于变量
+ bindingMap.put("classNameVar", classNameVar); // 将 DictType 转换成 dictType,用于变量
// 将 DictType 转换成 dict-type
String simpleClassNameStrikeCase = toSymbolCase(simpleClassName, '-');
bindingMap.put("simpleClassName_strikeCase", simpleClassNameStrikeCase);
@@ -427,6 +446,22 @@ public class CodegenEngine {
bindingMap.put("subClassNameVars", subClassNameVars);
bindingMap.put("subSimpleClassName_strikeCases", subSimpleClassNameStrikeCases);
}
+
+ // 多个 vm 公用的 VO 变量
+ if (ObjectUtil.equal(codegenProperties.getVoType(), CodegenVOTypeEnum.VO.getType())) {
+ String prefixClass = CodegenSceneEnum.valueOf(table.getScene()).getPrefixClass();
+ bindingMap.put("saveReqVOClass", prefixClass + className + "SaveReqVO");
+ bindingMap.put("updateReqVOClass", prefixClass + className + "SaveReqVO");
+ bindingMap.put("respVOClass", prefixClass + className + "RespVO");
+ bindingMap.put("saveReqVOVar", "createReqVO");
+ bindingMap.put("updateReqVOVar", "updateReqVO");
+ } else if (ObjectUtil.equal(codegenProperties.getVoType(), CodegenVOTypeEnum.DO.getType())) {
+ bindingMap.put("saveReqVOClass", className + "DO");
+ bindingMap.put("updateReqVOClass", className + "DO");
+ bindingMap.put("respVOClass", className + "DO");
+ bindingMap.put("saveReqVOVar", classNameVar);
+ bindingMap.put("updateReqVOVar", classNameVar);
+ }
return bindingMap;
}
@@ -434,11 +469,24 @@ public class CodegenEngine {
Map templates = new LinkedHashMap<>();
templates.putAll(SERVER_TEMPLATES);
templates.putAll(FRONT_TEMPLATES.row(frontType));
+ // 如果是 Boot 项目,则不使用 api/server 模块
+ if (Boolean.FALSE.equals(cloudEnable)) {
+ SERVER_TEMPLATES.forEach((templatePath, filePath) -> {
+ filePath = StrUtil.replace(filePath, "/yudao-module-${table.moduleName}-api", "");
+ filePath = StrUtil.replace(filePath, "/yudao-module-${table.moduleName}-server", "");
+ templates.put(templatePath, filePath);
+ });
+ }
// 如果禁用单元测试,则移除对应的模版
if (Boolean.FALSE.equals(codegenProperties.getUnitTestEnable())) {
templates.remove(javaTemplatePath("test/serviceTest"));
templates.remove("codegen/sql/h2.vm");
}
+ // 如果禁用 VO 类型,则移除对应的模版
+ if (ObjectUtil.notEqual(codegenProperties.getVoType(), CodegenVOTypeEnum.VO.getType())) {
+ templates.remove(javaTemplatePath("controller/vo/respVO"));
+ templates.remove(javaTemplatePath("controller/vo/saveReqVO"));
+ }
return templates;
}
@@ -480,16 +528,16 @@ public class CodegenEngine {
private static String javaModuleImplVOFilePath(String path) {
return javaModuleFilePath("controller/${sceneEnum.basePackage}/${table.businessName}/" +
- "vo/${sceneEnum.prefixClass}${table.className}" + path, "biz", "main");
+ "vo/${sceneEnum.prefixClass}${table.className}" + path, "server", "main");
}
private static String javaModuleImplControllerFilePath() {
return javaModuleFilePath("controller/${sceneEnum.basePackage}/${table.businessName}/" +
- "${sceneEnum.prefixClass}${table.className}Controller", "biz", "main");
+ "${sceneEnum.prefixClass}${table.className}Controller", "server", "main");
}
private static String javaModuleImplMainFilePath(String path) {
- return javaModuleFilePath(path, "biz", "main");
+ return javaModuleFilePath(path, "server", "main");
}
private static String javaModuleApiMainFilePath(String path) {
@@ -497,7 +545,7 @@ public class CodegenEngine {
}
private static String javaModuleImplTestFilePath(String path) {
- return javaModuleFilePath(path, "biz", "test");
+ return javaModuleFilePath(path, "server", "test");
}
private static String javaModuleFilePath(String path, String module, String src) {
@@ -508,7 +556,7 @@ public class CodegenEngine {
private static String mapperXmlFilePath() {
return "yudao-module-${table.moduleName}/" + // 顶级模块
- "yudao-module-${table.moduleName}-biz/" + // 子模块
+ "yudao-module-${table.moduleName}-server/" + // 子模块
"src/main/resources/mapper/${table.businessName}/${table.className}Mapper.xml";
}
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/config/ConfigService.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/config/ConfigService.java
similarity index 99%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/config/ConfigService.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/config/ConfigService.java
index 8ff2fb1682..0087b83b92 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/config/ConfigService.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/config/ConfigService.java
@@ -4,7 +4,6 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigPageReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigSaveReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.config.ConfigDO;
-
import jakarta.validation.Valid;
/**
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceImpl.java
similarity index 99%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceImpl.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceImpl.java
index e01ae893e3..b0e5c53bef 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceImpl.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceImpl.java
@@ -8,12 +8,11 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.config.ConfigDO;
import cn.iocoder.yudao.module.infra.dal.mysql.config.ConfigMapper;
import cn.iocoder.yudao.module.infra.enums.config.ConfigTypeEnum;
import com.google.common.annotations.VisibleForTesting;
+import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
-import jakarta.annotation.Resource;
-
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.*;
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigService.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigService.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigService.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigService.java
index 747f80943b..bb741660e8 100755
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigService.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigService.java
@@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.infra.service.db;
import cn.iocoder.yudao.module.infra.controller.admin.db.vo.DataSourceConfigSaveReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.db.DataSourceConfigDO;
-
import jakarta.validation.Valid;
+
import java.util.List;
/**
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigServiceImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigServiceImpl.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigServiceImpl.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigServiceImpl.java
index 79ba102532..3e9ed4ff3c 100755
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigServiceImpl.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigServiceImpl.java
@@ -7,10 +7,10 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.db.DataSourceConfigDO;
import cn.iocoder.yudao.module.infra.dal.mysql.db.DataSourceConfigMapper;
import com.baomidou.dynamic.datasource.creator.DataSourceProperty;
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties;
+import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
-import jakarta.annotation.Resource;
import java.util.List;
import java.util.Objects;
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableService.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableService.java
similarity index 81%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableService.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableService.java
index 9fd2ee9d6d..c58b125c14 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableService.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableService.java
@@ -15,8 +15,8 @@ public interface DatabaseTableService {
* 获得表列表,基于表名称 + 表描述进行模糊匹配
*
* @param dataSourceConfigId 数据源配置的编号
- * @param nameLike 表名称,模糊匹配
- * @param commentLike 表描述,模糊匹配
+ * @param nameLike 表名称,模糊匹配
+ * @param commentLike 表描述,模糊匹配
* @return 表列表
*/
List getTableList(Long dataSourceConfigId, String nameLike, String commentLike);
@@ -25,7 +25,7 @@ public interface DatabaseTableService {
* 获得指定表名
*
* @param dataSourceConfigId 数据源配置的编号
- * @param tableName 表名称
+ * @param tableName 表名称
* @return 表
*/
TableInfo getTable(Long dataSourceConfigId, String tableName);
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableServiceImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableServiceImpl.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableServiceImpl.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableServiceImpl.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo01/Demo01ContactService.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo01/Demo01ContactService.java
similarity index 87%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo01/Demo01ContactService.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo01/Demo01ContactService.java
index efcb6e5d04..9c1c072afd 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo01/Demo01ContactService.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo01/Demo01ContactService.java
@@ -1,11 +1,12 @@
package cn.iocoder.yudao.module.infra.service.demo.demo01;
-import jakarta.validation.*;
-
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.infra.controller.admin.demo.demo01.vo.Demo01ContactPageReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.demo.demo01.vo.Demo01ContactSaveReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo01.Demo01ContactDO;
-import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import jakarta.validation.Valid;
+
+import java.util.List;
/**
* 示例联系人 Service 接口
@@ -36,6 +37,13 @@ public interface Demo01ContactService {
*/
void deleteDemo01Contact(Long id);
+ /**
+ * 批量删除示例联系人
+ *
+ * @param ids 编号
+ */
+ void deleteDemo0iContactListByIds(List ids);
+
/**
* 获得示例联系人
*
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo01/Demo01ContactServiceImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo01/Demo01ContactServiceImpl.java
similarity index 80%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo01/Demo01ContactServiceImpl.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo01/Demo01ContactServiceImpl.java
index f695e3dcb7..fb6e19f967 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo01/Demo01ContactServiceImpl.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo01/Demo01ContactServiceImpl.java
@@ -1,19 +1,20 @@
package cn.iocoder.yudao.module.infra.service.demo.demo01;
-import cn.iocoder.yudao.module.infra.controller.admin.demo.demo01.vo.Demo01ContactPageReqVO;
-import cn.iocoder.yudao.module.infra.controller.admin.demo.demo01.vo.Demo01ContactSaveReqVO;
-import org.springframework.stereotype.Service;
-import jakarta.annotation.Resource;
-import org.springframework.validation.annotation.Validated;
-
-import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo01.Demo01ContactDO;
+import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
-
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo01.vo.Demo01ContactPageReqVO;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo01.vo.Demo01ContactSaveReqVO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo01.Demo01ContactDO;
import cn.iocoder.yudao.module.infra.dal.mysql.demo.demo01.Demo01ContactMapper;
+import jakarta.annotation.Resource;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
-import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.*;
+import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.DEMO01_CONTACT_NOT_EXISTS;
/**
* 示例联系人 Service 实现类
@@ -53,6 +54,21 @@ public class Demo01ContactServiceImpl implements Demo01ContactService {
demo01ContactMapper.deleteById(id);
}
+ @Override
+ public void deleteDemo0iContactListByIds(List ids) {
+ // 校验存在
+ validateDemo01ContactExists(ids);
+ // 删除
+ demo01ContactMapper.deleteByIds(ids);
+ }
+
+ private void validateDemo01ContactExists(List ids) {
+ List list = demo01ContactMapper.selectByIds(ids);
+ if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
+ throw exception(DEMO01_CONTACT_NOT_EXISTS);
+ }
+ }
+
private void validateDemo01ContactExists(Long id) {
if (demo01ContactMapper.selectById(id) == null) {
throw exception(DEMO01_CONTACT_NOT_EXISTS);
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo02/Demo02CategoryService.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo02/Demo02CategoryService.java
similarity index 95%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo02/Demo02CategoryService.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo02/Demo02CategoryService.java
index 04d81601a7..e280f6f61a 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo02/Demo02CategoryService.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo02/Demo02CategoryService.java
@@ -1,11 +1,11 @@
package cn.iocoder.yudao.module.infra.service.demo.demo02;
-import java.util.*;
-import jakarta.validation.*;
-
import cn.iocoder.yudao.module.infra.controller.admin.demo.demo02.vo.Demo02CategoryListReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.demo.demo02.vo.Demo02CategorySaveReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo02.Demo02CategoryDO;
+import jakarta.validation.Valid;
+
+import java.util.List;
/**
* 示例分类 Service 接口
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo02/Demo02CategoryServiceImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo02/Demo02CategoryServiceImpl.java
similarity index 99%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo02/Demo02CategoryServiceImpl.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo02/Demo02CategoryServiceImpl.java
index 524d20c3ab..d9a9eddceb 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo02/Demo02CategoryServiceImpl.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo02/Demo02CategoryServiceImpl.java
@@ -5,10 +5,10 @@ import cn.iocoder.yudao.module.infra.controller.admin.demo.demo02.vo.Demo02Categ
import cn.iocoder.yudao.module.infra.controller.admin.demo.demo02.vo.Demo02CategorySaveReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo02.Demo02CategoryDO;
import cn.iocoder.yudao.module.infra.dal.mysql.demo.demo02.Demo02CategoryMapper;
+import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
-import jakarta.annotation.Resource;
import java.util.List;
import java.util.Objects;
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/Demo03StudentService.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/erp/Demo03StudentErpService.java
similarity index 81%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/Demo03StudentService.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/erp/Demo03StudentErpService.java
index 1e384a31f2..8a03586206 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/Demo03StudentService.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/erp/Demo03StudentErpService.java
@@ -1,14 +1,14 @@
-package cn.iocoder.yudao.module.infra.service.demo.demo03;
+package cn.iocoder.yudao.module.infra.service.demo.demo03.erp;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.vo.Demo03StudentPageReqVO;
-import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.vo.Demo03StudentSaveReqVO;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.erp.vo.Demo03StudentErpPageReqVO;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.erp.vo.Demo03StudentErpSaveReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03CourseDO;
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03GradeDO;
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03StudentDO;
-
import jakarta.validation.Valid;
+
import java.util.List;
/**
@@ -16,7 +16,7 @@ import java.util.List;
*
* @author 芋道源码
*/
-public interface Demo03StudentService {
+public interface Demo03StudentErpService {
/**
* 创建学生
@@ -24,14 +24,14 @@ public interface Demo03StudentService {
* @param createReqVO 创建信息
* @return 编号
*/
- Long createDemo03Student(@Valid Demo03StudentSaveReqVO createReqVO);
+ Long createDemo03Student(@Valid Demo03StudentErpSaveReqVO createReqVO);
/**
* 更新学生
*
* @param updateReqVO 更新信息
*/
- void updateDemo03Student(@Valid Demo03StudentSaveReqVO updateReqVO);
+ void updateDemo03Student(@Valid Demo03StudentErpSaveReqVO updateReqVO);
/**
* 删除学生
@@ -40,6 +40,13 @@ public interface Demo03StudentService {
*/
void deleteDemo03Student(Long id);
+ /**
+ * 批量删除学生
+ *
+ * @param ids 编号
+ */
+ void deleteDemo03StudentListByIds(List ids);
+
/**
* 获得学生
*
@@ -54,19 +61,10 @@ public interface Demo03StudentService {
* @param pageReqVO 分页查询
* @return 学生分页
*/
- PageResult getDemo03StudentPage(Demo03StudentPageReqVO pageReqVO);
-
+ PageResult getDemo03StudentPage(Demo03StudentErpPageReqVO pageReqVO);
// ==================== 子表(学生课程) ====================
- /**
- * 获得学生课程列表
- *
- * @param studentId 学生编号
- * @return 学生课程列表
- */
- List getDemo03CourseListByStudentId(Long studentId);
-
/**
* 获得学生课程分页
*
@@ -98,6 +96,13 @@ public interface Demo03StudentService {
*/
void deleteDemo03Course(Long id);
+ /**
+ * 批量删除学生课程
+ *
+ * @param ids 编号
+ */
+ void deleteDemo03CourseListByIds(List ids);
+
/**
* 获得学生课程
*
@@ -108,14 +113,6 @@ public interface Demo03StudentService {
// ==================== 子表(学生班级) ====================
- /**
- * 获得学生班级
- *
- * @param studentId 学生编号
- * @return 学生班级
- */
- Demo03GradeDO getDemo03GradeByStudentId(Long studentId);
-
/**
* 获得学生班级分页
*
@@ -147,6 +144,13 @@ public interface Demo03StudentService {
*/
void deleteDemo03Grade(Long id);
+ /**
+ * 批量删除学生班级
+ *
+ * @param ids 编号
+ */
+ void deleteDemo03GradeListByIds(List ids);
+
/**
* 获得学生班级
*
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/Demo03StudentServiceImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/erp/Demo03StudentErpServiceImpl.java
similarity index 50%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/Demo03StudentServiceImpl.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/erp/Demo03StudentErpServiceImpl.java
index 21f49490b6..a8317fd92b 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/Demo03StudentServiceImpl.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/erp/Demo03StudentErpServiceImpl.java
@@ -1,21 +1,22 @@
-package cn.iocoder.yudao.module.infra.service.demo.demo03;
+package cn.iocoder.yudao.module.infra.service.demo.demo03.erp;
+import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
-import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.vo.Demo03StudentPageReqVO;
-import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.vo.Demo03StudentSaveReqVO;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.erp.vo.Demo03StudentErpPageReqVO;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.erp.vo.Demo03StudentErpSaveReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03CourseDO;
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03GradeDO;
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03StudentDO;
-import cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.Demo03CourseMapper;
-import cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.Demo03GradeMapper;
-import cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.Demo03StudentMapper;
+import cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.erp.Demo03CourseErpMapper;
+import cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.erp.Demo03GradeErpMapper;
+import cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.erp.Demo03StudentErpMapper;
+import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
-import jakarta.annotation.Resource;
import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
@@ -28,41 +29,31 @@ import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.*;
*/
@Service
@Validated
-public class Demo03StudentServiceImpl implements Demo03StudentService {
+public class Demo03StudentErpServiceImpl implements Demo03StudentErpService {
@Resource
- private Demo03StudentMapper demo03StudentMapper;
+ private Demo03StudentErpMapper demo03StudentErpMapper;
@Resource
- private Demo03CourseMapper demo03CourseMapper;
+ private Demo03CourseErpMapper demo03CourseErpMapper;
@Resource
- private Demo03GradeMapper demo03GradeMapper;
+ private Demo03GradeErpMapper demo03GradeErpMapper;
@Override
- @Transactional(rollbackFor = Exception.class)
- public Long createDemo03Student(Demo03StudentSaveReqVO createReqVO) {
+ public Long createDemo03Student(Demo03StudentErpSaveReqVO createReqVO) {
// 插入
Demo03StudentDO demo03Student = BeanUtils.toBean(createReqVO, Demo03StudentDO.class);
- demo03StudentMapper.insert(demo03Student);
-
- // 插入子表
- createDemo03CourseList(demo03Student.getId(), createReqVO.getDemo03Courses());
- createDemo03Grade(demo03Student.getId(), createReqVO.getDemo03Grade());
+ demo03StudentErpMapper.insert(demo03Student);
// 返回
return demo03Student.getId();
}
@Override
- @Transactional(rollbackFor = Exception.class)
- public void updateDemo03Student(Demo03StudentSaveReqVO updateReqVO) {
+ public void updateDemo03Student(Demo03StudentErpSaveReqVO updateReqVO) {
// 校验存在
validateDemo03StudentExists(updateReqVO.getId());
// 更新
Demo03StudentDO updateObj = BeanUtils.toBean(updateReqVO, Demo03StudentDO.class);
- demo03StudentMapper.updateById(updateObj);
-
- // 更新子表
- updateDemo03CourseList(updateReqVO.getId(), updateReqVO.getDemo03Courses());
- updateDemo03Grade(updateReqVO.getId(), updateReqVO.getDemo03Grade());
+ demo03StudentErpMapper.updateById(updateObj);
}
@Override
@@ -71,119 +62,117 @@ public class Demo03StudentServiceImpl implements Demo03StudentService {
// 校验存在
validateDemo03StudentExists(id);
// 删除
- demo03StudentMapper.deleteById(id);
+ demo03StudentErpMapper.deleteById(id);
// 删除子表
deleteDemo03CourseByStudentId(id);
deleteDemo03GradeByStudentId(id);
}
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void deleteDemo03StudentListByIds(List ids) {
+ // 校验存在
+ validateDemo03StudentExists(ids);
+ // 删除
+ demo03StudentErpMapper.deleteByIds(ids);
+
+ // 删除子表
+ deleteDemo03CourseByStudentIds(ids);
+ deleteDemo03GradeByStudentIds(ids);
+ }
+
+ private void validateDemo03StudentExists(List ids) {
+ List list = demo03StudentErpMapper.selectByIds(ids);
+ if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
+ throw exception(DEMO03_STUDENT_NOT_EXISTS);
+ }
+ }
+
private void validateDemo03StudentExists(Long id) {
- if (demo03StudentMapper.selectById(id) == null) {
+ if (demo03StudentErpMapper.selectById(id) == null) {
throw exception(DEMO03_STUDENT_NOT_EXISTS);
}
}
@Override
public Demo03StudentDO getDemo03Student(Long id) {
- return demo03StudentMapper.selectById(id);
+ return demo03StudentErpMapper.selectById(id);
}
@Override
- public PageResult getDemo03StudentPage(Demo03StudentPageReqVO pageReqVO) {
- return demo03StudentMapper.selectPage(pageReqVO);
+ public PageResult getDemo03StudentPage(Demo03StudentErpPageReqVO pageReqVO) {
+ return demo03StudentErpMapper.selectPage(pageReqVO);
}
// ==================== 子表(学生课程) ====================
- @Override
- public List getDemo03CourseListByStudentId(Long studentId) {
- return demo03CourseMapper.selectListByStudentId(studentId);
- }
-
- private void createDemo03CourseList(Long studentId, List list) {
- if (list != null) {
- list.forEach(o -> o.setStudentId(studentId));
- }
- demo03CourseMapper.insertBatch(list);
- }
-
- private void updateDemo03CourseList(Long studentId, List list) {
- deleteDemo03CourseByStudentId(studentId);
- list.forEach(o -> o.setId(null).setUpdater(null).setUpdateTime(null)); // 解决更新情况下:1)id 冲突;2)updateTime 不更新
- createDemo03CourseList(studentId, list);
- }
-
- private void deleteDemo03CourseByStudentId(Long studentId) {
- demo03CourseMapper.deleteByStudentId(studentId);
- }
-
@Override
public PageResult getDemo03CoursePage(PageParam pageReqVO, Long studentId) {
- return demo03CourseMapper.selectPage(pageReqVO, studentId);
+ return demo03CourseErpMapper.selectPage(pageReqVO, studentId);
}
@Override
public Long createDemo03Course(Demo03CourseDO demo03Course) {
- demo03CourseMapper.insert(demo03Course);
+ demo03CourseErpMapper.insert(demo03Course);
return demo03Course.getId();
}
@Override
public void updateDemo03Course(Demo03CourseDO demo03Course) {
- demo03CourseMapper.updateById(demo03Course);
+ // 校验存在
+ validateDemo03CourseExists(demo03Course.getId());
+ // 更新
+ demo03Course.clean();
+ demo03CourseErpMapper.updateById(demo03Course);
}
@Override
public void deleteDemo03Course(Long id) {
- demo03CourseMapper.deleteById(id);
+ // 删除
+ demo03CourseErpMapper.deleteById(id);
+ }
+
+ @Override
+ public void deleteDemo03CourseListByIds(List ids) {
+ // 删除
+ demo03CourseErpMapper.deleteByIds(ids);
}
@Override
public Demo03CourseDO getDemo03Course(Long id) {
- return demo03CourseMapper.selectById(id);
+ return demo03CourseErpMapper.selectById(id);
+ }
+
+ private void validateDemo03CourseExists(Long id) {
+ if (demo03CourseErpMapper.selectById(id) == null) {
+ throw exception(DEMO03_COURSE_NOT_EXISTS);
+ }
+ }
+
+ private void deleteDemo03CourseByStudentId(Long studentId) {
+ demo03CourseErpMapper.deleteByStudentId(studentId);
+ }
+
+ private void deleteDemo03CourseByStudentIds(List studentIds) {
+ demo03CourseErpMapper.deleteByStudentIds(studentIds);
}
// ==================== 子表(学生班级) ====================
- @Override
- public Demo03GradeDO getDemo03GradeByStudentId(Long studentId) {
- return demo03GradeMapper.selectByStudentId(studentId);
- }
-
- private void createDemo03Grade(Long studentId, Demo03GradeDO demo03Grade) {
- if (demo03Grade == null) {
- return;
- }
- demo03Grade.setStudentId(studentId);
- demo03GradeMapper.insert(demo03Grade);
- }
-
- private void updateDemo03Grade(Long studentId, Demo03GradeDO demo03Grade) {
- if (demo03Grade == null) {
- return;
- }
- demo03Grade.setStudentId(studentId);
- demo03Grade.setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新
- demo03GradeMapper.insertOrUpdate(demo03Grade);
- }
-
- private void deleteDemo03GradeByStudentId(Long studentId) {
- demo03GradeMapper.deleteByStudentId(studentId);
- }
-
@Override
public PageResult getDemo03GradePage(PageParam pageReqVO, Long studentId) {
- return demo03GradeMapper.selectPage(pageReqVO, studentId);
+ return demo03GradeErpMapper.selectPage(pageReqVO, studentId);
}
@Override
public Long createDemo03Grade(Demo03GradeDO demo03Grade) {
// 校验是否已经存在
- if (demo03GradeMapper.selectByStudentId(demo03Grade.getStudentId()) != null) {
+ if (demo03GradeErpMapper.selectByStudentId(demo03Grade.getStudentId()) != null) {
throw exception(DEMO03_GRADE_EXISTS);
}
- demo03GradeMapper.insert(demo03Grade);
+ // 插入
+ demo03GradeErpMapper.insert(demo03Grade);
return demo03Grade.getId();
}
@@ -192,26 +181,39 @@ public class Demo03StudentServiceImpl implements Demo03StudentService {
// 校验存在
validateDemo03GradeExists(demo03Grade.getId());
// 更新
- demo03GradeMapper.updateById(demo03Grade);
+ demo03Grade.clean();
+ demo03GradeErpMapper.updateById(demo03Grade);
}
@Override
public void deleteDemo03Grade(Long id) {
- // 校验存在
- validateDemo03GradeExists(id);
// 删除
- demo03GradeMapper.deleteById(id);
+ demo03GradeErpMapper.deleteById(id);
+ }
+
+ @Override
+ public void deleteDemo03GradeListByIds(List ids) {
+ // 删除
+ demo03GradeErpMapper.deleteByIds(ids);
}
@Override
public Demo03GradeDO getDemo03Grade(Long id) {
- return demo03GradeMapper.selectById(id);
+ return demo03GradeErpMapper.selectById(id);
}
private void validateDemo03GradeExists(Long id) {
- if (demo03GradeMapper.selectById(id) == null) {
+ if (demo03GradeErpMapper.selectById(id) == null) {
throw exception(DEMO03_GRADE_NOT_EXISTS);
}
}
+ private void deleteDemo03GradeByStudentId(Long studentId) {
+ demo03GradeErpMapper.deleteByStudentId(studentId);
+ }
+
+ private void deleteDemo03GradeByStudentIds(List studentIds) {
+ demo03GradeErpMapper.deleteByStudentIds(studentIds);
+ }
+
}
\ No newline at end of file
diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/inner/Demo03StudentInnerService.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/inner/Demo03StudentInnerService.java
new file mode 100644
index 0000000000..8c616022eb
--- /dev/null
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/inner/Demo03StudentInnerService.java
@@ -0,0 +1,85 @@
+package cn.iocoder.yudao.module.infra.service.demo.demo03.inner;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.inner.vo.Demo03StudentInnerPageReqVO;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.inner.vo.Demo03StudentInnerSaveReqVO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03CourseDO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03GradeDO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03StudentDO;
+import jakarta.validation.Valid;
+
+import java.util.List;
+
+/**
+ * 学生 Service 接口
+ *
+ * @author 芋道源码
+ */
+public interface Demo03StudentInnerService {
+
+ /**
+ * 创建学生
+ *
+ * @param createReqVO 创建信息
+ * @return 编号
+ */
+ Long createDemo03Student(@Valid Demo03StudentInnerSaveReqVO createReqVO);
+
+ /**
+ * 更新学生
+ *
+ * @param updateReqVO 更新信息
+ */
+ void updateDemo03Student(@Valid Demo03StudentInnerSaveReqVO updateReqVO);
+
+ /**
+ * 删除学生
+ *
+ * @param id 编号
+ */
+ void deleteDemo03Student(Long id);
+
+ /**
+ * 批量删除学生
+ *
+ * @param ids 编号
+ */
+ void deleteDemo03StudentListByIds(List ids);
+
+ /**
+ * 获得学生
+ *
+ * @param id 编号
+ * @return 学生
+ */
+ Demo03StudentDO getDemo03Student(Long id);
+
+ /**
+ * 获得学生分页
+ *
+ * @param pageReqVO 分页查询
+ * @return 学生分页
+ */
+ PageResult getDemo03StudentPage(Demo03StudentInnerPageReqVO pageReqVO);
+
+ // ==================== 子表(学生课程) ====================
+
+ /**
+ * 获得学生课程列表
+ *
+ * @param studentId 学生编号
+ * @return 学生课程列表
+ */
+ List getDemo03CourseListByStudentId(Long studentId);
+
+ // ==================== 子表(学生班级) ====================
+
+ /**
+ * 获得学生班级
+ *
+ * @param studentId 学生编号
+ * @return 学生班级
+ */
+ Demo03GradeDO getDemo03GradeByStudentId(Long studentId);
+
+}
\ No newline at end of file
diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/inner/Demo03StudentInnerServiceImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/inner/Demo03StudentInnerServiceImpl.java
new file mode 100644
index 0000000000..6faf857030
--- /dev/null
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/inner/Demo03StudentInnerServiceImpl.java
@@ -0,0 +1,194 @@
+package cn.iocoder.yudao.module.infra.service.demo.demo03.inner;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.inner.vo.Demo03StudentInnerPageReqVO;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.inner.vo.Demo03StudentInnerSaveReqVO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03CourseDO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03GradeDO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03StudentDO;
+import cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.inner.Demo03CourseInnerMapper;
+import cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.inner.Demo03GradeInnerMapper;
+import cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.inner.Demo03StudentInnerMapper;
+import jakarta.annotation.Resource;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.validation.annotation.Validated;
+
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
+import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
+import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.DEMO03_STUDENT_NOT_EXISTS;
+
+/**
+ * 学生 Service 实现类
+ *
+ * @author 芋道源码
+ */
+@Service
+@Validated
+public class Demo03StudentInnerServiceImpl implements Demo03StudentInnerService {
+
+ @Resource
+ private Demo03StudentInnerMapper demo03StudentInnerMapper;
+ @Resource
+ private Demo03CourseInnerMapper demo03CourseInnerMapper;
+ @Resource
+ private Demo03GradeInnerMapper demo03GradeInnerMapper;
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public Long createDemo03Student(Demo03StudentInnerSaveReqVO createReqVO) {
+ // 插入
+ Demo03StudentDO demo03Student = BeanUtils.toBean(createReqVO, Demo03StudentDO.class);
+ demo03StudentInnerMapper.insert(demo03Student);
+
+ // 插入子表
+ createDemo03CourseList(demo03Student.getId(), createReqVO.getDemo03Courses());
+ createDemo03Grade(demo03Student.getId(), createReqVO.getDemo03Grade());
+ // 返回
+ return demo03Student.getId();
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void updateDemo03Student(Demo03StudentInnerSaveReqVO updateReqVO) {
+ // 校验存在
+ validateDemo03StudentExists(updateReqVO.getId());
+ // 更新
+ Demo03StudentDO updateObj = BeanUtils.toBean(updateReqVO, Demo03StudentDO.class);
+ demo03StudentInnerMapper.updateById(updateObj);
+
+ // 更新子表
+ updateDemo03CourseList(updateReqVO.getId(), updateReqVO.getDemo03Courses());
+ updateDemo03Grade(updateReqVO.getId(), updateReqVO.getDemo03Grade());
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void deleteDemo03Student(Long id) {
+ // 校验存在
+ validateDemo03StudentExists(id);
+ // 删除
+ demo03StudentInnerMapper.deleteById(id);
+
+ // 删除子表
+ deleteDemo03CourseByStudentId(id);
+ deleteDemo03GradeByStudentId(id);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void deleteDemo03StudentListByIds(List ids) {
+ // 校验存在
+ validateDemo03StudentExists(ids);
+ // 删除
+ demo03StudentInnerMapper.deleteByIds(ids);
+
+ // 删除子表
+ deleteDemo03CourseByStudentIds(ids);
+ deleteDemo03GradeByStudentIds(ids);
+ }
+
+ private void validateDemo03StudentExists(List ids) {
+ List list = demo03StudentInnerMapper.selectByIds(ids);
+ if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
+ throw exception(DEMO03_STUDENT_NOT_EXISTS);
+ }
+ }
+
+ private void validateDemo03StudentExists(Long id) {
+ if (demo03StudentInnerMapper.selectById(id) == null) {
+ throw exception(DEMO03_STUDENT_NOT_EXISTS);
+ }
+ }
+
+ @Override
+ public Demo03StudentDO getDemo03Student(Long id) {
+ return demo03StudentInnerMapper.selectById(id);
+ }
+
+ @Override
+ public PageResult getDemo03StudentPage(Demo03StudentInnerPageReqVO pageReqVO) {
+ return demo03StudentInnerMapper.selectPage(pageReqVO);
+ }
+
+ // ==================== 子表(学生课程) ====================
+
+ @Override
+ public List getDemo03CourseListByStudentId(Long studentId) {
+ return demo03CourseInnerMapper.selectListByStudentId(studentId);
+ }
+
+ private void createDemo03CourseList(Long studentId, List list) {
+ list.forEach(o -> o.setStudentId(studentId).clean());
+ demo03CourseInnerMapper.insertBatch(list);
+ }
+
+ private void updateDemo03CourseList(Long studentId, List list) {
+ list.forEach(o -> o.setStudentId(studentId).clean());
+ List oldList = demo03CourseInnerMapper.selectListByStudentId(studentId);
+ List> diffList = diffList(oldList, list, (oldVal, newVal) -> {
+ boolean same = ObjectUtil.equal(oldVal.getId(), newVal.getId());
+ if (same) {
+ newVal.setId(oldVal.getId());
+ }
+ return same;
+ });
+
+ // 第二步,批量添加、修改、删除
+ if (CollUtil.isNotEmpty(diffList.get(0))) {
+ demo03CourseInnerMapper.insertBatch(diffList.get(0));
+ }
+ if (CollUtil.isNotEmpty(diffList.get(1))) {
+ demo03CourseInnerMapper.updateBatch(diffList.get(1));
+ }
+ if (CollUtil.isNotEmpty(diffList.get(2))) {
+ demo03CourseInnerMapper.deleteByIds(convertList(diffList.get(2), Demo03CourseDO::getId));
+ }
+ }
+
+ private void deleteDemo03CourseByStudentId(Long studentId) {
+ demo03CourseInnerMapper.deleteByStudentId(studentId);
+ }
+
+ private void deleteDemo03CourseByStudentIds(List studentIds) {
+ demo03CourseInnerMapper.deleteByStudentIds(studentIds);
+ }
+
+ // ==================== 子表(学生班级) ====================
+
+ @Override
+ public Demo03GradeDO getDemo03GradeByStudentId(Long studentId) {
+ return demo03GradeInnerMapper.selectByStudentId(studentId);
+ }
+
+ private void createDemo03Grade(Long studentId, Demo03GradeDO demo03Grade) {
+ if (demo03Grade == null) {
+ return;
+ }
+ demo03Grade.setStudentId(studentId);
+ demo03GradeInnerMapper.insert(demo03Grade);
+ }
+
+ private void updateDemo03Grade(Long studentId, Demo03GradeDO demo03Grade) {
+ if (demo03Grade == null) {
+ return;
+ }
+ demo03Grade.setStudentId(studentId).clean();
+ demo03GradeInnerMapper.insertOrUpdate(demo03Grade);
+ }
+
+ private void deleteDemo03GradeByStudentId(Long studentId) {
+ demo03GradeInnerMapper.deleteByStudentId(studentId);
+ }
+
+ private void deleteDemo03GradeByStudentIds(List studentIds) {
+ demo03GradeInnerMapper.deleteByStudentIds(studentIds);
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/normal/Demo03StudentNormalService.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/normal/Demo03StudentNormalService.java
new file mode 100644
index 0000000000..5833509ddb
--- /dev/null
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/normal/Demo03StudentNormalService.java
@@ -0,0 +1,85 @@
+package cn.iocoder.yudao.module.infra.service.demo.demo03.normal;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.normal.vo.Demo03StudentNormalPageReqVO;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.normal.vo.Demo03StudentNormalSaveReqVO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03CourseDO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03GradeDO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03StudentDO;
+import jakarta.validation.Valid;
+
+import java.util.List;
+
+/**
+ * 学生 Service 接口
+ *
+ * @author 芋道源码
+ */
+public interface Demo03StudentNormalService {
+
+ /**
+ * 创建学生
+ *
+ * @param createReqVO 创建信息
+ * @return 编号
+ */
+ Long createDemo03Student(@Valid Demo03StudentNormalSaveReqVO createReqVO);
+
+ /**
+ * 更新学生
+ *
+ * @param updateReqVO 更新信息
+ */
+ void updateDemo03Student(@Valid Demo03StudentNormalSaveReqVO updateReqVO);
+
+ /**
+ * 删除学生
+ *
+ * @param id 编号
+ */
+ void deleteDemo03Student(Long id);
+
+ /**
+ * 批量删除学生
+ *
+ * @param ids 编号
+ */
+ void deleteDemo03StudentListByIds(List ids);
+
+ /**
+ * 获得学生
+ *
+ * @param id 编号
+ * @return 学生
+ */
+ Demo03StudentDO getDemo03Student(Long id);
+
+ /**
+ * 获得学生分页
+ *
+ * @param pageReqVO 分页查询
+ * @return 学生分页
+ */
+ PageResult getDemo03StudentPage(Demo03StudentNormalPageReqVO pageReqVO);
+
+ // ==================== 子表(学生课程) ====================
+
+ /**
+ * 获得学生课程列表
+ *
+ * @param studentId 学生编号
+ * @return 学生课程列表
+ */
+ List getDemo03CourseListByStudentId(Long studentId);
+
+ // ==================== 子表(学生班级) ====================
+
+ /**
+ * 获得学生班级
+ *
+ * @param studentId 学生编号
+ * @return 学生班级
+ */
+ Demo03GradeDO getDemo03GradeByStudentId(Long studentId);
+
+}
\ No newline at end of file
diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/normal/Demo03StudentNormalServiceImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/normal/Demo03StudentNormalServiceImpl.java
new file mode 100644
index 0000000000..ad3a663827
--- /dev/null
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/normal/Demo03StudentNormalServiceImpl.java
@@ -0,0 +1,194 @@
+package cn.iocoder.yudao.module.infra.service.demo.demo03.normal;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.normal.vo.Demo03StudentNormalPageReqVO;
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.normal.vo.Demo03StudentNormalSaveReqVO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03CourseDO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03GradeDO;
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03StudentDO;
+import cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.normal.Demo03CourseNormalMapper;
+import cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.normal.Demo03GradeNormalMapper;
+import cn.iocoder.yudao.module.infra.dal.mysql.demo.demo03.normal.Demo03StudentNormalMapper;
+import jakarta.annotation.Resource;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.validation.annotation.Validated;
+
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
+import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
+import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.DEMO03_STUDENT_NOT_EXISTS;
+
+/**
+ * 学生 Service 实现类
+ *
+ * @author 芋道源码
+ */
+@Service
+@Validated
+public class Demo03StudentNormalServiceImpl implements Demo03StudentNormalService {
+
+ @Resource
+ private Demo03StudentNormalMapper demo03StudentNormalMapper;
+ @Resource
+ private Demo03CourseNormalMapper demo03CourseNormalMapper;
+ @Resource
+ private Demo03GradeNormalMapper demo03GradeNormalMapper;
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public Long createDemo03Student(Demo03StudentNormalSaveReqVO createReqVO) {
+ // 插入
+ Demo03StudentDO demo03Student = BeanUtils.toBean(createReqVO, Demo03StudentDO.class);
+ demo03StudentNormalMapper.insert(demo03Student);
+
+ // 插入子表
+ createDemo03CourseList(demo03Student.getId(), createReqVO.getDemo03Courses());
+ createDemo03Grade(demo03Student.getId(), createReqVO.getDemo03Grade());
+ // 返回
+ return demo03Student.getId();
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void updateDemo03Student(Demo03StudentNormalSaveReqVO updateReqVO) {
+ // 校验存在
+ validateDemo03StudentExists(updateReqVO.getId());
+ // 更新
+ Demo03StudentDO updateObj = BeanUtils.toBean(updateReqVO, Demo03StudentDO.class);
+ demo03StudentNormalMapper.updateById(updateObj);
+
+ // 更新子表
+ updateDemo03CourseList(updateReqVO.getId(), updateReqVO.getDemo03Courses());
+ updateDemo03Grade(updateReqVO.getId(), updateReqVO.getDemo03Grade());
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void deleteDemo03Student(Long id) {
+ // 校验存在
+ validateDemo03StudentExists(id);
+ // 删除
+ demo03StudentNormalMapper.deleteById(id);
+
+ // 删除子表
+ deleteDemo03CourseByStudentId(id);
+ deleteDemo03GradeByStudentId(id);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void deleteDemo03StudentListByIds(List ids) {
+ // 校验存在
+ validateDemo03StudentExists(ids);
+ // 删除
+ demo03StudentNormalMapper.deleteByIds(ids);
+
+ // 删除子表
+ deleteDemo03CourseByStudentIds(ids);
+ deleteDemo03GradeByStudentIds(ids);
+ }
+
+ private void validateDemo03StudentExists(List ids) {
+ List list = demo03StudentNormalMapper.selectByIds(ids);
+ if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
+ throw exception(DEMO03_STUDENT_NOT_EXISTS);
+ }
+ }
+
+ private void validateDemo03StudentExists(Long id) {
+ if (demo03StudentNormalMapper.selectById(id) == null) {
+ throw exception(DEMO03_STUDENT_NOT_EXISTS);
+ }
+ }
+
+ @Override
+ public Demo03StudentDO getDemo03Student(Long id) {
+ return demo03StudentNormalMapper.selectById(id);
+ }
+
+ @Override
+ public PageResult getDemo03StudentPage(Demo03StudentNormalPageReqVO pageReqVO) {
+ return demo03StudentNormalMapper.selectPage(pageReqVO);
+ }
+
+ // ==================== 子表(学生课程) ====================
+
+ @Override
+ public List getDemo03CourseListByStudentId(Long studentId) {
+ return demo03CourseNormalMapper.selectListByStudentId(studentId);
+ }
+
+ private void createDemo03CourseList(Long studentId, List list) {
+ list.forEach(o -> o.setStudentId(studentId).clean());
+ demo03CourseNormalMapper.insertBatch(list);
+ }
+
+ private void updateDemo03CourseList(Long studentId, List list) {
+ list.forEach(o -> o.setStudentId(studentId).clean());
+ List oldList = demo03CourseNormalMapper.selectListByStudentId(studentId);
+ List> diffList = diffList(oldList, list, (oldVal, newVal) -> {
+ boolean same = ObjectUtil.equal(oldVal.getId(), newVal.getId());
+ if (same) {
+ newVal.setId(oldVal.getId());
+ }
+ return same;
+ });
+
+ // 第二步,批量添加、修改、删除
+ if (CollUtil.isNotEmpty(diffList.get(0))) {
+ demo03CourseNormalMapper.insertBatch(diffList.get(0));
+ }
+ if (CollUtil.isNotEmpty(diffList.get(1))) {
+ demo03CourseNormalMapper.updateBatch(diffList.get(1));
+ }
+ if (CollUtil.isNotEmpty(diffList.get(2))) {
+ demo03CourseNormalMapper.deleteByIds(convertList(diffList.get(2), Demo03CourseDO::getId));
+ }
+ }
+
+ private void deleteDemo03CourseByStudentId(Long studentId) {
+ demo03CourseNormalMapper.deleteByStudentId(studentId);
+ }
+
+ private void deleteDemo03CourseByStudentIds(List studentIds) {
+ demo03CourseNormalMapper.deleteByStudentIds(studentIds);
+ }
+
+ // ==================== 子表(学生班级) ====================
+
+ @Override
+ public Demo03GradeDO getDemo03GradeByStudentId(Long studentId) {
+ return demo03GradeNormalMapper.selectByStudentId(studentId);
+ }
+
+ private void createDemo03Grade(Long studentId, Demo03GradeDO demo03Grade) {
+ if (demo03Grade == null) {
+ return;
+ }
+ demo03Grade.setStudentId(studentId);
+ demo03GradeNormalMapper.insert(demo03Grade);
+ }
+
+ private void updateDemo03Grade(Long studentId, Demo03GradeDO demo03Grade) {
+ if (demo03Grade == null) {
+ return;
+ }
+ demo03Grade.setStudentId(studentId).clean();
+ demo03GradeNormalMapper.insertOrUpdate(demo03Grade);
+ }
+
+ private void deleteDemo03GradeByStudentId(Long studentId) {
+ demo03GradeNormalMapper.deleteByStudentId(studentId);
+ }
+
+ private void deleteDemo03GradeByStudentIds(List studentIds) {
+ demo03GradeNormalMapper.deleteByStudentIds(studentIds);
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigService.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigService.java
similarity index 99%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigService.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigService.java
index 95ae94a016..b2bf491441 100755
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigService.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigService.java
@@ -1,11 +1,10 @@
package cn.iocoder.yudao.module.infra.service.file;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient;
import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigPageReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigSaveReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileConfigDO;
-
+import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient;
import jakarta.validation.Valid;
/**
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImpl.java
similarity index 99%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImpl.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImpl.java
index 37e2c46529..4e7bf47cc1 100755
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImpl.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImpl.java
@@ -5,25 +5,25 @@ import cn.hutool.core.util.IdUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
-import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient;
-import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientConfig;
-import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientFactory;
-import cn.iocoder.yudao.module.infra.framework.file.core.enums.FileStorageEnum;
import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigPageReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigSaveReqVO;
import cn.iocoder.yudao.module.infra.convert.file.FileConfigConvert;
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileConfigDO;
import cn.iocoder.yudao.module.infra.dal.mysql.file.FileConfigMapper;
+import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient;
+import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientConfig;
+import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientFactory;
+import cn.iocoder.yudao.module.infra.framework.file.core.enums.FileStorageEnum;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
+import jakarta.annotation.Resource;
+import jakarta.validation.Validator;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
-import jakarta.annotation.Resource;
-import jakarta.validation.Validator;
import java.time.Duration;
import java.util.Map;
import java.util.Objects;
@@ -137,7 +137,7 @@ public class FileConfigServiceImpl implements FileConfigService {
/**
* 清空指定文件配置
*
- * @param id 配置编号
+ * @param id 配置编号
* @param master 是否主配置
*/
private void clearCache(Long id, Boolean master) {
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java
similarity index 91%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java
index 247fe5f62a..01c2bba720 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java
@@ -25,10 +25,10 @@ public interface FileService {
/**
* 保存文件,并返回文件的访问路径
*
- * @param content 文件内容
- * @param name 文件名称,允许空
+ * @param content 文件内容
+ * @param name 文件名称,允许空
* @param directory 目录,允许空
- * @param type 文件的 MIME 类型,允许空
+ * @param type 文件的 MIME 类型,允许空
* @return 文件路径
*/
String createFile(@NotEmpty(message = "文件内容不能为空") byte[] content,
@@ -37,7 +37,7 @@ public interface FileService {
/**
* 生成文件预签名地址信息
*
- * @param name 文件名
+ * @param name 文件名
* @param directory 目录
* @return 预签名地址信息
*/
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobLogService.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobLogService.java
similarity index 94%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobLogService.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobLogService.java
index f1e7e7c67e..2efff754a2 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobLogService.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobLogService.java
@@ -31,7 +31,7 @@ public interface JobLogService extends JobLogFrameworkService {
/**
* 清理 exceedDay 天前的任务日志
*
- * @param exceedDay 超过多少天就进行清理
+ * @param exceedDay 超过多少天就进行清理
* @param deleteLimit 清理的间隔条数
*/
Integer cleanJobLog(Integer exceedDay, Integer deleteLimit);
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobLogServiceImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobLogServiceImpl.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobLogServiceImpl.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobLogServiceImpl.java
index bbf5f21bc4..a2abaff3b4 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobLogServiceImpl.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobLogServiceImpl.java
@@ -5,12 +5,12 @@ import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogPageReqVO
import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobLogDO;
import cn.iocoder.yudao.module.infra.dal.mysql.job.JobLogMapper;
import cn.iocoder.yudao.module.infra.enums.job.JobLogStatusEnum;
+import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
-import jakarta.annotation.Resource;
import java.time.LocalDateTime;
/**
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobService.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobService.java
similarity index 98%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobService.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobService.java
index 971fd1b62d..bce2a95570 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobService.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobService.java
@@ -4,9 +4,8 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.JobPageReqVO;
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.JobSaveReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobDO;
-import org.quartz.SchedulerException;
-
import jakarta.validation.Valid;
+import org.quartz.SchedulerException;
/**
* 定时任务 Service 接口
@@ -33,7 +32,7 @@ public interface JobService {
/**
* 更新定时任务的状态
*
- * @param id 任务编号
+ * @param id 任务编号
* @param status 状态
*/
void updateJobStatus(Long id, Integer status) throws SchedulerException;
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobServiceImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobServiceImpl.java
similarity index 99%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobServiceImpl.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobServiceImpl.java
index 2ebf06619d..982e39ba43 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobServiceImpl.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobServiceImpl.java
@@ -190,7 +190,7 @@ public class JobServiceImpl implements JobService {
@Override
public PageResult getJobPage(JobPageReqVO pageReqVO) {
- return jobMapper.selectPage(pageReqVO);
+ return jobMapper.selectPage(pageReqVO);
}
private static void fillJobMonitorTimeoutEmpty(JobDO job) {
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogService.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogService.java
similarity index 87%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogService.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogService.java
index fd4e841aff..65faa3f333 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogService.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogService.java
@@ -1,7 +1,7 @@
package cn.iocoder.yudao.module.infra.service.logger;
+import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiAccessLogCreateReqDTO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.module.infra.api.logger.dto.ApiAccessLogCreateReqDTO;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogPageReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiAccessLogDO;
@@ -30,7 +30,7 @@ public interface ApiAccessLogService {
/**
* 清理 exceedDay 天前的访问日志
*
- * @param exceedDay 超过多少天就进行清理
+ * @param exceedDay 超过多少天就进行清理
* @param deleteLimit 清理的间隔条数
*/
Integer cleanAccessLog(Integer exceedDay, Integer deleteLimit);
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImpl.java
similarity index 97%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImpl.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImpl.java
index 4433fc2a75..d47f192126 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImpl.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImpl.java
@@ -1,11 +1,11 @@
package cn.iocoder.yudao.module.infra.service.logger;
+import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiAccessLogCreateReqDTO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.common.util.string.StrUtils;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
-import cn.iocoder.yudao.module.infra.api.logger.dto.ApiAccessLogCreateReqDTO;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogPageReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiAccessLogDO;
import cn.iocoder.yudao.module.infra.dal.mysql.logger.ApiAccessLogMapper;
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogService.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogService.java
similarity index 86%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogService.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogService.java
index 82eb3c4c0d..b05ccf3d89 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogService.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogService.java
@@ -1,7 +1,7 @@
package cn.iocoder.yudao.module.infra.service.logger;
+import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.module.infra.api.logger.dto.ApiErrorLogCreateReqDTO;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiErrorLogDO;
@@ -30,7 +30,7 @@ public interface ApiErrorLogService {
/**
* 更新 API 错误日志已处理
*
- * @param id API 日志编号
+ * @param id API 日志编号
* @param processStatus 处理结果
* @param processUserId 处理人
*/
@@ -39,7 +39,7 @@ public interface ApiErrorLogService {
/**
* 清理 exceedDay 天前的错误日志
*
- * @param exceedDay 超过多少天就进行清理
+ * @param exceedDay 超过多少天就进行清理
* @param deleteLimit 清理的间隔条数
*/
Integer cleanErrorLog(Integer exceedDay, Integer deleteLimit);
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImpl.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImpl.java
similarity index 97%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImpl.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImpl.java
index 1fcbc8dd78..e91c098941 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImpl.java
+++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImpl.java
@@ -1,11 +1,11 @@
package cn.iocoder.yudao.module.infra.service.logger;
+import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.common.util.string.StrUtils;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
-import cn.iocoder.yudao.module.infra.api.logger.dto.ApiErrorLogCreateReqDTO;
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiErrorLogDO;
import cn.iocoder.yudao.module.infra.dal.mysql.logger.ApiErrorLogMapper;
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/websocket/DemoWebSocketMessageListener.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/websocket/DemoWebSocketMessageListener.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/websocket/DemoWebSocketMessageListener.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/websocket/DemoWebSocketMessageListener.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/websocket/message/DemoReceiveMessage.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/websocket/message/DemoReceiveMessage.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/websocket/message/DemoReceiveMessage.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/websocket/message/DemoReceiveMessage.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/websocket/message/DemoSendMessage.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/websocket/message/DemoSendMessage.java
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/websocket/message/DemoSendMessage.java
rename to yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/websocket/message/DemoSendMessage.java
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/controller.vm b/yudao-module-infra/src/main/resources/codegen/java/controller/controller.vm
similarity index 81%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/controller.vm
rename to yudao-module-infra/src/main/resources/codegen/java/controller/controller.vm
index 5aa3baef83..9f63e240da 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/controller.vm
+++ b/yudao-module-infra/src/main/resources/codegen/java/controller/controller.vm
@@ -49,8 +49,8 @@ public class ${sceneEnum.prefixClass}${table.className}Controller {
#if ($sceneEnum.scene == 1)
@PreAuthorize("@ss.hasPermission('${permissionPrefix}:create')")
#end
- public CommonResult<${primaryColumn.javaType}> create${simpleClassName}(@Valid @RequestBody ${sceneEnum.prefixClass}${table.className}SaveReqVO createReqVO) {
- return success(${classNameVar}Service.create${simpleClassName}(createReqVO));
+ public CommonResult<${primaryColumn.javaType}> create${simpleClassName}(@Valid @RequestBody ${saveReqVOClass} ${saveReqVOVar}) {
+ return success(${classNameVar}Service.create${simpleClassName}(${saveReqVOVar}));
}
@PutMapping("/update")
@@ -58,8 +58,8 @@ public class ${sceneEnum.prefixClass}${table.className}Controller {
#if ($sceneEnum.scene == 1)
@PreAuthorize("@ss.hasPermission('${permissionPrefix}:update')")
#end
- public CommonResult update${simpleClassName}(@Valid @RequestBody ${sceneEnum.prefixClass}${table.className}SaveReqVO updateReqVO) {
- ${classNameVar}Service.update${simpleClassName}(updateReqVO);
+ public CommonResult update${simpleClassName}(@Valid @RequestBody ${updateReqVOClass} ${updateReqVOVar}) {
+ ${classNameVar}Service.update${simpleClassName}(${updateReqVOVar});
return success(true);
}
@@ -74,15 +74,32 @@ public class ${sceneEnum.prefixClass}${table.className}Controller {
return success(true);
}
+#if ( $table.templateType != 2 && $deleteBatchEnable)
+ @DeleteMapping("/delete-list")
+ @Parameter(name = "ids", description = "编号", required = true)
+ @Operation(summary = "批量删除${table.classComment}")
+ #if ($sceneEnum.scene == 1)
+ @PreAuthorize("@ss.hasPermission('${permissionPrefix}:delete')")
+ #end
+ public CommonResult delete${simpleClassName}List(@RequestParam("ids") List<${primaryColumn.javaType}> ids) {
+ ${classNameVar}Service.delete${simpleClassName}ListByIds(ids);
+ return success(true);
+ }
+#end
+
@GetMapping("/get")
@Operation(summary = "获得${table.classComment}")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
#if ($sceneEnum.scene == 1)
@PreAuthorize("@ss.hasPermission('${permissionPrefix}:query')")
#end
- public CommonResult<${sceneEnum.prefixClass}${table.className}RespVO> get${simpleClassName}(@RequestParam("id") ${primaryColumn.javaType} id) {
+ public CommonResult<${respVOClass}> get${simpleClassName}(@RequestParam("id") ${primaryColumn.javaType} id) {
${table.className}DO ${classNameVar} = ${classNameVar}Service.get${simpleClassName}(id);
- return success(BeanUtils.toBean(${classNameVar}, ${sceneEnum.prefixClass}${table.className}RespVO.class));
+#if ($voType == 10)
+ return success(BeanUtils.toBean(${classNameVar}, ${respVOClass}.class));
+#else
+ return success(${classNameVar});
+#end
}
#if ( $table.templateType != 2 )
@@ -91,9 +108,13 @@ public class ${sceneEnum.prefixClass}${table.className}Controller {
#if ($sceneEnum.scene == 1)
@PreAuthorize("@ss.hasPermission('${permissionPrefix}:query')")
#end
- public CommonResult> get${simpleClassName}Page(@Valid ${sceneEnum.prefixClass}${table.className}PageReqVO pageReqVO) {
+ public CommonResult> get${simpleClassName}Page(@Valid ${sceneEnum.prefixClass}${table.className}PageReqVO pageReqVO) {
PageResult<${table.className}DO> pageResult = ${classNameVar}Service.get${simpleClassName}Page(pageReqVO);
- return success(BeanUtils.toBean(pageResult, ${sceneEnum.prefixClass}${table.className}RespVO.class));
+#if ($voType == 10)
+ return success(BeanUtils.toBean(pageResult, ${respVOClass}.class));
+#else
+ return success(pageResult);
+#end
}
## 特殊:树表专属逻辑(树不需要分页接口)
@@ -103,9 +124,13 @@ public class ${sceneEnum.prefixClass}${table.className}Controller {
#if ($sceneEnum.scene == 1)
@PreAuthorize("@ss.hasPermission('${permissionPrefix}:query')")
#end
- public CommonResult> get${simpleClassName}List(@Valid ${sceneEnum.prefixClass}${table.className}ListReqVO listReqVO) {
+ public CommonResult> get${simpleClassName}List(@Valid ${sceneEnum.prefixClass}${table.className}ListReqVO listReqVO) {
List<${table.className}DO> list = ${classNameVar}Service.get${simpleClassName}List(listReqVO);
- return success(BeanUtils.toBean(list, ${sceneEnum.prefixClass}${table.className}RespVO.class));
+#if ($voType == 10)
+ return success(BeanUtils.toBean(list, ${respVOClass}.class));
+#else
+ return success(list);
+#end
}
#end
@@ -121,8 +146,8 @@ public class ${sceneEnum.prefixClass}${table.className}Controller {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<${table.className}DO> list = ${classNameVar}Service.get${simpleClassName}Page(pageReqVO).getList();
// 导出 Excel
- ExcelUtils.write(response, "${table.classComment}.xls", "数据", ${sceneEnum.prefixClass}${table.className}RespVO.class,
- BeanUtils.toBean(list, ${sceneEnum.prefixClass}${table.className}RespVO.class));
+ ExcelUtils.write(response, "${table.classComment}.xls", "数据", ${respVOClass}.class,
+ BeanUtils.toBean(list, ${respVOClass}.class));
}
## 特殊:树表专属逻辑(树不需要分页接口)
#else
@@ -218,6 +243,19 @@ public class ${sceneEnum.prefixClass}${table.className}Controller {
return success(true);
}
+#if ($deleteBatchEnable)
+ @DeleteMapping("/${subSimpleClassName_strikeCase}/delete-list")
+ @Parameter(name = "ids", description = "编号", required = true)
+ @Operation(summary = "批量删除${subTable.classComment}")
+#if ($sceneEnum.scene == 1)
+ @PreAuthorize("@ss.hasPermission('${permissionPrefix}:delete')")
+#end
+ public CommonResult delete${subSimpleClassName}List(@RequestParam("ids") List<${subPrimaryColumn.javaType}> ids) {
+ ${classNameVar}Service.delete${subSimpleClassName}ListByIds(ids);
+ return success(true);
+ }
+#end
+
@GetMapping("/${subSimpleClassName_strikeCase}/get")
@Operation(summary = "获得${subTable.classComment}")
@Parameter(name = "id", description = "编号", required = true)
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/listReqVO.vm b/yudao-module-infra/src/main/resources/codegen/java/controller/vo/listReqVO.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/listReqVO.vm
rename to yudao-module-infra/src/main/resources/codegen/java/controller/vo/listReqVO.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/pageReqVO.vm b/yudao-module-infra/src/main/resources/codegen/java/controller/vo/pageReqVO.vm
similarity index 96%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/pageReqVO.vm
rename to yudao-module-infra/src/main/resources/codegen/java/controller/vo/pageReqVO.vm
index 003bac902f..d0367a3df2 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/pageReqVO.vm
+++ b/yudao-module-infra/src/main/resources/codegen/java/controller/vo/pageReqVO.vm
@@ -28,8 +28,6 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "${sceneEnum.name} - ${table.classComment}分页 Request VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
public class ${sceneEnum.prefixClass}${table.className}PageReqVO extends PageParam {
#foreach ($column in $columns)
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/respVO.vm b/yudao-module-infra/src/main/resources/codegen/java/controller/vo/respVO.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/respVO.vm
rename to yudao-module-infra/src/main/resources/codegen/java/controller/vo/respVO.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/saveReqVO.vm b/yudao-module-infra/src/main/resources/codegen/java/controller/vo/saveReqVO.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/saveReqVO.vm
rename to yudao-module-infra/src/main/resources/codegen/java/controller/vo/saveReqVO.vm
diff --git a/yudao-module-infra/src/main/resources/codegen/java/dal/do.vm b/yudao-module-infra/src/main/resources/codegen/java/dal/do.vm
new file mode 100644
index 0000000000..baf53f5986
--- /dev/null
+++ b/yudao-module-infra/src/main/resources/codegen/java/dal/do.vm
@@ -0,0 +1,103 @@
+package ${basePackage}.module.${table.moduleName}.dal.dataobject.${table.businessName};
+
+import lombok.*;
+import java.util.*;
+#foreach ($column in $columns)
+#if (${column.javaType} == "BigDecimal")
+import java.math.BigDecimal;
+#end
+#if (${column.javaType} == "LocalDateTime")
+import java.time.LocalDateTime;
+#end
+#end
+import com.baomidou.mybatisplus.annotation.*;
+import ${BaseDOClassName};
+## 处理 Excel 导出 + Schema 注解(仅 DO 模式)
+#if ($voType == 20)
+import io.swagger.v3.oas.annotations.media.Schema;
+import com.alibaba.excel.annotation.*;
+#foreach ($column in $columns)
+ #if ("$!column.dictType" != "")## 有设置数据字典
+ import ${DictFormatClassName};
+ import ${DictConvertClassName};
+ #break
+ #end
+#end
+#end
+
+/**
+ * ${table.classComment} DO
+ *
+ * @author ${table.author}
+ */
+@TableName("${table.tableName.toLowerCase()}")
+@KeySequence("${table.tableName.toLowerCase()}_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+## 处理 Excel 导出 + Schema 注解(仅 DO 模式)
+#if ($voType == 20)
+@Schema(description = "${sceneEnum.name} - ${table.classComment} Response VO")
+@ExcelIgnoreUnannotated
+#end
+public class ${table.className}DO extends BaseDO {
+
+## 特殊:树表专属逻辑
+#if ( $table.templateType == 2 )
+ public static final Long ${treeParentColumn_javaField_underlineCase.toUpperCase()}_ROOT = 0L;
+
+#end
+#foreach ($column in $columns)
+#if (!${baseDOFields.contains(${column.javaField})})##排除 BaseDO 的字段
+ /**
+ * ${column.columnComment}
+ #if ("$!column.dictType" != "")##处理枚举值
+ *
+ * 枚举 {@link TODO ${column.dictType} 对应的类}
+ #end
+ */
+ #if (${column.primaryKey})##处理主键
+ @TableId#if (${column.javaType} == 'String')(type = IdType.INPUT)#end
+ #end
+#if ($voType == 20)
+## 1. 处理 Swagger 注解
+ @Schema(description = "${column.columnComment}"#if (!${column.nullable}), requiredMode = Schema.RequiredMode.REQUIRED#end#if ("$!column.example" != ""), example = "${column.example}"#end)
+## 2. 处理 Excel 导出
+#if ("$!column.dictType" != "")##处理枚举值
+ @ExcelProperty(value = "${column.columnComment}", converter = DictConvert.class)
+ @DictFormat("${column.dictType}") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
+#else
+ @ExcelProperty("${column.columnComment}")
+#end
+#end
+## 3. 处理字段定义
+ private ${column.javaType} ${column.javaField};
+#end
+#end
+
+## 特殊:主子表专属逻辑(非 ERP 模式)
+#if ( $voType == 20 && $subTables && $subTables.size() > 0 && $table.templateType != 11 )
+ #foreach ($subTable in $subTables)
+ #set ($index = $foreach.count - 1)
+ #if ( $subTable.subJoinMany)
+ /**
+ * ${subTable.classComment}列表
+ */
+ @Schema(description = "${subTable.classComment}列表")
+ @TableField(exist = false)
+ private List<${subTable.className}DO> ${subClassNameVars.get($index)}s;
+ #else
+ /**
+ * ${subTable.classComment}
+ */
+ @Schema(description = "${subTable.classComment}")
+ @TableField(exist = false)
+ private ${subTable.className}DO ${subClassNameVars.get($index)};
+ #end
+ #end
+#end
+
+}
\ No newline at end of file
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/do_sub.vm b/yudao-module-infra/src/main/resources/codegen/java/dal/do_sub.vm
similarity index 66%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/do_sub.vm
rename to yudao-module-infra/src/main/resources/codegen/java/dal/do_sub.vm
index 16be55e8a5..0dfc38ffef 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/do_sub.vm
+++ b/yudao-module-infra/src/main/resources/codegen/java/dal/do_sub.vm
@@ -14,6 +14,17 @@ import java.time.LocalDateTime;
#end
import com.baomidou.mybatisplus.annotation.*;
import ${BaseDOClassName};
+## 处理 Schema 注解(仅 DO 模式)
+#if ($voType == 20)
+import io.swagger.v3.oas.annotations.media.Schema;
+#foreach ($column in $columns)
+ #if ("$!column.dictType" != "")## 有设置数据字典
+ import ${DictFormatClassName};
+ import ${DictConvertClassName};
+ #break
+ #end
+#end
+#end
/**
* ${subTable.classComment} DO
@@ -28,6 +39,10 @@ import ${BaseDOClassName};
@Builder
@NoArgsConstructor
@AllArgsConstructor
+## 处理 Schema 注解(仅 DO 模式)
+#if ($voType == 20)
+@Schema(description = "${sceneEnum.name} - ${table.classComment} Response VO")
+#end
public class ${subTable.className}DO extends BaseDO {
#foreach ($column in $subColumns)
@@ -42,6 +57,11 @@ public class ${subTable.className}DO extends BaseDO {
#if (${column.primaryKey})##处理主键
@TableId#if (${column.javaType} == 'String')(type = IdType.INPUT)#end
#end
+#if ($voType == 20)
+## 1. 处理 Swagger 注解
+ @Schema(description = "${column.columnComment}"#if (!${column.nullable}), requiredMode = Schema.RequiredMode.REQUIRED#end#if ("$!column.example" != ""), example = "${column.example}"#end)
+#end
+## 2. 处理字段定义
private ${column.javaType} ${column.javaField};
#end
#end
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/mapper.vm b/yudao-module-infra/src/main/resources/codegen/java/dal/mapper.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/mapper.vm
rename to yudao-module-infra/src/main/resources/codegen/java/dal/mapper.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/mapper.xml.vm b/yudao-module-infra/src/main/resources/codegen/java/dal/mapper.xml.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/mapper.xml.vm
rename to yudao-module-infra/src/main/resources/codegen/java/dal/mapper.xml.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/mapper_sub.vm b/yudao-module-infra/src/main/resources/codegen/java/dal/mapper_sub.vm
similarity index 90%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/mapper_sub.vm
rename to yudao-module-infra/src/main/resources/codegen/java/dal/mapper_sub.vm
index 6ccaea79ea..40f2ff5491 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/mapper_sub.vm
+++ b/yudao-module-infra/src/main/resources/codegen/java/dal/mapper_sub.vm
@@ -54,4 +54,10 @@ public interface ${subTable.className}Mapper extends BaseMapperX<${subTable.clas
return delete(${subTable.className}DO::get${SubJoinColumnName}, ${subJoinColumn.javaField});
}
+#if ( $table.templateType != 2 && $deleteBatchEnable)
+ default int deleteBy${SubJoinColumnName}s(List<${subJoinColumn.javaType}> ${subJoinColumn.javaField}s) {
+ return deleteBatch(${subTable.className}DO::get${SubJoinColumnName}, ${subJoinColumn.javaField}s);
+ }
+#end
+
}
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/enums/errorcode.vm b/yudao-module-infra/src/main/resources/codegen/java/enums/errorcode.vm
similarity index 92%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/enums/errorcode.vm
rename to yudao-module-infra/src/main/resources/codegen/java/enums/errorcode.vm
index b7e21e6315..0d1343b330 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/enums/errorcode.vm
+++ b/yudao-module-infra/src/main/resources/codegen/java/enums/errorcode.vm
@@ -1,4 +1,4 @@
-// TODO 待办:请将下面的错误码复制到 yudao-module-${table.moduleName}-api 模块的 ErrorCodeConstants 类中。注意,请给“TODO 补充编号”设置一个错误码编号!!!
+// TODO 待办:请将下面的错误码复制到 yudao-module-${table.moduleName} 模块的 ErrorCodeConstants 类中。注意,请给“TODO 补充编号”设置一个错误码编号!!!
// ========== ${table.classComment} TODO 补充编号 ==========
ErrorCode ${simpleClassName_underlineCase.toUpperCase()}_NOT_EXISTS = new ErrorCode(TODO 补充编号, "${table.classComment}不存在");
## 特殊:树表专属逻辑
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/service/service.vm b/yudao-module-infra/src/main/resources/codegen/java/service/service.vm
similarity index 87%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/service/service.vm
rename to yudao-module-infra/src/main/resources/codegen/java/service/service.vm
index c4ee4f0f64..1cc68bf363 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/service/service.vm
+++ b/yudao-module-infra/src/main/resources/codegen/java/service/service.vm
@@ -21,17 +21,17 @@ public interface ${table.className}Service {
/**
* 创建${table.classComment}
*
- * @param createReqVO 创建信息
+ * @param ${saveReqVOVar} 创建信息
* @return 编号
*/
- ${primaryColumn.javaType} create${simpleClassName}(@Valid ${sceneEnum.prefixClass}${table.className}SaveReqVO createReqVO);
+ ${primaryColumn.javaType} create${simpleClassName}(@Valid ${saveReqVOClass} ${saveReqVOVar});
/**
* 更新${table.classComment}
*
- * @param updateReqVO 更新信息
+ * @param ${updateReqVOVar} 更新信息
*/
- void update${simpleClassName}(@Valid ${sceneEnum.prefixClass}${table.className}SaveReqVO updateReqVO);
+ void update${simpleClassName}(@Valid ${updateReqVOClass} ${updateReqVOVar});
/**
* 删除${table.classComment}
@@ -40,6 +40,15 @@ public interface ${table.className}Service {
*/
void delete${simpleClassName}(${primaryColumn.javaType} id);
+#if ( $table.templateType != 2 && $deleteBatchEnable)
+ /**
+ * 批量删除${table.classComment}
+ *
+ * @param ids 编号
+ */
+ void delete${simpleClassName}ListByIds(List<${primaryColumn.javaType}> ids);
+#end
+
/**
* 获得${table.classComment}
*
@@ -134,6 +143,15 @@ public interface ${table.className}Service {
*/
void delete${subSimpleClassName}(${subPrimaryColumn.javaType} id);
+#if ($deleteBatchEnable)
+ /**
+ * 批量删除${subTable.classComment}
+ *
+ * @param ids 编号
+ */
+ void delete${subSimpleClassName}ListByIds(List<${subPrimaryColumn.javaType}> ids);
+#end
+
/**
* 获得${subTable.classComment}
*
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/service/serviceImpl.vm b/yudao-module-infra/src/main/resources/codegen/java/service/serviceImpl.vm
similarity index 76%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/service/serviceImpl.vm
rename to yudao-module-infra/src/main/resources/codegen/java/service/serviceImpl.vm
index 80bc71b026..edea2e7ab5 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/service/serviceImpl.vm
+++ b/yudao-module-infra/src/main/resources/codegen/java/service/serviceImpl.vm
@@ -1,5 +1,6 @@
package ${basePackage}.module.${table.moduleName}.service.${table.businessName};
+import cn.hutool.core.collection.CollUtil;
import org.springframework.stereotype.Service;
import ${jakartaPackage}.annotation.Resource;
import org.springframework.validation.annotation.Validated;
@@ -24,6 +25,8 @@ import ${basePackage}.module.${subTable.moduleName}.dal.mysql.${subTable.busines
#end
import static ${ServiceExceptionUtilClassName}.exception;
+import static ${CollectionUtilsClassName}.convertList;
+import static ${CollectionUtilsClassName}.diffList;
import static ${basePackage}.module.${table.moduleName}.enums.ErrorCodeConstants.*;
/**
@@ -49,19 +52,22 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
#if ( $subTables && $subTables.size() > 0 && $table.templateType != 11 )
@Transactional(rollbackFor = Exception.class)
#end
- public ${primaryColumn.javaType} create${simpleClassName}(${sceneEnum.prefixClass}${table.className}SaveReqVO createReqVO) {
+ public ${primaryColumn.javaType} create${simpleClassName}(${saveReqVOClass} ${saveReqVOVar}) {
## 特殊:树表专属逻辑
#if ( $table.templateType == 2 )
#set ($TreeParentJavaField = $treeParentColumn.javaField.substring(0,1).toUpperCase() + ${treeParentColumn.javaField.substring(1)})##首字母大写
#set ($TreeNameJavaField = $treeNameColumn.javaField.substring(0,1).toUpperCase() + ${treeNameColumn.javaField.substring(1)})##首字母大写
// 校验${treeParentColumn.columnComment}的有效性
- validateParent${simpleClassName}(null, createReqVO.get${TreeParentJavaField}());
+ validateParent${simpleClassName}(null, ${saveReqVOVar}.get${TreeParentJavaField}());
// 校验${treeNameColumn.columnComment}的唯一性
- validate${simpleClassName}${TreeNameJavaField}Unique(null, createReqVO.get${TreeParentJavaField}(), createReqVO.get${TreeNameJavaField}());
+ validate${simpleClassName}${TreeNameJavaField}Unique(null, ${saveReqVOVar}.get${TreeParentJavaField}(), ${saveReqVOVar}.get${TreeNameJavaField}());
#end
// 插入
+#if ($voType == 10)
+## TODO @puhui999:insert 也要加下 clean。万一前端乱传递,哈哈哈。这个就是 do 模式的缺点;(只在 do 模式下);看看主子表,是不是也可能存在,insert 的时候;
${table.className}DO ${classNameVar} = BeanUtils.toBean(createReqVO, ${table.className}DO.class);
+#end
${classNameVar}Mapper.insert(${classNameVar});
## 特殊:主子表专属逻辑(非 ERP 模式)
#if ( $subTables && $subTables.size() > 0 && $table.templateType != 11 )
@@ -73,9 +79,9 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
#set ($subJoinColumn = $subJoinColumns.get($index))##当前 join 字段
#set ($SubJoinColumnName = $subJoinColumn.javaField.substring(0,1).toUpperCase() + ${subJoinColumn.javaField.substring(1)})##首字母大写
#if ( $subTable.subJoinMany)
- create${subSimpleClassName}List(${classNameVar}.getId(), createReqVO.get${subSimpleClassNames.get($index)}s());
+ create${subSimpleClassName}List(${classNameVar}.getId(), ${saveReqVOVar}.get${subSimpleClassNames.get($index)}s());
#else
- create${subSimpleClassName}(${classNameVar}.getId(), createReqVO.get${subSimpleClassNames.get($index)}());
+ create${subSimpleClassName}(${classNameVar}.getId(), ${saveReqVOVar}.get${subSimpleClassNames.get($index)}());
#end
#end
#end
@@ -88,22 +94,26 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
#if ( $subTables && $subTables.size() > 0 && $table.templateType != 11 )
@Transactional(rollbackFor = Exception.class)
#end
- public void update${simpleClassName}(${sceneEnum.prefixClass}${table.className}SaveReqVO updateReqVO) {
+ public void update${simpleClassName}(${updateReqVOClass} ${updateReqVOVar}) {
// 校验存在
- validate${simpleClassName}Exists(updateReqVO.getId());
+ validate${simpleClassName}Exists(${updateReqVOVar}.getId());
## 特殊:树表专属逻辑
#if ( $table.templateType == 2 )
#set ($TreeParentJavaField = $treeParentColumn.javaField.substring(0,1).toUpperCase() + ${treeParentColumn.javaField.substring(1)})##首字母大写
#set ($TreeNameJavaField = $treeNameColumn.javaField.substring(0,1).toUpperCase() + ${treeNameColumn.javaField.substring(1)})##首字母大写
// 校验${treeParentColumn.columnComment}的有效性
- validateParent${simpleClassName}(updateReqVO.getId(), updateReqVO.get${TreeParentJavaField}());
+ validateParent${simpleClassName}(${updateReqVOVar}.getId(), ${updateReqVOVar}.get${TreeParentJavaField}());
// 校验${treeNameColumn.columnComment}的唯一性
- validate${simpleClassName}${TreeNameJavaField}Unique(updateReqVO.getId(), updateReqVO.get${TreeParentJavaField}(), updateReqVO.get${TreeNameJavaField}());
+ validate${simpleClassName}${TreeNameJavaField}Unique(${updateReqVOVar}.getId(), ${updateReqVOVar}.get${TreeParentJavaField}(), ${updateReqVOVar}.get${TreeNameJavaField}());
#end
// 更新
+#if ($voType == 10)
${table.className}DO updateObj = BeanUtils.toBean(updateReqVO, ${table.className}DO.class);
${classNameVar}Mapper.updateById(updateObj);
+#else
+ ${classNameVar}Mapper.updateById(${updateReqVOVar});
+#end
## 特殊:主子表专属逻辑(非 ERP 模式)
#if ( $subTables && $subTables.size() > 0 && $table.templateType != 11)
@@ -114,9 +124,9 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
#set ($subJoinColumn = $subJoinColumns.get($index))##当前 join 字段
#set ($SubJoinColumnName = $subJoinColumn.javaField.substring(0,1).toUpperCase() + ${subJoinColumn.javaField.substring(1)})##首字母大写
#if ( $subTable.subJoinMany)
- update${subSimpleClassName}List(updateReqVO.getId(), updateReqVO.get${subSimpleClassNames.get($index)}s());
+ update${subSimpleClassName}List(${updateReqVOVar}.getId(), ${updateReqVOVar}.get${subSimpleClassNames.get($index)}s());
#else
- update${subSimpleClassName}(updateReqVO.getId(), updateReqVO.get${subSimpleClassNames.get($index)}());
+ update${subSimpleClassName}(${updateReqVOVar}.getId(), ${updateReqVOVar}.get${subSimpleClassNames.get($index)}());
#end
#end
#end
@@ -154,6 +164,39 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
#end
}
+#if ( $table.templateType != 2 && $deleteBatchEnable)
+ @Override
+ ## 特殊:主子表专属逻辑
+ #if ( $subTables && $subTables.size() > 0)
+ @Transactional(rollbackFor = Exception.class)
+ #end
+ public void delete${simpleClassName}ListByIds(List<${primaryColumn.javaType}> ids) {
+ // 校验存在
+ validate${simpleClassName}Exists(ids);
+ // 删除
+ ${classNameVar}Mapper.deleteByIds(ids);
+ ## 特殊:主子表专属逻辑
+ #if ( $subTables && $subTables.size() > 0)
+
+ // 删除子表
+ #foreach ($subTable in $subTables)
+ #set ($index = $foreach.count - 1)
+ #set ($subSimpleClassName = $subSimpleClassNames.get($index))
+ #set ($subJoinColumn = $subJoinColumns.get($index))##当前 join 字段
+ #set ($SubJoinColumnName = $subJoinColumn.javaField.substring(0,1).toUpperCase() + ${subJoinColumn.javaField.substring(1)})##首字母大写
+ delete${subSimpleClassName}By${SubJoinColumnName}s(ids);
+ #end
+ #end
+ }
+
+ private void validate${simpleClassName}Exists(List<${primaryColumn.javaType}> ids) {
+ List<${table.className}DO> list = ${classNameVar}Mapper.selectByIds(ids);
+ if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
+ throw exception(${simpleClassName_underlineCase.toUpperCase()}_NOT_EXISTS);
+ }
+ }
+#end
+
private void validate${simpleClassName}Exists(${primaryColumn.javaType} id) {
if (${classNameVar}Mapper.selectById(id) == null) {
throw exception(${simpleClassName_underlineCase.toUpperCase()}_NOT_EXISTS);
@@ -286,18 +329,24 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
// 校验存在
validate${subSimpleClassName}Exists(${subClassNameVar}.getId());
// 更新
- ${subClassNameVar}.setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新
+ ${subClassNameVar}.clean(); // 解决更新情况下:updateTime 不更新
${subClassNameVars.get($index)}Mapper.updateById(${subClassNameVar});
}
@Override
public void delete${subSimpleClassName}(${subPrimaryColumn.javaType} id) {
- // 校验存在
- validate${subSimpleClassName}Exists(id);
// 删除
${subClassNameVars.get($index)}Mapper.deleteById(id);
}
+#if ($deleteBatchEnable)
+ @Override
+ public void delete${subSimpleClassName}ListByIds(List<${subPrimaryColumn.javaType}> ids) {
+ // 删除
+ ${subClassNameVars.get($index)}Mapper.deleteByIds(ids);
+ }
+#end
+
@Override
public ${subTable.className}DO get${subSimpleClassName}(${subPrimaryColumn.javaType} id) {
return ${subClassNameVars.get($index)}Mapper.selectById(id);
@@ -313,14 +362,31 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
#else
#if ( $subTable.subJoinMany)
private void create${subSimpleClassName}List(${primaryColumn.javaType} ${subJoinColumn.javaField}, List<${subTable.className}DO> list) {
- list.forEach(o -> o.set$SubJoinColumnName(${subJoinColumn.javaField}));
+ list.forEach(o -> o.set${SubJoinColumnName}(${subJoinColumn.javaField}).clean());
${subClassNameVars.get($index)}Mapper.insertBatch(list);
}
private void update${subSimpleClassName}List(${primaryColumn.javaType} ${subJoinColumn.javaField}, List<${subTable.className}DO> list) {
- delete${subSimpleClassName}By${SubJoinColumnName}(${subJoinColumn.javaField});
- list.forEach(o -> o.setId(null).setUpdater(null).setUpdateTime(null)); // 解决更新情况下:1)id 冲突;2)updateTime 不更新
- create${subSimpleClassName}List(${subJoinColumn.javaField}, list);
+ list.forEach(o -> o.set${SubJoinColumnName}(${subJoinColumn.javaField}).clean());
+ List<${subTable.className}DO> oldList = ${subClassNameVar}Mapper.selectListBy${SubJoinColumnName}(${subJoinColumn.javaField});
+ List> diffList = diffList(oldList, list, (oldVal, newVal) -> {
+ boolean same = ObjectUtil.equal(oldVal.getId(), newVal.getId());
+ if (same) {
+ newVal.setId(oldVal.getId()).clean(); // 解决更新情况下:updateTime 不更新
+ }
+ return same;
+ });
+
+ // 第二步,批量添加、修改、删除
+ if (CollUtil.isNotEmpty(diffList.get(0))) {
+ ${subClassNameVar}Mapper.insertBatch(diffList.get(0));
+ }
+ if (CollUtil.isNotEmpty(diffList.get(1))) {
+ ${subClassNameVar}Mapper.updateBatch(diffList.get(1));
+ }
+ if (CollUtil.isNotEmpty(diffList.get(2))) {
+ ${subClassNameVar}Mapper.deleteByIds(convertList(diffList.get(2), ${subTable.className}DO::getId));
+ }
}
#else
@@ -336,8 +402,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
if (${subClassNameVar} == null) {
return;
}
- ${subClassNameVar}.set$SubJoinColumnName(${subJoinColumn.javaField});
- ${subClassNameVar}.setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新
+ ${subClassNameVar}.set$SubJoinColumnName(${subJoinColumn.javaField}).clean();// 解决更新情况下:updateTime 不更新
${subClassNameVars.get($index)}Mapper.insertOrUpdate(${subClassNameVar});
}
@@ -347,5 +412,11 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
${subClassNameVars.get($index)}Mapper.deleteBy${SubJoinColumnName}(${subJoinColumn.javaField});
}
+#if ( $table.templateType != 2 && $deleteBatchEnable)
+ private void delete${subSimpleClassName}By${SubJoinColumnName}s(List<${primaryColumn.javaType}> ${subJoinColumn.javaField}s) {
+ ${subClassNameVars.get($index)}Mapper.deleteBy${SubJoinColumnName}s(${subJoinColumn.javaField}s);
+ }
+#end
+
#end
}
\ No newline at end of file
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/test/serviceTest.vm b/yudao-module-infra/src/main/resources/codegen/java/test/serviceTest.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/test/serviceTest.vm
rename to yudao-module-infra/src/main/resources/codegen/java/test/serviceTest.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/sql/h2.vm b/yudao-module-infra/src/main/resources/codegen/sql/h2.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/sql/h2.vm
rename to yudao-module-infra/src/main/resources/codegen/sql/h2.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/sql/sql.vm b/yudao-module-infra/src/main/resources/codegen/sql/sql.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/sql/sql.vm
rename to yudao-module-infra/src/main/resources/codegen/sql/sql.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/api/api.js.vm b/yudao-module-infra/src/main/resources/codegen/vue/api/api.js.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/api/api.js.vm
rename to yudao-module-infra/src/main/resources/codegen/vue/api/api.js.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/components/form_sub_erp.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue/views/components/form_sub_erp.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/components/form_sub_erp.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue/views/components/form_sub_erp.vue.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/components/form_sub_inner.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue/views/components/form_sub_inner.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/components/form_sub_inner.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue/views/components/form_sub_inner.vue.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/components/form_sub_normal.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue/views/components/form_sub_normal.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/components/form_sub_normal.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue/views/components/form_sub_normal.vue.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/components/list_sub_erp.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue/views/components/list_sub_erp.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/components/list_sub_erp.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue/views/components/list_sub_erp.vue.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/components/list_sub_inner.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue/views/components/list_sub_inner.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/components/list_sub_inner.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue/views/components/list_sub_inner.vue.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/form.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue/views/form.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/form.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue/views/form.vue.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/index.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue/views/index.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/index.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue/views/index.vue.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/api/api.ts.vm b/yudao-module-infra/src/main/resources/codegen/vue3/api/api.ts.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/api/api.ts.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3/api/api.ts.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/form_sub_erp.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue3/views/components/form_sub_erp.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/form_sub_erp.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3/views/components/form_sub_erp.vue.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/form_sub_inner.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue3/views/components/form_sub_inner.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/form_sub_inner.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3/views/components/form_sub_inner.vue.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/form_sub_normal.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue3/views/components/form_sub_normal.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/form_sub_normal.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3/views/components/form_sub_normal.vue.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/list_sub_erp.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue3/views/components/list_sub_erp.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/list_sub_erp.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3/views/components/list_sub_erp.vue.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/list_sub_inner.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue3/views/components/list_sub_inner.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/list_sub_inner.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3/views/components/list_sub_inner.vue.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/form.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue3/views/form.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/form.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3/views/form.vue.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/index.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue3/views/index.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/index.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3/views/index.vue.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/api/api.ts.vm b/yudao-module-infra/src/main/resources/codegen/vue3_vben/api/api.ts.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/api/api.ts.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3_vben/api/api.ts.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/data.ts.vm b/yudao-module-infra/src/main/resources/codegen/vue3_vben/views/data.ts.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/data.ts.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3_vben/views/data.ts.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/form.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue3_vben/views/form.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/form.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3_vben/views/form.vue.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/index.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue3_vben/views/index.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/index.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3_vben/views/index.vue.vm
diff --git a/yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/api/api.ts.vm b/yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/api/api.ts.vm
new file mode 100644
index 0000000000..f65994b8cc
--- /dev/null
+++ b/yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/api/api.ts.vm
@@ -0,0 +1,168 @@
+import type { PageParam, PageResult } from '@vben/request';
+import type { Dayjs } from 'dayjs';
+
+import { requestClient } from '#/api/request';
+#set ($baseURL = "/${table.moduleName}/${simpleClassName_strikeCase}")
+
+export namespace ${simpleClassName}Api {
+ ## 特殊:主子表专属逻辑
+ #foreach ($subTable in $subTables)
+ #set ($index = $foreach.count - 1)
+ #set ($subSimpleClassName = $subSimpleClassNames.get($index))
+ #set ($subColumns = $subColumnsList.get($index))##当前字段数组
+ /** ${subTable.classComment}信息 */
+ export interface ${subSimpleClassName} {
+ #foreach ($column in $subColumns)
+ #if ($column.createOperation || $column.updateOperation)
+ #if(${column.javaType.toLowerCase()} == "long" || ${column.javaType.toLowerCase()} == "integer" || ${column.javaType.toLowerCase()} == "short" || ${column.javaType.toLowerCase()} == "double" || ${column.javaType.toLowerCase()} == "bigdecimal")
+ ${column.javaField}#if($column.updateOperation && !$column.primaryKey && !$column.nullable)?#end: number; // ${column.columnComment}
+ #elseif(${column.javaType.toLowerCase()} == "date" || ${column.javaType.toLowerCase()} == "localdate" || ${column.javaType.toLowerCase()} == "localdatetime")
+ ${column.javaField}#if($column.updateOperation && !$column.primaryKey && !$column.nullable)?#end: string | Dayjs; // ${column.columnComment}
+ #else
+ ${column.javaField}#if($column.updateOperation && !$column.primaryKey && !$column.nullable)?#end: ${column.javaType.toLowerCase()}; // ${column.columnComment}
+ #end
+ #end
+ #end
+ }
+
+ #end
+ /** ${table.classComment}信息 */
+ export interface ${simpleClassName} {
+ #foreach ($column in $columns)
+ #if ($column.createOperation || $column.updateOperation)
+ #if(${column.javaType.toLowerCase()} == "long" || ${column.javaType.toLowerCase()} == "integer" || ${column.javaType.toLowerCase()} == "short" || ${column.javaType.toLowerCase()} == "double" || ${column.javaType.toLowerCase()} == "bigdecimal")
+ ${column.javaField}#if($column.updateOperation && !$column.primaryKey && !$column.nullable)?#end: number; // ${column.columnComment}
+ #elseif(${column.javaType.toLowerCase()} == "date" || ${column.javaType.toLowerCase()} == "localdate" || ${column.javaType.toLowerCase()} == "localdatetime")
+ ${column.javaField}#if($column.updateOperation && !$column.primaryKey && !$column.nullable)?#end: string | Dayjs; // ${column.columnComment}
+ #else
+ ${column.javaField}#if($column.updateOperation && !$column.primaryKey && !$column.nullable)?#end: ${column.javaType.toLowerCase()}; // ${column.columnComment}
+ #end
+ #end
+ #end
+ #if ( $table.templateType == 2 )
+ children?: ${simpleClassName}[];
+ #end
+ ## 特殊:主子表专属逻辑
+ #if ( $table.templateType == 10 || $table.templateType == 12 )
+ #foreach ($subTable in $subTables)
+ #set ($index = $foreach.count - 1)
+ #set ($subSimpleClassName = $subSimpleClassNames.get($index))
+ #if ( $subTable.subJoinMany )
+ ${subSimpleClassName.toLowerCase()}s?: ${subSimpleClassName}[]
+ #else
+ ${subSimpleClassName.toLowerCase()}?: ${subSimpleClassName}
+ #end
+ #end
+ #end
+ }
+}
+
+#if ( $table.templateType != 2 )
+/** 查询${table.classComment}分页 */
+export function get${simpleClassName}Page(params: PageParam) {
+ return requestClient.get>('${baseURL}/page', { params });
+}
+#else
+/** 查询${table.classComment}列表 */
+export function get${simpleClassName}List(params: any) {
+ return requestClient.get<${simpleClassName}Api.${simpleClassName}[]>('${baseURL}/list', { params });
+}
+#end
+
+/** 查询${table.classComment}详情 */
+export function get${simpleClassName}(id: number) {
+ return requestClient.get<${simpleClassName}Api.${simpleClassName}>(`${baseURL}/get?id=${id}`);
+}
+
+/** 新增${table.classComment} */
+export function create${simpleClassName}(data: ${simpleClassName}Api.${simpleClassName}) {
+ return requestClient.post('${baseURL}/create', data);
+}
+
+/** 修改${table.classComment} */
+export function update${simpleClassName}(data: ${simpleClassName}Api.${simpleClassName}) {
+ return requestClient.put('${baseURL}/update', data);
+}
+
+/** 删除${table.classComment} */
+export function delete${simpleClassName}(id: number) {
+ return requestClient.delete(`${baseURL}/delete?id=${id}`);
+}
+
+#if ( $table.templateType != 2 && $deleteBatchEnable)
+/** 批量删除${table.classComment} */
+export function delete${simpleClassName}ListByIds(ids: number[]) {
+ return requestClient.delete(`${baseURL}/delete-list?ids=${ids.join(',')}`)
+}
+#end
+
+/** 导出${table.classComment} */
+export function export${simpleClassName}(params: any) {
+ return requestClient.download('${baseURL}/export-excel', params);
+}
+
+## 特殊:主子表专属逻辑
+## TODO @puhui999:下面这块缩进调整了,会乱掉么?
+#foreach ($subTable in $subTables)
+ #set ($index = $foreach.count - 1)
+ #set ($subSimpleClassName = $subSimpleClassNames.get($index))
+ #set ($subPrimaryColumn = $subPrimaryColumns.get($index))##当前 primary 字段
+ #set ($subJoinColumn = $subJoinColumns.get($index))##当前 join 字段
+ #set ($SubJoinColumnName = $subJoinColumn.javaField.substring(0,1).toUpperCase() + ${subJoinColumn.javaField.substring(1)})##首字母大写
+ #set ($subSimpleClassName_strikeCase = $subSimpleClassName_strikeCases.get($index))
+ #set ($subJoinColumn_strikeCase = $subJoinColumn_strikeCases.get($index))
+ #set ($subClassNameVar = $subClassNameVars.get($index))
+
+// ==================== 子表($subTable.classComment) ====================
+
+ ## 情况一:MASTER_ERP 时,需要分查询页子表
+ #if ( $table.templateType == 11 )
+ /** 获得${subTable.classComment}分页 */
+ export function get${subSimpleClassName}Page(params: PageParam) {
+ return requestClient.get>(`${baseURL}/${subSimpleClassName_strikeCase}/page`, { params });
+ }
+ ## 情况二:非 MASTER_ERP 时,需要列表查询子表
+ #else
+ #if ( $subTable.subJoinMany )
+ /** 获得${subTable.classComment}列表 */
+ export function get${subSimpleClassName}ListBy${SubJoinColumnName}(${subJoinColumn.javaField}: number) {
+ return requestClient.get<${simpleClassName}Api.${subSimpleClassName}[]>(`${baseURL}/${subSimpleClassName_strikeCase}/list-by-${subJoinColumn_strikeCase}?${subJoinColumn.javaField}=${${subJoinColumn.javaField}}`);
+ }
+ #else
+ /** 获得${subTable.classComment} */
+ export function get${subSimpleClassName}By${SubJoinColumnName}(${subJoinColumn.javaField}: number) {
+ return requestClient.get<${simpleClassName}Api.${subSimpleClassName}>(`${baseURL}/${subSimpleClassName_strikeCase}/get-by-${subJoinColumn_strikeCase}?${subJoinColumn.javaField}=${${subJoinColumn.javaField}}`);
+ }
+ #end
+ #end
+ ## 特殊:MASTER_ERP 时,支持单个的新增、修改、删除操作
+ #if ( $table.templateType == 11 )
+ /** 新增${subTable.classComment} */
+ export function create${subSimpleClassName}(data: ${simpleClassName}Api.${subSimpleClassName}) {
+ return requestClient.post(`${baseURL}/${subSimpleClassName_strikeCase}/create`, data);
+ }
+
+ /** 修改${subTable.classComment} */
+ export function update${subSimpleClassName}(data: ${simpleClassName}Api.${subSimpleClassName}) {
+ return requestClient.put(`${baseURL}/${subSimpleClassName_strikeCase}/update`, data);
+ }
+
+ /** 删除${subTable.classComment} */
+ export function delete${subSimpleClassName}(id: number) {
+ return requestClient.delete(`${baseURL}/${subSimpleClassName_strikeCase}/delete?id=${id}`);
+ }
+
+ #if ($deleteBatchEnable)
+ /** 批量删除${subTable.classComment} */
+ export function delete${subSimpleClassName}ListByIds(ids: number[]) {
+ return requestClient.delete(`${baseURL}/${subSimpleClassName_strikeCase}/delete-list?ids=${ids.join(',')}`)
+ }
+ #end
+
+ /** 获得${subTable.classComment} */
+ export function get${subSimpleClassName}(id: number) {
+ return requestClient.get<${simpleClassName}Api.${subSimpleClassName}>(`${baseURL}/${subSimpleClassName_strikeCase}/get?id=${id}`);
+ }
+ #end
+#end
+
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/form.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/views/form.vue.vm
similarity index 99%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/form.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/views/form.vue.vm
index 90c0a6e9c5..c87cd2ad31 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/form.vue.vm
+++ b/yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/views/form.vue.vm
@@ -8,7 +8,7 @@ import { ImageUpload, FileUpload } from "#/components/upload";
import { message, Tabs, Form, Input, Textarea, Select, RadioGroup, Radio, CheckboxGroup, Checkbox, DatePicker, TreeSelect } from 'ant-design-vue';
import { DICT_TYPE, getDictOptions } from '#/utils';
#if($table.templateType == 2)## 树表需要导入这些
-import { get${simpleClassName}List } from '#/api/${table.moduleName}/${simpleClassName_strikeCase}';
+import { get${simpleClassName}List } from '#/api/${table.moduleName}/${table.businessName}';
import { handleTree } from '@vben/utils'
#end
## 特殊:主子表专属逻辑
@@ -22,7 +22,7 @@ import { handleTree } from '@vben/utils'
import { computed, ref } from 'vue';
import { $t } from '#/locales';
-import { get${simpleClassName}, create${simpleClassName}, update${simpleClassName} } from '#/api/${table.moduleName}/${simpleClassName_strikeCase}';
+import { get${simpleClassName}, create${simpleClassName}, update${simpleClassName} } from '#/api/${table.moduleName}/${table.businessName}';
const emit = defineEmits(['success']);
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/index.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/views/index.vue.vm
similarity index 90%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/index.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/views/index.vue.vm
index 1888a7c37f..c70bca31e8 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/index.vue.vm
+++ b/yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/views/index.vue.vm
@@ -8,7 +8,7 @@ import { Button, message,Tabs,Pagination,Form,RangePicker,DatePicker,Select,Inpu
import { DictTag } from '#/components/dict-tag';
import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
import ${simpleClassName}Form from './modules/form.vue';
-import { Download, Plus, RefreshCw, Search } from '@vben/icons';
+import { Download, Plus, RefreshCw, Search, Trash2 } from '@vben/icons';
import { ContentWrap } from '#/components/content-wrap';
import { VxeColumn, VxeTable } from '#/adapter/vxe-table';
import { TableToolbar } from '#/components/table-toolbar';
@@ -29,7 +29,8 @@ import { $t } from '#/locales';
import { handleTree,isEmpty } from '@vben/utils'
import { get${simpleClassName}List, delete${simpleClassName}, export${simpleClassName} } from '#/api/${table.moduleName}/${simpleClassName_strikeCase}';
#else## 标准表接口
-import { get${simpleClassName}Page, delete${simpleClassName}, export${simpleClassName} } from '#/api/${table.moduleName}/${simpleClassName_strikeCase}';
+import { isEmpty } from '@vben/utils';
+import { get${simpleClassName}Page, delete${simpleClassName},#if ($deleteBatchEnable) delete${simpleClassName}ListByIds,#end export${simpleClassName} } from '#/api/${table.moduleName}/${table.businessName}';
#end
import { downloadFileFromBlobPart } from '@vben/utils';
@@ -152,11 +153,38 @@ async function onDelete(row: ${simpleClassName}Api.${simpleClassName}) {
key: 'action_process_msg',
});
await getList();
- } catch {
+ } finally {
hideLoading();
}
}
+#if ($table.templateType != 2 && $deleteBatchEnable)
+/** 批量删除${table.classComment} */
+async function onDeleteBatch() {
+ const hideLoading = message.loading({
+ content: $t('ui.actionMessage.deleting'),
+ duration: 0,
+ key: 'action_process_msg',
+ });
+ try {
+ await delete${simpleClassName}ListByIds(deleteIds.value);
+ message.success( $t('ui.actionMessage.deleteSuccess') );
+ await getList();
+ } finally {
+ hideLoading();
+ }
+}
+
+const deleteIds = ref([]) // 待删除${table.classComment} ID
+function setDeleteIds({
+ records,
+}: {
+ records: ${simpleClassName}Api.${simpleClassName}[];
+}) {
+ deleteIds.value = records.map((item) => item.id);
+}
+#end
+
/** 导出表格 */
async function onExport() {
try {
@@ -302,6 +330,19 @@ onMounted(() => {
>
{{ $t('ui.actionTitle.export') }}
+ #if ($table.templateType != 2 && $deleteBatchEnable)
+
+ #end
{
#end
show-overflow
:loading="loading"
+#if ($table.templateType != 2 && $deleteBatchEnable)
+ @checkboxAll="setDeleteIds"
+ @checkboxChange="setDeleteIds"
+#end
>
+#if ($table.templateType != 2 && $deleteBatchEnable)
+
+#end
## 特殊:主子表专属逻辑
#if ( $table.templateType == 12 && $subTables && $subTables.size() > 0 )
@@ -421,7 +469,6 @@ onMounted(() => {
#end
-
#if ($table.templateType == 11) ## erp情况
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/form_sub_erp.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/form_sub_erp.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/form_sub_erp.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/form_sub_erp.vue.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/form_sub_inner.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/form_sub_inner.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/form_sub_inner.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/form_sub_inner.vue.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/form_sub_normal.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/form_sub_normal.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/form_sub_normal.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/form_sub_normal.vue.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/list_sub_erp.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/list_sub_erp.vue.vm
similarity index 89%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/list_sub_erp.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/list_sub_erp.vue.vm
index 9ee3364b5b..5e69257458 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/list_sub_erp.vue.vm
+++ b/yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/list_sub_erp.vue.vm
@@ -10,7 +10,7 @@
import type { VxeTableInstance } from '#/adapter/vxe-table';
import { DictTag } from '#/components/dict-tag';
- import { DICT_TYPE, getDictOptions } from '#/utils';
+ import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
import { VxeColumn, VxeTable } from '#/adapter/vxe-table';
import { reactive,ref, h, nextTick,watch,onMounted } from 'vue';
import { cloneDeep, formatDateTime } from '@vben/utils';
@@ -22,15 +22,15 @@
import { Tinymce as RichTextarea } from '#/components/tinymce';
import { ImageUpload, FileUpload } from "#/components/upload";
import { message,Button, Tabs,Pagination, Form, Input, Textarea, Select, RadioGroup, Radio, CheckboxGroup, Checkbox,RangePicker, DatePicker, TreeSelect } from 'ant-design-vue';
- import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
- import { Plus } from '@vben/icons';
+ import { Plus, Trash2 } from '@vben/icons';
import { $t } from '#/locales';
import { TableToolbar } from '#/components/table-toolbar';
import { useTableToolbar } from '#/hooks';
#end
#if ($table.templateType == 11) ## erp
- import { delete${subSimpleClassName}, get${subSimpleClassName}Page } from '#/api/${table.moduleName}/${simpleClassName_strikeCase}';
+ import { delete${subSimpleClassName},#if ($deleteBatchEnable) delete${subSimpleClassName}ListByIds,#end get${subSimpleClassName}Page } from '#/api/${table.moduleName}/${table.businessName}';
+ import { isEmpty } from '@vben/utils';
#else
#if ($subTable.subJoinMany) ## 一对多
import { get${subSimpleClassName}ListBy${SubJoinColumnName} } from '#/api/${table.moduleName}/${simpleClassName_strikeCase}';
@@ -76,11 +76,38 @@ async function onDelete(row: ${simpleClassName}Api.${subSimpleClassName}) {
content: $t('ui.actionMessage.deleteSuccess', [row.id]),
key: 'action_process_msg',
});
- getList();
- } catch {
+ await getList();
+ } finally {
hideLoading();
}
}
+
+#if ($deleteBatchEnable)
+/** 批量删除${subTable.classComment} */
+async function onDeleteBatch() {
+ const hideLoading = message.loading({
+ content: $t('ui.actionMessage.deleting'),
+ duration: 0,
+ key: 'action_process_msg',
+ });
+ try {
+ await delete${subSimpleClassName}ListByIds(deleteIds.value);
+ message.success( $t('ui.actionMessage.deleteSuccess') );
+ await getList();
+ } finally {
+ hideLoading();
+ }
+}
+
+const deleteIds = ref([]) // 待删除${subTable.classComment} ID
+function setDeleteIds({
+ records,
+}: {
+ records: ${simpleClassName}Api.${subSimpleClassName}[];
+}) {
+ deleteIds.value = records.map((item) => item.id);
+}
+#end
#end
const loading = ref(true) // 列表的加载中
@@ -277,6 +304,19 @@ onMounted(() => {
>
{{ $t('ui.actionTitle.create', ['${table.classComment}']) }}
+ #if ($deleteBatchEnable)
+
+ #end
{
:data="list"
show-overflow
:loading="loading"
+ #if ($deleteBatchEnable)
+ @checkboxAll="setDeleteIds"
+ @checkboxChange="setDeleteIds"
+ #end
>
+ #if ($deleteBatchEnable)
+
+ #end
#foreach($column in $subColumns)
#if ($column.listOperationResult)
#set ($dictType=$column.dictType)
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/list_sub_inner.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/list_sub_inner.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/list_sub_inner.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/list_sub_inner.vue.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/api/api.ts.vm b/yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/schema/api/api.ts.vm
similarity index 93%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/api/api.ts.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/schema/api/api.ts.vm
index d3342f1fc8..5a7602818e 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/api/api.ts.vm
+++ b/yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/schema/api/api.ts.vm
@@ -89,6 +89,13 @@ export function delete${simpleClassName}(id: number) {
return requestClient.delete(`${baseURL}/delete?id=${id}`);
}
+#if ( $table.templateType != 2 && $deleteBatchEnable)
+/** 批量删除${table.classComment} */
+export function delete${simpleClassName}ListByIds(ids: number[]) {
+ return requestClient.delete(`${baseURL}/delete-list?ids=${ids.join(',')}`)
+}
+#end
+
/** 导出${table.classComment} */
export function export${simpleClassName}(params: any) {
return requestClient.download('${baseURL}/export-excel', params);
@@ -144,6 +151,13 @@ export function delete${subSimpleClassName}(id: number) {
return requestClient.delete(`${baseURL}/${subSimpleClassName_strikeCase}/delete?id=${id}`);
}
+#if ($deleteBatchEnable)
+/** 批量删除${subTable.classComment} */
+export function delete${subSimpleClassName}ListByIds(ids: number[]) {
+ return requestClient.delete(`${baseURL}/${subSimpleClassName_strikeCase}/delete-list?ids=${ids.join(',')}`)
+}
+#end
+
/** 获得${subTable.classComment} */
export function get${subSimpleClassName}(id: number) {
return requestClient.get<${simpleClassName}Api.${subSimpleClassName}>(`${baseURL}/${subSimpleClassName_strikeCase}/get?id=${id}`);
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/data.ts.vm b/yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/schema/views/data.ts.vm
similarity index 88%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/data.ts.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/schema/views/data.ts.vm
index d7a90dcc20..113061e29a 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/data.ts.vm
+++ b/yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/schema/views/data.ts.vm
@@ -1,16 +1,17 @@
import type { VbenFormSchema } from '#/adapter/form';
-import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table';
-import type { ${simpleClassName}Api } from '#/api/${table.moduleName}/${simpleClassName_strikeCase}';
+import type { VxeTableGridOptions } from '#/adapter/vxe-table';
+import type { ${simpleClassName}Api } from '#/api/${table.moduleName}/${table.businessName}';
import { z } from '#/adapter/form';
+import {
+ DICT_TYPE,
+ getDictOptions,
+ getRangePickerDefaultProps,
+} from '#/utils';
#if(${table.templateType} == 2)## 树表需要导入这些
-import { get${simpleClassName}List } from '#/api/${table.moduleName}/${simpleClassName_strikeCase}';
+import { get${simpleClassName}List } from '#/api/${table.moduleName}/${table.businessName}';
import { handleTree } from '@vben/utils';
#end
-import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
-import { useAccess } from '@vben/access';
-
-const { hasAccessByCodes } = useAccess();
/** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] {
@@ -185,10 +186,11 @@ export function useGridFormSchema(): VbenFormSchema[] {
}
/** 列表的字段 */
-export function useGridColumns(
- onActionClick?: OnActionClickFn<${simpleClassName}Api.${simpleClassName}>,
-): VxeTableGridOptions<${simpleClassName}Api.${simpleClassName}>['columns'] {
+export function useGridColumns(): VxeTableGridOptions<${simpleClassName}Api.${simpleClassName}>['columns'] {
return [
+#if ($table.templateType != 2 && $deleteBatchEnable)
+ { type: 'checkbox', width: 40 },
+#end
#if ($table.templateType == 12) ## 内嵌情况
{ type: 'expand', width: 80, slots: { content: 'expand_content' } },
#end
@@ -216,43 +218,10 @@ export function useGridColumns(
#end
#end
{
- field: 'operation',
title: '操作',
- minWidth: 200,
- align: 'center',
+ width: 200,
fixed: 'right',
- headerAlign: 'center',
- showOverflow: false,
- cellRender: {
- attrs: {
- nameField: '${columns[0].javaField}',
- nameTitle: '${table.classComment}',
- onClick: onActionClick,
- },
- name: 'CellOperation',
- options: [
-#if (${table.templateType} == 2)## 树表特有操作
- {
- code: 'append',
- text: '新增下级',
- show: hasAccessByCodes(['${table.moduleName}:${simpleClassName_strikeCase}:create']),
- },
-#end
- {
- code: 'edit',
- show: hasAccessByCodes(['${table.moduleName}:${simpleClassName_strikeCase}:update']),
- },
- {
- code: 'delete',
- show: hasAccessByCodes(['${table.moduleName}:${simpleClassName_strikeCase}:delete']),
-#if (${table.templateType} == 2)## 树表禁止删除带有子节点的数据
- disabled: (row: ${simpleClassName}Api.${simpleClassName}) => {
- return !!(row.children && row.children.length > 0);
- },
-#end
- },
- ],
- },
+ slots: { default: 'actions' },
},
];
}
@@ -420,10 +389,11 @@ export function use${subSimpleClassName}GridFormSchema(): VbenFormSchema[] {
}
/** 列表的字段 */
-export function use${subSimpleClassName}GridColumns(
- onActionClick?: OnActionClickFn<${simpleClassName}Api.${subSimpleClassName}>,
-): VxeTableGridOptions<${simpleClassName}Api.${subSimpleClassName}>['columns'] {
+export function use${subSimpleClassName}GridColumns(): VxeTableGridOptions<${simpleClassName}Api.${subSimpleClassName}>['columns'] {
return [
+ #if ($table.templateType != 2 && $deleteBatchEnable)
+ { type: 'checkbox', width: 40 },
+ #end
#foreach($column in $subColumns)
#if ($column.listOperationResult)
#set ($dictType = $column.dictType)
@@ -445,31 +415,10 @@ export function use${subSimpleClassName}GridColumns(
#end
#end
{
- field: 'operation',
title: '操作',
- minWidth: 200,
- align: 'center',
+ width: 200,
fixed: 'right',
- headerAlign: 'center',
- showOverflow: false,
- cellRender: {
- attrs: {
- nameField: '${columns[0].javaField}',
- nameTitle: '${subTable.classComment}',
- onClick: onActionClick,
- },
- name: 'CellOperation',
- options: [
- {
- code: 'edit',
- show: hasAccessByCodes(['${table.moduleName}:${simpleClassName_strikeCase}:update']),
- },
- {
- code: 'delete',
- show: hasAccessByCodes(['${table.moduleName}:${simpleClassName_strikeCase}:delete']),
- },
- ],
- },
+ slots: { default: 'actions' },
},
];
}
@@ -515,27 +464,10 @@ export function use${subSimpleClassName}GridColumns(
#end
#end
{
- field: 'operation',
title: '操作',
- minWidth: 60,
- align: 'center',
+ width: 200,
fixed: 'right',
- headerAlign: 'center',
- showOverflow: false,
- cellRender: {
- attrs: {
- nameField: '${columns[0].javaField}',
- nameTitle: '${table.classComment}',
- onClick: onActionClick,
- },
- name: 'CellOperation',
- options: [
- {
- code: 'delete',
- show: hasAccessByCodes(['${table.moduleName}:${simpleClassName_strikeCase}:delete']),
- },
- ],
- },
+ slots: { default: 'actions' },
},
];
}
@@ -670,7 +602,6 @@ export function use${subSimpleClassName}GridColumns(
#end
];
}
-
#end
#end
#end
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/form.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/schema/views/form.vue.vm
similarity index 97%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/form.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/schema/views/form.vue.vm
index c4e0eecfb4..1c1b7d7f9c 100644
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/form.vue.vm
+++ b/yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/schema/views/form.vue.vm
@@ -1,5 +1,5 @@
+
+
+ #if ($table.templateType == 11) ## erp
+
+
+
+
+
+
+
+
+
+ #else
+
+ #end
+
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/modules/list_sub_inner.vue.vm b/yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/schema/views/modules/list_sub_inner.vue.vm
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/modules/list_sub_inner.vue.vm
rename to yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/schema/views/modules/list_sub_inner.vue.vm
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/file/erweima.jpg b/yudao-module-infra/src/main/resources/file/erweima.jpg
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/resources/file/erweima.jpg
rename to yudao-module-infra/src/main/resources/file/erweima.jpg
diff --git a/yudao-module-infra/yudao-module-infra-api/pom.xml b/yudao-module-infra/yudao-module-infra-api/pom.xml
deleted file mode 100644
index 168ea645bb..0000000000
--- a/yudao-module-infra/yudao-module-infra-api/pom.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
- cn.iocoder.boot
- yudao-module-infra
- ${revision}
-
- 4.0.0
- yudao-module-infra-api
- jar
-
- ${project.artifactId}
-
- infra 模块 API,暴露给其它模块调用
-
-
-
-
- cn.iocoder.boot
- yudao-common
-
-
-
-
- org.springframework.boot
- spring-boot-starter-validation
- true
-
-
-
-
diff --git a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/package-info.java b/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/package-info.java
deleted file mode 100644
index 9ed9a778e9..0000000000
--- a/yudao-module-infra/yudao-module-infra-api/src/main/java/cn/iocoder/yudao/module/infra/api/package-info.java
+++ /dev/null
@@ -1,4 +0,0 @@
-/**
- * infra API 包,定义暴露给其它模块的 API
- */
-package cn.iocoder.yudao.module.infra.api;
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/package-info.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/package-info.java
deleted file mode 100644
index af01680f6a..0000000000
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/api/package-info.java
+++ /dev/null
@@ -1 +0,0 @@
-package cn.iocoder.yudao.module.infra.api;
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/package-info.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/package-info.java
deleted file mode 100644
index 79682e2034..0000000000
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/package-info.java
+++ /dev/null
@@ -1 +0,0 @@
-package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03;
\ No newline at end of file
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/do.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/do.vm
deleted file mode 100644
index b019d6e12f..0000000000
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/dal/do.vm
+++ /dev/null
@@ -1,52 +0,0 @@
-package ${basePackage}.module.${table.moduleName}.dal.dataobject.${table.businessName};
-
-import lombok.*;
-import java.util.*;
-#foreach ($column in $columns)
-#if (${column.javaType} == "BigDecimal")
-import java.math.BigDecimal;
-#end
-#if (${column.javaType} == "LocalDateTime")
-import java.time.LocalDateTime;
-#end
-#end
-import com.baomidou.mybatisplus.annotation.*;
-import ${BaseDOClassName};
-
-/**
- * ${table.classComment} DO
- *
- * @author ${table.author}
- */
-@TableName("${table.tableName.toLowerCase()}")
-@KeySequence("${table.tableName.toLowerCase()}_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class ${table.className}DO extends BaseDO {
-
-## 特殊:树表专属逻辑
-#if ( $table.templateType == 2 )
- public static final Long ${treeParentColumn_javaField_underlineCase.toUpperCase()}_ROOT = 0L;
-
-#end
-#foreach ($column in $columns)
-#if (!${baseDOFields.contains(${column.javaField})})##排除 BaseDO 的字段
- /**
- * ${column.columnComment}
- #if ("$!column.dictType" != "")##处理枚举值
- *
- * 枚举 {@link TODO ${column.dictType} 对应的类}
- #end
- */
- #if (${column.primaryKey})##处理主键
- @TableId#if (${column.javaType} == 'String')(type = IdType.INPUT)#end
- #end
- private ${column.javaType} ${column.javaField};
-#end
-#end
-
-}
\ No newline at end of file
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/api/api.ts.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/api/api.ts.vm
deleted file mode 100644
index d3342f1fc8..0000000000
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/general/api/api.ts.vm
+++ /dev/null
@@ -1,153 +0,0 @@
-import type { PageParam, PageResult } from '@vben/request';
-import type { Dayjs } from 'dayjs';
-
-import { requestClient } from '#/api/request';
-#set ($baseURL = "/${table.moduleName}/${simpleClassName_strikeCase}")
-
-export namespace ${simpleClassName}Api {
-## 特殊:主子表专属逻辑
-#foreach ($subTable in $subTables)
- #set ($index = $foreach.count - 1)
- #set ($subSimpleClassName = $subSimpleClassNames.get($index))
- #set ($subColumns = $subColumnsList.get($index))##当前字段数组
- /** ${subTable.classComment}信息 */
- export interface ${subSimpleClassName} {
- #foreach ($column in $subColumns)
- #if ($column.createOperation || $column.updateOperation)
- #if(${column.javaType.toLowerCase()} == "long" || ${column.javaType.toLowerCase()} == "integer" || ${column.javaType.toLowerCase()} == "short" || ${column.javaType.toLowerCase()} == "double" || ${column.javaType.toLowerCase()} == "bigdecimal")
- ${column.javaField}#if($column.updateOperation && !$column.primaryKey && !$column.nullable)?#end: number; // ${column.columnComment}
- #elseif(${column.javaType.toLowerCase()} == "date" || ${column.javaType.toLowerCase()} == "localdate" || ${column.javaType.toLowerCase()} == "localdatetime")
- ${column.javaField}#if($column.updateOperation && !$column.primaryKey && !$column.nullable)?#end: string | Dayjs; // ${column.columnComment}
- #else
- ${column.javaField}#if($column.updateOperation && !$column.primaryKey && !$column.nullable)?#end: ${column.javaType.toLowerCase()}; // ${column.columnComment}
- #end
- #end
- #end
- }
-
-#end
- /** ${table.classComment}信息 */
- export interface ${simpleClassName} {
-#foreach ($column in $columns)
-#if ($column.createOperation || $column.updateOperation)
-#if(${column.javaType.toLowerCase()} == "long" || ${column.javaType.toLowerCase()} == "integer" || ${column.javaType.toLowerCase()} == "short" || ${column.javaType.toLowerCase()} == "double" || ${column.javaType.toLowerCase()} == "bigdecimal")
- ${column.javaField}#if($column.updateOperation && !$column.primaryKey && !$column.nullable)?#end: number; // ${column.columnComment}
-#elseif(${column.javaType.toLowerCase()} == "date" || ${column.javaType.toLowerCase()} == "localdate" || ${column.javaType.toLowerCase()} == "localdatetime")
- ${column.javaField}#if($column.updateOperation && !$column.primaryKey && !$column.nullable)?#end: string | Dayjs; // ${column.columnComment}
-#else
- ${column.javaField}#if($column.updateOperation && !$column.primaryKey && !$column.nullable)?#end: ${column.javaType.toLowerCase()}; // ${column.columnComment}
-#end
-#end
-#end
-#if ( $table.templateType == 2 )
- children?: ${simpleClassName}[];
-#end
-## 特殊:主子表专属逻辑
-#if ( $table.templateType == 10 || $table.templateType == 12 )
- #foreach ($subTable in $subTables)
- #set ($index = $foreach.count - 1)
- #set ($subSimpleClassName = $subSimpleClassNames.get($index))
- #if ( $subTable.subJoinMany )
- ${subSimpleClassName.toLowerCase()}s?: ${subSimpleClassName}[]
- #else
- ${subSimpleClassName.toLowerCase()}?: ${subSimpleClassName}
- #end
- #end
-#end
- }
-}
-
-#if ( $table.templateType != 2 )
-/** 查询${table.classComment}分页 */
-export function get${simpleClassName}Page(params: PageParam) {
- return requestClient.get>('${baseURL}/page', { params });
-}
-#else
-/** 查询${table.classComment}列表 */
-export function get${simpleClassName}List(params: any) {
- return requestClient.get<${simpleClassName}Api.${simpleClassName}[]>('${baseURL}/list', { params });
-}
-#end
-
-/** 查询${table.classComment}详情 */
-export function get${simpleClassName}(id: number) {
- return requestClient.get<${simpleClassName}Api.${simpleClassName}>(`${baseURL}/get?id=${id}`);
-}
-
-/** 新增${table.classComment} */
-export function create${simpleClassName}(data: ${simpleClassName}Api.${simpleClassName}) {
- return requestClient.post('${baseURL}/create', data);
-}
-
-/** 修改${table.classComment} */
-export function update${simpleClassName}(data: ${simpleClassName}Api.${simpleClassName}) {
- return requestClient.put('${baseURL}/update', data);
-}
-
-/** 删除${table.classComment} */
-export function delete${simpleClassName}(id: number) {
- return requestClient.delete(`${baseURL}/delete?id=${id}`);
-}
-
-/** 导出${table.classComment} */
-export function export${simpleClassName}(params: any) {
- return requestClient.download('${baseURL}/export-excel', params);
-}
-
-## 特殊:主子表专属逻辑
-#foreach ($subTable in $subTables)
-#set ($index = $foreach.count - 1)
-#set ($subSimpleClassName = $subSimpleClassNames.get($index))
-#set ($subPrimaryColumn = $subPrimaryColumns.get($index))##当前 primary 字段
-#set ($subJoinColumn = $subJoinColumns.get($index))##当前 join 字段
-#set ($SubJoinColumnName = $subJoinColumn.javaField.substring(0,1).toUpperCase() + ${subJoinColumn.javaField.substring(1)})##首字母大写
-#set ($subSimpleClassName_strikeCase = $subSimpleClassName_strikeCases.get($index))
-#set ($subJoinColumn_strikeCase = $subJoinColumn_strikeCases.get($index))
-#set ($subClassNameVar = $subClassNameVars.get($index))
-
-// ==================== 子表($subTable.classComment) ====================
-
-## 情况一:MASTER_ERP 时,需要分查询页子表
-#if ( $table.templateType == 11 )
-/** 获得${subTable.classComment}分页 */
-export function get${subSimpleClassName}Page(params: PageParam) {
- return requestClient.get>(`${baseURL}/${subSimpleClassName_strikeCase}/page`, { params });
-}
-## 情况二:非 MASTER_ERP 时,需要列表查询子表
-#else
- #if ( $subTable.subJoinMany )
-/** 获得${subTable.classComment}列表 */
-export function get${subSimpleClassName}ListBy${SubJoinColumnName}(${subJoinColumn.javaField}: number) {
- return requestClient.get<${simpleClassName}Api.${subSimpleClassName}[]>(`${baseURL}/${subSimpleClassName_strikeCase}/list-by-${subJoinColumn_strikeCase}?${subJoinColumn.javaField}=${${subJoinColumn.javaField}}`);
-}
- #else
-/** 获得${subTable.classComment} */
-export function get${subSimpleClassName}By${SubJoinColumnName}(${subJoinColumn.javaField}: number) {
- return requestClient.get<${simpleClassName}Api.${subSimpleClassName}>(`${baseURL}/${subSimpleClassName_strikeCase}/get-by-${subJoinColumn_strikeCase}?${subJoinColumn.javaField}=${${subJoinColumn.javaField}}`);
-}
- #end
-#end
-## 特殊:MASTER_ERP 时,支持单个的新增、修改、删除操作
-#if ( $table.templateType == 11 )
-/** 新增${subTable.classComment} */
-export function create${subSimpleClassName}(data: ${simpleClassName}Api.${subSimpleClassName}) {
- return requestClient.post(`${baseURL}/${subSimpleClassName_strikeCase}/create`, data);
-}
-
-/** 修改${subTable.classComment} */
-export function update${subSimpleClassName}(data: ${simpleClassName}Api.${subSimpleClassName}) {
- return requestClient.put(`${baseURL}/${subSimpleClassName_strikeCase}/update`, data);
-}
-
-/** 删除${subTable.classComment} */
-export function delete${subSimpleClassName}(id: number) {
- return requestClient.delete(`${baseURL}/${subSimpleClassName_strikeCase}/delete?id=${id}`);
-}
-
-/** 获得${subTable.classComment} */
-export function get${subSimpleClassName}(id: number) {
- return requestClient.get<${simpleClassName}Api.${subSimpleClassName}>(`${baseURL}/${subSimpleClassName_strikeCase}/get?id=${id}`);
-}
-#end
-#end
-
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/modules/list_sub_erp.vue.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/modules/list_sub_erp.vue.vm
deleted file mode 100644
index 616be9f299..0000000000
--- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben5_antd/schema/views/modules/list_sub_erp.vue.vm
+++ /dev/null
@@ -1,181 +0,0 @@
-#set ($subTable = $subTables.get($subIndex))##当前表
-#set ($subColumns = $subColumnsList.get($subIndex))##当前字段数组
-#set ($subJoinColumn = $subJoinColumns.get($subIndex))##当前 join 字段
-#set ($subSimpleClassName = $subSimpleClassNames.get($subIndex))
-#set ($subJoinColumn = $subJoinColumns.get($subIndex))##当前 join 字段
-#set ($subSimpleClassName_strikeCase = $subSimpleClassName_strikeCases.get($subIndex))
-#set ($SubJoinColumnName = $subJoinColumn.javaField.substring(0,1).toUpperCase() + ${subJoinColumn.javaField.substring(1)})##首字母大写
-
-
-
- #if ($table.templateType == 11) ## erp
-
-
-
-
-
-
- #else
-
- #end
-
diff --git a/yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/api/package-info.java b/yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/api/package-info.java
new file mode 100644
index 0000000000..e3e7412e91
--- /dev/null
+++ b/yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/api/package-info.java
@@ -0,0 +1,4 @@
+/**
+ * product API 包,定义并实现提供给其它模块的 API
+ */
+package cn.iocoder.yudao.module.product.api;
diff --git a/yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/controller/admin/comment/ProductCommentController.http b/yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/controller/admin/comment/ProductCommentController.http
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/controller/app/comment/AppCommentController.http b/yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/controller/app/comment/AppCommentController.http
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/yudao-module-mall/yudao-module-promotion/src/main/java/cn/iocoder/yudao/module/promotion/api/package-info.java b/yudao-module-mall/yudao-module-promotion/src/main/java/cn/iocoder/yudao/module/promotion/api/package-info.java
new file mode 100644
index 0000000000..d507b68960
--- /dev/null
+++ b/yudao-module-mall/yudao-module-promotion/src/main/java/cn/iocoder/yudao/module/promotion/api/package-info.java
@@ -0,0 +1,4 @@
+/**
+ * promotion API 包,定义并实现提供给其它模块的 API
+ */
+package cn.iocoder.yudao.module.promotion.api;
diff --git a/yudao-module-member/src/main/java/cn/iocoder/yudao/module/member/api/message/package-info.java b/yudao-module-member/src/main/java/cn/iocoder/yudao/module/member/api/message/package-info.java
new file mode 100644
index 0000000000..084525b590
--- /dev/null
+++ b/yudao-module-member/src/main/java/cn/iocoder/yudao/module/member/api/message/package-info.java
@@ -0,0 +1,4 @@
+/**
+ * 消息队列的消息
+ */
+package cn.iocoder.yudao.module.member.api.message;
diff --git a/yudao-module-member/src/main/java/cn/iocoder/yudao/module/member/api/package-info.java b/yudao-module-member/src/main/java/cn/iocoder/yudao/module/member/api/package-info.java
new file mode 100644
index 0000000000..8f74d80917
--- /dev/null
+++ b/yudao-module-member/src/main/java/cn/iocoder/yudao/module/member/api/package-info.java
@@ -0,0 +1,4 @@
+/**
+ * member API 包,定义并实现提供给其它模块的 API
+ */
+package cn.iocoder.yudao.module.member.api;
diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/convert/《芋道 Spring Boot 对象转换 MapStruct 入门》.md b/yudao-module-member/src/main/java/cn/iocoder/yudao/module/member/convert/《芋道 Spring Boot 对象转换 MapStruct 入门》.md
similarity index 100%
rename from yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/convert/《芋道 Spring Boot 对象转换 MapStruct 入门》.md
rename to yudao-module-member/src/main/java/cn/iocoder/yudao/module/member/convert/《芋道 Spring Boot 对象转换 MapStruct 入门》.md
diff --git a/yudao-module-pay/src/main/java/cn/iocoder/yudao/module/pay/api/package-info.java b/yudao-module-pay/src/main/java/cn/iocoder/yudao/module/pay/api/package-info.java
new file mode 100644
index 0000000000..256747ca5f
--- /dev/null
+++ b/yudao-module-pay/src/main/java/cn/iocoder/yudao/module/pay/api/package-info.java
@@ -0,0 +1,4 @@
+/**
+ * pay API 包,定义并实现提供给其它模块的 API
+ */
+package cn.iocoder.yudao.module.pay.api;
diff --git a/yudao-module-pay/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/channel/PayChannelDO.java b/yudao-module-pay/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/channel/PayChannelDO.java
new file mode 100644
index 0000000000..00397863ce
--- /dev/null
+++ b/yudao-module-pay/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/channel/PayChannelDO.java
@@ -0,0 +1,118 @@
+package cn.iocoder.yudao.module.pay.dal.dataobject.channel;
+
+import cn.hutool.core.util.StrUtil;
+import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
+import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
+import cn.iocoder.yudao.module.pay.enums.PayChannelEnum;
+import cn.iocoder.yudao.module.pay.framework.pay.core.client.PayClientConfig;
+import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
+import cn.iocoder.yudao.module.pay.dal.dataobject.app.PayAppDO;
+import cn.iocoder.yudao.module.pay.framework.pay.core.client.impl.NonePayClientConfig;
+import cn.iocoder.yudao.module.pay.framework.pay.core.client.impl.alipay.AlipayAppPayClient;
+import cn.iocoder.yudao.module.pay.framework.pay.core.client.impl.alipay.AlipayPayClientConfig;
+import cn.iocoder.yudao.module.pay.framework.pay.core.client.impl.weixin.WxPayClientConfig;
+import com.baomidou.mybatisplus.annotation.KeySequence;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler;
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
+import com.fasterxml.jackson.core.type.TypeReference;
+import lombok.*;
+
+import java.lang.reflect.Field;
+
+/**
+ * 支付渠道 DO
+ * 一个应用下,会有多种支付渠道,例如说微信支付、支付宝支付等等
+ *
+ * 即 PayAppDO : PayChannelDO = 1 : n
+ *
+ * @author 芋道源码
+ */
+@TableName(value = "pay_channel", autoResultMap = true)
+@KeySequence("pay_channel_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class PayChannelDO extends TenantBaseDO {
+
+ /**
+ * 渠道编号,数据库自增
+ */
+ private Long id;
+ /**
+ * 渠道编码
+ *
+ * 枚举 {@link PayChannelEnum}
+ */
+ private String code;
+ /**
+ * 状态
+ *
+ * 枚举 {@link CommonStatusEnum}
+ */
+ private Integer status;
+ /**
+ * 渠道费率,单位:百分比
+ */
+ private Double feeRate;
+ /**
+ * 备注
+ */
+ private String remark;
+
+ /**
+ * 应用编号
+ *
+ * 关联 {@link PayAppDO#getId()}
+ */
+ private Long appId;
+ /**
+ * 支付渠道配置
+ */
+ @TableField(typeHandler = PayClientConfigTypeHandler.class)
+ private PayClientConfig config;
+
+ public static class PayClientConfigTypeHandler extends AbstractJsonTypeHandler