Created
January 3, 2018 06:06
-
-
Save slmanju/d2990509fae476e0b25f88eba3d56de5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RestController | |
@RequestMapping("/todos") | |
public class TodoController { | |
@Autowired | |
private TodoService todoService; | |
@GetMapping | |
public ResponseEntity<?> getAll() { | |
// list all | |
} | |
@GetMapping("/{id}") | |
public ResponseEntity<?> getById(@PathVariable Long id) { | |
// get by id (GET) | |
} | |
@PostMapping | |
public ResponseEntity<?> create(@RequestBody TodoDto todoDto) { | |
// create a todo (POST) | |
} | |
@PutMapping("/{id}") | |
public ResponseEntity<?> update(@PathVariable Long id, @RequestBody TodoDto todoDto) { | |
// update a todo (PUT) | |
} | |
@DeleteMapping("/{id}") | |
public ResponseEntity<?> delete(@PathVariable Long id) { | |
// delete a todo (DELETE) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment