Skip to content

Instantly share code, notes, and snippets.

@TomCools
Created November 27, 2024 15:01
Show Gist options
  • Select an option

  • Save TomCools/c107c7ec3fdc650c8bf20c69bfb7525a to your computer and use it in GitHub Desktop.

Select an option

Save TomCools/c107c7ec3fdc650c8bf20c69bfb7525a to your computer and use it in GitHub Desktop.
@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