beanFieldNames) {
+ StringBuilder builder = new StringBuilder();
+ beanFieldNames.forEach(b -> {
+ if (!"id".equals(b)) {
+ builder.append("\t\t\t\n");
+ }
+ });
+ return builder.toString();
+ }
+
+ private static String getHtmlThs(List beanFieldNames) {
+ StringBuilder builder = new StringBuilder();
+ beanFieldNames.forEach(b -> {
+ builder.append("\t\t\t\t\t\t\t\t\t| {beanFieldName} | \n".replace("{beanFieldName}", b));
+ });
+ return builder.toString();
+ }
+
+ private static String getHtmlColumnsDatas(List beanFieldNames) {
+ StringBuilder builder = new StringBuilder();
+ beanFieldNames.forEach(b -> {
+ builder.append("\t\t\t\t{\"data\" : \"{beanFieldName}\", \"defaultContent\" : \"\"},\n"
+ .replace("{beanFieldName}", b));
+ });
+
+ builder.append("");
+ return builder.toString();
+ }
+
+ private static String getHtmlColumnDefs(List beanFieldNames) {
+ StringBuilder builder = new StringBuilder();
+ for (int i = 0; i < beanFieldNames.size(); i++) {
+ builder.append("\t\t\t\t{\"name\" : \"" + beanFieldNames.get(i) + "\", \"targets\" : \"" + i + "\"},\n");
+ }
+
+ return builder.toString();
+ }
+}
diff --git a/src/main/java/com/boot/security/server/utils/UserUtil.java b/src/main/java/com/boot/security/server/utils/UserUtil.java
new file mode 100644
index 0000000..e8f9c7d
--- /dev/null
+++ b/src/main/java/com/boot/security/server/utils/UserUtil.java
@@ -0,0 +1,39 @@
+package com.boot.security.server.utils;
+
+import java.util.List;
+
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.session.Session;
+import org.apache.shiro.subject.Subject;
+import org.springframework.security.core.context.SecurityContextHolder;
+
+import com.boot.security.server.dto.LoginUser;
+import com.boot.security.server.model.SysUser;
+import com.zw.admin.server.constants.UserConstants;
+import com.zw.admin.server.model.Permission;
+import com.zw.admin.server.model.User;
+
+public class UserUtil {
+
+ public static SysUser getCurrentUser() {
+ LoginUser loginUser = (LoginUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
+
+ return loginUser;
+ }
+
+ public static void setUserSession(User user) {
+ getSession().setAttribute(UserConstants.LOGIN_USER, user);
+ }
+
+ @SuppressWarnings("unchecked")
+ public static List getCurrentPermissions() {
+ List list = (List) getSession().getAttribute(UserConstants.USER_PERMISSIONS);
+
+ return list;
+ }
+
+ public static void setPermissionSession(List list) {
+ getSession().setAttribute(UserConstants.USER_PERMISSIONS, list);
+ }
+
+}
diff --git a/src/main/resources/logback-admin.xml b/src/main/resources/logback-admin.xml
new file mode 100644
index 0000000..20ec96f
--- /dev/null
+++ b/src/main/resources/logback-admin.xml
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+ %d [%thread] %-5level %logger{50} -[%file:%line]- %msg%n
+
+ UTF-8
+
+
+
+
+ ${logFile}
+
+ %d [%thread] %-5level -[%file:%line]- %msg%n
+
+ UTF-8
+
+
+ ${logFile}.%d{yyyy-MM-dd}.%i
+ ${maxFileSize}
+
+
+
+
+ ${logFile}.error
+
+ %d [%thread] %-5level %logger{36} -[%file:%line]- %msg%n
+
+ UTF-8
+
+
+ ${logFile}.error.%d{yyyy-MM-dd}.%i
+ ${maxFileSize}
+
+
+ error
+ ACCEPT
+ DENY
+
+
+
+
+ ${logFile}.sql
+
+ %d [%thread] %msg%n
+
+ UTF-8
+
+
+ ${logFile}.sql.%d{yyyy-MM-dd}.%i
+ ${maxFileSize}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/quartz.properties b/src/main/resources/quartz.properties
new file mode 100644
index 0000000..e560f7c
--- /dev/null
+++ b/src/main/resources/quartz.properties
@@ -0,0 +1,12 @@
+org.quartz.scheduler.instanceName = DefaultQuartzScheduler
+org.quartz.scheduler.instanceId = AUTO
+org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
+org.quartz.threadPool.threadCount = 10
+org.quartz.threadPool.threadPriority = 5
+
+org.quartz.jobStore.misfireThreshold = 60000
+org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
+org.quartz.jobStore.tablePrefix = QRTZ_
+
+org.quartz.jobStore.isClustered = true
+org.quartz.jobStore.clusterCheckinInterval = 15000