(1)maat配置转换后台提交
(2)maat-tools jar包提交 (3)maat相关接口url写入配置文件
This commit is contained in:
Binary file not shown.
@@ -19,7 +19,6 @@ import com.google.gson.annotations.SerializedName;
|
||||
* @version V1.0
|
||||
*/
|
||||
public class ComplexkeywordCfg extends BaseCfg<ComplexkeywordCfg>{
|
||||
protected String tableName;
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
@@ -33,12 +32,14 @@ public class ComplexkeywordCfg extends BaseCfg<ComplexkeywordCfg>{
|
||||
@Expose
|
||||
@SerializedName("district")
|
||||
protected String district ;
|
||||
protected String districtShowName;
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("keywords")
|
||||
protected String keywords;
|
||||
protected String keywordsShowName;
|
||||
/**
|
||||
* 表达式类型
|
||||
*/
|
||||
@@ -140,19 +141,4 @@ public class ComplexkeywordCfg extends BaseCfg<ComplexkeywordCfg>{
|
||||
this.isHexbin = 0 ;
|
||||
this.matchMethod=3;
|
||||
}
|
||||
/**
|
||||
* tableName
|
||||
* @return tableName
|
||||
*/
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
/**
|
||||
* @param tableName the tableName to set
|
||||
*/
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,15 +9,11 @@
|
||||
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
|
||||
@@ -37,7 +33,7 @@ public class ToMaatBean implements Serializable{
|
||||
private static final long serialVersionUID = 5123156423588372849L;
|
||||
@Expose
|
||||
@SerializedName("serviceCfg")
|
||||
private List<List<MaatCfg>> serviceCfg;
|
||||
private List<MaatCfg> serviceCfg;
|
||||
@Expose
|
||||
@SerializedName("areaCfg")
|
||||
private List<AreaIpCfg> areaCfg;
|
||||
@@ -78,13 +74,13 @@ public class ToMaatBean implements Serializable{
|
||||
* @return serviceCfg
|
||||
*/
|
||||
|
||||
public List<List<MaatCfg>> getServiceCfg() {
|
||||
public List<MaatCfg> getServiceCfg() {
|
||||
return serviceCfg;
|
||||
}
|
||||
/**
|
||||
* @param serviceCfg the serviceCfg to set
|
||||
*/
|
||||
public void setServiceCfg(List<List<MaatCfg>> serviceCfg) {
|
||||
public void setServiceCfg(List<MaatCfg> serviceCfg) {
|
||||
this.serviceCfg = serviceCfg;
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -236,6 +236,7 @@ public class ComplexStringCfgController extends BaseController{
|
||||
}else if(cfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
bean.setIsValid(Constants.VALID_YES);
|
||||
bean.setMaatTable(maatTable);
|
||||
}
|
||||
int result=complexStringCfgService.auditStringCfg(bean,cfg);
|
||||
if(result!=0){
|
||||
|
||||
@@ -307,6 +307,7 @@ public class IpCfgController extends BaseController{
|
||||
}else if(ipCfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||
ipCfg.setIsValid(Constants.VALID_YES);
|
||||
bean.setIsValid(Constants.VALID_YES);
|
||||
bean.setMaatTable(maatTable);
|
||||
}
|
||||
int result=ipCfgService.auditIpCfg(bean,ipCfg);
|
||||
if(result!=0){
|
||||
|
||||
@@ -199,6 +199,7 @@ public class NumCfgController extends BaseController{
|
||||
}else if(cfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
bean.setIsValid(Constants.VALID_YES);
|
||||
bean.setMaatTable(serviceConfigInfo.getMaatTable());
|
||||
}
|
||||
int result=numCfgService.auditNumCfg(bean,cfg);
|
||||
if(result!=0){
|
||||
|
||||
@@ -243,6 +243,7 @@ public class StringCfgController extends BaseController{
|
||||
}else if(stringCfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||
stringCfg.setIsValid(Constants.VALID_YES);
|
||||
bean.setIsValid(Constants.VALID_YES);
|
||||
bean.setMaatTable(maatTable);
|
||||
}
|
||||
int result=stringCfgService.auditStringCfg(bean,stringCfg);
|
||||
if(result!=0){
|
||||
|
||||
@@ -207,7 +207,6 @@ public abstract class CrudService<D extends CrudDao<T>, T extends BaseEntity<T>>
|
||||
throw new RuntimeException("转换出错,配置为空");
|
||||
}
|
||||
Gson gson=new GsonBuilder().disableHtmlEscaping()
|
||||
.setDateFormat("yyyy-MM-dd HH:mm:ss")
|
||||
/*.setPrettyPrinting().serializeNulls()*/
|
||||
.excludeFieldsWithoutExposeAnnotation()
|
||||
.create();
|
||||
@@ -224,6 +223,7 @@ public abstract class CrudService<D extends CrudDao<T>, T extends BaseEntity<T>>
|
||||
}
|
||||
bean.setCompileId(c.getCompileId());
|
||||
bean.setMaatTable(c.getMaatTable());
|
||||
toMaatUnAuditBean.getServiceCfg().add(bean);
|
||||
}
|
||||
String json=gson.toJson(toMaatUnAuditBean);
|
||||
logger.info("to maat json:"+json);
|
||||
@@ -232,7 +232,7 @@ public abstract class CrudService<D extends CrudDao<T>, T extends BaseEntity<T>>
|
||||
}else{
|
||||
int compileId=0;
|
||||
ToMaatBean toMaatBean=new ToMaatBean();
|
||||
toMaatBean.setServiceCfg(new ArrayList<List<MaatCfg>>());
|
||||
toMaatBean.setServiceCfg(new ArrayList<MaatCfg>());
|
||||
MaatCfg maatCfg=new MaatCfg();
|
||||
for(BaseCfg c:cfg){
|
||||
if(c instanceof BaseIpCfg){
|
||||
@@ -279,10 +279,10 @@ public abstract class CrudService<D extends CrudDao<T>, T extends BaseEntity<T>>
|
||||
}
|
||||
if(areaCfg!=null){
|
||||
toMaatBean.setAreaCfg(areaCfg);
|
||||
}else{
|
||||
toMaatBean.setAreaCfg(new ArrayList<AreaIpCfg>());
|
||||
}
|
||||
List<MaatCfg> serviceCfg=new ArrayList<>();
|
||||
serviceCfg.add(maatCfg);
|
||||
toMaatBean.getServiceCfg().add(serviceCfg);
|
||||
toMaatBean.getServiceCfg().add(maatCfg);
|
||||
BaseCfg baseCfg=(BaseCfg)cfg[0];
|
||||
if(compileId==0){
|
||||
throw new RuntimeException("转换出错,未获取到正确的compileId");
|
||||
|
||||
@@ -35,3 +35,19 @@ hasLastUpdate=true
|
||||
|
||||
#配置状态更新的字段
|
||||
updateFields=IS_VALID,OP_TIME
|
||||
#maat configurations
|
||||
#从后台服务获取compileid的url地址
|
||||
get_compileId_url=http://10.0.6.30:8080/maatRest/service/cfg/v1/getCompileId
|
||||
#从后台服务获取groupid的url地址
|
||||
get_groupId_url=http://10.0.6.30:8080/maatRest/service/cfg/v1/getCompileId
|
||||
#从后台服务获取regionid的url地址
|
||||
get_regionId_url=http://10.0.6.30:8080/maatRest/service/cfg/v1/getCompileId
|
||||
#http连接超时时间
|
||||
httpConnectTimeout=5000
|
||||
#http读超时时间
|
||||
readTimeout=5000
|
||||
#向后台提交配置的地址(post形式提交)
|
||||
saveConfigUrl=http://10.0.6.30:8080/maatRest/service/cfg/v1/configSources
|
||||
#将配置置为失效的接口地址
|
||||
invalidConfigUrl=http://10.0.6.30:8080/maatRest/service/cfg/v1/configSources
|
||||
|
||||
|
||||
Reference in New Issue
Block a user