Seth 6 years ago
parent
commit
eabfe96b74

+ 4
- 1
src/main/java/io/zipcoder/tc_spring_poll_application/controller/ComputeResultController.java View File

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

+ 4
- 0
src/main/java/io/zipcoder/tc_spring_poll_application/controller/PollController.java View File

1
 package io.zipcoder.tc_spring_poll_application.controller;
1
 package io.zipcoder.tc_spring_poll_application.controller;
2
 
2
 
3
 import io.zipcoder.tc_spring_poll_application.domain.Poll;
3
 import io.zipcoder.tc_spring_poll_application.domain.Poll;
4
+import io.zipcoder.tc_spring_poll_application.exception.ResourceNotFoundException;
4
 import io.zipcoder.tc_spring_poll_application.repositories.PollRepository;
5
 import io.zipcoder.tc_spring_poll_application.repositories.PollRepository;
5
 import org.springframework.beans.factory.annotation.Autowired;
6
 import org.springframework.beans.factory.annotation.Autowired;
6
 import org.springframework.http.HttpHeaders;
7
 import org.springframework.http.HttpHeaders;
59
         return new ResponseEntity<>(HttpStatus.OK);
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 View File

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
+}