Created
August 22, 2019 23:22
-
-
Save parzibyte/5c85b35e6e7a3e1c2c62488a658af1aa 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
package HolaMundoSpringBoot; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RequestParam; | |
import org.springframework.web.bind.annotation.RestController; | |
@RestController | |
public class MascotasController { | |
@RequestMapping("/mascota") | |
public Mascota mascota( | |
@RequestParam(value="nombre", defaultValue="Sin nombre") String nombre, | |
@RequestParam(value="edad", defaultValue="0") int edad) { | |
return new Mascota(nombre, edad); | |
} | |
@RequestMapping("/") | |
public String inicio() { | |
return "Estamos en el índice /"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment