We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb39550 commit e7a7487Copy full SHA for e7a7487
src/main/java/com/fhammerl/polls/controllers/PollsController.java
@@ -0,0 +1,21 @@
1
+package com.fhammerl.polls.controllers;
2
+
3
+import org.springframework.beans.factory.annotation.Autowired;
4
+import org.springframework.web.bind.annotation.*;
5
6
+import java.util.List;
7
8
+import com.fhammerl.polls.repositories.PollRepository;
9
+import com.fhammerl.polls.models.Poll;
10
11
+@RestController
12
+@RequestMapping("api/v1/polls")
13
+public class PollsController {
14
+ @Autowired
15
+ private PollRepository pollRepository;
16
17
+ @GetMapping
18
+ public List<Poll> list() {
19
+ return pollRepository.findAll();
20
+ }
21
+}
0 commit comments