package com.pollistics.controllers;

import com.pollistics.models.Poll;
import com.pollistics.services.PollService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created by Maliek on 24/11/2016.
 */

@RestController
@RequestMapping("/api/1/polls") // todo: this should have a subclass or something for all poll-things
public class APIController {
	@Autowired
	private PollService pollService;

	public @RequestMapping(method = RequestMethod.GET)
	List<Poll> findAll() {
		return pollService.getAllPolls();
	}

	public @RequestMapping(value = "{id}", method = RequestMethod.GET)
	Poll findById(@PathVariable("id") String id) {
		return pollService.getPoll(id);
	}

}

@@ -491,60 +491,28 @@
 ;%0A%0A%09
-public @RequestMapping(method = RequestMethod.GET)%0A%09
+@GetMapping%0A%09public 
 List
@@ -575,22 +575,11 @@
 %7D%0A%0A%09
-public @Reques
+@Ge
 tMap
@@ -601,39 +601,18 @@
 id%7D%22
-, method = RequestMethod.GET)%0A%09
+)%0A%09public 
 Poll

change to getmapping like @eliasmeire suggested