Просмотр исходного кода

I have fixed the BeanCreationExceptions

PeterMcCormick 8 лет назад
Родитель
Сommit
3a69db23da

+ 2
- 2
src/main/java/io/zipcoder/tc_spring_poll_application/controller/VoteController.java Просмотреть файл

26
         return new ResponseEntity<>(null, responseHeaders, HttpStatus.CREATED);
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
         return voteRepository.findAll();
31
         return voteRepository.findAll();
32
     }
32
     }
33
 
33
 

+ 1
- 0
src/main/java/io/zipcoder/tc_spring_poll_application/dtos/ComputeResultController.java Просмотреть файл

13
 
13
 
14
 @RestController
14
 @RestController
15
 public class ComputeResultController {
15
 public class ComputeResultController {
16
+
16
     @Inject
17
     @Inject
17
     private VoteRepository voteRepository;
18
     private VoteRepository voteRepository;
18
 
19
 

+ 1
- 0
src/main/java/io/zipcoder/tc_spring_poll_application/dtos/VoteResult.java Просмотреть файл

3
 import java.util.Collection;
3
 import java.util.Collection;
4
 
4
 
5
 public class VoteResult {
5
 public class VoteResult {
6
+
6
     private int totalVotes;
7
     private int totalVotes;
7
     private Collection<OptionCount> results;
8
     private Collection<OptionCount> results;
8
 
9