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