(1)BaseStringCfg 类修改为BaseStringCfg<T>,加入泛型。所有继承BaseStringCfg的类均已经修改泛型。
(2)HttpUrlCfg新增ratelimit一列,用于域名限速。 (3)域名限速新增/修改增加限速比例一列,列表展示新增限速比例一列。 (4)审核自定义域域名拦截与域名限速进行调整。 (5)删除MultipleCfg以及相关的dao,service (6StringCfgService重命名为DomainService,其不具备字符串配置都能调用的功能
This commit is contained in:
@@ -18,7 +18,7 @@ import com.google.gson.annotations.SerializedName;
|
||||
* @date 2018年2月5日 下午5:26:02
|
||||
* @version V1.0
|
||||
*/
|
||||
public class AppStringCfg extends BaseStringCfg {
|
||||
public class AppStringCfg extends BaseStringCfg<AppStringCfg> {
|
||||
|
||||
private static final String tableName="app_string_cfg";
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ package com.nis.domain.configuration;
|
||||
* @date 2018年2月6日 上午8:29:26
|
||||
* @version V1.0
|
||||
*/
|
||||
public class AvContUrlCfg extends BaseStringCfg {
|
||||
public class AvContUrlCfg extends BaseStringCfg<AvContUrlCfg> {
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -7,7 +7,7 @@ package com.nis.domain.configuration;
|
||||
* @date 2018年2月6日 上午8:29:26
|
||||
* @version V1.0
|
||||
*/
|
||||
public class AvPicUrlCfg extends BaseStringCfg {
|
||||
public class AvPicUrlCfg extends BaseStringCfg<AvPicUrlCfg> {
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -8,7 +8,7 @@ package com.nis.domain.configuration;
|
||||
* @date 2018年2月6日 上午8:18:55
|
||||
* @version V1.0
|
||||
*/
|
||||
public class AvVoipAccountCfg extends BaseStringCfg{
|
||||
public class AvVoipAccountCfg extends BaseStringCfg<AvVoipAccountCfg>{
|
||||
|
||||
|
||||
private static final long serialVersionUID = -7398698517584394431L;
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
*/
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
@@ -21,7 +19,7 @@ import com.nis.util.excel.ExcelField;
|
||||
* @date 2018年2月5日 下午5:26:02
|
||||
* @version V1.0
|
||||
*/
|
||||
public class BaseStringCfg extends BaseCfg<BaseStringCfg> {
|
||||
public class BaseStringCfg<T> extends BaseCfg<T> {
|
||||
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
@@ -37,8 +35,8 @@ public class BaseStringCfg extends BaseCfg<BaseStringCfg> {
|
||||
@SerializedName("keywords")
|
||||
@ExcelField(title="key_word")
|
||||
protected String cfgKeywords;
|
||||
|
||||
protected String cfgKeywordsShowName;
|
||||
|
||||
/**
|
||||
* @param cfgKeywords the cfgKeywords to set
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,7 @@ package com.nis.domain.configuration;
|
||||
* @date 2018年2月6日 上午10:36:22
|
||||
* @version V1.0
|
||||
*/
|
||||
public class ByteFeaturesCfg extends BaseStringCfg {
|
||||
public class ByteFeaturesCfg extends BaseStringCfg<ByteFeaturesCfg> {
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
|
||||
@@ -15,7 +15,7 @@ package com.nis.domain.configuration;
|
||||
* @date 2018年2月6日 上午8:18:55
|
||||
* @version V1.0
|
||||
*/
|
||||
public class FtpKeywordCfg extends BaseStringCfg{
|
||||
public class FtpKeywordCfg extends BaseStringCfg<FtpKeywordCfg>{
|
||||
private static final String tableName="ftp_keyword_cfg";
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
|
||||
@@ -15,7 +15,7 @@ package com.nis.domain.configuration;
|
||||
* @date 2018年2月5日 下午5:33:05
|
||||
* @version V1.0
|
||||
*/
|
||||
public class HttpBodyCfg extends BaseStringCfg {
|
||||
public class HttpBodyCfg extends BaseStringCfg<HttpBodyCfg> {
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
|
||||
@@ -15,7 +15,7 @@ package com.nis.domain.configuration;
|
||||
* @date 2018年2月5日 下午5:33:05
|
||||
* @version V1.0
|
||||
*/
|
||||
public class HttpDomainCfg extends BaseStringCfg {
|
||||
public class HttpDomainCfg extends BaseStringCfg<HttpDomainCfg> {
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.util.Constants;
|
||||
|
||||
/**
|
||||
@@ -17,8 +18,23 @@ import com.nis.util.Constants;
|
||||
* @date 2018年2月5日 下午5:33:05
|
||||
* @version V1.0
|
||||
*/
|
||||
public class HttpUrlCfg extends BaseStringCfg {
|
||||
public class HttpUrlCfg extends BaseStringCfg<HttpUrlCfg> {
|
||||
private static final String tableName="http_url_cfg";
|
||||
private Integer ratelimit;
|
||||
/**
|
||||
* ratelimit
|
||||
* @return ratelimit
|
||||
*/
|
||||
|
||||
public Integer getRatelimit() {
|
||||
return ratelimit;
|
||||
}
|
||||
/**
|
||||
* @param ratelimit the ratelimit to set
|
||||
*/
|
||||
public void setRatelimit(Integer ratelimit) {
|
||||
this.ratelimit = ratelimit;
|
||||
}
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
@@ -44,5 +60,4 @@ public class HttpUrlCfg extends BaseStringCfg {
|
||||
public static String getTablename() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ package com.nis.domain.configuration;
|
||||
* @date 2018年2月6日 上午10:30:46
|
||||
* @version V1.0
|
||||
*/
|
||||
public class HttpsContentReplaceCfg extends BaseStringCfg {
|
||||
public class HttpsContentReplaceCfg extends BaseStringCfg<HttpsContentReplaceCfg> {
|
||||
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
|
||||
@@ -15,7 +15,7 @@ package com.nis.domain.configuration;
|
||||
* @date 2018年2月6日 上午10:28:42
|
||||
* @version V1.0
|
||||
*/
|
||||
public class HttpsUrlCfg extends BaseStringCfg {
|
||||
public class HttpsUrlCfg extends BaseStringCfg<HttpsUrlCfg> {
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
|
||||
@@ -15,7 +15,7 @@ package com.nis.domain.configuration;
|
||||
* @date 2018年2月6日 上午8:42:42
|
||||
* @version V1.0
|
||||
*/
|
||||
public class L2tpUrlCfg extends BaseStringCfg {
|
||||
public class L2tpUrlCfg extends BaseStringCfg<L2tpUrlCfg> {
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
|
||||
@@ -15,7 +15,7 @@ package com.nis.domain.configuration;
|
||||
* @date 2018年2月6日 上午9:48:36
|
||||
* @version V1.0
|
||||
*/
|
||||
public class MmsUrlCfg extends BaseStringCfg{
|
||||
public class MmsUrlCfg extends BaseStringCfg<MmsUrlCfg>{
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
|
||||
@@ -1,186 +0,0 @@
|
||||
/**
|
||||
*@Title: MultipleCfg.java
|
||||
*@Package com.nis.domain.configuration
|
||||
*@Description TODO
|
||||
*@author dell
|
||||
*@date 2018年3月13日 上午8:59:32
|
||||
*@version 版本号
|
||||
*/
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: MultipleCfg.java
|
||||
* @Description: TODO
|
||||
* @author (dell)
|
||||
* @date 2018年3月13日 上午8:59:32
|
||||
* @version V1.0
|
||||
*/
|
||||
public class MultipleCfg extends BaseCfg<MultipleCfg> {
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private static final long serialVersionUID = -8369567908781421920L;
|
||||
/**
|
||||
* 配置关系表,一个compileId 中有哪些表存了数据
|
||||
*/
|
||||
private MultipleCfgRelation relation;
|
||||
private String mainTable;
|
||||
private String mainTableType;
|
||||
private String mainTableDesc;
|
||||
private List<TableBean> otherTables;//key 表名,value 类型
|
||||
//ip配置
|
||||
private Map<String,BaseIpCfg> ipCfg;
|
||||
//字符串配置
|
||||
private Map<String,BaseStringCfg> stringCfg;
|
||||
//数值类配置
|
||||
private Map<String,NumBoundaryCfg> numCfg;
|
||||
//增强字符串配置
|
||||
private Map<String,ComplexkeywordCfg> complexCfg;
|
||||
//地域配置
|
||||
private AreaIpCfg areaIpCfg;
|
||||
/**
|
||||
* mainTable
|
||||
* @return mainTable
|
||||
*/
|
||||
|
||||
public String getMainTable() {
|
||||
return mainTable;
|
||||
}
|
||||
/**
|
||||
* @param mainTable the mainTable to set
|
||||
*/
|
||||
public void setMainTable(String mainTable) {
|
||||
this.mainTable = mainTable;
|
||||
}
|
||||
/**
|
||||
* areaIpCfg
|
||||
* @return areaIpCfg
|
||||
*/
|
||||
|
||||
public AreaIpCfg getAreaIpCfg() {
|
||||
return areaIpCfg;
|
||||
}
|
||||
/**
|
||||
* @param areaIpCfg the areaIpCfg to set
|
||||
*/
|
||||
public void setAreaIpCfg(AreaIpCfg areaIpCfg) {
|
||||
this.areaIpCfg = areaIpCfg;
|
||||
}
|
||||
/**
|
||||
* ipCfg
|
||||
* @return ipCfg
|
||||
*/
|
||||
|
||||
public Map<String, BaseIpCfg> getIpCfg() {
|
||||
return ipCfg;
|
||||
}
|
||||
/**
|
||||
* @param ipCfg the ipCfg to set
|
||||
*/
|
||||
public void setIpCfg(Map<String, BaseIpCfg> ipCfg) {
|
||||
this.ipCfg = ipCfg;
|
||||
}
|
||||
/**
|
||||
* stringCfg
|
||||
* @return stringCfg
|
||||
*/
|
||||
|
||||
public Map<String, BaseStringCfg> getStringCfg() {
|
||||
return stringCfg;
|
||||
}
|
||||
/**
|
||||
* @param stringCfg the stringCfg to set
|
||||
*/
|
||||
public void setStringCfg(Map<String, BaseStringCfg> stringCfg) {
|
||||
this.stringCfg = stringCfg;
|
||||
}
|
||||
/**
|
||||
* numCfg
|
||||
* @return numCfg
|
||||
*/
|
||||
|
||||
public Map<String, NumBoundaryCfg> getNumCfg() {
|
||||
return numCfg;
|
||||
}
|
||||
/**
|
||||
* @param numCfg the numCfg to set
|
||||
*/
|
||||
public void setNumCfg(Map<String, NumBoundaryCfg> numCfg) {
|
||||
this.numCfg = numCfg;
|
||||
}
|
||||
/**
|
||||
* complexCfg
|
||||
* @return complexCfg
|
||||
*/
|
||||
|
||||
public Map<String, ComplexkeywordCfg> getComplexCfg() {
|
||||
return complexCfg;
|
||||
}
|
||||
/**
|
||||
* @param complexCfg the complexCfg to set
|
||||
*/
|
||||
public void setComplexCfg(Map<String, ComplexkeywordCfg> complexCfg) {
|
||||
this.complexCfg = complexCfg;
|
||||
}
|
||||
/**
|
||||
* mainTableType
|
||||
* @return mainTableType
|
||||
*/
|
||||
|
||||
public String getMainTableType() {
|
||||
return mainTableType;
|
||||
}
|
||||
/**
|
||||
* @param mainTableType the mainTableType to set
|
||||
*/
|
||||
public void setMainTableType(String mainTableType) {
|
||||
this.mainTableType = mainTableType;
|
||||
}
|
||||
/**
|
||||
* otherTables
|
||||
* @return otherTables
|
||||
*/
|
||||
|
||||
public List<TableBean> getOtherTables() {
|
||||
return otherTables;
|
||||
}
|
||||
/**
|
||||
* @param otherTables the otherTables to set
|
||||
*/
|
||||
public void setOtherTables(List<TableBean> otherTables) {
|
||||
this.otherTables = otherTables;
|
||||
}
|
||||
/**
|
||||
* mainTableDesc
|
||||
* @return mainTableDesc
|
||||
*/
|
||||
|
||||
public String getMainTableDesc() {
|
||||
return mainTableDesc;
|
||||
}
|
||||
/**
|
||||
* @param mainTableDesc the mainTableDesc to set
|
||||
*/
|
||||
public void setMainTableDesc(String mainTableDesc) {
|
||||
this.mainTableDesc = mainTableDesc;
|
||||
}
|
||||
/**
|
||||
* relation
|
||||
* @return relation
|
||||
*/
|
||||
|
||||
public MultipleCfgRelation getRelation() {
|
||||
return relation;
|
||||
}
|
||||
/**
|
||||
* @param relation the relation to set
|
||||
*/
|
||||
public void setRelation(MultipleCfgRelation relation) {
|
||||
this.relation = relation;
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
/**
|
||||
*@Title: MultipleCfgRelation.java
|
||||
*@Package com.nis.domain.configuration
|
||||
*@Description TODO
|
||||
*@author dell
|
||||
*@date 2018年4月10日 上午11:11:53
|
||||
*@version 版本号
|
||||
*/
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName: MultipleCfgRelation.java
|
||||
* @Description: TODO
|
||||
* @author (dell)
|
||||
* @date 2018年4月10日 上午11:11:53
|
||||
* @version V1.0
|
||||
*/
|
||||
public class MultipleCfgRelation implements Serializable{
|
||||
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
private static final long serialVersionUID = -615924510840736781L;
|
||||
private int compileId;
|
||||
private String tableName;
|
||||
private int isValid;
|
||||
/**
|
||||
* compileId
|
||||
* @return compileId
|
||||
*/
|
||||
|
||||
public int getCompileId() {
|
||||
return compileId;
|
||||
}
|
||||
/**
|
||||
* @param compileId the compileId to set
|
||||
*/
|
||||
public void setCompileId(int compileId) {
|
||||
this.compileId = compileId;
|
||||
}
|
||||
/**
|
||||
* tableName
|
||||
* @return tableName
|
||||
*/
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
/**
|
||||
* @param tableName the tableName to set
|
||||
*/
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
/**
|
||||
* isValid
|
||||
* @return isValid
|
||||
*/
|
||||
|
||||
public int getIsValid() {
|
||||
return isValid;
|
||||
}
|
||||
/**
|
||||
* @param isValid the isValid to set
|
||||
*/
|
||||
public void setIsValid(int isValid) {
|
||||
this.isValid = isValid;
|
||||
}
|
||||
}
|
||||
@@ -1,214 +0,0 @@
|
||||
/**
|
||||
*@Title: MultipleCfg.java
|
||||
*@Package com.nis.domain.configuration
|
||||
*@Description TODO
|
||||
*@author dell
|
||||
*@date 2018年3月13日 上午8:59:32
|
||||
*@version 版本号
|
||||
*/
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName: MultipleCfg.java
|
||||
* @Description: TODO
|
||||
* @author (dell)
|
||||
* @date 2018年3月13日 上午8:59:32
|
||||
* @version V1.0
|
||||
*/
|
||||
public class MultipleSearchCfg extends BaseCfg<MultipleSearchCfg> {
|
||||
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
private static final long serialVersionUID = -8369567908781421920L;
|
||||
private String mainTable;//主表名
|
||||
private String mainTableType;//主表类型
|
||||
private String mainTableDesc;//主表类型
|
||||
private String ipTable;//查询条件IP表名,界面限制查询条件除了共用属性之外只能查一个条件
|
||||
private String stringTable;//查询条件字符串表名,界面限制查询条件除了共用属性之外只能查一个条件
|
||||
private String complexTable;//查询条件增强字符串串表名,界面限制查询条件除了共用属性之外只能查一个条件
|
||||
private List<TableBean> otherTables;//key 表名,value 类型
|
||||
//ip配置
|
||||
private BaseIpCfg ipCfg;
|
||||
//字符串配置
|
||||
private BaseStringCfg stringCfg;
|
||||
//数值类配置
|
||||
private NumBoundaryCfg numCfg;
|
||||
//增强字符串配置
|
||||
private ComplexkeywordCfg complexCfg;
|
||||
//地域配置
|
||||
private AreaIpCfg areaIpCfg;
|
||||
/**
|
||||
* mainTable
|
||||
* @return mainTable
|
||||
*/
|
||||
|
||||
public String getMainTable() {
|
||||
return mainTable;
|
||||
}
|
||||
/**
|
||||
* @param mainTable the mainTable to set
|
||||
*/
|
||||
public void setMainTable(String mainTable) {
|
||||
this.mainTable = mainTable;
|
||||
}
|
||||
/**
|
||||
* ipCfg
|
||||
* @return ipCfg
|
||||
*/
|
||||
|
||||
public BaseIpCfg getIpCfg() {
|
||||
return ipCfg;
|
||||
}
|
||||
/**
|
||||
* @param ipCfg the ipCfg to set
|
||||
*/
|
||||
public void setIpCfg(BaseIpCfg ipCfg) {
|
||||
this.ipCfg = ipCfg;
|
||||
}
|
||||
/**
|
||||
* stringCfg
|
||||
* @return stringCfg
|
||||
*/
|
||||
|
||||
public BaseStringCfg getStringCfg() {
|
||||
return stringCfg;
|
||||
}
|
||||
/**
|
||||
* @param stringCfg the stringCfg to set
|
||||
*/
|
||||
public void setStringCfg(BaseStringCfg stringCfg) {
|
||||
this.stringCfg = stringCfg;
|
||||
}
|
||||
/**
|
||||
* numCfg
|
||||
* @return numCfg
|
||||
*/
|
||||
|
||||
public NumBoundaryCfg getNumCfg() {
|
||||
return numCfg;
|
||||
}
|
||||
/**
|
||||
* @param numCfg the numCfg to set
|
||||
*/
|
||||
public void setNumCfg(NumBoundaryCfg numCfg) {
|
||||
this.numCfg = numCfg;
|
||||
}
|
||||
/**
|
||||
* complexCfg
|
||||
* @return complexCfg
|
||||
*/
|
||||
|
||||
public ComplexkeywordCfg getComplexCfg() {
|
||||
return complexCfg;
|
||||
}
|
||||
/**
|
||||
* @param complexCfg the complexCfg to set
|
||||
*/
|
||||
public void setComplexCfg(ComplexkeywordCfg complexCfg) {
|
||||
this.complexCfg = complexCfg;
|
||||
}
|
||||
/**
|
||||
* areaIpCfg
|
||||
* @return areaIpCfg
|
||||
*/
|
||||
|
||||
public AreaIpCfg getAreaIpCfg() {
|
||||
return areaIpCfg;
|
||||
}
|
||||
/**
|
||||
* @param areaIpCfg the areaIpCfg to set
|
||||
*/
|
||||
public void setAreaIpCfg(AreaIpCfg areaIpCfg) {
|
||||
this.areaIpCfg = areaIpCfg;
|
||||
}
|
||||
/**
|
||||
* mainTableType
|
||||
* @return mainTableType
|
||||
*/
|
||||
|
||||
public String getMainTableType() {
|
||||
return mainTableType;
|
||||
}
|
||||
/**
|
||||
* @param mainTableType the mainTableType to set
|
||||
*/
|
||||
public void setMainTableType(String mainTableType) {
|
||||
this.mainTableType = mainTableType;
|
||||
}
|
||||
/**
|
||||
* otherTables
|
||||
* @return otherTables
|
||||
*/
|
||||
|
||||
public List<TableBean> getOtherTables() {
|
||||
return otherTables;
|
||||
}
|
||||
/**
|
||||
* @param otherTables the otherTables to set
|
||||
*/
|
||||
public void setOtherTables(List<TableBean> otherTables) {
|
||||
this.otherTables = otherTables;
|
||||
}
|
||||
/**
|
||||
* ipTable
|
||||
* @return ipTable
|
||||
*/
|
||||
|
||||
public String getIpTable() {
|
||||
return ipTable;
|
||||
}
|
||||
/**
|
||||
* @param ipTable the ipTable to set
|
||||
*/
|
||||
public void setIpTable(String ipTable) {
|
||||
this.ipTable = ipTable;
|
||||
}
|
||||
/**
|
||||
* stringTable
|
||||
* @return stringTable
|
||||
*/
|
||||
|
||||
public String getStringTable() {
|
||||
return stringTable;
|
||||
}
|
||||
/**
|
||||
* @param stringTable the stringTable to set
|
||||
*/
|
||||
public void setStringTable(String stringTable) {
|
||||
this.stringTable = stringTable;
|
||||
}
|
||||
/**
|
||||
* complexTable
|
||||
* @return complexTable
|
||||
*/
|
||||
|
||||
public String getComplexTable() {
|
||||
return complexTable;
|
||||
}
|
||||
/**
|
||||
* @param complexTable the complexTable to set
|
||||
*/
|
||||
public void setComplexTable(String complexTable) {
|
||||
this.complexTable = complexTable;
|
||||
}
|
||||
/**
|
||||
* mainTableDesc
|
||||
* @return mainTableDesc
|
||||
*/
|
||||
|
||||
public String getMainTableDesc() {
|
||||
return mainTableDesc;
|
||||
}
|
||||
/**
|
||||
* @param mainTableDesc the mainTableDesc to set
|
||||
*/
|
||||
public void setMainTableDesc(String mainTableDesc) {
|
||||
this.mainTableDesc = mainTableDesc;
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ package com.nis.domain.configuration;
|
||||
* @date 2018年2月6日 上午8:46:52
|
||||
* @version V1.0
|
||||
*/
|
||||
public class PptpUrlCfg extends BaseStringCfg {
|
||||
public class PptpUrlCfg extends BaseStringCfg<PptpUrlCfg> {
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
|
||||
@@ -15,7 +15,7 @@ package com.nis.domain.configuration;
|
||||
* @date 2018年2月6日 上午10:27:18
|
||||
* @version V1.0
|
||||
*/
|
||||
public class RtmpUrlCfg extends BaseStringCfg{
|
||||
public class RtmpUrlCfg extends BaseStringCfg<RtmpUrlCfg>{
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
|
||||
@@ -15,7 +15,7 @@ package com.nis.domain.configuration;
|
||||
* @date 2018年2月6日 上午10:24:55
|
||||
* @version V1.0
|
||||
*/
|
||||
public class RtspUrlCfg extends BaseStringCfg {
|
||||
public class RtspUrlCfg extends BaseStringCfg<RtspUrlCfg> {
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
|
||||
@@ -15,7 +15,7 @@ package com.nis.domain.configuration;
|
||||
* @date 2018年2月6日 上午8:59:51
|
||||
* @version V1.0
|
||||
*/
|
||||
public class SslKeywordCfg extends BaseStringCfg{
|
||||
public class SslKeywordCfg extends BaseStringCfg<SslKeywordCfg>{
|
||||
public static final String tableName="ssl_keyword_cfg";
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
|
||||
@@ -15,11 +15,7 @@ import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.nis.domain.configuration.AppComplexKeywordCfg;
|
||||
import com.nis.domain.configuration.AppStringCfg;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.NumBoundaryCfg;
|
||||
import com.nis.domain.specific.SpecificServiceHostCfg;
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,10 +16,6 @@ import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
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;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DateUtils;
|
||||
|
||||
|
||||
@@ -29,9 +29,13 @@ public final class Constants {
|
||||
*/
|
||||
public static final String USERREGION_DOMIAN_STR=Configurations.getStringProperty("userregion_domian_str", "DOMIAN_STR");
|
||||
/**
|
||||
* IP复用业务类型
|
||||
* IP限速业务类型
|
||||
*/
|
||||
public static final int SERVICE_IP_RATELIMIT = Configurations.getIntProperty("service_ip_ratelimit", 0x421);
|
||||
/**
|
||||
* 域名限速业务类型
|
||||
*/
|
||||
public static final int SERVICE_DOMAIN_RATELIMIT = Configurations.getIntProperty("service_domain_ratelimit", 0x421);
|
||||
/**
|
||||
* IP复用业务类型
|
||||
*/
|
||||
|
||||
@@ -68,7 +68,7 @@ import com.nis.web.service.configuration.IpCfgService;
|
||||
import com.nis.web.service.configuration.MailCfgService;
|
||||
import com.nis.web.service.configuration.NumCfgService;
|
||||
import com.nis.web.service.configuration.RequestInfoService;
|
||||
import com.nis.web.service.configuration.StringCfgService;
|
||||
import com.nis.web.service.configuration.DomainService;
|
||||
import com.nis.web.service.configuration.WebsiteCfgService;
|
||||
import com.nis.web.service.configuration.XmppCfgService;
|
||||
import com.nis.web.service.specific.SpecificServiceCfgService;
|
||||
@@ -136,7 +136,7 @@ public class BaseController {
|
||||
@Autowired
|
||||
protected RequestInfoService requestInfoService;
|
||||
@Autowired
|
||||
protected StringCfgService stringCfgService;
|
||||
protected DomainService domainService;
|
||||
@Autowired
|
||||
protected NumCfgService numCfgService;
|
||||
@Autowired
|
||||
|
||||
@@ -15,12 +15,12 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.HttpUrlCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
@@ -46,8 +46,8 @@ public class CommonController extends BaseController {
|
||||
public void _domainList(String cfgName,Model model,HttpUrlCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
cfg.setTableName(HttpUrlCfg.getTablename());
|
||||
Page<BaseStringCfg> searchPage=new Page<BaseStringCfg>(request,response,"r");
|
||||
Page<BaseStringCfg> page = stringCfgService.findPage(searchPage, cfg);
|
||||
Page<HttpUrlCfg> searchPage=new Page<HttpUrlCfg>(request,response,"r");
|
||||
Page<HttpUrlCfg> page = domainService.findPage(searchPage, cfg);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,cfg);
|
||||
}
|
||||
@@ -68,10 +68,10 @@ public class CommonController extends BaseController {
|
||||
initFormCondition(model,entity);
|
||||
}
|
||||
}
|
||||
public void _domainForm(String cfgName,Model model,String ids,Integer functionId,BaseStringCfg entity) {
|
||||
public void _domainForm(String cfgName,Model model,String ids,Integer functionId,HttpUrlCfg entity) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
entity = stringCfgService.getStringCfgById(HttpUrlCfg.getTablename(),Long.parseLong(ids));
|
||||
entity = domainService.getStringCfgById(Long.parseLong(ids));
|
||||
}
|
||||
if(entity.getCfgId()!=null){
|
||||
model.addAttribute("_cfg", entity);
|
||||
@@ -118,11 +118,11 @@ public class CommonController extends BaseController {
|
||||
if(cfg.getCfgId()==null){//新增
|
||||
cfg.setCreatorId(cfg.getCurrentUser().getId());
|
||||
cfg.setCreateTime(date);
|
||||
stringCfgService.addStringCfg((BaseStringCfg)cfg);
|
||||
domainService.addStringCfg(cfg);
|
||||
}else{//修改
|
||||
cfg.setEditorId(cfg.getCurrentUser().getId());
|
||||
cfg.setEditTime(new Date());
|
||||
stringCfgService.updateStringCfg((BaseStringCfg)cfg);
|
||||
domainService.updateStringCfg(cfg);
|
||||
}
|
||||
addMessage(model,"save_success");
|
||||
}catch(Exception e){
|
||||
@@ -143,7 +143,7 @@ public class CommonController extends BaseController {
|
||||
public void _deleteDomain(String cfgName,String ids,String compileIds,Integer functionId,RedirectAttributes model) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
try{
|
||||
stringCfgService.deleteDomain(ids,compileIds,functionId.intValue());
|
||||
domainService.deleteDomain(ids,compileIds,functionId.intValue());
|
||||
addMessage(model,"delete_success");
|
||||
}catch(Exception e){
|
||||
logger.error("删除失败", e);
|
||||
@@ -180,15 +180,17 @@ public class CommonController extends BaseController {
|
||||
for(String id:ids.split(",")){
|
||||
Long.parseLong(id);
|
||||
}
|
||||
List<BaseStringCfg> beans=stringCfgService.getListByCfgId(HttpUrlCfg.getTablename(),ids);
|
||||
List<HttpUrlCfg> beans=domainService.getListByCfgId(ids);
|
||||
Date date=new Date();
|
||||
for(BaseStringCfg bean:beans){
|
||||
bean.setTableName(HttpUrlCfg.getTablename());
|
||||
bean.setAuditorId(bean.getCurrentUser().getId());
|
||||
bean.setAuditTime(date);
|
||||
bean.setIsAudit(cfg.getIsAudit());
|
||||
bean.setIsValid(cfg.getIsValid());
|
||||
stringCfgService.auditDomain(bean);
|
||||
for(HttpUrlCfg bean:beans){
|
||||
HttpUrlCfg domain=new HttpUrlCfg();
|
||||
BeanUtils.copyProperties(bean, domain);
|
||||
domain.setTableName(HttpUrlCfg.getTablename());
|
||||
domain.setAuditorId(bean.getCurrentUser().getId());
|
||||
domain.setAuditTime(date);
|
||||
domain.setIsAudit(cfg.getIsAudit());
|
||||
domain.setIsValid(cfg.getIsValid());
|
||||
domainService.auditDomain(domain);
|
||||
}
|
||||
addMessage(redirectAttributes,"audit_success");
|
||||
}catch(MaatConvertException e){
|
||||
|
||||
@@ -1,19 +1,12 @@
|
||||
package com.nis.web.controller.configuration.maintenance;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
@@ -22,27 +15,11 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.SysUser;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.domain.basics.SysDictInfo;
|
||||
import com.nis.domain.configuration.AreaBean;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.AvContIpCfg;
|
||||
import com.nis.domain.configuration.AvVoipAccountCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.DnsResStrategy;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.domain.configuration.AvVoipIpCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.util.Configurations;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DateUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.excel.ExportExcel;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.security.UserUtils;
|
||||
|
||||
/**
|
||||
* dns响应策略
|
||||
|
||||
@@ -20,7 +20,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.HttpUrlCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.web.controller.configuration.CommonController;
|
||||
@@ -61,7 +60,7 @@ public class RatelimitController extends CommonController {
|
||||
}
|
||||
@RequestMapping(value = {"/domain/form"})
|
||||
@RequiresPermissions(value={"domain:ratelimit:config"})
|
||||
public String domainForm(String cfgName,Model model,String ids,Integer functionId,BaseStringCfg entity) {
|
||||
public String domainForm(String cfgName,Model model,String ids,Integer functionId,HttpUrlCfg entity) {
|
||||
this._domainForm(cfgName, model, ids, functionId, entity);
|
||||
model.addAttribute("urlPrefix","/manipulation/ratelimit/domain");
|
||||
model.addAttribute("requiresPermissionPrefix","domain:ratelimit");
|
||||
|
||||
@@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
@@ -17,7 +18,6 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.HttpUrlCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
@@ -47,8 +47,8 @@ public class WhiteListController extends BaseController{
|
||||
@RequiresPermissions(value={"whitelist:config","whitelist:audit"},logical=Logical.OR)
|
||||
public String domainList(Model model,@ModelAttribute("cfg")HttpUrlCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
cfg.setTableName(HttpUrlCfg.getTablename());
|
||||
Page<BaseStringCfg> searchPage=new Page<BaseStringCfg>(request,response,"r");
|
||||
Page<BaseStringCfg> page = stringCfgService.findPage(searchPage, cfg);
|
||||
Page<HttpUrlCfg> searchPage=new Page<HttpUrlCfg>(request,response,"r");
|
||||
Page<HttpUrlCfg> page = domainService.findPage(searchPage, cfg);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,cfg);
|
||||
return "/cfg/whitelist/domainList";
|
||||
@@ -74,9 +74,9 @@ public class WhiteListController extends BaseController{
|
||||
}
|
||||
@RequestMapping(value = {"domainForm"})
|
||||
@RequiresPermissions(value={"whitelist:config"})
|
||||
public String domainForm(Model model,String ids,BaseStringCfg entity) {
|
||||
public String domainForm(Model model,String ids,HttpUrlCfg entity) {
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
entity = stringCfgService.getStringCfgById(HttpUrlCfg.getTablename(),Long.parseLong(ids));
|
||||
entity = domainService.getStringCfgById(Long.parseLong(ids));
|
||||
}
|
||||
initFormCondition(model,entity);
|
||||
if(entity.getCfgId()!=null){
|
||||
@@ -125,11 +125,11 @@ public class WhiteListController extends BaseController{
|
||||
if(cfg.getCfgId()==null){//新增
|
||||
cfg.setCreatorId(cfg.getCurrentUser().getId());
|
||||
cfg.setCreateTime(date);
|
||||
stringCfgService.addStringCfg((BaseStringCfg)cfg,null);
|
||||
domainService.addStringCfg(cfg);
|
||||
}else{//修改
|
||||
cfg.setEditorId(cfg.getCurrentUser().getId());
|
||||
cfg.setEditTime(new Date());
|
||||
stringCfgService.updateStringCfg((BaseStringCfg)cfg);
|
||||
domainService.updateStringCfg(cfg);
|
||||
}
|
||||
addMessage(model,"save_success");
|
||||
}catch(Exception e){
|
||||
@@ -155,7 +155,7 @@ public class WhiteListController extends BaseController{
|
||||
@RequiresPermissions("whitelist:config")
|
||||
public String deleteDomain(String ids,Integer functionId,RedirectAttributes model) {
|
||||
try{
|
||||
stringCfgService.deleteWhiteDomain(ids);
|
||||
domainService.deleteWhiteDomain(ids);
|
||||
addMessage(model,"delete_success");
|
||||
}catch(Exception e){
|
||||
logger.error("删除失败", e);
|
||||
@@ -194,15 +194,17 @@ public class WhiteListController extends BaseController{
|
||||
// @RequiresPermissions("whitelist:aduit")
|
||||
public String auditDomain(String ids,HttpUrlCfg cfg,RedirectAttributes redirectAttributes) {
|
||||
try{
|
||||
List<BaseStringCfg> beans=stringCfgService.getListByCfgId(HttpUrlCfg.getTablename(),ids);
|
||||
List<HttpUrlCfg> beans=domainService.getListByCfgId(ids);
|
||||
Date date=new Date();
|
||||
for(BaseStringCfg bean:beans){
|
||||
bean.setTableName(HttpUrlCfg.getTablename());
|
||||
bean.setAuditorId(bean.getCurrentUser().getId());
|
||||
bean.setAuditTime(date);
|
||||
bean.setIsAudit(cfg.getIsAudit());
|
||||
bean.setIsValid(cfg.getIsValid());
|
||||
stringCfgService.auditWhiteDomain(bean);
|
||||
for(HttpUrlCfg bean:beans){
|
||||
HttpUrlCfg domain=new HttpUrlCfg();
|
||||
BeanUtils.copyProperties(bean, domain);
|
||||
domain.setTableName(HttpUrlCfg.getTablename());
|
||||
domain.setAuditorId(bean.getCurrentUser().getId());
|
||||
domain.setAuditTime(date);
|
||||
domain.setIsAudit(cfg.getIsAudit());
|
||||
domain.setIsValid(cfg.getIsValid());
|
||||
domainService.auditWhiteDomain(domain);
|
||||
}
|
||||
addMessage(redirectAttributes,"audit_success");
|
||||
}catch(MaatConvertException e){
|
||||
|
||||
@@ -20,7 +20,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.HttpUrlCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.web.controller.configuration.CommonController;
|
||||
@@ -61,7 +60,7 @@ public class ControlController extends CommonController {
|
||||
}
|
||||
@RequestMapping(value = {"/domain/form"})
|
||||
@RequiresPermissions(value={"control:domain:config"})
|
||||
public String domainForm(String cfgName,Model model,String ids,Integer functionId,BaseStringCfg entity) {
|
||||
public String domainForm(String cfgName,Model model,String ids,Integer functionId,HttpUrlCfg entity) {
|
||||
this._domainForm(cfgName, model, ids, functionId, entity);
|
||||
model.addAttribute("urlPrefix","/proxy/control/domain");
|
||||
model.addAttribute("requiresPermissionPrefix","control:domain");
|
||||
|
||||
@@ -12,7 +12,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.HttpUrlCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.web.controller.configuration.CommonController;
|
||||
@@ -51,7 +50,7 @@ public class InterceptController extends CommonController{
|
||||
}
|
||||
@RequestMapping(value = {"/domain/form"})
|
||||
@RequiresPermissions(value={"intercept:domain:config"})
|
||||
public String domainForm(String cfgName,Model model,String ids,Integer functionId,BaseStringCfg entity) {
|
||||
public String domainForm(String cfgName,Model model,String ids,Integer functionId,HttpUrlCfg entity) {
|
||||
this._domainForm(cfgName, model, ids, functionId, entity);
|
||||
model.addAttribute("urlPrefix","/proxy/intercept/domain");
|
||||
model.addAttribute("requiresPermissionPrefix","intercept:domain");
|
||||
|
||||
43
src/main/java/com/nis/web/dao/configuration/DomainDao.java
Normal file
43
src/main/java/com/nis/web/dao/configuration/DomainDao.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package com.nis.web.dao.configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.configuration.HttpUrlCfg;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
/**
|
||||
* 字符串相关配置数据处理类
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@MyBatisDao
|
||||
public interface DomainDao extends CrudDao<HttpUrlCfg>{
|
||||
public HttpUrlCfg getById(@Param("cfgId")Long id) ;
|
||||
public HttpUrlCfg get(HttpUrlCfg entity) ;
|
||||
public List<HttpUrlCfg> findList(HttpUrlCfg entity) ;
|
||||
public int insert(HttpUrlCfg entity) ;
|
||||
public int update(HttpUrlCfg entity) ;
|
||||
public int updateValid(HttpUrlCfg entity) ;
|
||||
public int audit(HttpUrlCfg entity) ;
|
||||
public int getIsValid(@Param("cfgId")Long id);
|
||||
public int getIsValid(HttpUrlCfg entity);
|
||||
public int getIsAudit(@Param("cfgId")Long id);
|
||||
public int getIsAudit(HttpUrlCfg entity);
|
||||
public int deleteByCompileId(HttpUrlCfg entity);
|
||||
public List<HttpUrlCfg> getListByCfgId(@Param("ids")String ids);
|
||||
public List<HttpUrlCfg> getListByCompileId(@Param("ids")String ids);
|
||||
/**
|
||||
* deleteByCompileIds(这里用一句话描述这个方法的作用)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @param id
|
||||
* @param tablename
|
||||
* @param compileIds
|
||||
*void
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public void deleteByCompileIds(@Param("user")long user,@Param("compileIds")String compileIds);
|
||||
}
|
||||
470
src/main/java/com/nis/web/dao/configuration/DomainDao.xml
Normal file
470
src/main/java/com/nis/web/dao/configuration/DomainDao.xml
Normal file
@@ -0,0 +1,470 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.nis.web.dao.configuration.DomainDao" >
|
||||
<resultMap id="BaseStringMap" type="com.nis.domain.configuration.HttpUrlCfg" >
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="cfg_keywords" property="cfgKeywords" jdbcType="VARCHAR" />
|
||||
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||
<result column="action" property="action" jdbcType="INTEGER" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
|
||||
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
||||
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
||||
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
|
||||
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
|
||||
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
|
||||
<result column="request_id" property="requestId" jdbcType="INTEGER" />
|
||||
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
|
||||
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
|
||||
<result column="classify" property="classify" jdbcType="VARCHAR" />
|
||||
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
|
||||
<result column="lable" property="lable" jdbcType="VARCHAR" />
|
||||
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
|
||||
<result column="expr_type" property="exprType" jdbcType="INTEGER" />
|
||||
<result column="match_method" property="matchMethod" jdbcType="INTEGER" />
|
||||
<result column="is_hexbin" property="isHexbin" jdbcType="INTEGER" />
|
||||
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="VARCHAR" />
|
||||
<result column="ratelimit" property="ratelimit" jdbcType="INTEGER" />
|
||||
</resultMap>
|
||||
<resultMap id="BaseStringMapWithUser" type="com.nis.domain.configuration.HttpUrlCfg" extends="BaseStringMap">
|
||||
<result column="creator_name" property="creatorName" jdbcType="VARCHAR" />
|
||||
<result column="auditor_name" property="auditorName" jdbcType="VARCHAR" />
|
||||
<result column="editor_name" property="editorName" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="HttpUrlCfg_Column_List_with_id" >
|
||||
CFG_ID, CFG_DESC, CFG_KEYWORDS,CFG_TYPE,ACTION,IS_VALID,IS_AUDIT,
|
||||
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
|
||||
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
|
||||
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,FUNCTION_ID,CFG_REGION_CODE,RATELIMIT
|
||||
</sql>
|
||||
<sql id="HttpUrlCfg_Column_List_with_id_alias" >
|
||||
<choose>
|
||||
<when test="page !=null and page.alias != null and page.alias != ''">
|
||||
${page.alias}.CFG_ID as cfgId, ${page.alias}.CFG_DESC as cfgDesc, ${page.alias}.CFG_KEYWORDS as cfgKeywords,${page.alias}.CFG_TYPE as cfgType,${page.alias}.ACTION as action,${page.alias}.IS_VALID as isValid,${page.alias}.IS_AUDIT as isAudit,
|
||||
${page.alias}.CREATOR_ID as creatorId,${page.alias}.CREATE_TIME AS createTime,${page.alias}.EDITOR_ID as editorId,${page.alias}.EDIT_TIME AS editTime,${page.alias}.AUDITOR_ID as auditorId,${page.alias}.AUDIT_TIME AS auditTime,
|
||||
${page.alias}.SERVICE_ID as serviceId,${page.alias}.REQUEST_ID AS requestId,${page.alias}.COMPILE_ID AS compileId,${page.alias}.IS_AREA_EFFECTIVE as isAreaEffective,${page.alias}.classify,
|
||||
${page.alias}.ATTRIBUTE AS attribute,${page.alias}.LABLE AS lable,${page.alias}.EXPR_TYPE as exprType,${page.alias}.MATCH_METHOD as matchMethod,${page.alias}.IS_HEXBIN as isHexbin,${page.alias}.AREA_EFFECTIVE_IDS AS areaEffectiveIds,${page.alias}.FUNCTION_ID AS functionId,${page.alias}.CFG_REGION_CODE as cfgRegionCode
|
||||
,${page.alias}.RATELIMIT as ratelimit
|
||||
</when>
|
||||
<otherwise>
|
||||
r.CFG_ID as cfgId, r.CFG_DESC as cfgDesc, r.CFG_KEYWORDS as cfgKeywords,r.CFG_TYPE as cfgType, r.ACTION as action,r.IS_VALID as isValid,r.IS_AUDIT as isAudit,
|
||||
r.CREATOR_ID as creatorId,r.CREATE_TIME AS createTime,r.EDITOR_ID as editorId,r.EDIT_TIME AS editTime,r.AUDITOR_ID as auditorId,r.AUDIT_TIME AS auditTime,
|
||||
r.SERVICE_ID as serviceId,r.REQUEST_ID AS requestId,r.COMPILE_ID AS compileId,r.IS_AREA_EFFECTIVE as isAreaEffective,r.classify,
|
||||
r.ATTRIBUTE AS attribute,r.LABLE AS lable,r.EXPR_TYPE as exprType,r.MATCH_METHOD as matchMethod,r.IS_HEXBIN as isHexbin,
|
||||
r.AREA_EFFECTIVE_IDS AS areaEffectiveIds,r.FUNCTION_ID AS functionId,r.CFG_REGION_CODE as cfgRegionCode
|
||||
,r.RATELIMIT as ratelimit
|
||||
</otherwise>
|
||||
</choose>
|
||||
</sql>
|
||||
<sql id="HttpUrlCfg_Column_List" >
|
||||
CFG_DESC, CFG_KEYWORDS,CFG_TYPE, ACTION,IS_VALID,IS_AUDIT,
|
||||
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
|
||||
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
|
||||
ATTRIBUTE,LABLE,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,AREA_EFFECTIVE_IDS,FUNCTION_ID,CFG_REGION_CODE,
|
||||
RATELIMIT
|
||||
</sql>
|
||||
<sql id="HttpUrlCfg_Value_List" >
|
||||
#{cfgDesc,jdbcType=VARCHAR},#{cfgKeywords,jdbcType=VARCHAR},#{cfgType,jdbcType=VARCHAR},#{action,jdbcType=INTEGER},
|
||||
#{isValid,jdbcType=INTEGER},#{isAudit,jdbcType=INTEGER},#{creatorId,jdbcType=INTEGER},
|
||||
#{createTime,jdbcType=TIMESTAMP},#{editorId,jdbcType=INTEGER},#{editTime,jdbcType=TIMESTAMP},
|
||||
#{auditorId,jdbcType=INTEGER},#{auditTime,jdbcType=TIMESTAMP},#{serviceId,jdbcType=INTEGER},
|
||||
#{requestId,jdbcType=INTEGER},#{compileId,jdbcType=INTEGER},#{isAreaEffective,jdbcType=INTEGER},
|
||||
#{classify,jdbcType=VARCHAR},#{attribute,jdbcType=VARCHAR},#{lable,jdbcType=VARCHAR},
|
||||
#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER},
|
||||
#{areaEffectiveIds,jdbcType=VARCHAR},#{functionId,jdbcType=INTEGER},#{cfgRegionCode,jdbcType=INTEGER}
|
||||
,#{ratelimit,jdbcType=INTEGER}
|
||||
</sql>
|
||||
<select id="getById" resultMap="BaseStringMap" parameterType="java.lang.Long" >
|
||||
SELECT
|
||||
<include refid="HttpUrlCfg_Column_List_with_id" />
|
||||
FROM HTTP_URL_CFG
|
||||
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
|
||||
</select>
|
||||
<select id="get" resultMap="BaseStringMap" >
|
||||
SELECT
|
||||
<include refid="HttpUrlCfg_Column_List_with_id" />
|
||||
FROM HTTP_URL_CFG
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="cfgId != null">
|
||||
AND CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="compileId != null">
|
||||
AND COMPILE_ID=#{compileId,jdbcType=INTEGER}
|
||||
</if>
|
||||
AND IS_VALID!=-1
|
||||
</trim>
|
||||
</select>
|
||||
<select id="getListByCompileId" resultMap="BaseStringMap">
|
||||
SELECT
|
||||
<include refid="HttpUrlCfg_Column_List_with_id" />
|
||||
FROM HTTP_URL_CFG WHERE IS_VALID!=-1 AND COMPILE_ID in (${ids})
|
||||
</select>
|
||||
<select id="getListByCfgId" resultMap="BaseStringMap">
|
||||
SELECT
|
||||
<include refid="HttpUrlCfg_Column_List_with_id" />
|
||||
FROM HTTP_URL_CFG WHERE IS_VALID!=-1 AND CFG_ID in (${ids})
|
||||
</select>
|
||||
|
||||
<select id="findList" resultMap="BaseStringMapWithUser">
|
||||
select
|
||||
<include refid="HttpUrlCfg_Column_List_with_id_alias"/>
|
||||
<trim prefix="," prefixOverrides=",">
|
||||
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
|
||||
,ri.request_title as requestName
|
||||
</trim>
|
||||
from HTTP_URL_CFG r
|
||||
left join sys_user s on r.creator_id=s.id
|
||||
left join sys_user e on r.editor_id=e.id
|
||||
left join sys_user u on r.auditor_id=u.id
|
||||
left join request_info ri on r.request_id=ri.id
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="page !=null and page.where != null and page.where != ''">
|
||||
AND ${page.where}
|
||||
</if>
|
||||
<choose>
|
||||
<when test="page !=null and page.alias != null and page.alias != ''">
|
||||
<if test="cfgId != null">
|
||||
AND ${page.alias}.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND ${page.alias}.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="cfgKeywords != null and cfgKeywords != ''">
|
||||
AND ${page.alias}.CFG_KEYWORDS like concat(concat('%',#{cfgKeywords,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType != ''">
|
||||
AND ${page.alias}.CFG_TYPE=#{cfgType,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="action != null">
|
||||
AND ${page.alias}.ACTION=#{action,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
AND ${page.alias}.IS_VALID=#{isValid,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid == null">
|
||||
AND ${page.alias}.IS_VALID != -1
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
AND ${page.alias}.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="creatorName != null and creatorName != ''">
|
||||
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="createTime != null and createTime != ''">
|
||||
AND ${page.alias}.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="editorName != null and editorName != ''">
|
||||
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="editTime != null and editTime != ''">
|
||||
AND ${page.alias}.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="auditorName != null and auditorName != ''">
|
||||
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="auditTime != null and auditTime != ''">
|
||||
AND ${page.alias}.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="serviceId != null">
|
||||
AND ${page.alias}.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
AND ${page.alias}.REQUEST_ID=#{requestId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="compileId != null">
|
||||
AND ${page.alias}.COMPILE_ID=#{compileId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isAreaEffective != null">
|
||||
AND ${page.alias}.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="classify != null and classify != ''">
|
||||
AND ${page.alias}.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="attribute != null and attribute != ''">
|
||||
AND ${page.alias}.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="lable != null and lable != ''">
|
||||
AND ${page.alias}.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="exprType != null">
|
||||
AND ${page.alias}.EXPR_TYPE=#{exprType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="matchMethod != null">
|
||||
AND ${page.alias}.MATCH_METHOD=#{matchMethod,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isHexbin != null">
|
||||
AND ${page.alias}.IS_HEXBIN=#{isHexbin,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="areaEffectiveIds != null and areaEffectiveIds != ''">
|
||||
AND ${page.alias}.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
AND ${page.alias}.FUNCTION_ID =#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="cfgRegionCode != null">
|
||||
AND ${page.alias}.CFG_REGION_CODE =#{cfgRegionCode,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="ratelimit != null">
|
||||
AND ${page.alias}.RATELIMIT =#{ratelimit,jdbcType=INTEGER}
|
||||
</if>
|
||||
</when>
|
||||
<otherwise>
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="cfgKeywords != null and cfgKeywords != ''">
|
||||
AND r.CFG_KEYWORDS like concat(concat('%',#{cfgKeywords,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType != ''">
|
||||
AND r.CFG_TYPE =#{cfgType,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="action != null">
|
||||
AND r.ACTION=#{action,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid == null">
|
||||
AND r.IS_VALID != -1
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="creatorName != null and creatorName != ''">
|
||||
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="createTime != null and createTime != ''">
|
||||
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="editorName != null and editorName != ''">
|
||||
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="editTime != null and editTime != ''">
|
||||
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="auditorName != null and auditorName != ''">
|
||||
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="auditTime != null and auditTime != ''">
|
||||
AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="serviceId != null">
|
||||
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="compileId != null">
|
||||
AND r.COMPILE_ID=#{compileId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isAreaEffective != null">
|
||||
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="classify != null and classify != ''">
|
||||
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="attribute != null and attribute != ''">
|
||||
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="lable != null and lable != ''">
|
||||
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="exprType != null">
|
||||
AND r.EXPR_TYPE=#{exprType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="matchMethod != null">
|
||||
AND r.MATCH_METHOD=#{matchMethod,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isHexbin != null">
|
||||
AND r.IS_HEXBIN=#{isHexbin,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="areaEffectiveIds != null and areaEffectiveIds != ''">
|
||||
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
AND r.FUNCTION_ID =#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="cfgRegionCode != null">
|
||||
AND r.CFG_REGION_CODE =#{cfgRegionCode,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="ratelimit != null">
|
||||
AND r.RATELIMIT =#{ratelimit,jdbcType=INTEGER}
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
</trim>
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY CFG_ID desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
<select id="findAllList" resultMap="BaseStringMap">
|
||||
select
|
||||
<choose>
|
||||
<when test="page !=null and page.fields != null and page.fields != ''">
|
||||
${page.fields}
|
||||
</when>
|
||||
<otherwise>
|
||||
<include refid="HttpUrlCfg_Column_List_with_id"/>
|
||||
</otherwise>
|
||||
</choose>
|
||||
from HTTP_URL_CFG
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="page !=null and page.where != null and page.where != ''">
|
||||
AND ${page.where}
|
||||
</if>
|
||||
</trim>
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY CFG_ID desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
<insert id="insert" parameterType="com.nis.domain.configuration.HttpUrlCfg" >
|
||||
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into HTTP_URL_CFG (
|
||||
<include refid="HttpUrlCfg_Column_List" />
|
||||
)values (
|
||||
<include refid="HttpUrlCfg_Value_List" />
|
||||
)
|
||||
</insert>
|
||||
<update id="update" parameterType="com.nis.domain.configuration.HttpUrlCfg" >
|
||||
update HTTP_URL_CFG
|
||||
<set >
|
||||
<trim suffixOverrides=",">
|
||||
<if test="cfgDesc != null and cfgDesc != ''" >
|
||||
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="cfgKeywords != null and cfgKeywords != ''">
|
||||
cfg_keywords = #{cfgKeywords,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType != ''">
|
||||
CFG_TYPE=#{cfgType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="action != null" >
|
||||
action = #{action,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isValid != null" >
|
||||
is_valid = #{isValid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAudit != null" >
|
||||
is_audit = #{isAudit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="creatorId != null" >
|
||||
creator_id = #{creatorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="editorId != null" >
|
||||
editor_id = #{editorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="editTime != null and editTime != ''" >
|
||||
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="auditorId != null" >
|
||||
auditor_id = #{auditorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="auditTime != null and auditTime != ''" >
|
||||
audit_time = #{auditTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="serviceId != null" >
|
||||
service_id = #{serviceId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="requestId != null" >
|
||||
request_id = #{requestId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="compileId != null" >
|
||||
compile_id = #{compileId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAreaEffective != null" >
|
||||
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="classify != null and classify != ''" >
|
||||
classify = #{classify,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="attribute != null and attribute != ''" >
|
||||
attribute = #{attribute,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="lable != null and lable != ''" >
|
||||
lable = #{lable,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="exprType != null">
|
||||
expr_type=#{exprType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="matchMethod != null">
|
||||
match_method=#{matchMethod,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isHexbin != null">
|
||||
is_hexbin=#{isHexbin,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="areaEffectiveIds != null" >
|
||||
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="functionId != null" >
|
||||
function_id = #{functionId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="cfgRegionCode != null" >
|
||||
cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="ratelimit != null" >
|
||||
ratelimit = #{ratelimit,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
where cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
||||
<update id="updateValid" parameterType="com.nis.domain.configuration.HttpUrlCfg" >
|
||||
update HTTP_URL_CFG set is_valid = #{isValid,jdbcType=INTEGER}, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="audit" parameterType="com.nis.domain.configuration.HttpUrlCfg" >
|
||||
update HTTP_URL_CFG set is_audit = #{isAudit,jdbcType=INTEGER}, auditor_id = #{auditorId,jdbcType=INTEGER}, audit_time = #{auditTime,jdbcType=TIMESTAMP}
|
||||
<if test="isValid != null" >
|
||||
,is_valid = #{isValid,jdbcType=INTEGER}
|
||||
</if>
|
||||
where cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
</update>
|
||||
<select id="getIsValid" resultType="java.lang.Integer" parameterType="java.lang.Long" >
|
||||
SELECT IS_VALID FROM HTTP_URL_CFG
|
||||
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
|
||||
</select>
|
||||
<select id="getIsAudit" resultType="java.lang.Integer" parameterType="java.lang.Long" >
|
||||
SELECT IS_AUDIT FROM HTTP_URL_CFG
|
||||
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
|
||||
</select>
|
||||
<update id="deleteByCompileId" parameterType="com.nis.domain.configuration.HttpUrlCfg" >
|
||||
update HTTP_URL_CFG set is_valid = -1, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where compile_id = #{compileId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="delete" >
|
||||
update HTTP_URL_CFG set is_valid = -1, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP}
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="cfgId !=null ">
|
||||
AND cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="compileId !=null ">
|
||||
AND compile_id = #{compileId,jdbcType=INTEGER}
|
||||
</if>
|
||||
</trim>
|
||||
</update>
|
||||
<update id="deleteByCompileIds" parameterType="com.nis.domain.configuration.HttpUrlCfg" >
|
||||
update HTTP_URL_CFG set is_valid = -1, editor_id = #{user,jdbcType=INTEGER} , edit_time = NOW() where compile_id in (${compileIds})
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.nis.web.dao.configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.configuration.MultipleSearchCfg;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
/**
|
||||
* 多域配置数据处理类
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@MyBatisDao
|
||||
public interface MultipleCfgDao extends CrudDao<MultipleSearchCfg>{
|
||||
public MultipleSearchCfg getById(@Param("tableName")String tableName,@Param("cfgId")Long id) ;
|
||||
public MultipleSearchCfg get(MultipleSearchCfg entity) ;
|
||||
public List<MultipleSearchCfg> findList(MultipleSearchCfg entity) ;
|
||||
public int insert(MultipleSearchCfg entity) ;
|
||||
public int updateByPrimaryKeySelective(MultipleSearchCfg entity) ;
|
||||
public int updateValid(MultipleSearchCfg entity) ;
|
||||
public int audit(MultipleSearchCfg entity) ;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.nis.web.dao.configuration.MultipleCfgDao" >
|
||||
</mapper>
|
||||
@@ -9,7 +9,7 @@ import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
/**
|
||||
* IP相关配置数据处理类
|
||||
* 字符串相关配置数据处理类
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
<result column="is_hexbin" property="isHexbin" jdbcType="INTEGER" />
|
||||
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="VARCHAR" />
|
||||
<result column="ratelimit" property="ratelimit" jdbcType="INTEGER" />
|
||||
</resultMap>
|
||||
<resultMap id="BaseStringMapWithUser" type="com.nis.domain.configuration.BaseStringCfg" extends="BaseStringMap">
|
||||
<result column="creator_name" property="creatorName" jdbcType="VARCHAR" />
|
||||
@@ -39,7 +40,7 @@
|
||||
CFG_ID, CFG_DESC, CFG_KEYWORDS,CFG_TYPE,ACTION,IS_VALID,IS_AUDIT,
|
||||
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
|
||||
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
|
||||
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,FUNCTION_ID,CFG_REGION_CODE
|
||||
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,FUNCTION_ID,CFG_REGION_CODE,RATELIMIT
|
||||
</sql>
|
||||
<!-- <sql id="BaseStringCfg_Column_List_with_id_alias" >
|
||||
r.CFG_ID as cfgId, r.CFG_DESC as cfgDesc, r.CFG_KEYWORDS as cfgKeywords, r.ACTION as action,r.IS_VALID as isValid,r.IS_AUDIT as isAudit,
|
||||
@@ -55,6 +56,7 @@
|
||||
${page.alias}.CREATOR_ID as creatorId,${page.alias}.CREATE_TIME AS createTime,${page.alias}.EDITOR_ID as editorId,${page.alias}.EDIT_TIME AS editTime,${page.alias}.AUDITOR_ID as auditorId,${page.alias}.AUDIT_TIME AS auditTime,
|
||||
${page.alias}.SERVICE_ID as serviceId,${page.alias}.REQUEST_ID AS requestId,${page.alias}.COMPILE_ID AS compileId,${page.alias}.IS_AREA_EFFECTIVE as isAreaEffective,${page.alias}.classify,
|
||||
${page.alias}.ATTRIBUTE AS attribute,${page.alias}.LABLE AS lable,${page.alias}.EXPR_TYPE as exprType,${page.alias}.MATCH_METHOD as matchMethod,${page.alias}.IS_HEXBIN as isHexbin,${page.alias}.AREA_EFFECTIVE_IDS AS areaEffectiveIds,${page.alias}.FUNCTION_ID AS functionId,${page.alias}.CFG_REGION_CODE as cfgRegionCode
|
||||
,${page.alias}.RATELIMIT as ratelimit
|
||||
</when>
|
||||
<otherwise>
|
||||
r.CFG_ID as cfgId, r.CFG_DESC as cfgDesc, r.CFG_KEYWORDS as cfgKeywords,r.CFG_TYPE as cfgType, r.ACTION as action,r.IS_VALID as isValid,r.IS_AUDIT as isAudit,
|
||||
@@ -62,6 +64,7 @@
|
||||
r.SERVICE_ID as serviceId,r.REQUEST_ID AS requestId,r.COMPILE_ID AS compileId,r.IS_AREA_EFFECTIVE as isAreaEffective,r.classify,
|
||||
r.ATTRIBUTE AS attribute,r.LABLE AS lable,r.EXPR_TYPE as exprType,r.MATCH_METHOD as matchMethod,r.IS_HEXBIN as isHexbin,
|
||||
r.AREA_EFFECTIVE_IDS AS areaEffectiveIds,r.FUNCTION_ID AS functionId,r.CFG_REGION_CODE as cfgRegionCode
|
||||
,r.RATELIMIT as ratelimit
|
||||
</otherwise>
|
||||
</choose>
|
||||
</sql>
|
||||
@@ -69,7 +72,8 @@
|
||||
CFG_DESC, CFG_KEYWORDS,CFG_TYPE, ACTION,IS_VALID,IS_AUDIT,
|
||||
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
|
||||
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
|
||||
ATTRIBUTE,LABLE,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,AREA_EFFECTIVE_IDS,FUNCTION_ID,CFG_REGION_CODE
|
||||
ATTRIBUTE,LABLE,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,AREA_EFFECTIVE_IDS,FUNCTION_ID,CFG_REGION_CODE,
|
||||
RATELIMIT
|
||||
</sql>
|
||||
<sql id="BaseStringCfg_Value_List" >
|
||||
#{cfgDesc,jdbcType=VARCHAR},#{cfgKeywords,jdbcType=VARCHAR},#{cfgType,jdbcType=VARCHAR},#{action,jdbcType=INTEGER},
|
||||
@@ -80,6 +84,7 @@
|
||||
#{classify,jdbcType=VARCHAR},#{attribute,jdbcType=VARCHAR},#{lable,jdbcType=VARCHAR},
|
||||
#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER},
|
||||
#{areaEffectiveIds,jdbcType=VARCHAR},#{functionId,jdbcType=INTEGER},#{cfgRegionCode,jdbcType=INTEGER}
|
||||
,#{ratelimit,jdbcType=INTEGER}
|
||||
</sql>
|
||||
<select id="getById" resultMap="BaseStringMap" parameterType="java.lang.Long" >
|
||||
SELECT
|
||||
@@ -211,6 +216,9 @@
|
||||
<if test="cfgRegionCode != null">
|
||||
AND ${page.alias}.CFG_REGION_CODE =#{cfgRegionCode,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="ratelimit != null">
|
||||
AND ${page.alias}.RATELIMIT =#{ratelimit,jdbcType=INTEGER}
|
||||
</if>
|
||||
</when>
|
||||
<otherwise>
|
||||
<if test="cfgId != null">
|
||||
@@ -294,6 +302,9 @@
|
||||
<if test="cfgRegionCode != null">
|
||||
AND r.CFG_REGION_CODE =#{cfgRegionCode,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="ratelimit != null">
|
||||
AND r.RATELIMIT =#{ratelimit,jdbcType=INTEGER}
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
</trim>
|
||||
@@ -420,6 +431,9 @@
|
||||
<if test="cfgRegionCode != null" >
|
||||
cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="ratelimit != null" >
|
||||
ratelimit = #{ratelimit,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
where cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonPrimitive;
|
||||
import com.google.gson.JsonSerializationContext;
|
||||
import com.google.gson.JsonSerializer;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.googlecode.ipv6.IPv6Address;
|
||||
import com.googlecode.ipv6.IPv6Network;
|
||||
import com.nis.domain.SysRole;
|
||||
@@ -31,11 +30,7 @@ import com.nis.domain.configuration.AreaBean;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.DnsResStrategy;
|
||||
import com.nis.domain.configuration.HttpBodyCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.maat.MaatCfg.GroupCfg;
|
||||
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||
|
||||
@@ -13,7 +13,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.nis.domain.BaseEntity;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.configuration.AreaIpCfgDao;
|
||||
|
||||
@@ -1035,7 +1035,7 @@ public class AvContentCfgService extends BaseService{
|
||||
return avContentCfgDao.findStringCfgById(entity);
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveOrUpdateContUrl(BaseStringCfg entity,String areaCfgIds){
|
||||
public void saveOrUpdateContUrl(BaseStringCfg<BaseStringCfg> entity,String areaCfgIds){
|
||||
Date createTime=new Date();
|
||||
entity.setTableName("av_cont_url_cfg");
|
||||
//设置区域运营商信息
|
||||
@@ -1288,7 +1288,7 @@ public class AvContentCfgService extends BaseService{
|
||||
return avContentCfgDao.findStringCfgById(entity);
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveOrUpdatePicUrl(BaseStringCfg entity,String areaCfgIds){
|
||||
public void saveOrUpdatePicUrl(BaseStringCfg<BaseStringCfg> entity,String areaCfgIds){
|
||||
Date createTime=new Date();
|
||||
entity.setTableName("av_pic_url_cfg");
|
||||
//设置区域运营商信息
|
||||
|
||||
@@ -5,31 +5,21 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.DnsDomainCfg;
|
||||
import com.nis.domain.configuration.HttpBodyCfg;
|
||||
import com.nis.domain.configuration.HttpReqHeadCfg;
|
||||
import com.nis.domain.configuration.HttpResHeadCfg;
|
||||
import com.nis.domain.configuration.HttpUrlCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.SslKeywordCfg;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.domain.maat.MaatCfg.DigestCfg;
|
||||
import com.nis.domain.maat.MaatCfg.GroupCfg;
|
||||
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.nis.web.service.configuration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -13,27 +12,20 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.AreaBean;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.AvVoipAccountCfg;
|
||||
import com.nis.domain.configuration.AvVoipIpCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.HttpBodyCfg;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.domain.maat.MaatCfg.DigestCfg;
|
||||
import com.nis.domain.maat.MaatCfg.GroupCfg;
|
||||
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.dao.configuration.AreaIpCfgDao;
|
||||
import com.nis.web.dao.configuration.ControlPolicyDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
|
||||
@@ -3,39 +3,18 @@ package com.nis.web.service.configuration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.callback.InlineIp;
|
||||
import com.nis.domain.callback.NtcDnsResStrategy;
|
||||
import com.nis.domain.configuration.AreaBean;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.AvVoipAccountCfg;
|
||||
import com.nis.domain.configuration.AvVoipIpCfg;
|
||||
import com.nis.domain.configuration.DnsIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.DnsIpCfg;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.domain.maat.MaatCfg.DigestCfg;
|
||||
import com.nis.domain.maat.MaatCfg.GroupCfg;
|
||||
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.dao.configuration.DnsIpCfgDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
|
||||
@@ -13,7 +13,6 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.HttpUrlCfg;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.domain.maat.MaatCfg.DigestCfg;
|
||||
@@ -28,6 +27,7 @@ import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.configuration.AreaIpCfgDao;
|
||||
import com.nis.web.dao.configuration.DomainDao;
|
||||
import com.nis.web.dao.configuration.StringCfgDao;
|
||||
import com.nis.web.service.CrudService;
|
||||
|
||||
@@ -37,49 +37,16 @@ import com.nis.web.service.CrudService;
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
|
||||
@Autowired
|
||||
DomainDao domainDao;
|
||||
@Autowired
|
||||
protected StringCfgDao stringCfgDao;
|
||||
@Autowired
|
||||
protected AreaIpCfgDao areaIpCfgDao;
|
||||
/**
|
||||
*
|
||||
* addStringCfg(新增IP类配置)
|
||||
* (继承BaseStringCfg这个类方可使用)
|
||||
* @param baseStringCfg
|
||||
* @return
|
||||
*int
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int addStringCfg(BaseStringCfg baseStringCfg,List<BaseIpCfg> areaIpCfgs){
|
||||
if(areaIpCfgs!=null&&areaIpCfgs.size()>0){
|
||||
// this.saveIpBatch(areaIpCfgs);
|
||||
}
|
||||
//调用服务接口获取compileId
|
||||
Integer compileId = 0;
|
||||
try {
|
||||
List<Integer> compileIds = ConfigServiceUtil.getId(1,1);
|
||||
if(!StringUtil.isEmpty(compileIds)){
|
||||
compileId = compileIds.get(0);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
if(compileId!=0){
|
||||
baseStringCfg.setCompileId(compileId);
|
||||
return stringCfgDao.insert(baseStringCfg);
|
||||
}else{
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
// baseStringCfg.setCompileId(0);
|
||||
// return stringCfgDao.insert(baseStringCfg);
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void addStringCfg(BaseStringCfg cfg){
|
||||
public void addStringCfg(HttpUrlCfg cfg){
|
||||
//调用服务接口获取compileId
|
||||
Integer compileId = 0;
|
||||
try {
|
||||
@@ -105,14 +72,19 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
}
|
||||
this.saveIpBatch(cfg.getAreaCfg());
|
||||
}
|
||||
if(cfg instanceof HttpUrlCfg){
|
||||
domainDao.insert((HttpUrlCfg)cfg);
|
||||
}else{
|
||||
stringCfgDao.insert(cfg);
|
||||
}
|
||||
|
||||
}else{
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void updateStringCfg(BaseStringCfg cfg){
|
||||
public void updateStringCfg(HttpUrlCfg cfg){
|
||||
AreaIpCfg area=new AreaIpCfg();
|
||||
area.setCompileId(cfg.getCompileId());
|
||||
area.setFunctionId(cfg.getFunctionId());
|
||||
@@ -132,12 +104,17 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
}
|
||||
this.saveIpBatch(cfg.getAreaCfg());
|
||||
}
|
||||
if(cfg instanceof HttpUrlCfg){
|
||||
domainDao.insert((HttpUrlCfg)cfg);
|
||||
}else{
|
||||
stringCfgDao.update(cfg);
|
||||
}
|
||||
public void auditWhiteDomain(BaseStringCfg cfg) throws Exception{
|
||||
List<BaseStringCfg> beans=new ArrayList<>();
|
||||
|
||||
}
|
||||
public void auditWhiteDomain(HttpUrlCfg cfg) throws Exception{
|
||||
List<HttpUrlCfg> beans=new ArrayList<>();
|
||||
beans.add(cfg);
|
||||
this.auditBatch(beans, StringCfgDao.class);
|
||||
this.auditBatch(beans, DomainDao.class);
|
||||
List<MaatCfg> configCompileList = new ArrayList<>();
|
||||
List<GroupCfg> groupRelationList = new ArrayList<>();
|
||||
List<IpCfg> ipRegionList = new ArrayList<>();
|
||||
@@ -149,7 +126,7 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
MaatCfg maatCfg = new MaatCfg();
|
||||
maatCfg.initDefaultValue();
|
||||
BeanUtils.copyProperties(cfg, maatCfg);
|
||||
if(cfg.getIsAudit()==1){
|
||||
if(cfg.getIsAudit()==Constants.AUDIT_YES){
|
||||
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||
Map<String,List> map = cfgConvert(strRegionList,beans,2,cfg,groupRelationList);
|
||||
groupRelationList=map.get("groupList");
|
||||
@@ -181,10 +158,10 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
logger.info("域名白名单配置下发失败");
|
||||
throw e;
|
||||
}
|
||||
}else if(cfg.getIsAudit()==3){
|
||||
}else if(cfg.getIsAudit()==Constants.AUDIT_NOT_YES){
|
||||
maatCfg.setCompileId(cfg.getCompileId());
|
||||
maatCfg.setServiceId(cfg.getServiceId());
|
||||
maatCfg.setIsValid(0);//无效
|
||||
maatCfg.setIsValid(Constants.VALID_NO);//无效
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
maatBean.setAuditTime(cfg.getAuditTime());
|
||||
@@ -205,10 +182,10 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
}
|
||||
}
|
||||
}
|
||||
public void auditDomain(BaseStringCfg cfg) throws Exception{
|
||||
List<BaseStringCfg> beans=new ArrayList<>();
|
||||
public void auditDomain(HttpUrlCfg cfg) throws Exception{
|
||||
List<HttpUrlCfg> beans=new ArrayList<>();
|
||||
beans.add(cfg);
|
||||
this.auditBatch(beans, StringCfgDao.class);
|
||||
this.auditBatch(beans, DomainDao.class);
|
||||
List<BaseIpCfg> beans1=new ArrayList<>();
|
||||
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(cfg.getCompileId());
|
||||
for(AreaIpCfg area:areaIpCfgList){
|
||||
@@ -240,7 +217,7 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
MaatCfg maatCfg = new MaatCfg();
|
||||
maatCfg.initDefaultValue();
|
||||
BeanUtils.copyProperties(cfg, maatCfg);
|
||||
if(cfg.getIsAudit()==1){
|
||||
if(cfg.getIsAudit()==Constants.AUDIT_YES){
|
||||
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||
Map<String,List> map = cfgConvert(strRegionList,beans,2,cfg,groupRelationList);
|
||||
groupRelationList=map.get("groupList");
|
||||
@@ -251,7 +228,14 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
areaIpRegionList=areaMap.get("dstList");
|
||||
maatCfg.setAreaEffectiveIds(StringUtils.isBlank(cfg.getAreaEffectiveIds())?"0":cfg.getAreaEffectiveIds());
|
||||
if(cfg.getServiceId().intValue()==Constants.SERVICE_PXY_DOMAIN_INTERCEPT){
|
||||
maatCfg.setUserRegion(this.keywordsEscape(cfg.getCfgKeywords()));
|
||||
String region=Constants.USERREGION_DOMIAN_ID+"="+cfg.getCompileId().intValue()+
|
||||
Constants.USER_REGION_SPLIT+Constants.USERREGION_DOMIAN_STR+"="+this.keywordsEscape(cfg.getCfgKeywords());
|
||||
maatCfg.setUserRegion(region);
|
||||
}else if(Constants.SERVICE_DOMAIN_RATELIMIT==cfg.getServiceId().intValue()){
|
||||
String region=Constants.USERREGION_RATE_LIMIT+"="+cfg.getRatelimit()+
|
||||
Constants.USER_REGION_SPLIT+Constants.USERREGION_DOMIAN_ID+"="+cfg.getCompileId().intValue()+
|
||||
Constants.USER_REGION_SPLIT+Constants.USERREGION_DOMIAN_STR+"="+this.keywordsEscape(cfg.getCfgKeywords());
|
||||
maatCfg.setUserRegion(region);
|
||||
}
|
||||
maatCfg.setAction(cfg.getAction());
|
||||
maatCfg.setAuditTime(cfg.getAuditTime());
|
||||
@@ -281,10 +265,10 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
logger.info("域名配置下发失败");
|
||||
throw e;
|
||||
}
|
||||
}else if(cfg.getIsAudit()==3){
|
||||
}else if(cfg.getIsAudit()==Constants.AUDIT_NOT_YES){
|
||||
maatCfg.setCompileId(cfg.getCompileId());
|
||||
maatCfg.setServiceId(cfg.getServiceId());
|
||||
maatCfg.setIsValid(0);//无效
|
||||
maatCfg.setIsValid(Constants.VALID_NO);//无效
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
maatBean.setAuditTime(cfg.getAuditTime());
|
||||
@@ -308,12 +292,12 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void deleteWhiteDomain(String ids){
|
||||
List<BaseStringCfg> cfgs=new ArrayList<BaseStringCfg>();
|
||||
List<HttpUrlCfg> cfgs=new ArrayList<HttpUrlCfg>();
|
||||
Date date =new Date();
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
for(String idStr:ids.split(",")){
|
||||
if(StringUtils.isNotBlank(idStr)){
|
||||
BaseStringCfg cfg=new BaseStringCfg();
|
||||
HttpUrlCfg cfg=new HttpUrlCfg();
|
||||
cfg.setCfgId(Long.parseLong(idStr));
|
||||
cfg.setTableName(HttpUrlCfg.getTablename());
|
||||
cfg.setEditorId(cfg.getCurrentUser().getId());
|
||||
@@ -323,7 +307,7 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
}
|
||||
}
|
||||
}
|
||||
this.deleteBatch(cfgs, StringCfgDao.class);
|
||||
this.deleteBatch(cfgs, DomainDao.class);
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void deleteDomain(String ids,String compileIds,int functionId){
|
||||
@@ -331,14 +315,14 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
for(String compileId:compileIds.split(",")){//强转数字,防止注入
|
||||
Integer.parseInt(compileId);
|
||||
}
|
||||
stringCfgDao.deleteByCompileIds(new BaseStringCfg().getCurrentUser().getId(),AreaIpCfg.getTablename(),compileIds);
|
||||
stringCfgDao.deleteByCompileIds(new HttpUrlCfg().getCurrentUser().getId(),AreaIpCfg.getTablename(),compileIds);
|
||||
}
|
||||
List<BaseStringCfg> stringCfgs=new ArrayList<BaseStringCfg>();
|
||||
List<HttpUrlCfg> stringCfgs=new ArrayList<HttpUrlCfg>();
|
||||
Date date =new Date();
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
for(String idStr:ids.split(",")){
|
||||
if(StringUtils.isNotBlank(idStr)){
|
||||
BaseStringCfg cfg=new BaseStringCfg();
|
||||
HttpUrlCfg cfg=new HttpUrlCfg();
|
||||
cfg.setCfgId(Long.parseLong(idStr));
|
||||
cfg.setTableName(HttpUrlCfg.getTablename());
|
||||
cfg.setEditorId(cfg.getCurrentUser().getId());
|
||||
@@ -361,7 +345,7 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void deleteStringCfg(List<BaseStringCfg> stringCfg,List<BaseIpCfg> areaCfg){
|
||||
public void deleteStringCfg(List<HttpUrlCfg> stringCfg,List<BaseIpCfg> areaCfg){
|
||||
if(areaCfg!=null&&areaCfg.size()>0){
|
||||
this.deleteIpBatch(areaCfg);
|
||||
}
|
||||
@@ -378,23 +362,23 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public BaseStringCfg getStringCfgById(BaseStringCfg baseStringCfg){
|
||||
return stringCfgDao.getById(baseStringCfg.getTableName(), baseStringCfg.getCfgId());
|
||||
public HttpUrlCfg getStringCfgById(HttpUrlCfg baseStringCfg){
|
||||
return domainDao.getById(baseStringCfg.getCfgId());
|
||||
}
|
||||
public BaseStringCfg getStringCfgById(String tableName, long id){
|
||||
return stringCfgDao.getById(tableName, id);
|
||||
public HttpUrlCfg getStringCfgById(long id){
|
||||
return domainDao.getById(id);
|
||||
}
|
||||
public Integer getIsValid(BaseStringCfg baseStringCfg){
|
||||
return stringCfgDao.getIsValid(baseStringCfg);
|
||||
public Integer getIsValid(HttpUrlCfg baseStringCfg){
|
||||
return domainDao.getIsValid(baseStringCfg);
|
||||
}
|
||||
public Integer getIsValid(String tableName, long id){
|
||||
return stringCfgDao.getIsValid(tableName,id);
|
||||
public Integer getIsValid(long id){
|
||||
return domainDao.getIsValid(id);
|
||||
}
|
||||
public Integer getIsAudit(BaseStringCfg baseStringCfg){
|
||||
return stringCfgDao.getIsAudit(baseStringCfg);
|
||||
public Integer getIsAudit(HttpUrlCfg baseStringCfg){
|
||||
return domainDao.getIsAudit(baseStringCfg);
|
||||
}
|
||||
public Integer getIsAudit(String tableName, long id){
|
||||
return stringCfgDao.getIsAudit(tableName,id);
|
||||
public Integer getIsAudit(long id){
|
||||
return domainDao.getIsAudit(id);
|
||||
}
|
||||
/**
|
||||
* getList(这里用一句话描述这个方法的作用)
|
||||
@@ -406,9 +390,9 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public List<BaseStringCfg> getListByCompileId(String tableName, String ids) {
|
||||
public List<HttpUrlCfg> getListByCompileId(String ids) {
|
||||
// TODO Auto-generated method stub
|
||||
return stringCfgDao.getListByCompileId(tableName,ids);
|
||||
return domainDao.getListByCompileId(ids);
|
||||
}
|
||||
/**
|
||||
* getListByCfgId(这里用一句话描述这个方法的作用)
|
||||
@@ -420,8 +404,8 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public List<BaseStringCfg> getListByCfgId(String tableName, String ids) {
|
||||
public List<HttpUrlCfg> getListByCfgId(String ids) {
|
||||
// TODO Auto-generated method stub
|
||||
return stringCfgDao.getListByCfgId(tableName, ids);
|
||||
return domainDao.getListByCfgId(ids);
|
||||
}
|
||||
}
|
||||
@@ -1,349 +0,0 @@
|
||||
package com.nis.web.service.configuration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.MultipleCfg;
|
||||
import com.nis.domain.configuration.MultipleSearchCfg;
|
||||
import com.nis.domain.configuration.NumBoundaryCfg;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.configuration.ComplexStringCfgDao;
|
||||
import com.nis.web.dao.configuration.IpCfgDao;
|
||||
import com.nis.web.dao.configuration.MultipleCfgDao;
|
||||
import com.nis.web.dao.configuration.NumCfgDao;
|
||||
import com.nis.web.dao.configuration.StringCfgDao;
|
||||
import com.nis.web.service.CrudService;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
|
||||
/**
|
||||
* 多域相关配置事务类
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class MultipleCfgService extends CrudService<MultipleCfgDao,MultipleSearchCfg> {
|
||||
@Autowired
|
||||
protected MultipleCfgDao multipleCfgDao;
|
||||
@Autowired
|
||||
protected IpCfgDao ipCfgDao;
|
||||
@Autowired
|
||||
protected StringCfgDao stringCfgDao;
|
||||
@Autowired
|
||||
protected ComplexStringCfgDao complexStringCfgDao;
|
||||
@Autowired
|
||||
protected NumCfgDao numCfgDao;
|
||||
/**
|
||||
*
|
||||
* addStringCfg(新增IP类配置)
|
||||
* (继承ComplexkeywordCfg这个类方可使用)
|
||||
* @param cfg
|
||||
* @return
|
||||
*int
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void addCfg(MultipleCfg cfg){
|
||||
if(cfg!=null) {
|
||||
if(cfg.getIpCfg()!=null){
|
||||
for(BaseIpCfg _cfg:cfg.getIpCfg().values()){
|
||||
ipCfgDao.insert(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getStringCfg()!=null){
|
||||
for(BaseStringCfg _cfg:cfg.getStringCfg().values()){
|
||||
stringCfgDao.insert(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getNumCfg()!=null){
|
||||
for(NumBoundaryCfg _cfg:cfg.getNumCfg().values()){
|
||||
numCfgDao.insert(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getComplexCfg()!=null){
|
||||
for(ComplexkeywordCfg _cfg:cfg.getComplexCfg().values()){
|
||||
complexStringCfgDao.insert(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getAreaCfg()!=null&&cfg.getAreaCfg().size()>0){
|
||||
List<BaseIpCfg> areaCfg=new ArrayList<>();
|
||||
areaCfg.addAll(cfg.getAreaCfg());
|
||||
// this.saveIpBatch(areaCfg);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void updateCfg(MultipleCfg cfg,List<BaseCfg> deleteCfg,List<BaseIpCfg> addAreaCfg,List<BaseIpCfg> updateAreaCfg,List<BaseIpCfg> deleteAreaCfgs){
|
||||
if(cfg!=null){
|
||||
if(cfg.getIpCfg()!=null){
|
||||
for(BaseIpCfg _cfg:cfg.getIpCfg().values()){
|
||||
if(_cfg.getCfgId()==null){//修改配置时用户可能希望新增IP配置,此时新增的IP配置无配置ID
|
||||
ipCfgDao.insert(_cfg);
|
||||
}else{
|
||||
ipCfgDao.update(_cfg);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if(cfg.getStringCfg()!=null){
|
||||
for(BaseStringCfg _cfg:cfg.getStringCfg().values()){
|
||||
if(_cfg.getCfgId()==null){
|
||||
stringCfgDao.insert(_cfg);
|
||||
}else
|
||||
stringCfgDao.update(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getNumCfg()!=null){
|
||||
for(NumBoundaryCfg _cfg:cfg.getNumCfg().values()){
|
||||
if(_cfg.getCfgId()==null){
|
||||
numCfgDao.insert(_cfg);
|
||||
}else
|
||||
numCfgDao.updateByPrimaryKeySelective(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getComplexCfg()!=null){
|
||||
for(ComplexkeywordCfg _cfg:cfg.getComplexCfg().values()){
|
||||
if(_cfg.getCfgId()==null){
|
||||
complexStringCfgDao.insert(_cfg);
|
||||
}else
|
||||
complexStringCfgDao.update(_cfg);
|
||||
}
|
||||
}
|
||||
if(deleteCfg!=null&&deleteCfg.size()>0){
|
||||
for(BaseCfg _cfg:deleteCfg){
|
||||
if(_cfg instanceof BaseIpCfg){
|
||||
ipCfgDao.deleteByCompileId((BaseIpCfg)_cfg);
|
||||
}else if(_cfg instanceof BaseStringCfg){
|
||||
stringCfgDao.deleteByCompileId((BaseStringCfg)_cfg);
|
||||
}else if(_cfg instanceof NumBoundaryCfg){
|
||||
numCfgDao.deleteByCompileId((NumBoundaryCfg)_cfg);
|
||||
}else if(_cfg instanceof ComplexkeywordCfg){
|
||||
complexStringCfgDao.deleteByCompileId((ComplexkeywordCfg)_cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(addAreaCfg!=null&&addAreaCfg.size()>0){
|
||||
// this.saveIpBatch(addAreaCfg);
|
||||
}
|
||||
if(updateAreaCfg!=null&&updateAreaCfg.size()>0){
|
||||
this.updateIpBatch(updateAreaCfg);
|
||||
}
|
||||
if(deleteAreaCfgs!=null&&deleteAreaCfgs.size()>0){
|
||||
this.deleteIpBatch(deleteAreaCfgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void deleteCfg(List<BaseIpCfg> delIpCfgs,List<BaseStringCfg> delStringCfgs,List<NumBoundaryCfg> delNumCfgs,List<ComplexkeywordCfg> delComplexCfgs){
|
||||
if(delIpCfgs!=null&&delIpCfgs.size()>0){
|
||||
this.deleteIpBatch(delIpCfgs);
|
||||
}
|
||||
if(delStringCfgs!=null&&delStringCfgs.size()>0){
|
||||
this.deleteStringBatch(delStringCfgs);
|
||||
}
|
||||
if(delNumCfgs!=null&&delNumCfgs.size()>0){
|
||||
this.deleteNumBatch(delNumCfgs);
|
||||
}
|
||||
if(delComplexCfgs!=null&&delComplexCfgs.size()>0){
|
||||
this.deleteComplexBatch(delComplexCfgs);
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
* auditCfg(这里用一句话描述这个方法的作用)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @param cfg
|
||||
* @return
|
||||
*int
|
||||
* @throws Exception
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void auditCfg(int isAudit,List<MultipleCfg> sendCfgs,List<BaseIpCfg> auduitIpCfgs,
|
||||
List<BaseStringCfg> auduitStringCfgs,List<NumBoundaryCfg> auduitNumCfgs,List<ComplexkeywordCfg> auduitComplexCfgs) throws Exception{
|
||||
if(Constants.AUDIT_YES==isAudit||Constants.AUDIT_NOT_YES==isAudit){
|
||||
List<List<BaseCfg>> cfgs=new ArrayList<List<BaseCfg>>();
|
||||
for(MultipleCfg sendCfg:sendCfgs){
|
||||
List<BaseCfg> cfg=new ArrayList<>();
|
||||
if(sendCfg.getIpCfg()!=null){
|
||||
for(BaseIpCfg _cfg:sendCfg.getIpCfg().values()){
|
||||
cfg.add(_cfg);
|
||||
}
|
||||
}
|
||||
if(sendCfg.getStringCfg()!=null){
|
||||
for(BaseStringCfg _cfg:sendCfg.getStringCfg().values()){
|
||||
cfg.add(_cfg);
|
||||
}
|
||||
}
|
||||
if(sendCfg.getNumCfg()!=null){
|
||||
for(NumBoundaryCfg _cfg:sendCfg.getNumCfg().values()){
|
||||
cfg.add(_cfg);
|
||||
}
|
||||
}
|
||||
if(sendCfg.getComplexCfg()!=null){
|
||||
for(ComplexkeywordCfg _cfg:sendCfg.getComplexCfg().values()){
|
||||
cfg.add(_cfg);
|
||||
}
|
||||
}
|
||||
//设置区域ip
|
||||
if(sendCfg.getAreaCfg()!=null){
|
||||
if(cfg.size()>0){
|
||||
cfg.get(0).setAreaCfg(sendCfg.getAreaCfg());
|
||||
}else{
|
||||
throw new RuntimeException("发送至maat异常,没有有效的配置!");
|
||||
}
|
||||
}
|
||||
cfgs.add(cfg);
|
||||
}
|
||||
// if(this.sendToMaatConvertorBatch(isAudit, cfgs)){
|
||||
// if(auduitIpCfgs!=null&&auduitIpCfgs.size()>0){
|
||||
// this.auditIpBatch(auduitIpCfgs);
|
||||
// }
|
||||
// if(auduitStringCfgs!=null&&auduitStringCfgs.size()>0){
|
||||
// this.auditStringBatch(auduitStringCfgs);
|
||||
// }
|
||||
// if(auduitNumCfgs!=null&&auduitNumCfgs.size()>0){
|
||||
// this.auditNumBatch(auduitNumCfgs);
|
||||
// }
|
||||
// if(auduitComplexCfgs!=null&&auduitComplexCfgs.size()>0){
|
||||
// this.auditComplexBatch(auduitComplexCfgs);
|
||||
// }
|
||||
// }else{
|
||||
// throw new RuntimeException("发送至maat失败,返回false!");
|
||||
// }
|
||||
}else{
|
||||
if(auduitIpCfgs!=null&&auduitIpCfgs.size()>0){
|
||||
this.auditIpBatch(auduitIpCfgs);
|
||||
}
|
||||
if(auduitStringCfgs!=null&&auduitStringCfgs.size()>0){
|
||||
this.auditStringBatch(auduitStringCfgs);
|
||||
}
|
||||
if(auduitNumCfgs!=null&&auduitNumCfgs.size()>0){
|
||||
this.auditNumBatch(auduitNumCfgs);
|
||||
}
|
||||
if(auduitComplexCfgs!=null&&auduitComplexCfgs.size()>0){
|
||||
this.auditComplexBatch(auduitComplexCfgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 由于mysql不支持full join,并且考虑mysql的性能问题,这里分别从各个基础表里查询数据再拼接
|
||||
*/
|
||||
@Override
|
||||
public Page<MultipleSearchCfg> findPage(Page<MultipleSearchCfg> page, MultipleSearchCfg entity) {
|
||||
return super.findPage(page, entity);
|
||||
}
|
||||
private void deleteStringBatch(List<BaseStringCfg> data) {
|
||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||
SqlSession batchSqlSession = null;
|
||||
try{
|
||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||
for(int index = 0; index < data.size();index++){
|
||||
BaseStringCfg t = data.get(index);
|
||||
((CrudDao<BaseStringCfg>) batchSqlSession.getMapper(StringCfgDao.class)).delete(t);
|
||||
}
|
||||
batchSqlSession.commit();
|
||||
}finally {
|
||||
if(batchSqlSession != null){
|
||||
batchSqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
private void deleteComplexBatch(List<ComplexkeywordCfg> data) {
|
||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||
SqlSession batchSqlSession = null;
|
||||
try{
|
||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||
for(int index = 0; index < data.size();index++){
|
||||
ComplexkeywordCfg t = data.get(index);
|
||||
((CrudDao<ComplexkeywordCfg>) batchSqlSession.getMapper(ComplexStringCfgDao.class)).delete(t);
|
||||
}
|
||||
batchSqlSession.commit();
|
||||
}finally {
|
||||
if(batchSqlSession != null){
|
||||
batchSqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
private void deleteNumBatch(List<NumBoundaryCfg> data) {
|
||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||
SqlSession batchSqlSession = null;
|
||||
try{
|
||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||
for(int index = 0; index < data.size();index++){
|
||||
NumBoundaryCfg t = data.get(index);
|
||||
((CrudDao<NumBoundaryCfg>) batchSqlSession.getMapper(NumCfgDao.class)).delete(t);
|
||||
}
|
||||
batchSqlSession.commit();
|
||||
}finally {
|
||||
if(batchSqlSession != null){
|
||||
batchSqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
private void auditStringBatch(List<BaseStringCfg> data) {
|
||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||
SqlSession batchSqlSession = null;
|
||||
try{
|
||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||
for(int index = 0; index < data.size();index++){
|
||||
BaseStringCfg t = data.get(index);
|
||||
((CrudDao<BaseStringCfg>) batchSqlSession.getMapper(StringCfgDao.class)).audit(t);
|
||||
}
|
||||
batchSqlSession.commit();
|
||||
}finally {
|
||||
if(batchSqlSession != null){
|
||||
batchSqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
private void auditNumBatch(List<NumBoundaryCfg> data) {
|
||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||
SqlSession batchSqlSession = null;
|
||||
try{
|
||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||
for(int index = 0; index < data.size();index++){
|
||||
NumBoundaryCfg t = data.get(index);
|
||||
((CrudDao<NumBoundaryCfg>) batchSqlSession.getMapper(NumCfgDao.class)).audit(t);
|
||||
}
|
||||
batchSqlSession.commit();
|
||||
}finally {
|
||||
if(batchSqlSession != null){
|
||||
batchSqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
private void auditComplexBatch(List<ComplexkeywordCfg> data) {
|
||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||
SqlSession batchSqlSession = null;
|
||||
try{
|
||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||
for(int index = 0; index < data.size();index++){
|
||||
ComplexkeywordCfg t = data.get(index);
|
||||
((CrudDao<ComplexkeywordCfg>) batchSqlSession.getMapper(ComplexStringCfgDao.class)).audit(t);
|
||||
}
|
||||
batchSqlSession.commit();
|
||||
}finally {
|
||||
if(batchSqlSession != null){
|
||||
batchSqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -291,6 +291,7 @@ time_zone=8
|
||||
service_pxy_domain_intercept=513
|
||||
service_ip_mulitiplex=768
|
||||
service_ip_ratelimit=1057
|
||||
service_domain_ratelimit=1058
|
||||
#用户自定义域
|
||||
userregion_rate_limit=RATE_LIMIT
|
||||
userregion_ir_strategy=IR_STRATEGY
|
||||
|
||||
@@ -52,7 +52,11 @@
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<c:forEach items="${fns:getDictList('SPECIAL_FUNCTION_ID')}" var="sfi">
|
||||
<c:if test="${sfi.itemCode==_cfg.functionId}">
|
||||
<c:set var="specialFunctionId" value="${sfi.itemValue}"/>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<div class="page-content">
|
||||
|
||||
<h3 class="page-title">
|
||||
@@ -76,7 +80,7 @@
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form id="cfgFrom"
|
||||
action="${ctx}/proxy/intercept/saveOrUpdate" method="post"
|
||||
action="${ctx}${urlPrefix}/saveOrUpdate" method="post"
|
||||
class="form-horizontal">
|
||||
<input type="hidden" name="cfgName" value="${cfgName}">
|
||||
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
||||
@@ -203,6 +207,19 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<c:if test="${specialFunctionId ne null and specialFunctionId eq 'domainratelimit'}">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ratelimit"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required number" range="[0,100]" type="text" name="ratelimit">
|
||||
</div>
|
||||
<div for="ratelimit"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>
|
||||
<%@include file="/WEB-INF/include/form/basicInfo.jsp"%>
|
||||
|
||||
@@ -49,7 +49,11 @@
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<c:forEach items="${fns:getDictList('SPECIAL_FUNCTION_ID')}" var="sfi">
|
||||
<c:if test="${sfi.itemCode==cfg.functionId}">
|
||||
<c:set var="specialFunctionId" value="${sfi.itemValue}"/>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<div class="page-content">
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
<%-- <button type="button" class="btn btn-default" onclick="location='${ctx}/cfg/string/list?serviceId=${serviceId}&action=${action}&cfgName=${cfgName}'"><spring:message code="refresh"></spring:message></button> --%>
|
||||
@@ -205,6 +209,9 @@
|
||||
<th><spring:message code="match_method"/></th>
|
||||
<th><spring:message code="whether_hexbinary"/></th>
|
||||
<th><spring:message code="whether_area_block"/></th>
|
||||
<c:if test="${specialFunctionId ne null and specialFunctionId eq 'domainratelimit'}">
|
||||
<th><spring:message code="ratelimit"/></th>
|
||||
</c:if>
|
||||
<th><spring:message code="letter"/></th>
|
||||
<th><spring:message code="type"/></th>
|
||||
<th><spring:message code="attribute"/></th>
|
||||
@@ -238,7 +245,6 @@
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>
|
||||
${cfg.exprType}
|
||||
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="expressionC">
|
||||
<c:if test="${cfg.exprType eq expressionC.itemCode}"><spring:message code="${expressionC.itemValue }"/></c:if>
|
||||
</c:forEach>
|
||||
@@ -263,6 +269,12 @@
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<c:if test="${specialFunctionId ne null and specialFunctionId eq 'domainratelimit'}">
|
||||
<td>
|
||||
<c:if test="${cfg.ratelimit eq null}">0%</c:if>
|
||||
<c:if test="${cfg.ratelimit ne null}">${cfg.ratelimit}%</c:if>
|
||||
</td>
|
||||
</c:if>
|
||||
<td>
|
||||
${cfg.requestName }
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user