Implemented the following points:
- Roster/Auctionhouse send initial getExecutors request - Remove executor (made DELETE endpoint in executor pool)
This commit is contained in:
@@ -27,7 +27,7 @@ public class AddNewExecutorToExecutorPoolWebController {
|
||||
this.addNewExecutorToExecutorPoolUseCase = addNewExecutorToExecutorPoolUseCase;
|
||||
}
|
||||
|
||||
@PostMapping(path = "/executor-pool/AddExecutor", consumes = {ExecutorJsonRepresentation.EXECUTOR_MEDIA_TYPE})
|
||||
@PostMapping(path = "/executor-pool/executors", consumes = {ExecutorJsonRepresentation.EXECUTOR_MEDIA_TYPE})
|
||||
public ResponseEntity<String> addNewExecutorToExecutorPool(@RequestBody ExecutorJsonRepresentation payload){
|
||||
try {
|
||||
AddNewExecutorToExecutorPoolCommand command = new AddNewExecutorToExecutorPoolCommand(
|
||||
|
@@ -19,7 +19,7 @@ public class GetAllExecutorsInExecutorPoolWebController {
|
||||
this.getAllExecutorsInExecutorPoolUseCase = getAllExecutorsInExecutorPoolUseCase;
|
||||
}
|
||||
|
||||
@GetMapping(path = "executor-pool/GetAllExecutorsinExecutorPool")
|
||||
@GetMapping(path = "executor-pool/GetAllExecutorsInExecutorPool")
|
||||
public ResponseEntity<String> getAllExecutorsInExecutorPool(){
|
||||
List<ExecutorClass> executorClassList = getAllExecutorsInExecutorPoolUseCase.getAllExecutorsInExecutorPool();
|
||||
|
||||
|
@@ -7,9 +7,7 @@ import ch.unisg.executorpool.domain.ExecutorClass;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.server.ResponseStatusException;
|
||||
|
||||
import java.net.URI;
|
||||
@@ -23,10 +21,10 @@ public class RemoveExecutorFromExecutorPoolWebController {
|
||||
this.removeExecutorFromExecutorPoolUseCase = removeExecutorFromExecutorPoolUseCase;
|
||||
}
|
||||
|
||||
@PostMapping(path = "/executor-pool/RemoveExecutor", consumes = {ExecutorJsonRepresentation.EXECUTOR_MEDIA_TYPE})
|
||||
public ResponseEntity<String> removeExecutorFromExecutorPool(@RequestBody ExecutorJsonRepresentation executorJsonRepresentation){
|
||||
@DeleteMapping(path = "/executor-pool/executors/{executorUri}")
|
||||
public ResponseEntity<String> removeExecutorFromExecutorPool(@PathVariable("executorUri") String executorUri){
|
||||
RemoveExecutorFromExecutorPoolCommand command = new RemoveExecutorFromExecutorPoolCommand(
|
||||
new ExecutorClass.ExecutorUri(URI.create(executorJsonRepresentation.getExecutorUri()))
|
||||
new ExecutorClass.ExecutorUri(URI.create(executorUri))
|
||||
);
|
||||
Optional<ExecutorClass> removedExecutor = removeExecutorFromExecutorPoolUseCase.removeExecutorFromExecutorPool(command);
|
||||
|
||||
|
Reference in New Issue
Block a user