LOGGING ADDED
Some checks failed
Build and Push Quarkus Image / build-and-push (push) Has been cancelled
Some checks failed
Build and Push Quarkus Image / build-and-push (push) Has been cancelled
This commit is contained in:
@@ -5,6 +5,7 @@ import jakarta.ws.rs.*;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
import nl.veenm.jobfindr.domain.Vacature;
|
||||
import nl.veenm.jobfindr.services.VacatureService;
|
||||
import org.jboss.logging.Logger;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -12,30 +13,36 @@ import java.util.List;
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public class VacatureResource {
|
||||
private static final org.jboss.logging.Logger logger = Logger.getLogger(VacatureService.class);
|
||||
|
||||
@Inject
|
||||
VacatureService vacatureService;
|
||||
|
||||
@GET
|
||||
public List<Vacature> getVacatures() {
|
||||
return vacatureService.getServices();
|
||||
@Path("/new")
|
||||
public List<Vacature> getNewVacatures() {
|
||||
logger.info("getNewVacatures");
|
||||
return vacatureService.getNewVacatures();
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/test")
|
||||
public void testEmails(){
|
||||
logger.info("testEmails");
|
||||
vacatureService.checkAndSendNewVacatures();
|
||||
}
|
||||
|
||||
@GET()
|
||||
@Path("/all")
|
||||
public List<Vacature> getAllVacatures() {
|
||||
logger.info("getAllVacatures");
|
||||
return vacatureService.getAllVacatures();
|
||||
}
|
||||
|
||||
@PATCH
|
||||
@Path("/clean")
|
||||
public void cleanVacatures() {
|
||||
logger.info("cleanVacatures");
|
||||
vacatureService.cleanVacatures();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class VacatureService {
|
||||
|
||||
private final String className = this.getClass().getSimpleName();
|
||||
|
||||
public List<Vacature> getServices() {
|
||||
public List<Vacature> getNewVacatures() {
|
||||
eventService.logInfo(VacatureService.class.getName(), "getServices", "getServices aangeroepen");
|
||||
List<Vacature> vacatures = getVacatures();
|
||||
emailService.stuurVacatureEmail("vanveenmel11@gmail.com", vacatures);
|
||||
|
||||
Reference in New Issue
Block a user