package com.jh.radegast.api;

import java.util.Collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseStatus;

import com.jh.radegast.model.Rating;
import com.jh.radegast.rating.RatingService;

@Controller
@RequestMapping("/api")
public class RatingApiController {

	@Autowired
	private RatingService service;
	
    @RequestMapping(path = "ratings", method = RequestMethod.POST)
    @ResponseStatus(HttpStatus.CREATED)
    public void bulkRating(@RequestBody Collection<Rating> ratings) {
    	service.saveBulk(ratings);
    }

}
