package br.com.centralit.controller; import org.springframework.beans.factory.annotation.Autowired; 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.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import br.com.centralit.api.model.Processo; import br.com.centralit.api.service.AnexarProcessoService; import br.com.centralit.api.service.ProcessoService; import br.com.centralit.api.viewHelper.AnexarProcessoVH; import br.com.centralit.framework.controller.GenericController; import br.com.centralit.framework.json.ResponseBodyWrapper; import br.com.centralit.framework.json.Views; /** *
*
*
* Company: Central IT - Governança Corporativa - *
* ** Title: *
* ** Description: *
* ** Iniciativa(s): NUMERO_INICIATIVA *
* ** Regra(s) de negócio: NUMERO_REGRA_DE_NEGOCIO *
* * @since 09/02/2016 - 14:38:02 * * @version 1.0.0 * * @author andre.silva * */ @Controller @RequestMapping("/rest/anexarProcessos") public class AnexarProcessoController extends GenericControllerIniciativa(s): NUMERO_INICIATIVA
* *Regra(s) de negócio: NUMERO_REGRA_DE_NEGOCIO
* * Método responsável por * * @author andre.silva * * @param anexarProcessoVH * @return * @throws Exception */ @RequestMapping(method = RequestMethod.POST, produces = "application/json", value = "save") @ResponseBody public ResponseBodyWrapper save(@RequestBody AnexarProcessoVH anexarProcessoVH) throws Exception { ResponseBodyWrapper responseBody = new ResponseBodyWrapper(this.anexarProcessoService.save(anexarProcessoVH), Views.AnexarProcesso.class); return responseBody; } /** * *Iniciativa(s): NUMERO_INICIATIVA
* *Regra(s) de negócio: NUMERO_REGRA_DE_NEGOCIO
* * Método responsável por * * @author andre.silva * * @param idProcesso * @return * @throws Exception */ @RequestMapping(value = "/findByIdProcesso", method = RequestMethod.GET, produces = "application/json") @ResponseBody public ResponseBodyWrapper findByIdProcesso(@RequestParam(value = "idProcesso") Long idProcesso) throws Exception { ResponseBodyWrapper responseBody = new ResponseBodyWrapper(this.anexarProcessoService.findByIdProcesso(idProcesso), Views.AnexarProcesso.class); return responseBody; } /** * *Iniciativa(s): NUMERO_INICIATIVA
* *Regra(s) de negócio: NUMERO_REGRA_DE_NEGOCIO
* * Método responsável por * * @author andre.silva * * @param idProcesso * @return * @throws Exception */ @RequestMapping(value = "/findByIdAnexoProcesso", method = RequestMethod.GET, produces = "application/json") @ResponseBody public ResponseBodyWrapper findByIdAnexoProcesso(@RequestParam(value = "idProcesso") Long idProcesso) throws Exception { ResponseBodyWrapper responseBody = new ResponseBodyWrapper(this.anexarProcessoService.findByIdAnexoProcesso(idProcesso), Views.AnexarProcesso.class); return responseBody; } /** * *Iniciativa(s): NUMERO_INICIATIVA
* *Regra(s) de negócio: NUMERO_REGRA_DE_NEGOCIO
* * Método responsável por * * @author andre.silva * * @param processoRelacionadoVH * @return */ @RequestMapping(method = RequestMethod.POST, produces = "application/json", value = "/removeProcessoAnexado") @ResponseBody public ResponseBodyWrapper removeProcessoAnexado(@RequestBody AnexarProcessoVH anexarProcessoVH) { ResponseBodyWrapper responseBody = new ResponseBodyWrapper(this.anexarProcessoService.removerProcessoAnexado(anexarProcessoVH), Views.AnexarProcesso.class); return responseBody; } }