Created
November 27, 2024 15:01
-
-
Save TomCools/c107c7ec3fdc650c8bf20c69bfb7525a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Path("santa") | |
| public class SantaResource { | |
| // Fields and constructor excluded | |
| @POST | |
| @Path("plan") | |
| @Consumes(MediaType.APPLICATION_JSON) | |
| @Produces(MediaType.APPLICATION_JSON) | |
| public SantaPlan solve(List<Visit> visits) { | |
| Santa santa = new Santa(new Location(66.5039, 25.7294)); | |
| SantaPlan santaPlan = new SantaPlan(santa, visits); | |
| Solver<SantaPlan> solver = solverFactory.buildSolver(); | |
| return solver.solve(santaPlan); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment