diff --git a/pom.xml b/pom.xml
index a1ffaf2d30..295927311b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,15 +27,16 @@
4.1.90.Final
2.10.1
- 5.3.26
- 2.7.9
+ 6.0.11
+ 3.1.2
2.3.0
8.0.32
1.7.36
5.9.2
- 1.3.2
+ 6.0.0
+ 2.1.1
4.0.10
diff --git a/xxl-job-admin/Dockerfile b/xxl-job-admin/Dockerfile
old mode 100644
new mode 100755
index dc1953712b..4b178b5e09
--- a/xxl-job-admin/Dockerfile
+++ b/xxl-job-admin/Dockerfile
@@ -1,11 +1,13 @@
-FROM openjdk:8-jre-slim
-MAINTAINER xuxueli
+# 基础镜像使用java
+FROM eclipse-temurin:17-jre
-ENV PARAMS=""
+MAINTAINER enjoy-ai
-ENV TZ=PRC
+ENV PARAMS=""
+WORKDIR /home/admin
+ADD target/xxl-job-admin-*.jar /home/admin/app.jar
+# TODO 时区调整
+ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
-ADD target/xxl-job-admin-*.jar /app.jar
-
-ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS /app.jar $PARAMS"]
\ No newline at end of file
+ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/home/admin/app.jar"]
\ No newline at end of file
diff --git a/xxl-job-admin/pom.xml b/xxl-job-admin/pom.xml
index 4d3167071a..ebdea83ff6 100644
--- a/xxl-job-admin/pom.xml
+++ b/xxl-job-admin/pom.xml
@@ -59,12 +59,7 @@
mybatis-spring-boot-starter
${mybatis-spring-boot-starter.version}
-
-
- com.mysql
- mysql-connector-j
- ${mysql-connector-j.version}
-
+
@@ -72,8 +67,26 @@
xxl-job-core
${project.parent.version}
+
+ jakarta.annotation
+ jakarta.annotation-api
+ ${jakarta.annotation-api.version}
+ compile
+
+
+ jakarta.servlet
+ jakarta.servlet-api
+ ${jakarta.servlet-api.version}
+ compile
+
-
+
+
+ org.postgresql
+ postgresql
+ 42.6.0
+
+
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/IndexController.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/IndexController.java
index a84fb7dd7e..2e7586ee4f 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/IndexController.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/IndexController.java
@@ -1,9 +1,13 @@
package com.xxl.job.admin.controller;
import com.xxl.job.admin.controller.annotation.PermissionLimit;
+import com.xxl.job.admin.core.model.XxlJobUser;
import com.xxl.job.admin.service.LoginService;
import com.xxl.job.admin.service.XxlJobService;
import com.xxl.job.core.biz.model.ReturnT;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -15,9 +19,6 @@
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.RedirectView;
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
@@ -36,11 +37,12 @@ public class IndexController {
@RequestMapping("/")
- public String index(Model model) {
+ public String index(Model model, HttpServletRequest request) {
+ XxlJobUser loginUser = (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY);
Map dashboardMap = xxlJobService.dashboardInfo();
+ dashboardMap.put("user", loginUser);
model.addAllAttributes(dashboardMap);
-
return "index";
}
@@ -58,6 +60,7 @@ public ModelAndView toLogin(HttpServletRequest request, HttpServletResponse resp
modelAndView.setView(new RedirectView("/",true,false));
return modelAndView;
}
+
return new ModelAndView("login");
}
@@ -77,12 +80,13 @@ public ReturnT logout(HttpServletRequest request, HttpServletResponse re
}
@RequestMapping("/help")
- public String help() {
+ public String help(HttpServletRequest request, Model model) {
/*if (!PermissionInterceptor.ifLogin(request)) {
return "redirect:/toLogin";
}*/
+ model.addAttribute("user", (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY));
return "help";
}
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobApiController.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobApiController.java
index aa51e73907..8d0f566967 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobApiController.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobApiController.java
@@ -8,14 +8,14 @@
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.util.GsonTool;
import com.xxl.job.core.util.XxlJobRemotingUtil;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobCodeController.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobCodeController.java
index 302b9bf9eb..3f566b33af 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobCodeController.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobCodeController.java
@@ -2,18 +2,20 @@
import com.xxl.job.admin.core.model.XxlJobInfo;
import com.xxl.job.admin.core.model.XxlJobLogGlue;
+import com.xxl.job.admin.core.model.XxlJobUser;
import com.xxl.job.admin.core.util.I18nUtil;
import com.xxl.job.admin.dao.XxlJobInfoDao;
import com.xxl.job.admin.dao.XxlJobLogGlueDao;
+import com.xxl.job.admin.service.LoginService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.glue.GlueTypeEnum;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;
@@ -50,6 +52,7 @@ public String index(HttpServletRequest request, Model model, int jobId) {
model.addAttribute("jobInfo", jobInfo);
model.addAttribute("jobLogGlues", jobLogGlues);
+ model.addAttribute("user", (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY));
return "jobcode/jobcode.index";
}
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java
index 8e0c5a4d56..6ae9eebfa6 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java
@@ -3,20 +3,22 @@
import com.xxl.job.admin.controller.annotation.PermissionLimit;
import com.xxl.job.admin.core.model.XxlJobGroup;
import com.xxl.job.admin.core.model.XxlJobRegistry;
+import com.xxl.job.admin.core.model.XxlJobUser;
import com.xxl.job.admin.core.util.I18nUtil;
import com.xxl.job.admin.dao.XxlJobGroupDao;
import com.xxl.job.admin.dao.XxlJobInfoDao;
import com.xxl.job.admin.dao.XxlJobRegistryDao;
+import com.xxl.job.admin.service.LoginService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.enums.RegistryConfig;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
import java.util.*;
/**
@@ -36,7 +38,8 @@ public class JobGroupController {
@RequestMapping
@PermissionLimit(adminuser = true)
- public String index(Model model) {
+ public String index(Model model, HttpServletRequest request) {
+ model.addAttribute("user", (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY));
return "jobgroup/jobgroup.index";
}
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java
index ea314b3239..2c76c53ff7 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java
@@ -1,6 +1,5 @@
package com.xxl.job.admin.controller;
-import com.xxl.job.admin.core.cron.CronExpression;
import com.xxl.job.admin.core.exception.XxlJobException;
import com.xxl.job.admin.core.model.XxlJobGroup;
import com.xxl.job.admin.core.model.XxlJobInfo;
@@ -19,6 +18,8 @@
import com.xxl.job.core.enums.ExecutorBlockStrategyEnum;
import com.xxl.job.core.glue.GlueTypeEnum;
import com.xxl.job.core.util.DateUtil;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
@@ -27,9 +28,6 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import java.text.ParseException;
import java.util.*;
/**
@@ -67,6 +65,7 @@ public String index(HttpServletRequest request, Model model, @RequestParam(requi
model.addAttribute("JobGroupList", jobGroupList);
model.addAttribute("jobGroup", jobGroup);
+ model.addAttribute("user", (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY));
return "jobinfo/jobinfo.index";
}
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java
index 67faebcce3..070cd888d9 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java
@@ -5,17 +5,21 @@
import com.xxl.job.admin.core.model.XxlJobGroup;
import com.xxl.job.admin.core.model.XxlJobInfo;
import com.xxl.job.admin.core.model.XxlJobLog;
+import com.xxl.job.admin.core.model.XxlJobUser;
import com.xxl.job.admin.core.scheduler.XxlJobScheduler;
import com.xxl.job.admin.core.util.I18nUtil;
import com.xxl.job.admin.dao.XxlJobGroupDao;
import com.xxl.job.admin.dao.XxlJobInfoDao;
import com.xxl.job.admin.dao.XxlJobLogDao;
+import com.xxl.job.admin.service.LoginService;
import com.xxl.job.core.biz.ExecutorBiz;
import com.xxl.job.core.biz.model.KillParam;
import com.xxl.job.core.biz.model.LogParam;
import com.xxl.job.core.biz.model.LogResult;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.util.DateUtil;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
@@ -24,8 +28,6 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@@ -73,6 +75,7 @@ public String index(HttpServletRequest request, Model model, @RequestParam(requi
// valid permission
JobInfoController.validPermission(request, jobInfo.getJobGroup());
}
+ model.addAttribute("user", (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY));
return "joblog/joblog.index";
}
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/UserController.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/UserController.java
index 3f4c7559b5..4f93778c29 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/UserController.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/UserController.java
@@ -8,6 +8,8 @@
import com.xxl.job.admin.dao.XxlJobUserDao;
import com.xxl.job.admin.service.LoginService;
import com.xxl.job.core.biz.model.ReturnT;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.DigestUtils;
@@ -16,8 +18,6 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -36,11 +36,13 @@ public class UserController {
@RequestMapping
@PermissionLimit(adminuser = true)
- public String index(Model model) {
+ public String index(Model model, HttpServletRequest request) {
// 执行器列表
List groupList = xxlJobGroupDao.findAll();
model.addAttribute("groupList", groupList);
+ model.addAttribute("user", (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY));
+
return "user/user.index";
}
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/CookieInterceptor.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/CookieInterceptor.java
index 930b9e8a84..23d3a0041c 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/CookieInterceptor.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/CookieInterceptor.java
@@ -2,13 +2,13 @@
import com.xxl.job.admin.core.util.FtlUtil;
import com.xxl.job.admin.core.util.I18nUtil;
+import jakarta.servlet.http.Cookie;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.AsyncHandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
/**
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/PermissionInterceptor.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/PermissionInterceptor.java
index ecb281145a..b6444ae774 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/PermissionInterceptor.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/PermissionInterceptor.java
@@ -4,14 +4,13 @@
import com.xxl.job.admin.core.model.XxlJobUser;
import com.xxl.job.admin.core.util.I18nUtil;
import com.xxl.job.admin.service.LoginService;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.AsyncHandlerInterceptor;
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
/**
* 权限拦截
*
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/WebMvcConfig.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/WebMvcConfig.java
index 0be6ba6631..561be371c7 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/WebMvcConfig.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/WebMvcConfig.java
@@ -1,11 +1,10 @@
package com.xxl.job.admin.controller.interceptor;
+import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-import javax.annotation.Resource;
-
/**
* web mvc config
*
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/resolver/WebExceptionResolver.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/resolver/WebExceptionResolver.java
index 114407b667..33614f1111 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/resolver/WebExceptionResolver.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/resolver/WebExceptionResolver.java
@@ -1,8 +1,10 @@
package com.xxl.job.admin.controller.resolver;
import com.xxl.job.admin.core.exception.XxlJobException;
-import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.admin.core.util.JacksonUtil;
+import com.xxl.job.core.biz.model.ReturnT;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@@ -11,8 +13,6 @@
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/alarm/impl/EmailJobAlarm.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/alarm/impl/EmailJobAlarm.java
index 16e5218489..04254b1010 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/alarm/impl/EmailJobAlarm.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/alarm/impl/EmailJobAlarm.java
@@ -7,12 +7,12 @@
import com.xxl.job.admin.core.model.XxlJobLog;
import com.xxl.job.admin.core.util.I18nUtil;
import com.xxl.job.core.biz.model.ReturnT;
+import jakarta.mail.internet.MimeMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.stereotype.Component;
-import javax.mail.internet.MimeMessage;
import java.text.MessageFormat;
import java.util.Arrays;
import java.util.HashSet;
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java
index 380b8a596b..20be206fb9 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java
@@ -3,13 +3,13 @@
import com.xxl.job.admin.core.alarm.JobAlarmer;
import com.xxl.job.admin.core.scheduler.XxlJobScheduler;
import com.xxl.job.admin.dao.*;
+import jakarta.annotation.Resource;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Component;
-import javax.annotation.Resource;
import javax.sql.DataSource;
import java.util.Arrays;
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/cron/CronExpression.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/cron/CronExpression.java
index fce23524d7..1791d88f1e 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/cron/CronExpression.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/cron/CronExpression.java
@@ -19,16 +19,7 @@
import java.io.Serializable;
import java.text.ParseException;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import java.util.SortedSet;
-import java.util.StringTokenizer;
-import java.util.TimeZone;
-import java.util.TreeSet;
+import java.util.*;
/**
* Provides a parser and evaluator for unix-like cron expressions. Cron
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/old/XxlJobDynamicScheduler.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/old/XxlJobDynamicScheduler.java
index 1e62aa1906..d9ec216180 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/old/XxlJobDynamicScheduler.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/old/XxlJobDynamicScheduler.java
@@ -25,9 +25,9 @@
//import org.slf4j.LoggerFactory;
//import org.springframework.util.Assert;
//
-//import javax.servlet.ServletException;
-//import javax.servlet.http.HttpServletRequest;
-//import javax.servlet.http.HttpServletResponse;
+//import jakarta.servlet.ServletException;
+//import jakarta.servlet.http.HttpServletRequest;
+//import jakarta.servlet.http.HttpServletResponse;
//import java.io.IOException;
//import java.util.Date;
//import java.util.concurrent.ConcurrentHashMap;
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteBusyover.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteBusyover.java
index 868560fc29..50fe5bd78a 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteBusyover.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteBusyover.java
@@ -1,7 +1,7 @@
package com.xxl.job.admin.core.route.strategy;
-import com.xxl.job.admin.core.scheduler.XxlJobScheduler;
import com.xxl.job.admin.core.route.ExecutorRouter;
+import com.xxl.job.admin.core.scheduler.XxlJobScheduler;
import com.xxl.job.admin.core.util.I18nUtil;
import com.xxl.job.core.biz.ExecutorBiz;
import com.xxl.job.core.biz.model.IdleBeatParam;
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteFailover.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteFailover.java
index a2e4c909a8..1b5750286b 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteFailover.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteFailover.java
@@ -1,7 +1,7 @@
package com.xxl.job.admin.core.route.strategy;
-import com.xxl.job.admin.core.scheduler.XxlJobScheduler;
import com.xxl.job.admin.core.route.ExecutorRouter;
+import com.xxl.job.admin.core.scheduler.XxlJobScheduler;
import com.xxl.job.admin.core.util.I18nUtil;
import com.xxl.job.core.biz.ExecutorBiz;
import com.xxl.job.core.biz.model.ReturnT;
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/CookieUtil.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/CookieUtil.java
index 34a898f3c4..16b58d0086 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/CookieUtil.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/CookieUtil.java
@@ -1,8 +1,8 @@
package com.xxl.job.admin.core.util;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.Cookie;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
/**
* Cookie.Util
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobUserDao.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobUserDao.java
index e840494753..78ba99f498 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobUserDao.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobUserDao.java
@@ -3,6 +3,7 @@
import com.xxl.job.admin.core.model.XxlJobUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
+
import java.util.List;
/**
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/service/LoginService.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/service/LoginService.java
index e1cf2e44ed..11b215d32d 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/service/LoginService.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/service/LoginService.java
@@ -6,12 +6,12 @@
import com.xxl.job.admin.core.util.JacksonUtil;
import com.xxl.job.admin.dao.XxlJobUserDao;
import com.xxl.job.core.biz.model.ReturnT;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.DigestUtils;
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import java.math.BigInteger;
/**
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java
index 530ee41c89..f610e8c233 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java
@@ -15,11 +15,11 @@
import com.xxl.job.core.enums.ExecutorBlockStrategyEnum;
import com.xxl.job.core.glue.GlueTypeEnum;
import com.xxl.job.core.util.DateUtil;
+import jakarta.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
-import javax.annotation.Resource;
import java.text.MessageFormat;
import java.util.*;
diff --git a/xxl-job-admin/src/main/resources/application.properties b/xxl-job-admin/src/main/resources/application.properties
index 8727b6c762..199281d4c2 100644
--- a/xxl-job-admin/src/main/resources/application.properties
+++ b/xxl-job-admin/src/main/resources/application.properties
@@ -1,5 +1,5 @@
### web
-server.port=8080
+server.port=8082
server.servlet.context-path=/xxl-job-admin
### actuator
@@ -23,10 +23,10 @@ mybatis.mapper-locations=classpath:/mybatis-mapper/*Mapper.xml
#mybatis.type-aliases-package=com.xxl.job.admin.core.model
### xxl-job, datasource
-spring.datasource.url=jdbc:mysql://127.0.0.1:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
-spring.datasource.username=root
-spring.datasource.password=root_pwd
-spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
+spring.datasource.url=${POSTGRESQL_URL:jdbc:postgresql://127.0.0.1:5432/xxx}
+spring.datasource.username=${POSTGRESQL_USER:xxx}
+spring.datasource.password=${POSTGRESQL_PASSWORD:xxx}
+spring.datasource.driver-class-name=org.postgresql.Driver
### datasource-pool
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
diff --git a/xxl-job-admin/src/main/resources/logback.xml b/xxl-job-admin/src/main/resources/logback.xml
index d4b08c2403..58f455f7d6 100644
--- a/xxl-job-admin/src/main/resources/logback.xml
+++ b/xxl-job-admin/src/main/resources/logback.xml
@@ -2,7 +2,9 @@
logback
-
+
+
+
diff --git a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobGroupMapper.xml b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobGroupMapper.xml
index 87299f88ba..e0a818c83a 100644
--- a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobGroupMapper.xml
+++ b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobGroupMapper.xml
@@ -35,17 +35,17 @@
- INSERT INTO xxl_job_group ( `app_name`, `title`, `address_type`, `address_list`, `update_time`)
+ INSERT INTO xxl_job_group ( app_name, title, address_type, address_list, update_time)
values ( #{appname}, #{title}, #{addressType}, #{addressList}, #{updateTime} );
UPDATE xxl_job_group
- SET `app_name` = #{appname},
- `title` = #{title},
- `address_type` = #{addressType},
- `address_list` = #{addressList},
- `update_time` = #{updateTime}
+ SET app_name = #{appname},
+ title = #{title},
+ address_type = #{addressType},
+ address_list = #{addressList},
+ update_time = #{updateTime}
WHERE id = #{id}
@@ -72,7 +72,7 @@
ORDER BY t.app_name, t.title, t.id ASC
- LIMIT #{offset}, #{pagesize}
+ LIMIT #{pagesize} OFFSET #{offset}
@@ -119,11 +119,11 @@
INSERT INTO xxl_job_log (
- `job_group`,
- `job_id`,
- `trigger_time`,
- `trigger_code`,
- `handle_code`
+ job_group,
+ job_id,
+ trigger_time,
+ trigger_code,
+ handle_code
) VALUES (
#{jobGroup},
#{jobId},
@@ -139,24 +139,24 @@
UPDATE xxl_job_log
SET
- `trigger_time`= #{triggerTime},
- `trigger_code`= #{triggerCode},
- `trigger_msg`= #{triggerMsg},
- `executor_address`= #{executorAddress},
- `executor_handler`=#{executorHandler},
- `executor_param`= #{executorParam},
- `executor_sharding_param`= #{executorShardingParam},
- `executor_fail_retry_count`= #{executorFailRetryCount}
- WHERE `id`= #{id}
+ trigger_time = #{triggerTime},
+ trigger_code = #{triggerCode},
+ trigger_msg = #{triggerMsg},
+ executor_address = #{executorAddress},
+ executor_handler =#{executorHandler},
+ executor_param = #{executorParam},
+ executor_sharding_param = #{executorShardingParam},
+ executor_fail_retry_count = #{executorFailRetryCount}
+ WHERE id = #{id}
UPDATE xxl_job_log
SET
- `handle_time`= #{handleTime},
- `handle_code`= #{handleCode},
- `handle_msg`= #{handleMsg}
- WHERE `id`= #{id}
+ handle_time = #{handleTime},
+ handle_code = #{handleCode},
+ handle_msg = #{handleMsg}
+ WHERE id = #{id}
@@ -178,7 +178,7 @@
SELECT
- COUNT(handle_code) triggerDayCount,
+ COUNT(handle_code) as triggerDayCount,
SUM(CASE WHEN (trigger_code in (0, 200) and handle_code = 0) then 1 else 0 end) as triggerDayCountRunning,
SUM(CASE WHEN handle_code = 200 then 1 else 0 end) as triggerDayCountSuc
FROM xxl_job_log
@@ -228,13 +228,13 @@
- SELECT id FROM `xxl_job_log`
- WHERE !(
+ SELECT id FROM xxl_job_log
+ WHERE not (
(trigger_code in (0, 200) and handle_code = 0)
OR
(handle_code = 200)
)
- AND `alarm_status` = 0
+ AND alarm_status = 0
ORDER BY id ASC
LIMIT #{pagesize}
@@ -242,8 +242,8 @@
UPDATE xxl_job_log
SET
- `alarm_status` = #{newAlarmStatus}
- WHERE `id`= #{logId} AND `alarm_status` = #{oldAlarmStatus}
+ alarm_status = #{newAlarmStatus}
+ WHERE id= #{logId} AND alarm_status = #{oldAlarmStatus}
diff --git a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobLogReportMapper.xml b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobLogReportMapper.xml
index 579d5f3940..1bc92defcd 100644
--- a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobLogReportMapper.xml
+++ b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobLogReportMapper.xml
@@ -21,10 +21,10 @@
INSERT INTO xxl_job_log_report (
- `trigger_day`,
- `running_count`,
- `suc_count`,
- `fail_count`
+ trigger_day,
+ running_count,
+ suc_count,
+ fail_count
) VALUES (
#{triggerDay},
#{runningCount},
@@ -38,10 +38,10 @@
UPDATE xxl_job_log_report
- SET `running_count` = #{runningCount},
- `suc_count` = #{sucCount},
- `fail_count` = #{failCount}
- WHERE `trigger_day` = #{triggerDay}
+ SET running_count = #{runningCount},
+ suc_count = #{sucCount},
+ fail_count = #{failCount}
+ WHERE trigger_day = #{triggerDay}
diff --git a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobRegistryMapper.xml b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobRegistryMapper.xml
index 4cae667a28..b1673d2531 100644
--- a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobRegistryMapper.xml
+++ b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobRegistryMapper.xml
@@ -22,7 +22,7 @@
SELECT t.id
FROM xxl_job_registry AS t
- WHERE t.update_time DATE_ADD(#{nowTime},INTERVAL -#{timeout} SECOND)
+ WHERE t.update_time ((select NOW())-INTERVAL '${timeout} S')
@@ -36,19 +36,19 @@
SELECT
FROM xxl_job_registry AS t
- WHERE t.update_time ]]> DATE_ADD(#{nowTime},INTERVAL -#{timeout} SECOND)
+ WHERE t.update_time ]]> ((select NOW())-INTERVAL '${timeout} S')
UPDATE xxl_job_registry
- SET `update_time` = #{updateTime}
- WHERE `registry_group` = #{registryGroup}
- AND `registry_key` = #{registryKey}
- AND `registry_value` = #{registryValue}
+ SET update_time = #{updateTime}
+ WHERE registry_group = #{registryGroup}
+ AND registry_key = #{registryKey}
+ AND registry_value = #{registryValue}
- INSERT INTO xxl_job_registry( `registry_group` , `registry_key` , `registry_value`, `update_time`)
+ INSERT INTO xxl_job_registry( registry_group , registry_key , registry_value, update_time)
VALUES( #{registryGroup} , #{registryKey} , #{registryValue}, #{updateTime})
diff --git a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobUserMapper.xml b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobUserMapper.xml
index 9e09b4aae9..1deec58b88 100644
--- a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobUserMapper.xml
+++ b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobUserMapper.xml
@@ -31,7 +31,7 @@
ORDER BY username ASC
- LIMIT #{offset}, #{pagesize}
+ LIMIT #{pagesize} OFFSET #{offset}
diff --git a/xxl-job-admin/src/main/resources/templates/common/common.macro.ftl b/xxl-job-admin/src/main/resources/templates/common/common.macro.ftl
index aace849f91..5eb5cdc1d9 100644
--- a/xxl-job-admin/src/main/resources/templates/common/common.macro.ftl
+++ b/xxl-job-admin/src/main/resources/templates/common/common.macro.ftl
@@ -84,7 +84,7 @@
<#-- login user -->
- ${I18n.system_welcome} ${Request["XXL_JOB_LOGIN_IDENTITY"].username}
+ ${I18n.system_welcome} ${user.username}