Browse Source

调整任务策略,系统任务无法删除

wangq 4 years ago
parent
commit
e501b5b4f6

+ 6 - 0
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java

@@ -124,12 +124,18 @@ public class JobInfoController {
     @RequestMapping("/remove")
     @ResponseBody
     public ReturnT<String> remove(int id) {
+        if(id<=9){
+            return new ReturnT<String>(ReturnT.FAIL_CODE, "系统定制任务无法删除!");
+        }
         return xxlJobService.remove(id);
     }
 
     @RequestMapping("/stop")
     @ResponseBody
     public ReturnT<String> pause(int id) {
+//        if(id<=9){
+//            return new ReturnT<String>(ReturnT.FAIL_CODE, "系统定制任务无法终止!");
+//        }
         return xxlJobService.stop(id);
     }