1515
1616import java .util .List ;
1717
18- @ RequestMapping ("jshell" )
18+ @ RequestMapping (ApiEndpoints . BASE )
1919@ RestController
2020public class JShellController {
2121 private JShellSessionService service ;
2222 private StartupScriptsService startupScriptsService ;
2323
24- @ PostMapping ("/eval /{id}" )
24+ @ PostMapping (ApiEndpoints . EVALUATE + " /{id}" )
2525 public JShellResult eval (@ PathVariable String id ,
2626 @ RequestParam (required = false ) StartupScriptId startupScriptId ,
2727 @ RequestBody String code ) throws DockerException {
@@ -32,7 +32,7 @@ public JShellResult eval(@PathVariable String id,
3232 "An operation is already running" ));
3333 }
3434
35- @ PostMapping ("/eval" )
35+ @ PostMapping (ApiEndpoints . EVALUATE )
3636 public JShellResultWithId eval (@ RequestParam (required = false ) StartupScriptId startupScriptId ,
3737 @ RequestBody String code ) throws DockerException {
3838 JShellService jShellService = service .session (startupScriptId );
@@ -42,7 +42,7 @@ public JShellResultWithId eval(@RequestParam(required = false) StartupScriptId s
4242 "An operation is already running" )));
4343 }
4444
45- @ PostMapping ("/single-eval" )
45+ @ PostMapping (ApiEndpoints . SINGLE_EVALUATE )
4646 public JShellResult singleEval (@ RequestParam (required = false ) StartupScriptId startupScriptId ,
4747 @ RequestBody String code ) throws DockerException {
4848 JShellService jShellService = service .oneTimeSession (startupScriptId );
@@ -51,7 +51,7 @@ public JShellResult singleEval(@RequestParam(required = false) StartupScriptId s
5151 "An operation is already running" ));
5252 }
5353
54- @ GetMapping ("/snippets /{id}" )
54+ @ GetMapping (ApiEndpoints . SNIPPETS + " /{id}" )
5555 public List <String > snippets (@ PathVariable String id ,
5656 @ RequestParam (required = false ) boolean includeStartupScript ) throws DockerException {
5757 validateId (id );
@@ -71,7 +71,7 @@ public void delete(@PathVariable String id) throws DockerException {
7171 service .deleteSession (id );
7272 }
7373
74- @ GetMapping ("/startup_script /{id}" )
74+ @ GetMapping (ApiEndpoints . STARTING_SCRIPT + " /{id}" )
7575 public String startupScript (@ PathVariable StartupScriptId id ) {
7676 return startupScriptsService .get (id );
7777 }
0 commit comments