From 649170d58d32f15bc538caf1f424a5caf3fd59f1 Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Wed, 8 May 2019 22:13:58 +0800 Subject: [PATCH] update document --- .../job/admin/controller/IndexController.java | 8 +-- .../admin/controller/JobApiController.java | 4 +- .../admin/controller/JobInfoController.java | 2 +- .../job/admin/controller/UserController.java | 12 ++-- ...messionLimit.java => PermissionLimit.java} | 56 +++++++++---------- .../interceptor/PermissionInterceptor.java | 4 +- 6 files changed, 43 insertions(+), 43 deletions(-) rename xxl-job-admin/src/main/java/com/xxl/job/admin/controller/annotation/{PermessionLimit.java => PermissionLimit.java} (88%) 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 2e4d5e90..ecd99774 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,6 +1,6 @@ package com.xxl.job.admin.controller; -import com.xxl.job.admin.controller.annotation.PermessionLimit; +import com.xxl.job.admin.controller.annotation.PermissionLimit; import com.xxl.job.admin.service.LoginService; import com.xxl.job.admin.service.XxlJobService; import com.xxl.job.core.biz.model.ReturnT; @@ -50,7 +50,7 @@ public class IndexController { } @RequestMapping("/toLogin") - @PermessionLimit(limit=false) + @PermissionLimit(limit=false) public String toLogin(HttpServletRequest request, HttpServletResponse response) { if (loginService.ifLogin(request, response) != null) { return "redirect:/"; @@ -60,7 +60,7 @@ public class IndexController { @RequestMapping(value="login", method=RequestMethod.POST) @ResponseBody - @PermessionLimit(limit=false) + @PermissionLimit(limit=false) public ReturnT loginDo(HttpServletRequest request, HttpServletResponse response, String userName, String password, String ifRemember){ boolean ifRem = (ifRemember!=null && ifRemember.trim().length()>0 && "on".equals(ifRemember))?true:false; return loginService.login(request, response, userName, password, ifRem); @@ -68,7 +68,7 @@ public class IndexController { @RequestMapping(value="logout", method=RequestMethod.POST) @ResponseBody - @PermessionLimit(limit=false) + @PermissionLimit(limit=false) public ReturnT logout(HttpServletRequest request, HttpServletResponse response){ return loginService.logout(request, response); } 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 0b39a4e1..ee301810 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 @@ -1,6 +1,6 @@ package com.xxl.job.admin.controller; -import com.xxl.job.admin.controller.annotation.PermessionLimit; +import com.xxl.job.admin.controller.annotation.PermissionLimit; import com.xxl.job.admin.core.schedule.XxlJobDynamicScheduler; import com.xxl.job.core.biz.AdminBiz; import org.springframework.beans.factory.InitializingBean; @@ -25,7 +25,7 @@ public class JobApiController implements InitializingBean { } @RequestMapping(AdminBiz.MAPPING) - @PermessionLimit(limit=false) + @PermissionLimit(limit=false) public void api(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { XxlJobDynamicScheduler.invokeAdminService(request, response); } 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 6b268a3c..30047cf5 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 @@ -131,7 +131,7 @@ public class JobInfoController { @RequestMapping("/trigger") @ResponseBody - //@PermessionLimit(limit = false) + //@PermissionLimit(limit = false) public ReturnT triggerJob(int id, String executorParam) { // force cover job param if (executorParam == null) { 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 4b58f84f..573ffccf 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 @@ -1,6 +1,6 @@ package com.xxl.job.admin.controller; -import com.xxl.job.admin.controller.annotation.PermessionLimit; +import com.xxl.job.admin.controller.annotation.PermissionLimit; import com.xxl.job.admin.core.model.XxlJobGroup; import com.xxl.job.admin.core.model.XxlJobUser; import com.xxl.job.admin.core.util.I18nUtil; @@ -35,7 +35,7 @@ public class UserController { private XxlJobGroupDao xxlJobGroupDao; @RequestMapping - @PermessionLimit(adminuser = true) + @PermissionLimit(adminuser = true) public String index(Model model) { // 执行器列表 @@ -47,7 +47,7 @@ public class UserController { @RequestMapping("/pageList") @ResponseBody - @PermessionLimit(adminuser = true) + @PermissionLimit(adminuser = true) public Map pageList(@RequestParam(required = false, defaultValue = "0") int start, @RequestParam(required = false, defaultValue = "10") int length, String username, int role) { @@ -66,7 +66,7 @@ public class UserController { @RequestMapping("/add") @ResponseBody - @PermessionLimit(adminuser = true) + @PermissionLimit(adminuser = true) public ReturnT add(XxlJobUser xxlJobUser) { // valid username @@ -101,7 +101,7 @@ public class UserController { @RequestMapping("/update") @ResponseBody - @PermessionLimit(adminuser = true) + @PermissionLimit(adminuser = true) public ReturnT update(HttpServletRequest request, XxlJobUser xxlJobUser) { // avoid opt login seft @@ -129,7 +129,7 @@ public class UserController { @RequestMapping("/remove") @ResponseBody - @PermessionLimit(adminuser = true) + @PermissionLimit(adminuser = true) public ReturnT remove(HttpServletRequest request, int id) { // avoid opt login seft diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/annotation/PermessionLimit.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/annotation/PermissionLimit.java similarity index 88% rename from xxl-job-admin/src/main/java/com/xxl/job/admin/controller/annotation/PermessionLimit.java rename to xxl-job-admin/src/main/java/com/xxl/job/admin/controller/annotation/PermissionLimit.java index 81108a95..379efd46 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/annotation/PermessionLimit.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/annotation/PermissionLimit.java @@ -1,29 +1,29 @@ -package com.xxl.job.admin.controller.annotation; - - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * 权限限制 - * @author xuxueli 2015-12-12 18:29:02 - */ -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.RUNTIME) -public @interface PermessionLimit { - - /** - * 登录拦截 (默认拦截) - */ - boolean limit() default true; - - /** - * 要求管理员权限 - * - * @return - */ - boolean adminuser() default false; - +package com.xxl.job.admin.controller.annotation; + + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 权限限制 + * @author xuxueli 2015-12-12 18:29:02 + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface PermissionLimit { + + /** + * 登录拦截 (默认拦截) + */ + boolean limit() default true; + + /** + * 要求管理员权限 + * + * @return + */ + boolean adminuser() default false; + } \ No newline at end of file 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 f198c887..416507b1 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 @@ -1,6 +1,6 @@ package com.xxl.job.admin.controller.interceptor; -import com.xxl.job.admin.controller.annotation.PermessionLimit; +import com.xxl.job.admin.controller.annotation.PermissionLimit; import com.xxl.job.admin.core.model.XxlJobUser; import com.xxl.job.admin.core.util.I18nUtil; import com.xxl.job.admin.service.LoginService; @@ -34,7 +34,7 @@ public class PermissionInterceptor extends HandlerInterceptorAdapter { boolean needLogin = true; boolean needAdminuser = false; HandlerMethod method = (HandlerMethod)handler; - PermessionLimit permission = method.getMethodAnnotation(PermessionLimit.class); + PermissionLimit permission = method.getMethodAnnotation(PermissionLimit.class); if (permission!=null) { needLogin = permission.limit(); needAdminuser = permission.adminuser();