Skip to content

Commit 0fd2a53

Browse files
committed
chore: align urls
Some URLs were not consistent, for example "score-analysis".
1 parent 42878b9 commit 0fd2a53

File tree

64 files changed

+116
-131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+116
-131
lines changed

java/bed-allocation/src/main/java/org/acme/bedallocation/rest/BedSchedulingResource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ public String solve(BedPlan problem) {
108108
description = "Resulting score analysis, optionally without constraint matches.",
109109
content = @Content(mediaType = MediaType.APPLICATION_JSON,
110110
schema = @Schema(implementation = ScoreAnalysis.class))) })
111-
@PUT
111+
@POST
112112
@Consumes({ MediaType.APPLICATION_JSON })
113113
@Produces(MediaType.APPLICATION_JSON)
114-
@Path("analyze")
114+
@Path("score-analysis")
115115
public ScoreAnalysis<HardSoftScore> analyze(BedPlan problem,
116116
@QueryParam("fetchPolicy") ScoreAnalysisFetchPolicy fetchPolicy) {
117117
return fetchPolicy == null ? solutionManager.analyze(problem) : solutionManager.analyze(problem, fetchPolicy);

java/bed-allocation/src/main/resources/META-INF/resources/app.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ function analyze() {
250250
scoreAnalysisModalContent.text("No score to analyze yet, please first press the 'solve' button.");
251251
} else {
252252
$('#scoreAnalysisScoreLabel').text(`(${loadedSchedule.score})`);
253-
$.put("/schedules/analyze", JSON.stringify(loadedSchedule), function (scoreAnalysis) {
253+
$.post("/schedules/score-analysis", JSON.stringify(loadedSchedule), function (scoreAnalysis) {
254254
let constraints = scoreAnalysis.constraints;
255255
constraints.sort((a, b) => {
256256
let aComponents = getScoreComponents(a.score), bComponents = getScoreComponents(b.score);
@@ -316,19 +316,6 @@ function analyze() {
316316
}
317317
}
318318

319-
function publish() {
320-
$("#publishButton").hide();
321-
$("#publishLoadingButton").show();
322-
$.put(`/schedules/${scheduleId}/publish`, function (schedule) {
323-
loadedSchedule = schedule;
324-
renderSchedule(schedule);
325-
})
326-
.fail(function (xhr, ajaxOptions, thrownError) {
327-
showError("Publish failed.", xhr);
328-
refreshSolvingButtons(false);
329-
});
330-
}
331-
332319
function getScoreComponents(score) {
333320
let components = {hard: 0, medium: 0, soft: 0};
334321

java/bed-allocation/src/test/java/org/acme/bedallocation/rest/BedSchedulingResourceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void analyze() {
8383
.body(solution)
8484
.expect().contentType(ContentType.JSON)
8585
.when()
86-
.put("/schedules/analyze")
86+
.post("/schedules/score-analysis")
8787
.then()
8888
.extract()
8989
.asString();
@@ -96,7 +96,7 @@ void analyze() {
9696
.body(solution)
9797
.expect().contentType(ContentType.JSON)
9898
.when()
99-
.put("/schedules/analyze")
99+
.post("/schedules/score-analysis")
100100
.then()
101101
.extract()
102102
.asString();

java/conference-scheduling/src/main/java/org/acme/conferencescheduling/rest/ConferenceSchedulingResource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ public String solve(ConferenceSchedule problem) {
108108
description = "Resulting score analysis, optionally without constraint matches.",
109109
content = @Content(mediaType = MediaType.APPLICATION_JSON,
110110
schema = @Schema(implementation = ScoreAnalysis.class))) })
111-
@PUT
111+
@POST
112112
@Consumes({ MediaType.APPLICATION_JSON })
113113
@Produces(MediaType.APPLICATION_JSON)
114-
@Path("analyze")
114+
@Path("score-analysis")
115115
public ScoreAnalysis<HardSoftScore> analyze(ConferenceSchedule problem,
116116
@QueryParam("fetchPolicy") ScoreAnalysisFetchPolicy fetchPolicy) {
117117
return fetchPolicy == null ? solutionManager.analyze(problem) : solutionManager.analyze(problem, fetchPolicy);

java/conference-scheduling/src/main/resources/META-INF/resources/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ function analyze() {
332332
scoreAnalysisModalContent.text("No score to analyze yet, please first press the 'solve' button.");
333333
} else {
334334
$('#scoreAnalysisScoreLabel').text(`(${loadedSchedule.score})`);
335-
$.put("/schedules/analyze", JSON.stringify(loadedSchedule), function (scoreAnalysis) {
335+
$.post("/schedules/score-analysis", JSON.stringify(loadedSchedule), function (scoreAnalysis) {
336336
let constraints = scoreAnalysis.constraints;
337337
constraints.sort((a, b) => {
338338
let aComponents = getScoreComponents(a.score), bComponents = getScoreComponents(b.score);

java/conference-scheduling/src/test/java/org/acme/conferencescheduling/rest/ConferenceScheduleResourceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void analyze() {
8383
.body(solution)
8484
.expect().contentType(ContentType.JSON)
8585
.when()
86-
.put("/schedules/analyze")
86+
.post("/schedules/score-analysis")
8787
.then()
8888
.extract()
8989
.asString();
@@ -96,7 +96,7 @@ void analyze() {
9696
.body(solution)
9797
.expect().contentType(ContentType.JSON)
9898
.when()
99-
.put("/schedules/analyze")
99+
.post("/schedules/score-analysis")
100100
.then()
101101
.extract()
102102
.asString();

java/employee-scheduling/src/main/java/org/acme/employeescheduling/rest/EmployeeScheduleResource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ public String solve(EmployeeSchedule problem) {
9898
description = "Resulting score analysis, optionally without constraint matches.",
9999
content = @Content(mediaType = MediaType.APPLICATION_JSON,
100100
schema = @Schema(implementation = ScoreAnalysis.class))) })
101-
@PUT
101+
@POST
102102
@Consumes({ MediaType.APPLICATION_JSON })
103103
@Produces(MediaType.APPLICATION_JSON)
104-
@Path("analyze")
104+
@Path("score-analysis")
105105
public ScoreAnalysis<HardSoftBigDecimalScore> analyze(EmployeeSchedule problem,
106106
@QueryParam("fetchPolicy") ScoreAnalysisFetchPolicy fetchPolicy) {
107107
return fetchPolicy == null ? solutionManager.analyze(problem) : solutionManager.analyze(problem, fetchPolicy);

java/employee-scheduling/src/main/resources/META-INF/resources/app.js

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ function analyze() {
319319
scoreAnalysisModalContent.text("No score to analyze yet, please first press the 'solve' button.");
320320
} else {
321321
$('#scoreAnalysisScoreLabel').text(`(${loadedSchedule.score})`);
322-
$.put("/schedules/analyze", JSON.stringify(loadedSchedule), function (scoreAnalysis) {
322+
$.post("/schedules/score-analysis", JSON.stringify(loadedSchedule), function (scoreAnalysis) {
323323
let constraints = scoreAnalysis.constraints;
324324
constraints.sort((a, b) => {
325325
let aComponents = getScoreComponents(a.score), bComponents = getScoreComponents(b.score);
@@ -412,23 +412,6 @@ function refreshSolvingButtons(solving) {
412412
}
413413
}
414414

415-
function refreshSolvingButtons(solving) {
416-
if (solving) {
417-
$("#solveButton").hide();
418-
$("#stopSolvingButton").show();
419-
if (autoRefreshIntervalId == null) {
420-
autoRefreshIntervalId = setInterval(refreshSchedule, 2000);
421-
}
422-
} else {
423-
$("#solveButton").show();
424-
$("#stopSolvingButton").hide();
425-
if (autoRefreshIntervalId != null) {
426-
clearInterval(autoRefreshIntervalId);
427-
autoRefreshIntervalId = null;
428-
}
429-
}
430-
}
431-
432415
function stopSolving() {
433416
$.delete(`/schedules/${scheduleId}`, function () {
434417
refreshSolvingButtons(false);

java/facility-location/src/main/java/org/acme/facilitylocation/rest/SolverResource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ public void solve() {
6767
.run());
6868
}
6969

70-
@PUT
70+
@POST
7171
@Consumes({ MediaType.APPLICATION_JSON })
7272
@Produces(MediaType.APPLICATION_JSON)
73-
@Path("analyze")
73+
@Path("score-analysis")
7474
public ScoreAnalysis<HardSoftLongScore> analyze(@QueryParam("fetchPolicy") ScoreAnalysisFetchPolicy fetchPolicy) {
7575
FacilityLocationProblem problem = repository.solution().get();
7676
return fetchPolicy == null ? solutionManager.analyze(problem) : solutionManager.analyze(problem, fetchPolicy);

java/facility-location/src/main/resources/META-INF/resources/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ function analyze() {
178178
scoreAnalysisModalContent.text("No score to analyze yet, please first press the 'solve' button.");
179179
} else {
180180
$('#scoreAnalysisScoreLabel').text(`(${loadedSchedule.score})`);
181-
$.put("/flp/analyze", function (scoreAnalysis) {
181+
$.post("/flp/score-analysis", function (scoreAnalysis) {
182182
let constraints = scoreAnalysis.constraints;
183183
constraints.sort((a, b) => {
184184
let aComponents = getScoreComponents(a.score), bComponents = getScoreComponents(b.score);

0 commit comments

Comments
 (0)