commit ae0b2dcd6e140537742b11ffeb384c7f9b0dea9f
Author: dimengzhe <251008545@qq.com>
Date: Mon Apr 17 23:02:30 2023 +0800
项目构建
diff --git a/HELP.md b/HELP.md
new file mode 100644
index 0000000..744564c
--- /dev/null
+++ b/HELP.md
@@ -0,0 +1,6 @@
+#1、搭建框架
+#2、数据库设计
+#3、页面设计
+#4、编写代码
+
+
diff --git a/demo-common/demo-common-base/pom.xml b/demo-common/demo-common-base/pom.xml
new file mode 100644
index 0000000..96a7f41
--- /dev/null
+++ b/demo-common/demo-common-base/pom.xml
@@ -0,0 +1,28 @@
+
+
+
+ com.yxt.demo
+ demo-common
+ 0.0.1
+
+ 4.0.0
+ demo-common-base
+ 0.0.1
+
+
+
+ com.yxt.demo
+ demo-common-core
+ 0.0.1
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo-common/demo-common-base/src/main/java/com/yxt/demo/common/base/config/handler/CustomException.java b/demo-common/demo-common-base/src/main/java/com/yxt/demo/common/base/config/handler/CustomException.java
new file mode 100644
index 0000000..d30f871
--- /dev/null
+++ b/demo-common/demo-common-base/src/main/java/com/yxt/demo/common/base/config/handler/CustomException.java
@@ -0,0 +1,44 @@
+package com.yxt.demo.common.base.config.handler;
+
+
+/**
+ * @Author dimengzhe
+ * @Date 2022/5/13 17:23
+ * @Description
+ */
+public class CustomException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+
+ public CustomException() {
+ super();
+ }
+
+ public CustomException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+ super(message, cause, enableSuppression, writableStackTrace);
+ }
+
+ /**
+ * @param message
+ * @param cause
+ */
+ public CustomException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * @param message
+ */
+ public CustomException(String message) {
+ super(message);
+ }
+
+ /**
+ * @param cause
+ */
+ public CustomException(Throwable cause) {
+ super(cause);
+ }
+
+}
diff --git a/demo-common/demo-common-base/src/main/java/com/yxt/demo/common/base/config/utils/SpringUtil.java b/demo-common/demo-common-base/src/main/java/com/yxt/demo/common/base/config/utils/SpringUtil.java
new file mode 100644
index 0000000..f0b347d
--- /dev/null
+++ b/demo-common/demo-common-base/src/main/java/com/yxt/demo/common/base/config/utils/SpringUtil.java
@@ -0,0 +1,72 @@
+package com.yxt.demo.common.base.config.utils;
+
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @Author dimengzhe
+ * @Date 2022/7/10 14:42
+ * @Description
+ */
+@Component
+public class SpringUtil implements ApplicationContextAware {
+
+ private static ApplicationContext applicationContext;
+
+ @Override
+ public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+ if (SpringUtil.applicationContext == null) {
+ SpringUtil.applicationContext = applicationContext;
+ }
+ }
+
+ // 获取applicationContext
+ public static ApplicationContext getApplicationContext() {
+ return applicationContext;
+ }
+
+ // 通过name获取 Bean.
+ public static Object getBean(String name) {
+ return getApplicationContext().getBean(name);
+ }
+
+ // 通过class获取Bean.
+ public static T getBean(Class clazz) {
+ return getApplicationContext().getBean(clazz);
+ }
+
+ // 通过name,以及Clazz返回指定的Bean
+ public static T getBean(String name, Class clazz) {
+ return getApplicationContext().getBean(name, clazz);
+ }
+
+ /**
+ * 通过类型获取Spring容器中的对象
+ *
+ * @param type
+ * @param
+ * @return
+ */
+ public static Map getBeansOfType(Class type) {
+ Map beansOfType = getApplicationContext().getBeansOfType(type);
+ return beansOfType;
+ }
+
+ /**
+ * 通过类型获取Spring容器中的对象
+ *
+ * @param type
+ * @param includeNonSingletons
+ * @param allowEagerInit
+ * @param
+ * @return
+ */
+ public static Map getBeansOfType(Class type, boolean includeNonSingletons, boolean allowEagerInit) {
+ Map beansOfType = getApplicationContext().getBeansOfType(type, includeNonSingletons, allowEagerInit);
+ return beansOfType;
+ }
+}
diff --git a/demo-common/demo-common-base/src/main/java/com/yxt/demo/common/base/config/utils/jackson/CustomizeNullJsonSerializer.java b/demo-common/demo-common-base/src/main/java/com/yxt/demo/common/base/config/utils/jackson/CustomizeNullJsonSerializer.java
new file mode 100644
index 0000000..1cec502
--- /dev/null
+++ b/demo-common/demo-common-base/src/main/java/com/yxt/demo/common/base/config/utils/jackson/CustomizeNullJsonSerializer.java
@@ -0,0 +1,72 @@
+package com.yxt.demo.common.base.config.utils.jackson;
+
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.SerializerProvider;
+
+import java.io.IOException;
+
+/**
+ * @Author dimengzhe
+ * @Date 2022/5/13 17:15
+ * @Description
+ */
+public class CustomizeNullJsonSerializer {
+
+ /**
+ * 处理数组集合类型的null值
+ */
+ public static class NullArrayJsonSerializer extends JsonSerializer