|
@@ -0,0 +1,37 @@
|
|
|
|
|
+package puzzeltocht.controller;
|
|
|
|
|
+
|
|
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
+import puzzeltocht.dto.Event;
|
|
|
|
|
+import puzzeltocht.dto.EventType;
|
|
|
|
|
+import puzzeltocht.dto.Location;
|
|
|
|
|
+
|
|
|
|
|
+import java.util.Collections;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
|
|
+@RestController
|
|
|
|
|
+@RequestMapping("api")
|
|
|
|
|
+public class RouteController {
|
|
|
|
|
+
|
|
|
|
|
+ @RequestMapping(method = RequestMethod.GET, path ="route")
|
|
|
|
|
+ public List<Long> routes() {
|
|
|
|
|
+ return Collections.singletonList(0L);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @RequestMapping(method = RequestMethod.GET, path ="route/{id}")
|
|
|
|
|
+ public ResponseEntity<Event> route(@PathVariable Long id) {
|
|
|
|
|
+ if (id != 0L) {
|
|
|
|
|
+ return ResponseEntity.badRequest().build();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Location loc = new Location(51.244640, 6.038359);
|
|
|
|
|
+ Event mockEvent = new Event(EventType.START, loc, "Welkom bij de Summercamp puzzeltocht!");
|
|
|
|
|
+
|
|
|
|
|
+ return new ResponseEntity<>(mockEvent, HttpStatus.OK);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|