1.增加guava-18.0.jar,用于gson将json转为泛型list
2.调整欺骗ip下发的结构,外层加一层[]
This commit is contained in:
@@ -33,6 +33,7 @@ public class DnsIpCfgService extends CrudService<DnsIpCfgDao, DnsIpCfg>{
|
||||
Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
|
||||
|
||||
//组织要发送的json
|
||||
List<ToMaatDnsIpBean> toMaatData = new ArrayList<ToMaatDnsIpBean>();
|
||||
ToMaatDnsIpBean toMaatBean = new ToMaatDnsIpBean();
|
||||
List<MaatDnsIpCfg> ipCfgList = new ArrayList<MaatDnsIpCfg>();
|
||||
MaatDnsIpCfg ipCfg = new MaatDnsIpCfg();
|
||||
@@ -47,7 +48,9 @@ public class DnsIpCfgService extends CrudService<DnsIpCfgDao, DnsIpCfg>{
|
||||
toMaatBean.setIsValid(1);
|
||||
toMaatBean.setRequestId(dnsIpCfg.getRequest().getId());
|
||||
|
||||
String sendJson = gson.toJson(toMaatBean);
|
||||
toMaatData.add(toMaatBean);
|
||||
|
||||
String sendJson = gson.toJson(toMaatData);
|
||||
|
||||
logger.info("准备下发配置:" + sendJson);
|
||||
//下发配置、接收结果
|
||||
|
||||
Reference in New Issue
Block a user