Developer exchange endpoint

This commit is contained in:
Filip Izydorczyk
2021-01-19 12:13:26 +01:00
parent 7f647f9b8a
commit d1a54a93d6
2 changed files with 52 additions and 4 deletions

View File

@ -13,6 +13,7 @@ import io.swagger.annotations.Api;
import com.plannaplan.App;
import com.plannaplan.services.AssignmentService;
import com.plannaplan.services.ExchangeService;
/**
* Rest controller to enpoint that help deveopler test the app
@ -27,13 +28,26 @@ public class DeveloperController {
@Autowired
private AssignmentService assignmentService;
@Autowired
private ExchangeService exchangeService;
/**
* @return if accept algoythm was perfomed
*/
@PreAuthorize("hasRole('ROLE_DEVELOPER')")
@PostMapping(path = "/algoythm/accept")
@PostMapping(path = "/algorythm/accept")
public ResponseEntity<String> performAcceptAlgorythm() {
this.assignmentService.callAcceptAlgorythm();
return new ResponseEntity<>("Success", HttpStatus.OK);
}
/**
* @return if accept algoythm was perfomed
*/
@PreAuthorize("hasRole('ROLE_DEVELOPER')")
@PostMapping(path = "/algorythm/exchange")
public ResponseEntity<String> performExchangeAlgorythm() {
this.exchangeService.performExchange();
return new ResponseEntity<>("Success", HttpStatus.OK);
}
}