소스 검색

clean code; 升级依赖版本;

xuxueli 7 년 전
부모
커밋
fa1ed59b8d

+ 1 - 1
xxl-job-executor-samples/xxl-job-executor-sample-jfinal/pom.xml 파일 보기

@@ -16,7 +16,7 @@
16 16
         <dependency>
17 17
             <groupId>com.jfinal</groupId>
18 18
             <artifactId>jfinal</artifactId>
19
-            <version>2.0</version>
19
+            <version>2.2</version>
20 20
         </dependency>
21 21
 
22 22
         <!-- slf4j -->

+ 18 - 18
xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/mvc/controller/IndexController.java 파일 보기

@@ -1,18 +1,18 @@
1
-package com.xxl.job.executor.mvc.controller;
2
-
3
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
4
-import org.springframework.stereotype.Controller;
5
-import org.springframework.web.bind.annotation.RequestMapping;
6
-import org.springframework.web.bind.annotation.ResponseBody;
7
-
8
-@Controller
9
-@EnableAutoConfiguration
10
-public class IndexController {
11
-
12
-    @RequestMapping("/")
13
-    @ResponseBody
14
-    String index() {
15
-        return "xxl job executor running.";
16
-    }
17
-
18
-}
1
+//package com.xxl.job.executor.mvc.controller;
2
+//
3
+//import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
4
+//import org.springframework.stereotype.Controller;
5
+//import org.springframework.web.bind.annotation.RequestMapping;
6
+//import org.springframework.web.bind.annotation.ResponseBody;
7
+//
8
+//@Controller
9
+//@EnableAutoConfiguration
10
+//public class IndexController {
11
+//
12
+//    @RequestMapping("/")
13
+//    @ResponseBody
14
+//    String index() {
15
+//        return "xxl job executor running.";
16
+//    }
17
+//
18
+//}

+ 5 - 5
xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/service/jobhandler/DemoJobHandler.java 파일 보기

@@ -4,7 +4,7 @@ import com.xxl.job.core.biz.model.ReturnT;
4 4
 import com.xxl.job.core.handler.IJobHandler;
5 5
 import com.xxl.job.core.handler.annotation.JobHandler;
6 6
 import com.xxl.job.core.log.XxlJobLogger;
7
-import org.springframework.stereotype.Service;
7
+import org.springframework.stereotype.Component;
8 8
 
9 9
 import java.util.concurrent.TimeUnit;
10 10
 
@@ -13,15 +13,15 @@ import java.util.concurrent.TimeUnit;
13 13
  * 任务Handler的一个Demo(Bean模式)
14 14
  *
15 15
  * 开发步骤:
16
- * 1、继承 “IJobHandler” 
17
- * 2、装配到Spring,例如加 “@Service” 注解;
18
- * 3、加 “@JobHandler” 注解,注解value值为新增任务生成的JobKey的值;多个JobKey用逗号分割;
16
+ * 1、新建一个继承com.xxl.job.core.handler.IJobHandler的Java类
17
+ * 2、该类被Spring容器扫描为Bean实例,如加“@Component”注解;
18
+ * 3、添加 “@JobHandler(value="自定义jobhandler名称")”注解,注解的value值为自定义的JobHandler名称,该名称对应的是调度中心新建任务的JobHandler属性的值。
19 19
  * 4、执行日志:需要通过 "XxlJobLogger.log" 打印执行日志;
20 20
  *
21 21
  * @author xuxueli 2015-12-19 19:43:36
22 22
  */
23 23
 @JobHandler(value="demoJobHandler")
24
-@Service
24
+@Component
25 25
 public class DemoJobHandler extends IJobHandler {
26 26
 
27 27
 	@Override