Skip to content
Snippets Groups Projects
Commit df1bea05 authored by George Adrian Stoica's avatar George Adrian Stoica
Browse files

fix: makes the springboot endpoint equivalent to jetty

parent db3d6db8
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ import todolist.core.TodoModel; ...@@ -21,7 +21,7 @@ import todolist.core.TodoModel;
@RequestMapping(TodoModelController.TODO_MODEL_SERVICE_PATH) @RequestMapping(TodoModelController.TODO_MODEL_SERVICE_PATH)
public class TodoModelController { public class TodoModelController {
public static final String TODO_MODEL_SERVICE_PATH = "springboot/todo"; public static final String TODO_MODEL_SERVICE_PATH = "todo";
@Autowired @Autowired
private TodoModelService todoModelService; private TodoModelService todoModelService;
...@@ -47,7 +47,7 @@ public class TodoModelController { ...@@ -47,7 +47,7 @@ public class TodoModelController {
* @param name the name of the TodoList * @param name the name of the TodoList
* @return the corresponding TodoList * @return the corresponding TodoList
*/ */
@GetMapping(path = "/{name}") @GetMapping(path = "/list/{name}")
public AbstractTodoList getTodoList(@PathVariable("name") String name) { public AbstractTodoList getTodoList(@PathVariable("name") String name) {
AbstractTodoList todoList = getTodoModel().getTodoList(name); AbstractTodoList todoList = getTodoModel().getTodoList(name);
checkTodoList(todoList, name); checkTodoList(todoList, name);
...@@ -61,7 +61,7 @@ public class TodoModelController { ...@@ -61,7 +61,7 @@ public class TodoModelController {
* @param todoList the todoList to add * @param todoList the todoList to add
* @return true if it was added, false if it replaced * @return true if it was added, false if it replaced
*/ */
@PutMapping(path = "/{name}") @PutMapping(path = "/list/{name}")
public boolean putTodoList(@PathVariable("name") String name, public boolean putTodoList(@PathVariable("name") String name,
@RequestBody AbstractTodoList todoList) { @RequestBody AbstractTodoList todoList) {
boolean added = getTodoModel().putTodoList(todoList) == null; boolean added = getTodoModel().putTodoList(todoList) == null;
...@@ -75,7 +75,7 @@ public class TodoModelController { ...@@ -75,7 +75,7 @@ public class TodoModelController {
* @param name the name of the TodoList * @param name the name of the TodoList
* @param newName the new name * @param newName the new name
*/ */
@PostMapping(path = "/{name}/rename") @PostMapping(path = "/list/{name}/rename")
public boolean renameTodoList(@PathVariable("name") String name, public boolean renameTodoList(@PathVariable("name") String name,
@RequestParam("newName") String newName) { @RequestParam("newName") String newName) {
AbstractTodoList todoList = getTodoModel().getTodoList(name); AbstractTodoList todoList = getTodoModel().getTodoList(name);
...@@ -93,7 +93,7 @@ public class TodoModelController { ...@@ -93,7 +93,7 @@ public class TodoModelController {
* *
* @param name the name of the TodoList * @param name the name of the TodoList
*/ */
@DeleteMapping(path = "/{name}") @DeleteMapping(path = "/list/{name}")
public boolean removeTodoList(@PathVariable("name") String name) { public boolean removeTodoList(@PathVariable("name") String name) {
AbstractTodoList todoList = getTodoModel().getTodoList(name); AbstractTodoList todoList = getTodoModel().getTodoList(name);
checkTodoList(todoList, name); checkTodoList(todoList, name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment