summaryrefslogtreecommitdiffstats
path: root/servicegateway
diff options
context:
space:
mode:
authorLuji7 <lu.ji3@zte.com.cn>2016-10-19 17:52:42 +0800
committerLuji <lu.ji3@zte.com.cn>2016-10-19 10:02:17 +0000
commit80c5f95a92fa087be0a329d795b579a372f9966e (patch)
tree4cdad90b796d918342c7a7889acc3eba322f95da /servicegateway
parent0c05ae98dff8400cfdc76129c4306b1e14361618 (diff)
GSO-26 Fix the wrong url sent to service gateway. Modify the codes for deleting service to be consistent with the api.
Change-Id: If9242f8c956d5e93f49c4359a959343ed34cfefb Signed-off-by: Luji7 <lu.ji3@zte.com.cn> (cherry picked from commit cddbebf090d52a234e536bef5f7e6dbd6ddcc9e0)
Diffstat (limited to 'servicegateway')
-rw-r--r--servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/roa/inf/IServiceGatewayRoaModule.java5
-rw-r--r--servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImpl.java13
2 files changed, 6 insertions, 12 deletions
diff --git a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/roa/inf/IServiceGatewayRoaModule.java b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/roa/inf/IServiceGatewayRoaModule.java
index 302b2bd9..0e8b03ce 100644
--- a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/roa/inf/IServiceGatewayRoaModule.java
+++ b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/roa/inf/IServiceGatewayRoaModule.java
@@ -18,7 +18,6 @@ package org.openo.gso.gui.servicegateway.roa.inf;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
@@ -63,10 +62,10 @@ public interface IServiceGatewayRoaModule {
* @throws ServiceException when operate database or parameter is wrong.
* @since GSO 0.5
*/
- @DELETE
+ @POST
@Produces({"application/json"})
@Consumes({"application/json"})
- @Path("/{serviceId}")
+ @Path("/{serviceId}/terminate")
Response deleteService(@PathParam("serviceId") String serviceId, @Context HttpServletRequest servletReq)
throws ServiceException;
diff --git a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImpl.java b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImpl.java
index c3dee4a3..3ff4f89b 100644
--- a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImpl.java
+++ b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImpl.java
@@ -139,21 +139,16 @@ public class ServiceGatewayImpl implements IServiceGateway {
// Parse request
String reqContent = RestUtils.getRequestBody(httpRequest);
Map<String, Object> requestBody = JsonUtil.unMarshal(reqContent, Map.class);
- Map<String, Object> service = (Map<String, Object>)requestBody.get(Constant.SERVICE_INDENTIFY);
- if(null == service)
- {
- service = requestBody;
- }
ValidateUtil.assertObjectNotNull(requestBody);
// Validate data
- String gatewayUri = (String)service.get(Constant.SERVICE_GATEWAY_URI);
+ String gatewayUri = (String)requestBody.get(Constant.SERVICE_GATEWAY_URI);
ValidateUtil.assertStringNotNull(gatewayUri);
- service.remove(Constant.SERVICE_GATEWAY_URI);
+ requestBody.remove(Constant.SERVICE_GATEWAY_URI);
- String operation = (String) service.get(Constant.SERVICE_OPERATION);
+ String operation = (String) requestBody.get(Constant.SERVICE_OPERATION);
ValidateUtil.assertStringNotNull(operation);
- service.remove(Constant.SERVICE_OPERATION);
+ requestBody.remove(Constant.SERVICE_OPERATION);
// call the restful
try {