fi.evolver.basics.spring.job.TaskStatusController Maven / Gradle / Ivy
package fi.evolver.basics.spring.job;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import fi.evolver.basics.spring.http.MessageType;
import fi.evolver.basics.spring.http.crud.ReadOnlyCrudController;
import fi.evolver.basics.spring.job.entity.TaskStatus;
import fi.evolver.basics.spring.job.entity.TaskStatus.TaskState;
@RestController
@RequestMapping("/task")
public class TaskStatusController extends ReadOnlyCrudController {
@Autowired
public TaskStatusController(TaskStatusRepository taskStatusRepository) {
super(taskStatusRepository);
}
@MessageType("TaskStatus/active")
@GetMapping("/list/active")
public List getStatusByReportable() {
return ((TaskStatusRepository)this.jpaRepository).findByStates(List.of(TaskState.RUNNING, TaskState.CANCELLING));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy