Skip to content

Commit f5b96ee

Browse files
committed
feat: api home quotes
1 parent c8a9291 commit f5b96ee

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed
Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,40 @@
11
package com.github.throyer.common.springboot.controllers.api;
22

3-
import com.github.throyer.common.springboot.utils.Hello;
3+
import java.util.List;
4+
import java.util.Random;
45

5-
import io.swagger.v3.oas.annotations.Operation;
66
import org.springframework.web.bind.annotation.GetMapping;
77
import org.springframework.web.bind.annotation.RequestMapping;
88
import org.springframework.web.bind.annotation.RestController;
99

10+
import com.github.throyer.common.springboot.utils.Hello;
11+
12+
import io.swagger.v3.oas.annotations.Operation;
13+
1014
@RestController
1115
@RequestMapping("/api")
1216
public class ApiController {
1317

1418
@GetMapping
1519
@Operation(hidden = true)
1620
public Hello index() {
17-
return () -> "Is a live!";
21+
22+
var quotes = List.of(
23+
"You talking to me? - Taxi Driver",
24+
"I'm going to make him an offer he can't refuse. - The Godfather",
25+
"May the Force be with you. - Star Wars",
26+
"You're gonna need a bigger boat. - Jaws",
27+
"Dadinho é o caralho! meu nome é Zé Pequeno, porra!",
28+
"Say “hello” to my little friend! - Scarface",
29+
"Bond. James Bond. - Dr. No",
30+
"Hasta la vista, baby. - Terminator 2",
31+
"I see dead people. - The Sixth Sense",
32+
"Houston, we have a problem. - Apollo 13",
33+
"Só sei que foi assim. - O Auto da Compadecida"
34+
);
35+
36+
var quote = quotes.get(new Random().nextInt(quotes.size()));
37+
38+
return () -> quote;
1839
}
1940
}

0 commit comments

Comments
 (0)