package com.jasamedika.medifirst2000.controller.base;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jasamedika.medifirst2000.base.vo.BaseVO;

import static org.springframework.web.bind.annotation.RequestMethod.*;

/**
 * Base Rest Operation for Controller Class
 * 
 * @author Roberto
 */
public interface BaseRestController<V extends BaseVO> extends RestPageController<V> {

	@RequestMapping(value = "/{id}", method = GET)
	@ResponseBody
	ResponseEntity<V> getVO(@PathVariable("id") String id);

	@RequestMapping(value = "/", method = POST, consumes = { "application/json" })
	@ResponseBody
	ResponseEntity<Integer> addVO(@RequestBody V vo);

	@RequestMapping(value = "/", method = PUT, consumes = { "application/json" })
	@ResponseBody
	ResponseEntity<Integer> editVO(@RequestBody V vo);

}
