注释
This commit is contained in:
@@ -77,7 +77,7 @@
|
|||||||
### 使用方法
|
### 使用方法
|
||||||
```java
|
```java
|
||||||
@Scheduled(name = "testTask")
|
@Scheduled(name = "testTask")
|
||||||
public void runTask(ScheduleEvent event) {
|
public void runTask(ScheduledEvent event) {
|
||||||
System.out.println("xxl-job参数param: " + event.getString("param"));
|
System.out.println("xxl-job参数param: " + event.getString("param"));
|
||||||
System.out.println("xxl-job参数index: " + event.getInteger("index"));
|
System.out.println("xxl-job参数index: " + event.getInteger("index"));
|
||||||
System.out.println("xxl-job参数total: " + event.getInteger("total"));
|
System.out.println("xxl-job参数total: " + event.getInteger("total"));
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ public class CachedManagerService implements CachedManager, CachedActionFunc, Se
|
|||||||
* 检查name是否含特殊字符
|
* 检查name是否含特殊字符
|
||||||
*
|
*
|
||||||
* @param value 参数
|
* @param value 参数
|
||||||
* @return
|
* @return value
|
||||||
*/
|
*/
|
||||||
protected String checkSchema(String value) {
|
protected String checkSchema(String value) {
|
||||||
if (value != null && !value.isEmpty()) {
|
if (value != null && !value.isEmpty()) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import org.redkale.service.LoadMode;
|
import org.redkale.service.LoadMode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 定时任务标记,只能作用于Service的无参数或者单一ScheduleEvent参数的菲static方法上, 功能类似Spring里的Scheduled注解
|
* 定时任务标记,只能作用于Service的无参数或者单一{@link org.redkale.scheduled.ScheduledEvent}参数的菲static方法上, 功能类似Spring里的Scheduled注解
|
||||||
*
|
*
|
||||||
* <p>详情见: https://redkale.org
|
* <p>详情见: https://redkale.org
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -36,7 +36,13 @@ public final class ScheduledEvent {
|
|||||||
|
|
||||||
public <T> T getJson(String name, Type type) {
|
public <T> T getJson(String name, Type type) {
|
||||||
Object obj = get(name);
|
Object obj = get(name);
|
||||||
return obj == null ? null : JsonConvert.root().convertFrom(type, obj.toString());
|
if (obj == null) {
|
||||||
|
return null;
|
||||||
|
} else if (type instanceof Class && ((Class) type).isAssignableFrom(obj.getClass())) {
|
||||||
|
return (T) obj;
|
||||||
|
} else {
|
||||||
|
return JsonConvert.root().convertFrom(type, obj.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getString(String name) {
|
public String getString(String name) {
|
||||||
|
|||||||
Reference in New Issue
Block a user