瀏覽代碼

I have fixed the BeanCreationExceptions

PeterMcCormick 8 年之前
父節點
當前提交
3a69db23da

+ 2
- 2
src/main/java/io/zipcoder/tc_spring_poll_application/controller/VoteController.java 查看文件

@@ -26,8 +26,8 @@ public class VoteController {
26 26
         return new ResponseEntity<>(null, responseHeaders, HttpStatus.CREATED);
27 27
     }
28 28
 
29
-    @RequestMapping(value="/polls/{pollId}/votes", method=RequestMethod.GET)
30
-    public Iterable<Vote> getAllVotes() {
29
+    @RequestMapping(value="/polls/votes", method=RequestMethod.GET)
30
+    public Iterable<Vote> getAllVotes(@PathVariable("pollId") String pollId) {
31 31
         return voteRepository.findAll();
32 32
     }
33 33
 

+ 1
- 0
src/main/java/io/zipcoder/tc_spring_poll_application/dtos/ComputeResultController.java 查看文件

@@ -13,6 +13,7 @@ import javax.inject.Inject;
13 13
 
14 14
 @RestController
15 15
 public class ComputeResultController {
16
+
16 17
     @Inject
17 18
     private VoteRepository voteRepository;
18 19
 

+ 1
- 0
src/main/java/io/zipcoder/tc_spring_poll_application/dtos/VoteResult.java 查看文件

@@ -3,6 +3,7 @@ package io.zipcoder.tc_spring_poll_application.dtos;
3 3
 import java.util.Collection;
4 4
 
5 5
 public class VoteResult {
6
+
6 7
     private int totalVotes;
7 8
     private Collection<OptionCount> results;
8 9