15
15
16
16
import java .util .List ;
17
17
18
- @ RequestMapping ("jshell" )
18
+ @ RequestMapping (ApiEndpoints . BASE )
19
19
@ RestController
20
20
public class JShellController {
21
21
private JShellSessionService service ;
22
22
private StartupScriptsService startupScriptsService ;
23
23
24
- @ PostMapping ("/eval /{id}" )
24
+ @ PostMapping (ApiEndpoints . EVALUATE + " /{id}" )
25
25
public JShellResult eval (@ PathVariable String id ,
26
26
@ RequestParam (required = false ) StartupScriptId startupScriptId ,
27
27
@ RequestBody String code ) throws DockerException {
@@ -32,7 +32,7 @@ public JShellResult eval(@PathVariable String id,
32
32
"An operation is already running" ));
33
33
}
34
34
35
- @ PostMapping ("/eval" )
35
+ @ PostMapping (ApiEndpoints . EVALUATE )
36
36
public JShellResultWithId eval (@ RequestParam (required = false ) StartupScriptId startupScriptId ,
37
37
@ RequestBody String code ) throws DockerException {
38
38
JShellService jShellService = service .session (startupScriptId );
@@ -42,7 +42,7 @@ public JShellResultWithId eval(@RequestParam(required = false) StartupScriptId s
42
42
"An operation is already running" )));
43
43
}
44
44
45
- @ PostMapping ("/single-eval" )
45
+ @ PostMapping (ApiEndpoints . SINGLE_EVALUATE )
46
46
public JShellResult singleEval (@ RequestParam (required = false ) StartupScriptId startupScriptId ,
47
47
@ RequestBody String code ) throws DockerException {
48
48
JShellService jShellService = service .oneTimeSession (startupScriptId );
@@ -51,7 +51,7 @@ public JShellResult singleEval(@RequestParam(required = false) StartupScriptId s
51
51
"An operation is already running" ));
52
52
}
53
53
54
- @ GetMapping ("/snippets /{id}" )
54
+ @ GetMapping (ApiEndpoints . SNIPPETS + " /{id}" )
55
55
public List <String > snippets (@ PathVariable String id ,
56
56
@ RequestParam (required = false ) boolean includeStartupScript ) throws DockerException {
57
57
validateId (id );
@@ -71,7 +71,7 @@ public void delete(@PathVariable String id) throws DockerException {
71
71
service .deleteSession (id );
72
72
}
73
73
74
- @ GetMapping ("/startup_script /{id}" )
74
+ @ GetMapping (ApiEndpoints . STARTING_SCRIPT + " /{id}" )
75
75
public String startupScript (@ PathVariable StartupScriptId id ) {
76
76
return startupScriptsService .get (id );
77
77
}
0 commit comments