Skip to content

Instantly share code, notes, and snippets.

Created September 8, 2020 00:10
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
package me.parzibyte.api;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
@RequestMapping(path = "/alumnos")
@CrossOrigin(origins = "http://localhost")
public class AlumnosController {
private AlumnosRepository alumnosRepository;
@RequestMapping(value = "/crear", method = RequestMethod.POST)
public Alumno crearAlumno(@RequestBody Alumno alumno) {
@RequestMapping(value = "/obtener", method = RequestMethod.GET)
public Iterable<Alumno> obtenerTodos() {
return alumnosRepository.findAll();
@RequestMapping(value = "/eliminar/{id}", method = RequestMethod.DELETE)
public boolean eliminar(@PathVariable() Long id) {
return true;
@RequestMapping(value = "/actualizar", method = RequestMethod.PUT)
public Alumno editar(@RequestBody Alumno alumno) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment