vpn 用户管理修改新增修改和删除逻辑

ip地址池增加存在可用ip地址池才在策略展示
This commit is contained in:
DuanDongmei
2018-11-30 15:48:11 +08:00
parent 64efd2b9d6
commit a2266e45d6
15 changed files with 378 additions and 208 deletions

View File

@@ -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)&&params.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;
}
}