Просмотр исходного кода

Remove exception from other services

Drowsito 2 месяцев назад
Родитель
Сommit
cd317d0785

+ 11 - 13
src/main/java/es/uv/saic/feign/CalendarClient.java

@@ -1,7 +1,5 @@
 package es.uv.saic.feign;
 
-import java.io.IOException;
-import java.text.ParseException;
 import java.util.List;
 import java.util.Optional;
 
@@ -17,29 +15,29 @@ import es.uv.saic.domain.Calendari;
 
 @FeignClient(name = "saic-core-service", contextId = "calendar-controller")
 public interface CalendarClient {
-    	@ResponseBody
-	@PostMapping("/ajax/calendar")
+        @ResponseBody
+	@PostMapping("/calendar")
 	public Calendari calendarAddEvent(@RequestParam("idProces") Integer idProces, 
         @RequestParam("titulacions") List<String> titulacions, @RequestParam("centres") List<String> centres, 
-        @RequestParam("data") String data, @RequestParam("instancia") Optional<Integer> instancia) throws IOException, ParseException;
+        @RequestParam("data") String data, @RequestParam("instancia") Optional<Integer> instancia);
 
     @ResponseBody
-	@PostMapping("/ajax/calendar/{id}")
+	@PostMapping("/calendar/{id}")
 	public Calendari calendarAddEvent(@PathVariable("id") Integer id, 
         @RequestParam("idProces") Integer idProces, @RequestParam("titulacions") List<String> titulacions, 
-        @RequestParam("centres") List<String> centres, @RequestParam("data") String data) throws IOException, ParseException;
+        @RequestParam("centres") List<String> centres, @RequestParam("data") String data);
 
     @ResponseBody
-	@GetMapping("/ajax/calendar")
-	public List<Calendari> calendarGetEvents() throws IOException, ParseException;
+	@GetMapping("/calendar")
+	public List<Calendari> calendarGetEvents();
 
     @ResponseBody
-	@DeleteMapping("/ajax/calendar")
-	public Integer calendarDeleteEvent(@RequestParam("id") Integer id) throws IOException, ParseException;
+	@DeleteMapping("/calendar")
+	public Integer calendarDeleteEvent(@RequestParam("id") Integer id);
 
     @ResponseBody
-	@PostMapping("/ajax/instantiate")
+	@PostMapping("/calendar/instantiate")
     public List<String> instantiate(@RequestParam("id") Integer id,
         @RequestParam("idProces") Integer idProces, @RequestParam("centres") List<Integer> centres,
-        @RequestParam("titulacions") List<Integer> titulacions, @RequestParam String usuari) throws IOException, ParseException;   
+        @RequestParam("titulacions") List<Integer> titulacions, @RequestParam String usuari);   
 }

+ 6 - 10
src/main/java/es/uv/saic/feign/DashboardClient.java

@@ -1,12 +1,8 @@
 package es.uv.saic.feign;
 
-import java.io.IOException;
-import java.text.ParseException;
 import java.util.HashMap;
 import java.util.List;
 
-import javax.xml.parsers.ParserConfigurationException;
-
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -57,7 +53,7 @@ public interface DashboardClient {
     @PostMapping("/dashboard/documents")
 	@ResponseBody
 	public void uploadDocument(@RequestParam MultipartFile file, @RequestParam Integer idCategoria, 
-							   @RequestParam Integer lugar, @RequestParam String tlugar) throws IllegalStateException, IOException;
+							   @RequestParam Integer lugar, @RequestParam String tlugar);
     
     @PostMapping("/dashboard/documents/archive")
 	@ResponseBody
