package es.uv.saic.feign; import java.io.IOException; import java.util.HashMap; import java.util.List; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import es.uv.saic.domain.Usuari; import es.uv.saic.dto.OrganDTO; @FeignClient(name = "saic-core-service", contextId = "organ-controller") public interface OrganClient { @GetMapping("/organ") List getCentres(); @GetMapping("/organ/active") List getActiveCentres(); @GetMapping("/organ/titulacions") public List getTitulacionsWithCentre(); @GetMapping("/organ/find/{tlugar}/{idTitulacio}") public OrganDTO findByID(@PathVariable String tlugar, @PathVariable Integer idTitulacio); @GetMapping("/organ/supervisor") public List getTitulacionsSupervisor(); @GetMapping("/organ/titulacions/{centre}") public List getTitulacionsByCentre(@PathVariable Integer centre); @PostMapping("/organ/usuari") public List findOrgansByUsuari(@RequestBody Usuari usuari); @GetMapping("/organ/findByRuct/{ruct}") public OrganDTO findByRuct(@PathVariable Integer ruct); @PostMapping("/organ/titulacions/usuari") public HashMap getTitulationsByCenter(@RequestParam(name="centers[]", required=false) List centres, @RequestParam String usuari ) throws IOException; @PostMapping("/organ/titulacions/managers") public HashMap getCenterTitulations(@RequestParam("center") Integer centre); @PostMapping("/organ/titulacions/calendar") public HashMap getTitulationsByCenters(@RequestParam("centers[]") List centres, @RequestParam("procedure") Integer idProces); @PostMapping("/organ/titulacions/admin") public HashMap getTitulationsByCenter(@RequestParam("center") Integer centre, @RequestParam("procedure") Integer idProces); @PostMapping("/organ/titulacions") public HashMap getAllTitulationsByCenter(@RequestParam("center") Integer centre); @PostMapping("/organ/centres") public HashMap getAllCentresByAmbit(@RequestParam("procedure") Integer idProces); @PostMapping("/organ/equivalents") public List getEquivalents(@RequestParam Integer lugar, @RequestParam String tlugar); @PostMapping("/organs/new/centre") public void createNewCentre(@RequestParam("codiCentro") Integer codigo, @RequestParam("nomCasCentro") String nomCas, @RequestParam("nomValCentro") String nomVal, @RequestParam("ructCentro") Integer ruct); @PostMapping("/organs/new/titulacion") public void createNewTitulacion(@RequestParam("codiTit") Integer codigo, @RequestParam("centre") Integer idCentro, @RequestParam("nomCasTit") String nomCas, @RequestParam("nomValTit") String nomVal, @RequestParam("ructTit") Integer ruct, @RequestParam("tambit") String ambit); @PostMapping("organs/update/centre") public void updateCentre(@RequestParam("lugar") Integer lugar, @RequestParam("tlugar") String tlugar, @RequestParam("nomCasTit") String nomCas, @RequestParam("nomValTit") String nomVal, @RequestParam("ructTit") Integer ruct); @PostMapping("organs/update/titulacion") public void updateTitulacion(@RequestParam("lugar") Integer lugar, @RequestParam("tlugar") String tlugar, @RequestParam("nomCasTit") String nomCas, @RequestParam("nomValTit") String nomVal, @RequestParam("ructTit") Integer ruct, @RequestParam("centre") Integer idCentro, @RequestParam("tambit") String ambit); }