added valueObjects & CustomErrors
This commit is contained in:
@@ -45,6 +45,12 @@
|
||||
<artifactId>executorBase</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20210307</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@@ -1,5 +1,7 @@
|
||||
package ch.unisg.executor2.executor.adapter.in.web;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -25,12 +27,9 @@ public class TaskAvailableController {
|
||||
if (ExecutorType.contains(taskType.toUpperCase())) {
|
||||
TaskAvailableCommand command = new TaskAvailableCommand(
|
||||
ExecutorType.valueOf(taskType.toUpperCase()));
|
||||
taskAvailableUseCase.newTaskAvailable(command);
|
||||
CompletableFuture.runAsync(() -> taskAvailableUseCase.newTaskAvailable(command));
|
||||
}
|
||||
|
||||
// Add the content type as a response header
|
||||
HttpHeaders responseHeaders = new HttpHeaders();
|
||||
|
||||
return new ResponseEntity<>("OK", responseHeaders, HttpStatus.OK);
|
||||
return new ResponseEntity<>("OK", new HttpHeaders(), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package ch.unisg.executor2.executor.application.service;
|
||||
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import ch.unisg.executor2.executor.domain.Executor;
|
||||
@@ -16,6 +17,7 @@ import javax.transaction.Transactional;
|
||||
public class TaskAvailableService implements TaskAvailableUseCase {
|
||||
|
||||
@Override
|
||||
@Async
|
||||
public void newTaskAvailable(TaskAvailableCommand command) {
|
||||
|
||||
Executor executor = Executor.getExecutor();
|
||||
|
Reference in New Issue
Block a user