vpn 用户管理修改新增修改和删除逻辑
ip地址池增加存在可用ip地址池才在策略展示
This commit is contained in:
@@ -373,46 +373,4 @@ public class HttpClientUtil {
|
||||
//
|
||||
// }
|
||||
|
||||
/**
|
||||
* CGI get 获取消息
|
||||
* @param destUrl 业务地址
|
||||
* @param params 参数列表
|
||||
* @return 查询结果数据json
|
||||
*/
|
||||
public static String getCGI(String destUrl, Map<String, Object> params, HttpServletRequest req) throws IOException {
|
||||
String result = null;
|
||||
Response response=null;
|
||||
String url = "";
|
||||
try {
|
||||
URIBuilder uriBuilder = new URIBuilder(destUrl);
|
||||
if(params!=null) {
|
||||
for (String param : params.keySet()) {
|
||||
if(!StringUtil.isBlank(param)&¶ms.get(param)!=null) {
|
||||
uriBuilder.addParameter(param, params.get(param).toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
System.err.println(uriBuilder);
|
||||
url=uriBuilder.toString();
|
||||
//创建连接
|
||||
WebTarget wt = ClientUtil.getWebTarger(url);
|
||||
logger.info("getMsg url:"+url);
|
||||
//获取响应结果
|
||||
Builder header = wt.request(MediaType.APPLICATION_JSON).header("Content-Type", MediaType.APPLICATION_JSON);
|
||||
response= header.get();
|
||||
result= response.readEntity(String.class);
|
||||
//调用处理数据方法
|
||||
logger.info("获取消息成功,相应内容如下: " + result);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("获取消息失败,相应内容如下: " + result);
|
||||
logger.error("获取消息失败 ", e);
|
||||
throw new MaatConvertException("<spring:message code=\"cgi_service_failed\"/>:");
|
||||
}finally {
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user