Skip to content

Commit 8120214

Browse files
Simplify path. Clean code.
1 parent 9a747cc commit 8120214

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/main/java/org/wise/portal/presentation/web/controllers/run/RunInfoAPIController.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@
2727
* @author Aaron Detre
2828
*/
2929
@RestController
30-
@RequestMapping("/api/run-info")
30+
@RequestMapping("/api/run")
3131
public class RunInfoAPIController {
32-
32+
3333
@Autowired
3434
private RunService runService;
35-
35+
3636
@Autowired
3737
private UserService userService;
3838

3939
@Secured("ROLE_USER")
40-
@GetMapping("/run/info-by-id")
41-
HashMap<String, Object> getRunInfoById(Authentication auth, @RequestParam("runId") Long runId) {
40+
@GetMapping("/info-by-id")
41+
HashMap<String, Object> getRunInfoById(Authentication auth, @RequestParam Long runId) {
4242
try {
4343
User user = userService.retrieveUserByUsername(auth.getName());
4444
Run run = runService.retrieveById(runId);
@@ -49,7 +49,7 @@ HashMap<String, Object> getRunInfoById(Authentication auth, @RequestParam("runId
4949
}
5050
return createRunNotFoundInfo();
5151
}
52-
52+
5353
private HashMap<String, Object> getRunInfo(Run run) {
5454
HashMap<String, Object> info = new HashMap<String, Object>();
5555
info.put("id", String.valueOf(run.getId()));
@@ -79,8 +79,8 @@ private HashMap<String, Object> createRunNotFoundInfo() {
7979
return info;
8080
}
8181

82-
@GetMapping("/run/info")
83-
HashMap<String, Object> getRunInfoByRunCode(@RequestParam("runCode") String runCode) {
82+
@GetMapping("/info")
83+
HashMap<String, Object> getRunInfoByRunCode(@RequestParam String runCode) {
8484
try {
8585
return getRunInfo(runService.retrieveRunByRuncode(runCode));
8686
} catch (ObjectNotFoundException e) {
@@ -89,4 +89,3 @@ HashMap<String, Object> getRunInfoByRunCode(@RequestParam("runCode") String runC
8989
}
9090

9191
}
92-

0 commit comments

Comments
 (0)