1.增加guava-18.0.jar,用于gson将json转为泛型list
2.调整欺骗ip下发的结构,外层加一层[]
This commit is contained in:
BIN
lib/guava-18.0.jar
Normal file
BIN
lib/guava-18.0.jar
Normal file
Binary file not shown.
22
pom.xml
22
pom.xml
@@ -193,6 +193,12 @@
|
||||
<groupId>com.mangofactory</groupId>
|
||||
<artifactId>swagger-springmvc</artifactId>
|
||||
<version>1.0.2</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>guava</artifactId>
|
||||
<groupId>com.google.guava</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -380,6 +386,12 @@
|
||||
<groupId>com.jolbox</groupId>
|
||||
<artifactId>bonecp</artifactId>
|
||||
<version>0.8.0.RELEASE</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>guava</artifactId>
|
||||
<groupId>com.google.guava</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -613,6 +625,10 @@
|
||||
<artifactId>asm-commons</artifactId>
|
||||
<groupId>asm</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>guava</artifactId>
|
||||
<groupId>com.google.guava</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -638,6 +654,12 @@
|
||||
<artifactId>cglib</artifactId>
|
||||
<version>3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>18.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
|
||||
@@ -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);
|
||||
//下发配置、接收结果
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.nis.web.test;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.nis.domain.configuration.DnsIpCfg;
|
||||
import com.nis.domain.maat.DnsIpRecvData;
|
||||
import com.nis.domain.maat.FromMaatBean;
|
||||
@@ -19,8 +21,9 @@ public class DnsIpTest {
|
||||
*/
|
||||
public static String examine(String recv) {
|
||||
Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
|
||||
ToMaatDnsIpBean fromJson = gson.fromJson(recv, ToMaatDnsIpBean.class);
|
||||
List<MaatDnsIpCfg> serviceCfg = fromJson.getServiceCfg();
|
||||
Type type = new TypeToken<List<ToMaatDnsIpBean>>(){}.getType();
|
||||
List<ToMaatDnsIpBean> fromJson = gson.fromJson(recv, type);
|
||||
List<MaatDnsIpCfg> serviceCfg = fromJson.get(0).getServiceCfg();
|
||||
|
||||
FromMaatBean fBean = new FromMaatBean();
|
||||
List<DnsIpRecvData> data = new ArrayList<DnsIpRecvData>();
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
}
|
||||
|
||||
$("#inputForm").validate({
|
||||
ignore: [],
|
||||
rules: {
|
||||
'serviceId':{
|
||||
remote:"${ctx}/systemService/serviceIdValidate?id=" + encodeURIComponent($("#id").val())
|
||||
@@ -305,7 +304,7 @@
|
||||
<shiro:hasPermission name="system:service:edit">
|
||||
<div>
|
||||
<button id="addBtn" type="button" class="btn btn-default" onclick="addDatatable()"><spring:message code="add"/></button>
|
||||
<input type="hidden" name="childTableFlag" value="${id }"/>
|
||||
<input type="hidden" name="childTableFlag" value="${id }" class="required"/>
|
||||
<!-- <label for="childTableFlag" class="error" style="display:none"></label> -->
|
||||
</div>
|
||||
</shiro:hasPermission>
|
||||
|
||||
Reference in New Issue
Block a user