-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGreetingController.java
More file actions
28 lines (22 loc) · 834 Bytes
/
GreetingController.java
File metadata and controls
28 lines (22 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.example.springdemo.controller;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/hola")
public class GreetingController {
@GetMapping("/hola")
public String getHelloMessage() {
return "Hooooooooooooooola Liiiiiiiiiiiiiiiiiiiiiiisaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!!!!!!!!!!!!!!!!!!!!!!";
}
@GetMapping("/hola!{name}")
public String getPersonalizedGreeting(@PathVariable String name) {
return "Hello " + name + "!";
}
@GetMapping("/add/{num1}/{num2}")
public int getSum(@PathVariable int num1, @PathVariable int num2) {
return num1 + num2;
}
@GetMapping("/multiply/{num1}/{num2}")
public int getProduct(@PathVariable int num1, @PathVariable int num2) {
return num1 * num2;
}
}