Bläddra i källkod

Alterado endpoint para numeroRegistroEletronico

Elemar Deckmann 1 år sedan
förälder
incheckning
ca238c3225

+ 3 - 3
src/main/java/com/ademicon/controller/ContratoController.java

@@ -37,12 +37,12 @@ public class ContratoController {
     }
 
     @PUT
-    @Path("/upload/chassi/{chassi}")
+    @Path("/upload/numeroRegistroEletronico/{numeroRegistroEletronico}")
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces(MediaType.APPLICATION_JSON)
-    public Response doUpload(@PathParam(value = "chassi") String chassi, String arquivo) throws Exception {
+    public Response doUpload(@PathParam(value = "numeroRegistroEletronico") String numeroRegistroEletronico, String arquivo) throws Exception {
         try {
-            ContratoResponse contratoResponse = contratoService.upload(chassi, arquivo);
+            ContratoResponse contratoResponse = contratoService.upload(numeroRegistroEletronico, arquivo);
             return Response.status(Status.OK).entity(contratoResponse).build();
 
         } catch (Exception e) {

+ 2 - 2
src/main/java/com/ademicon/service/ContratoService.java

@@ -48,7 +48,7 @@ public class ContratoService {
 
     }
 
-    public ContratoResponse upload(String registro, String arquivo) throws Exception {
+    public ContratoResponse upload(String numeroRegistroEletronico, String arquivo) throws Exception {
 
         try {
             AccessModel accessModel = accessService.find();
@@ -61,7 +61,7 @@ public class ContratoService {
             Response response = ClientBuilder.newClient()
                     .target(accessModel.getPlaceti_url_base()
                             + "/api/v1/contrato/upload/numeroRegistroEletronico/:numeroRegistroEletronico")
-                    .queryParam("numeroRegistroEletronico", registro)
+                    .queryParam("numeroRegistroEletronico", numeroRegistroEletronico)
                     .request()
                     .header("Content-Type", "multipart/form-data")
                     .header("Accept", "application/json")

+ 2 - 2
src/main/webapp/WEB-INF/jboss-web.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <jboss-web>
     <context-root>/placeti</context-root>
-    <!-- <disable-cross-context>false</disable-cross-context>
+    <disable-cross-context>false</disable-cross-context>
     <security-domain>TOTVSTech</security-domain>
     <security-role>
         <role-name>user</role-name>
@@ -18,5 +18,5 @@
     <security-role>
         <role-name>admin</role-name>
         <principal-name>wcmadmin</principal-name>
-    </security-role>  -->
+    </security-role> 
 </jboss-web>

+ 2 - 2
src/main/webapp/WEB-INF/web.xml

@@ -2,7 +2,7 @@
 	xmlns="http://xmlns.jcp.org/xml/ns/javaee"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd">
-	<!-- <security-constraint>
+	<security-constraint>
 		<display-name>REST</display-name>
 		<web-resource-collection>
 			<web-resource-name>REST</web-resource-name>
@@ -22,5 +22,5 @@
 	</security-role>
 	<security-role>
 		<role-name>sysadmin</role-name>
-	</security-role> -->
+	</security-role>
 </web-app>