1.增加guava-18.0.jar,用于gson将json转为泛型list

2.调整欺骗ip下发的结构,外层加一层[]
This commit is contained in:
chenjinsong
2018-04-09 16:24:17 +08:00
parent 116087c068
commit fdf20225aa
5 changed files with 32 additions and 5 deletions

View File

@@ -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);
//下发配置、接收结果