Merge remote-tracking branch 'remotes/origin/orgin/develop' into develop
This commit is contained in:
@@ -31,7 +31,7 @@ import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.restful.DfIpPortLog;
|
||||
|
||||
|
||||
/**
|
||||
* 简单封装Jackson,实现JSON String<->Java Object的Mapper. 封装不同的输出风格,
|
||||
@@ -264,15 +264,7 @@ public class JsonMapper extends ObjectMapper {
|
||||
* map.put("id", 2); map.put("pId", 1); map.put("name", "你好");
|
||||
* map.put("open", true); list.add(map);
|
||||
*/
|
||||
List<DfIpPortLog> ipPort = new ArrayList<DfIpPortLog>();
|
||||
DfIpPortLog ip = new DfIpPortLog();
|
||||
ip.setCljIp("aa");
|
||||
ip.setId(null);
|
||||
ipPort.add(ip);
|
||||
Page page = new Page();
|
||||
page.setList(ipPort);
|
||||
String json = JsonMapper.getInstance().toJsonString(ipPort);
|
||||
System.out.println(json);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.nis.util.JsonMapper;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
@@ -107,10 +108,9 @@ public class HttpClientUtil {
|
||||
}
|
||||
public static void main(String[] args) throws ClientProtocolException, IOException {
|
||||
HttpClientUtil hd = new HttpClientUtil();
|
||||
hd.get("http://10.0.6.115:9200/_sql?sql=select * from dfipportlog-2016-09-07-15 limit 1 10");
|
||||
Map<String,String> map = new HashMap();
|
||||
map.put("id","1");
|
||||
hd.post("http://localhost:8080/springMVC/menu/getChildren.do",map);
|
||||
String result = hd.get("http://10.0.6.104:8080/galaxy/service/cfg/v1/configPzIdSources");
|
||||
Object mapResult = JsonMapper.fromJsonString(result,Map.class);
|
||||
System.out.println(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user