package com.eyrolles.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.eyrolles.model.Theme;
import com.eyrolles.service.IThemeService;

@RestController
@RequestMapping("/")
public class ThemeController {
	@Autowired
	IThemeService serviceTheme;
	
	@RequestMapping("/theme")
	public List<Theme> all(){
		return serviceTheme.all();
	}
	@RequestMapping("/theme/{id}")
	public Theme get(@PathVariable int id){
		return serviceTheme.details(id);
	}
}
