ai.timefold.solver.spring.boot.it.TimefoldSolverController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-boot-integration-test Show documentation
Show all versions of spring-boot-integration-test Show documentation
Spring Boot integration tests for Timefold
The newest version!
package ai.timefold.solver.spring.boot.it;
import ai.timefold.solver.core.api.solver.SolverFactory;
import ai.timefold.solver.spring.boot.it.domain.IntegrationTestSolution;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/integration-test")
public class TimefoldSolverController {
private final SolverFactory solverFactory;
public TimefoldSolverController(SolverFactory solverFactory) {
this.solverFactory = solverFactory;
}
@PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public IntegrationTestSolution solve(@RequestBody IntegrationTestSolution problem) {
return solverFactory.buildSolver().solve(problem);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy