package com.hws.gateway;
import com.hws.gateway.access.RestMethod;
import com.hws.gateway.common.GWUtil;

import java.util.Map;
import org.apache.log4j.Logger;

public class ServiceAplicationProxy {
    
    private static Logger logger = Logger.getLogger(ServiceAplicationProxy.class);
    
    public static String get(String ak, String sk, String url, String serviceName, String region)
    {
        String stringResponse = "";
        Map<String, Object> responseMap = RestMethod.get(ak, sk, url, serviceName, region);
        stringResponse = GWUtil.mapToString(responseMap);
        
        logger.debug("Response of rest method GET is: " + stringResponse);
        
        
        return stringResponse;
    }
    
    public static String post(String ak, String sk, String requestUrl, String postbody, 
            String serviceName, String region){
        String stringResponse = "";
        Map<String, Object> responseMap = RestMethod.post(ak, sk, requestUrl, postbody, serviceName, region);
        stringResponse = GWUtil.mapToString(responseMap);
        
        logger.debug("Response of rest method POST is: " + stringResponse);
        
        
        return stringResponse;
    }
    
    public static String delete(String ak, String sk, String requestUrl, 
            String serviceName, String region){
        String stringResponse = "";
        Map<String, Object> responseMap = RestMethod.delete(ak, sk, requestUrl, serviceName, region);
        stringResponse = GWUtil.mapToString(responseMap);
        
        logger.debug("Response of rest method DELETE is: " + stringResponse);
        
        
        return stringResponse;
    }
    
}

@@ -1670,10 +1670,981 @@
  %7D%0A    %0A
+    public static String put(String ak, String sk, String requestUrl, String putbody, %0A            String serviceName, String region)%7B%0A        String stringResponse = %22%22;%0A        Map%3CString, Object%3E responseMap = RestMethod.put(ak, sk, requestUrl, putbody, serviceName, region);%0A        stringResponse = GWUtil.mapToString(responseMap);%0A        %0A        logger.debug(%22Response of rest method PUT is: %22 + stringResponse);%0A        %0A        %0A        return stringResponse;%0A    %7D%0A    %0A    public static String patch(String ak, String sk, String requestUrl, String patchBody,%0A            String serviceName, String region)%7B%0A        String stringResponse = %22%22;%0A        Map%3CString, Object%3E responseMap = RestMethod.patch(ak, sk, requestUrl, patchBody, serviceName, region);%0A        stringResponse = GWUtil.mapToString(responseMap);%0A        %0A        logger.debug(%22Response of rest method PATCH is: %22 + stringResponse);%0A        %0A        %0A        return stringResponse;%0A    %7D%0A    %0A
 %7D%0A

add put and patch function