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;

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

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

}

@@ -487,16 +487,23 @@
 vice;%0A%0A%09
+public 
 @Request
@@ -603,16 +603,23 @@
 );%0A%09%7D%0A%0A%09
+public 
 @Request

make codacy happy