Seth 5 jaren geleden
bovenliggende
commit
eabfe96b74

+ 4
- 1
src/main/java/io/zipcoder/tc_spring_poll_application/controller/ComputeResultController.java Bestand weergeven

@@ -10,7 +10,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
10 10
 import org.springframework.web.bind.annotation.RequestMethod;
11 11
 import org.springframework.web.bind.annotation.RequestParam;
12 12
 import org.springframework.web.bind.annotation.RestController;
13
-    @RestController
13
+
14
+import java.util.ArrayList;
15
+
16
+@RestController
14 17
     public class ComputeResultController {
15 18
 
16 19
         private VoteRepository voteRepository;

+ 4
- 0
src/main/java/io/zipcoder/tc_spring_poll_application/controller/PollController.java Bestand weergeven

@@ -1,6 +1,7 @@
1 1
 package io.zipcoder.tc_spring_poll_application.controller;
2 2
 
3 3
 import io.zipcoder.tc_spring_poll_application.domain.Poll;
4
+import io.zipcoder.tc_spring_poll_application.exception.ResourceNotFoundException;
4 5
 import io.zipcoder.tc_spring_poll_application.repositories.PollRepository;
5 6
 import org.springframework.beans.factory.annotation.Autowired;
6 7
 import org.springframework.http.HttpHeaders;
@@ -59,4 +60,7 @@ public class PollController {
59 60
         return new ResponseEntity<>(HttpStatus.OK);
60 61
     }
61 62
 
63
+    public void verifyPoll(){
64
+    }
65
+
62 66
 }

+ 19
- 0
src/main/java/io/zipcoder/tc_spring_poll_application/exception/ResourceNotFoundException.java Bestand weergeven

@@ -0,0 +1,19 @@
1
+package io.zipcoder.tc_spring_poll_application.exception;
2
+
3
+import org.springframework.http.HttpStatus;
4
+import org.springframework.web.bind.annotation.ResponseStatus;
5
+
6
+@ResponseStatus(HttpStatus.NOT_FOUND)
7
+public class ResourceNotFoundException extends RuntimeException {
8
+
9
+    public ResourceNotFoundException() {
10
+    }
11
+
12
+    public ResourceNotFoundException(String message) {
13
+        super(message);
14
+    }
15
+
16
+    public ResourceNotFoundException(String message, Throwable cause) {
17
+        super(message, cause);
18
+    }
19
+}