package com.ejie.ab63.control.generarPublicacion;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ejie.ab63.service.generarPublicacion.GenerarPublicacionService;

/**
 * LeerExcelController
 * 
 */

@Controller
@RequestMapping(value = "/generarPublicacion")
public class GenerarPublicacionController {

	@Autowired
	GenerarPublicacionService generarPublicacionService;

	@RequestMapping(value = "/generar", method = RequestMethod.POST)
	public @ResponseBody Integer generarPubic(
			@RequestParam(value = "idEstablecimientoPublicar", required = true) Integer idEstablecimiento)
			throws Exception {

		return generarPublicacionService.generarPublicacion(idEstablecimiento);
	}
}