@@ -65,19 +61,19 @@ public interface DashboardClient {
 
     @GetMapping("/dashboard/graphs/list/{ruct}")
 	@ResponseBody
-	public List<Grafica> getGraphDataList(@PathVariable Integer ruct) throws ParserConfigurationException;
+	public List<Grafica> getGraphDataList(@PathVariable Integer ruct);
 
     @GetMapping("/dashboard/graphs/rates/{lugar}")
 	@ResponseBody
-	public List<Indicador> getGraphDataTaxes(@PathVariable Integer lugar) throws ParserConfigurationException;
+	public List<Indicador> getGraphDataTaxes(@PathVariable Integer lugar);
 
 	@GetMapping("/dashboard/graphs/inds/{ruct}/{tambit}")
 	@ResponseBody
-	public List<Indicador> getGraphDataByRuctTambit(@PathVariable Integer ruct, @PathVariable String tambit) throws ParserConfigurationException;
+	public List<Indicador> getGraphDataByRuctTambit(@PathVariable Integer ruct, @PathVariable String tambit);
 
     @GetMapping("/dashboard/graphs/inds/{ruct}")
 	@ResponseBody
-	public List<Indicador> getGraphDataByRuct(@PathVariable Integer ruct) throws ParserConfigurationException;
+	public List<Indicador> getGraphDataByRuct(@PathVariable Integer ruct);
 
     @GetMapping("/dashboard/links/{ruct}")
 	@ResponseBody
@@ -85,7 +81,7 @@ public interface DashboardClient {
 
     @PostMapping("/dashboard/links/{ruct}")
 	@ResponseBody
-	public Link createLink(@PathVariable Integer ruct, @RequestParam String dataExp) throws ParseException;
+	public Link createLink(@PathVariable Integer ruct, @RequestParam String dataExp);
 
     @DeleteMapping("/dashboard/links/{id}")
 	@ResponseBody

+ 5 - 6
src/main/java/es/uv/saic/feign/DataClient.java

@@ -1,6 +1,5 @@
 package es.uv.saic.feign;
 
-import java.io.IOException;
 import java.util.List;
 
 import org.springframework.cloud.openfeign.FeignClient;
@@ -21,21 +20,21 @@ public interface DataClient {
     public List<Datasource> renderImport();
 
     @PostMapping("/data/import")
-    public String uploadFile(@RequestBody ImportDTO importDto) throws IOException;
+    public String uploadFile(@RequestBody ImportDTO importDto);
 
     @PostMapping("/data/view/columns")
     public List<String> listTableColumns(@RequestBody TablaDTO tablaDTO);
 
     @PostMapping("/data/check/{type}")
-    public List<IndicadorEnquestaTmpDup> check(@RequestBody String enquesta, @PathVariable Integer type) throws IOException;
+    public List<IndicadorEnquestaTmpDup> check(@RequestBody String enquesta, @PathVariable Integer type);
 
     @GetMapping("/data/sources")
-	public List<Datasource> getDatasources() throws IOException;
+	public List<Datasource> getDatasources();
 
     @PostMapping("/data/count")
-	public Integer countByEnquesta(@RequestBody String enquesta) throws IOException;
+	public Integer countByEnquesta(@RequestBody String enquesta);
 
     @PostMapping("/data/consolidate")
-	public Integer consolidate(@RequestBody String enquesta) throws IOException;
+	public Integer consolidate(@RequestBody String enquesta);
     
 }

+ 7 - 8
src/main/java/es/uv/saic/feign/DocumentClient.java

@@ -1,6 +1,5 @@
 package es.uv.saic.feign;
 
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.math.BigInteger;
 
@@ -44,19 +43,19 @@ public interface DocumentClient {
 
     @GetMapping("/downloads/{fileName}")
     @ResponseBody
-	public ResponseEntity<byte[]> download(@PathVariable("fileName") BigInteger idInstanciaTasca) throws IOException;		
+	public ResponseEntity<byte[]> download(@PathVariable("fileName") BigInteger idInstanciaTasca);		
 
     @GetMapping(value="/downloads/document/{id}", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
 	@ResponseBody
-	public ResponseEntity<byte[]> downloadDocument(@PathVariable("id") Integer idDocument) throws FileNotFoundException;
+	public ResponseEntity<byte[]> downloadDocument(@PathVariable("id") Integer idDocument);
 
    	@GetMapping(value="/downloads/report/{t}/{p}", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
 	@ResponseBody 
-	public ResponseEntity<FileSystemResource> downloadReport(@PathVariable("t") Integer idTitulacio, @PathVariable("p") String nomProces) throws IOException, XDocReportException;
+	public ResponseEntity<FileSystemResource> downloadReport(@PathVariable("t") Integer idTitulacio, @PathVariable("p") String nomProces);
 
     @GetMapping(value="/downloads/template/{id}", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
 	@ResponseBody 
-	public ResponseEntity<byte[]> downloadTemplate(@PathVariable("id") BigInteger idTascai) throws IOException, XDocReportException;
+	public ResponseEntity<byte[]> downloadTemplate(@PathVariable("id") BigInteger idTascai);
 
     @GetMapping(value="/test/template/{titulacio}/{centre}/{idProces}/{idTascap}", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
 	@ResponseBody
@@ -68,14 +67,14 @@ public interface DocumentClient {
 	@ResponseBody
 	public byte[] testTemplate(@PathVariable("titulacio") Integer idTitulacio, @PathVariable("centre") Integer idCentre,
 			@PathVariable("evidencia") String evidencia, @PathVariable("curs") Integer curs,
-            @PathVariable("tipusTasca") Integer tipusTasca) throws IOException, XDocReportException;
+            @PathVariable("tipusTasca") Integer tipusTasca);
 
     @GetMapping(value="/pdf/{idTascai}")
 	@ResponseBody
-	public byte[] downloadTemplatePdf(@PathVariable("idTascai") BigInteger idTascai) throws IOException, InterruptedException;
+	public byte[] downloadTemplatePdf(@PathVariable("idTascai") BigInteger idTascai);
 
     @PostMapping(value="/pdf/preview")
 	@ResponseBody
-	public byte[] downloadTemplatePdf(@RequestBody PdfDTO pdf) throws IOException, InterruptedException;
+	public byte[] downloadTemplatePdf(@RequestBody PdfDTO pdf);
 
 }

+ 1 - 1
src/main/java/es/uv/saic/feign/EmailClient.java

@@ -8,7 +8,7 @@ import es.uv.saic.dto.EmailDTO;
 
 @FeignClient(name = "saic-core-service", contextId = "email-controller")
 public interface EmailClient {
-    @PostMapping("emails/send")
+    @PostMapping("/emails/send")
 	public void sendEmail(@RequestBody EmailDTO email);
 
     @PostMapping("/emails/add")

+ 4 - 4
src/main/java/es/uv/saic/feign/OrganClient.java

@@ -52,16 +52,16 @@ public interface OrganClient {
 	public HashMap<String, Object> getCenterTitulations(@RequestParam("center") Integer centre);
 
     @PostMapping("/organs/titulacions/calendar")
-	public HashMap<String, Object> getTitulationsByCenters(@RequestParam("centers[]") List<Integer> centres, @RequestParam("procedure") Integer idProces) throws IOException;
+	public HashMap<String, Object> getTitulationsByCenters(@RequestParam("centers[]") List<Integer> centres, @RequestParam("procedure") Integer idProces);
 
     @PostMapping("/organs/titulacions/admin")
-	public HashMap<String, Object> getTitulationsByCenter(@RequestParam("center") Integer centre, @RequestParam("procedure") Integer idProces) throws IOException;
+	public HashMap<String, Object> getTitulationsByCenter(@RequestParam("center") Integer centre, @RequestParam("procedure") Integer idProces);
 
     @PostMapping("/organs/titulacions")
-	public HashMap<String, Object> getAllTitulationsByCenter(@RequestParam("center") Integer centre) throws IOException;
+	public HashMap<String, Object> getAllTitulationsByCenter(@RequestParam("center") Integer centre);
 
     @PostMapping("/organs/centres")
-	public HashMap<String, Object> getAllCentresByAmbit(@RequestParam("procedure") Integer idProces) throws IOException;
+	public HashMap<String, Object> getAllCentresByAmbit(@RequestParam("procedure") Integer idProces);
 
     @PostMapping("/organs/equivalents")
 	public List<Integer> getEquivalents(@RequestParam Integer lugar, @RequestParam String tlugar);

+ 3 - 8
src/main/java/es/uv/saic/feign/ParseClient.java

@@ -1,8 +1,5 @@
 package es.uv.saic.feign;
 
-import java.io.IOException;
-import java.sql.SQLException;
-
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -14,13 +11,11 @@ public interface ParseClient {
 
     @PostMapping("/admin/parse/do")
 	public void doParse(HttpServletResponse response, @RequestParam String database, 
-        @RequestParam String table, @RequestParam Integer year) throws IOException, SQLException, ClassNotFoundException;	
+        @RequestParam String table, @RequestParam Integer year);	
 
     @PostMapping("/admin/parse/action")
-	public void doAction(HttpServletResponse response, @RequestParam String action) 
-        throws IOException, SQLException, ClassNotFoundException;
+	public void doAction(HttpServletResponse response, @RequestParam String action);
 
     @PostMapping("/admin/parse/delete")
-	public void doDelete(HttpServletResponse response, @RequestParam String action, @RequestParam Integer year) 
-        throws IOException, SQLException, ClassNotFoundException;
+	public void doDelete(HttpServletResponse response, @RequestParam String action, @RequestParam Integer year);
 }

+ 11 - 13
src/main/java/es/uv/saic/feign/ProceduresClient.java

@@ -1,7 +1,6 @@
 package es.uv.saic.feign;
 
 import java.io.File;
-import java.io.IOException;
 import java.math.BigInteger;
 import java.sql.Timestamp;
 import java.util.HashMap;
@@ -35,11 +34,11 @@ public interface ProceduresClient {
     @PostMapping("/procedure/files/{id}")
 	@ResponseBody 
 	public HashMap<String, Object> updateInstanciaTascaEvidencia(@PathVariable BigInteger id, @RequestParam Map<String,String> params, 
-        @RequestBody(required = true) List<File> evidencias, @RequestParam String usuari) throws IllegalStateException, IOException;
+        @RequestBody(required = true) List<File> evidencias, @RequestParam String usuari);
     
     @PostMapping("/procedure/{id}")
 	public HashMap<String, Object> updateInstanciaTasca(@PathVariable BigInteger id, @RequestBody Map<String,String> params,
-        @RequestParam(required = false) List<MultipartFile> evidencias, @RequestParam String usuari) throws IllegalStateException, IOException, InterruptedException;
+        @RequestParam(required = false) List<MultipartFile> evidencias, @RequestParam String usuari);
 
     @PostMapping("/procedure/save/{id}")
 	@ResponseBody
@@ -63,27 +62,26 @@ public interface ProceduresClient {
     @GetMapping("/tipus/findAll")
 	public List<Tipus> findAll();
 
-    @PostMapping("/ajax/search/years")
+    @PostMapping("/search/years")
 	public HashMap<String, Object> getYearsByCenterTitulation(
         @RequestParam(name="centers[]", required=false) List<Integer> centres,
-        @RequestParam("titulations[]") List<Integer> titulacions, @RequestParam String usuari) throws IOException;
+        @RequestParam("titulations[]") List<Integer> titulacions, @RequestParam String usuari);
 
-    @PostMapping("/ajax/search/procedures")
+    @PostMapping("/search/procedures")
 	public HashMap<String, Object> getProceduresByCenterTitulationYear(
         @RequestParam(name="centers[]", required=false) List<Integer> centres,
         @RequestParam("years[]") List<Integer> cursos,
         @RequestParam("titulations[]") List<Integer> titulacions,
-        @RequestParam String usuari) throws IOException;
+        @RequestParam String usuari);
 
-    @PostMapping("/ajax/find/procedure")
+    @PostMapping("/find/procedure")
 	public HashMap<String, Object> findProcedure(@RequestParam("procedure") String idProces, 
-        @RequestParam("action") String action) throws IOException;
+        @RequestParam("action") String action);
 
-    @PostMapping("/ajax/template/form")
+    @PostMapping("/template/form")
 	public HashMap<String, Object> formTemplate(@RequestParam("id") Integer idPlantilla,
-			@RequestParam("action") String action) throws IOException;
-
-            
+			@RequestParam("action") String action);
+          
     @GetMapping("/find/proces/{idProces}")
 	public Proces findProcesByID(@PathVariable Integer idProces);
 

+ 2 - 4
src/main/java/es/uv/saic/feign/TascaClient.java

@@ -1,6 +1,5 @@
 package es.uv.saic.feign;
 
-import java.io.IOException;
 import java.util.HashMap;
 import java.util.List;
 
@@ -14,12 +13,11 @@ import es.uv.saic.dto.EvidenciaBuscadorDTO;
 
 @FeignClient(name = "saic-core-service", contextId = "tasca-controller")
 public interface TascaClient {
-     @PostMapping("/ajax/search/evidences")
+     @PostMapping("/search/evidences")
 	public HashMap<String, Object> getEvidencesByCenterTitulationYear(
         @RequestParam(name="centers[]", required=false) List<Integer> centres,
         @RequestParam("years[]") List<Integer> cursos,
-        @RequestParam("titulations[]") List<Integer> titulacions) throws IOException;
-   
+        @RequestParam("titulations[]") List<Integer> titulacions);
     @GetMapping("/getEvidencesByProcedure/{idProces}")
     public List<EvidenciaBuscadorDTO> getEvidencesByProcedure(@PathVariable Integer idProces);
 }