dawdler-client-plug-schedule
Module introduction
Implements injection of the schedule functionality on the web side.
1. Add the dependency to the pom
<groupId>club.dawdler</groupId>
<artifactId>dawdler-client-plug-schedule</artifactId>
2. Usage
Annotate a method with @Schedule; the method must take no parameters.
@Controller
public class UserController{
/**
*Runs every 5 seconds
**/
@Schedule(cron="*/5 * * * * ?")
public void schedule() {
System.out.println(new Date());
}
}