-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
320 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
austin-cron/src/main/java/com/java3y/austin/entity/XxlJobGroup.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.java3y.austin.entity; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.Accessors; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.Date; | ||
import java.util.List; | ||
|
||
/** | ||
* 执行器组信息 | ||
* | ||
* @author 3y | ||
*/ | ||
@Data | ||
@Accessors(chain = true) | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Builder | ||
public class XxlJobGroup { | ||
|
||
private int id; | ||
private String appname; | ||
|
||
private String title; | ||
/** | ||
* 执行器地址类型:0=自动注册、1=手动录入 | ||
*/ | ||
private int addressType; | ||
|
||
/** | ||
* 执行器地址列表,多地址逗号分隔(手动录入) | ||
*/ | ||
private String addressList; | ||
private Date updateTime; | ||
|
||
/** | ||
* registry list 执行器地址列表(系统注册) | ||
*/ | ||
private List<String> registryList; | ||
|
||
public List<String> getRegistryList() { | ||
if (addressList != null && addressList.trim().length() > 0) { | ||
registryList = new ArrayList<String>(Arrays.asList(addressList.split(","))); | ||
} | ||
return registryList; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 11 additions & 2 deletions
13
austin-cron/src/main/java/com/java3y/austin/handler/CronTaskHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,28 @@ | ||
package com.java3y.austin.handler; | ||
|
||
import com.alibaba.fastjson.JSON; | ||
import com.java3y.austin.domain.MessageTemplate; | ||
import com.xxl.job.core.context.XxlJobHelper; | ||
import com.xxl.job.core.handler.annotation.XxlJob; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Service; | ||
|
||
|
||
/** | ||
* 定时任务处理类 | ||
* @author 3y | ||
*/ | ||
@Service | ||
@Slf4j | ||
public class CronTaskHandler { | ||
|
||
/** | ||
* 简单任务 | ||
* 处理所有的 austin 定时任务消息 | ||
*/ | ||
@XxlJob("austinJobHandler") | ||
@XxlJob("austinJob") | ||
public void execute() { | ||
log.info("XXL-JOB, Hello World."); | ||
MessageTemplate messageTemplate = JSON.parseObject(XxlJobHelper.getJobParam(), MessageTemplate.class); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.