Added event service
This commit is contained in:
parent
a294ecac37
commit
28c09bea6e
22
buisnesslogic/src/main/java/com/plannaplan/services/EventService.java
Executable file
22
buisnesslogic/src/main/java/com/plannaplan/services/EventService.java
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
package com.plannaplan.services;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class EventService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EmailService emailService;
|
||||||
|
|
||||||
|
@Scheduled(cron = "0 2 17 * * *")
|
||||||
|
public void collectGroupLosses() {
|
||||||
|
System.out.println("Checking for groups");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Scheduled(cron = "0 30 17 * * *")
|
||||||
|
public void testMail() {
|
||||||
|
this.emailService.sendMail("kaczor982@gmail.com", "Cześć. Jestem Tomek.");
|
||||||
|
}
|
||||||
|
}
|
@ -16,9 +16,12 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||||
|
|
||||||
import org.springframework.context.event.EventListener;
|
import org.springframework.context.event.EventListener;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
import com.plannaplan.services.ConfiguratorService;
|
import com.plannaplan.services.ConfiguratorService;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
|
@EnableScheduling
|
||||||
public class App {
|
public class App {
|
||||||
|
|
||||||
public final static String API_VERSION = "v1";
|
public final static String API_VERSION = "v1";
|
||||||
|
Loading…
Reference in New Issue
Block a user