Kaynağa Gözat

Update README.md

Git-Leon 6 yıl önce
ebeveyn
işleme
3d3107004d
No account linked to committer's email
1 değiştirilmiş dosya ile 11 ekleme ve 2 silme
  1. 11
    2
      README.md

+ 11
- 2
README.md Dosyayı Görüntüle

@@ -328,8 +328,17 @@ public interface VoteRepository extends CrudRepository<Vote, Long> {
328 328
 
329 329
 ```java
330 330
 @RequestMapping(value="/polls/{pollId}/votes", method=RequestMethod.GET)
331
-public Iterable<Vote> getAllVotes(@PathVariable Long pollId) {
332
-        return voteRepository. findByPoll(pollId);
331
+public Iterable<Vote> getAllVotes() {
332
+	return voteRepository.findAll();
333
+}
334
+```
335
+
336
+* Create a `getVote` method in the `VoteController`
337
+
338
+```java
339
+@RequestMapping(value="/polls/{pollId}/votes", method=RequestMethod.GET)
340
+public Iterable<Vote> getVote(@PathVariable Long pollId) {
341
+	return voteRepository.findById(pollId);
333 342
 }
334 343
 ```
335 344