①修复新增,修改,列表展示配置时分类性质标签展示的问题
②列表展示时采用遍历分类性质标签的方法展示,减少数据库查询时的压力 ③取掉了一些不需要展示的列 ④新增Maat转换的bean ⑤采用gson的方式对在bean上做注解做转换,禁止了htmlescape
This commit is contained in:
105
src/main/java/com/nis/domain/maat/MaatCfg.java
Normal file
105
src/main/java/com/nis/domain/maat/MaatCfg.java
Normal file
@@ -0,0 +1,105 @@
|
||||
/**
|
||||
*@Title: MaatCfg.java
|
||||
*@Package com.nis.domain.maat
|
||||
*@Description TODO
|
||||
*@author dell
|
||||
*@date 2018年3月1日 上午10:29:29
|
||||
*@version 版本号
|
||||
*/
|
||||
package com.nis.domain.maat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.NumBoundaryCfg;
|
||||
|
||||
/**
|
||||
* @ClassName: MaatCfg.java
|
||||
* @Description: TODO
|
||||
* @author (dell)
|
||||
* @date 2018年3月1日 上午10:29:29
|
||||
* @version V1.0
|
||||
*/
|
||||
public class MaatCfg implements Serializable {
|
||||
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
private static final long serialVersionUID = -7745084076394247318L;
|
||||
@Expose
|
||||
@SerializedName("strCfg")
|
||||
private BaseStringCfg[] strCfg;
|
||||
@Expose
|
||||
@SerializedName("ipCfg")
|
||||
private BaseIpCfg[] ipCfg;
|
||||
@Expose
|
||||
@SerializedName("numCfg")
|
||||
private NumBoundaryCfg[] numCfg;
|
||||
@Expose
|
||||
@SerializedName("complexStrCfg")
|
||||
private ComplexkeywordCfg[] complexStrCfg;
|
||||
/**
|
||||
* strCfg
|
||||
* @return strCfg
|
||||
*/
|
||||
|
||||
public BaseStringCfg[] getStrCfg() {
|
||||
return strCfg;
|
||||
}
|
||||
/**
|
||||
* @param strCfg the strCfg to set
|
||||
*/
|
||||
public void setStrCfg(BaseStringCfg[] strCfg) {
|
||||
this.strCfg = strCfg;
|
||||
}
|
||||
/**
|
||||
* ipCfg
|
||||
* @return ipCfg
|
||||
*/
|
||||
|
||||
public BaseIpCfg[] getIpCfg() {
|
||||
return ipCfg;
|
||||
}
|
||||
/**
|
||||
* @param ipCfg the ipCfg to set
|
||||
*/
|
||||
public void setIpCfg(BaseIpCfg[] ipCfg) {
|
||||
this.ipCfg = ipCfg;
|
||||
}
|
||||
/**
|
||||
* numCfg
|
||||
* @return numCfg
|
||||
*/
|
||||
|
||||
public NumBoundaryCfg[] getNumCfg() {
|
||||
return numCfg;
|
||||
}
|
||||
/**
|
||||
* @param numCfg the numCfg to set
|
||||
*/
|
||||
public void setNumCfg(NumBoundaryCfg[] numCfg) {
|
||||
this.numCfg = numCfg;
|
||||
}
|
||||
/**
|
||||
* complexStrCfg
|
||||
* @return complexStrCfg
|
||||
*/
|
||||
|
||||
public ComplexkeywordCfg[] getComplexStrCfg() {
|
||||
return complexStrCfg;
|
||||
}
|
||||
/**
|
||||
* @param complexStrCfg the complexStrCfg to set
|
||||
*/
|
||||
public void setComplexStrCfg(ComplexkeywordCfg[] complexStrCfg) {
|
||||
this.complexStrCfg = complexStrCfg;
|
||||
}
|
||||
|
||||
}
|
||||
263
src/main/java/com/nis/domain/maat/ToMaatBean.java
Normal file
263
src/main/java/com/nis/domain/maat/ToMaatBean.java
Normal file
@@ -0,0 +1,263 @@
|
||||
/**
|
||||
*@Title: ToMaatBean.java
|
||||
*@Package com.nis.domain.configuration
|
||||
*@Description TODO
|
||||
*@author dell
|
||||
*@date 2018年2月28日 下午2:03:08
|
||||
*@version 版本号
|
||||
*/
|
||||
package com.nis.domain.maat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
|
||||
/**
|
||||
* @ClassName: ToMaatBean.java
|
||||
* @Description: TODO
|
||||
* @author (dell)
|
||||
* @date 2018年2月28日 下午2:03:08
|
||||
* @version V1.0
|
||||
*/
|
||||
public class ToMaatBean implements Serializable{
|
||||
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(转换为maat格式的java bean)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
private static final long serialVersionUID = 5123156423588372849L;
|
||||
@Expose
|
||||
@SerializedName("serviceCfg")
|
||||
private List<MaatCfg[]> serviceCfg;
|
||||
@Expose
|
||||
@SerializedName("areaCfg")
|
||||
private List<AreaIpCfg> areaCfg;
|
||||
@Expose
|
||||
@SerializedName("action")
|
||||
private Integer action;
|
||||
@Expose
|
||||
@SerializedName("areaEffectiveIds")
|
||||
private String areaEffectiveIds;
|
||||
@Expose
|
||||
@SerializedName("attribute")
|
||||
private String attribute;
|
||||
@Expose
|
||||
@SerializedName("classify")
|
||||
private String classify;
|
||||
@Expose
|
||||
@SerializedName("lable")
|
||||
private String lable;
|
||||
@Expose
|
||||
@SerializedName("compileId")
|
||||
private Long compileId;
|
||||
@Expose
|
||||
@SerializedName("isAreaEffective")
|
||||
private Integer isAreaEffective;
|
||||
@Expose
|
||||
@SerializedName("isValid")
|
||||
private Integer isValid;
|
||||
@Expose
|
||||
@SerializedName("requestId")
|
||||
private Integer requestId;
|
||||
@Expose
|
||||
@SerializedName("serviceId")
|
||||
private Integer serviceId;
|
||||
|
||||
/**
|
||||
* serviceCfg
|
||||
* @return serviceCfg
|
||||
*/
|
||||
|
||||
public List<MaatCfg[]> getServiceCfg() {
|
||||
return serviceCfg;
|
||||
}
|
||||
/**
|
||||
* @param serviceCfg the serviceCfg to set
|
||||
*/
|
||||
public void setServiceCfg(List<MaatCfg[]> serviceCfg) {
|
||||
this.serviceCfg = serviceCfg;
|
||||
}
|
||||
/**
|
||||
* areaCfg
|
||||
* @return areaCfg
|
||||
*/
|
||||
|
||||
public List<AreaIpCfg> getAreaCfg() {
|
||||
return areaCfg;
|
||||
}
|
||||
/**
|
||||
* @param areaCfg the areaCfg to set
|
||||
*/
|
||||
public void setAreaCfg(List<AreaIpCfg> areaCfg) {
|
||||
this.areaCfg = areaCfg;
|
||||
}
|
||||
/**
|
||||
* action
|
||||
* @return action
|
||||
*/
|
||||
|
||||
public Integer getAction() {
|
||||
return action;
|
||||
}
|
||||
/**
|
||||
* @param action the action to set
|
||||
*/
|
||||
public void setAction(Integer action) {
|
||||
this.action = action;
|
||||
}
|
||||
/**
|
||||
* areaEffectiveIds
|
||||
* @return areaEffectiveIds
|
||||
*/
|
||||
|
||||
public String getAreaEffectiveIds() {
|
||||
return areaEffectiveIds;
|
||||
}
|
||||
/**
|
||||
* @param areaEffectiveIds the areaEffectiveIds to set
|
||||
*/
|
||||
public void setAreaEffectiveIds(String areaEffectiveIds) {
|
||||
this.areaEffectiveIds = areaEffectiveIds;
|
||||
}
|
||||
/**
|
||||
* attribute
|
||||
* @return attribute
|
||||
*/
|
||||
|
||||
public String getAttribute() {
|
||||
return attribute;
|
||||
}
|
||||
/**
|
||||
* @param attribute the attribute to set
|
||||
*/
|
||||
public void setAttribute(String attribute) {
|
||||
this.attribute = attribute;
|
||||
}
|
||||
/**
|
||||
* classify
|
||||
* @return classify
|
||||
*/
|
||||
|
||||
public String getClassify() {
|
||||
return classify;
|
||||
}
|
||||
/**
|
||||
* @param classify the classify to set
|
||||
*/
|
||||
public void setClassify(String classify) {
|
||||
this.classify = classify;
|
||||
}
|
||||
|
||||
/**
|
||||
* lable
|
||||
* @return lable
|
||||
*/
|
||||
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
/**
|
||||
* @param lable the lable to set
|
||||
*/
|
||||
public void setLable(String lable) {
|
||||
this.lable = lable;
|
||||
}
|
||||
/**
|
||||
* compileId
|
||||
* @return compileId
|
||||
*/
|
||||
|
||||
public Long getCompileId() {
|
||||
return compileId;
|
||||
}
|
||||
/**
|
||||
* @param compileId the compileId to set
|
||||
*/
|
||||
public void setCompileId(Long compileId) {
|
||||
this.compileId = compileId;
|
||||
}
|
||||
/**
|
||||
* isAreaEffective
|
||||
* @return isAreaEffective
|
||||
*/
|
||||
|
||||
public Integer getIsAreaEffective() {
|
||||
return isAreaEffective;
|
||||
}
|
||||
/**
|
||||
* @param isAreaEffective the isAreaEffective to set
|
||||
*/
|
||||
public void setIsAreaEffective(Integer isAreaEffective) {
|
||||
this.isAreaEffective = isAreaEffective;
|
||||
}
|
||||
/**
|
||||
* isValid
|
||||
* @return isValid
|
||||
*/
|
||||
|
||||
public Integer getIsValid() {
|
||||
return isValid;
|
||||
}
|
||||
/**
|
||||
* @param isValid the isValid to set
|
||||
*/
|
||||
public void setIsValid(Integer isValid) {
|
||||
this.isValid = isValid;
|
||||
}
|
||||
/**
|
||||
* requestId
|
||||
* @return requestId
|
||||
*/
|
||||
|
||||
public Integer getRequestId() {
|
||||
return requestId;
|
||||
}
|
||||
/**
|
||||
* @param requestId the requestId to set
|
||||
*/
|
||||
public void setRequestId(Integer requestId) {
|
||||
this.requestId = requestId;
|
||||
}
|
||||
/**
|
||||
* serviceId
|
||||
* @return serviceId
|
||||
*/
|
||||
|
||||
public Integer getServiceId() {
|
||||
return serviceId;
|
||||
}
|
||||
/**
|
||||
* @param serviceId the serviceId to set
|
||||
*/
|
||||
public void setServiceId(Integer serviceId) {
|
||||
this.serviceId = serviceId;
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
Gson gson=new GsonBuilder().disableHtmlEscaping()
|
||||
.setDateFormat("yyyy-MM-dd HH:mm:ss")
|
||||
.setPrettyPrinting()/*.serializeNulls()*/
|
||||
.excludeFieldsWithoutExposeAnnotation()
|
||||
.create();
|
||||
ToMaatBean bean=new ToMaatBean();
|
||||
List<MaatCfg[]> cfg=new ArrayList<>();
|
||||
MaatCfg[] ma=new MaatCfg[1];
|
||||
MaatCfg mc=new MaatCfg();
|
||||
IpPortCfg[] a=new IpPortCfg[1];
|
||||
a[0]=new IpPortCfg();
|
||||
mc.setIpCfg(a);
|
||||
ma[0]=mc;
|
||||
cfg.add(ma);
|
||||
bean.setServiceCfg(cfg);
|
||||
System.out.println(gson.toJson(bean));
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user