1、删除无用类和方法;
2、修改异常处理方式,一直往上抛在controller里记录日志并返回给客户端; 3、回调类配置新增时isValid只能为1
This commit is contained in:
@@ -1,179 +0,0 @@
|
|||||||
/**
|
|
||||||
* @Title: LogEntity.java
|
|
||||||
* @Package com.nis.domain
|
|
||||||
* @Description: TODO(用一句话描述该文件做什么)
|
|
||||||
* @author (darnell)
|
|
||||||
* @date 2016年9月1日 上午10:16:54
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
package com.nis.domain;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
import javax.xml.bind.annotation.XmlTransient;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
import com.nis.util.JsonDateSerializer;
|
|
||||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @ClassName: DfJitLogEntity
|
|
||||||
* @Description: TODO(实时统计公共实体部分)
|
|
||||||
* @author (rkg)
|
|
||||||
* @date 2016年9月13日下午2:54:12
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public abstract class DfJitLogEntity<T> implements Serializable {
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "id", required = true)
|
|
||||||
protected Long statId;
|
|
||||||
@ApiModelProperty(value = "统计时间", required = true)
|
|
||||||
protected Date reportTime;
|
|
||||||
@ApiModelProperty(value = "ip所属国家", required = false)
|
|
||||||
protected String nation;
|
|
||||||
@ApiModelProperty(value = "ip所属省", required = false)
|
|
||||||
protected String province;
|
|
||||||
@ApiModelProperty(value = "ip所属市", required = false)
|
|
||||||
protected String city;
|
|
||||||
@ApiModelProperty(value = "日志数量", required = true)
|
|
||||||
protected Long sum;
|
|
||||||
@ApiModelProperty(value = "业务类型", required = true)
|
|
||||||
protected Integer service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公共查询部分
|
|
||||||
*/
|
|
||||||
protected String searchReportStartTime;
|
|
||||||
protected String searchReportEndTime;
|
|
||||||
protected String searchService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 当前实体分页对象
|
|
||||||
*/
|
|
||||||
protected Page<T> page;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义SQL(SQL标识,SQL内容)
|
|
||||||
*/
|
|
||||||
protected Map<String, String> sqlMap;
|
|
||||||
|
|
||||||
public DfJitLogEntity() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getStatId() {
|
|
||||||
return statId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatId(Long statId) {
|
|
||||||
this.statId = statId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonSerialize(using = JsonDateSerializer.class)
|
|
||||||
public Date getReportTime() {
|
|
||||||
return reportTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReportTime(Date reportTime) {
|
|
||||||
this.reportTime = reportTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNation() {
|
|
||||||
return nation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNation(String nation) {
|
|
||||||
this.nation = nation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getProvince() {
|
|
||||||
return province;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProvince(String province) {
|
|
||||||
this.province = province;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCity() {
|
|
||||||
return city;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCity(String city) {
|
|
||||||
this.city = city;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Long getSum() {
|
|
||||||
return sum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSum(Long sum) {
|
|
||||||
this.sum = sum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getService() {
|
|
||||||
return service;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setService(Integer service) {
|
|
||||||
this.service = service;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public String getSearchReportStartTime() {
|
|
||||||
return searchReportStartTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSearchReportStartTime(String searchReportStartTime) {
|
|
||||||
this.searchReportStartTime = searchReportStartTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public String getSearchReportEndTime() {
|
|
||||||
return searchReportEndTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSearchReportEndTime(String searchReportEndTime) {
|
|
||||||
this.searchReportEndTime = searchReportEndTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public String getSearchService() {
|
|
||||||
return searchService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSearchService(String searchService) {
|
|
||||||
this.searchService = searchService;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
@XmlTransient
|
|
||||||
public Page<T> getPage() {
|
|
||||||
if (page == null) {
|
|
||||||
page = new Page<T>();
|
|
||||||
}
|
|
||||||
return page;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPage(Page<T> page) {
|
|
||||||
this.page = page;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
@XmlTransient
|
|
||||||
public Map<String, String> getSqlMap() {
|
|
||||||
if (sqlMap == null) {
|
|
||||||
sqlMap = Maps.newHashMap();
|
|
||||||
}
|
|
||||||
return sqlMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSqlMap(Map<String, String> sqlMap) {
|
|
||||||
this.sqlMap = sqlMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,149 +0,0 @@
|
|||||||
package com.nis.domain;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlTransient;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
import com.nis.domain.Page;
|
|
||||||
import com.nis.util.Configurations;
|
|
||||||
import com.nis.util.JsonDateSerializer;
|
|
||||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
public class DfReportEntity<T> implements Serializable {
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 2990823464993846973L;
|
|
||||||
@ApiModelProperty(value = "A系统", required = true)
|
|
||||||
protected Long asum;
|
|
||||||
@ApiModelProperty(value = "B系统", required = true)
|
|
||||||
protected Long bsum;
|
|
||||||
@ApiModelProperty(value = "C系统", required = true)
|
|
||||||
protected Long csum;
|
|
||||||
@ApiModelProperty(value = "统计时间", required = true)
|
|
||||||
protected Date reportTime;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "全A+单B", required = true)
|
|
||||||
protected Long absum;
|
|
||||||
|
|
||||||
public Long getAsum() {
|
|
||||||
return asum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAsum(Long asum) {
|
|
||||||
this.asum = asum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getBsum() {
|
|
||||||
return bsum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBsum(Long bsum) {
|
|
||||||
this.bsum = bsum;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonSerialize(using = JsonDateSerializer.class)
|
|
||||||
public Date getReportTime() {
|
|
||||||
return reportTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReportTime(Date reportTime) {
|
|
||||||
this.reportTime = reportTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected String searchReportStartTime;
|
|
||||||
protected String searchReportEndTime;
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public String getSearchReportStartTime() {
|
|
||||||
return searchReportStartTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSearchReportStartTime(String searchReportStartTime) {
|
|
||||||
this.searchReportStartTime = searchReportStartTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public String getSearchReportEndTime() {
|
|
||||||
return searchReportEndTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSearchReportEndTime(String searchReportEndTime) {
|
|
||||||
this.searchReportEndTime = searchReportEndTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 当前实体分页对象
|
|
||||||
*/
|
|
||||||
protected Page<T> page;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义SQL(SQL标识,SQL内容)
|
|
||||||
*/
|
|
||||||
protected Map<String, String> sqlMap;
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
@XmlTransient
|
|
||||||
public Page<T> getPage() {
|
|
||||||
if (page == null) {
|
|
||||||
page = new Page<T>();
|
|
||||||
}
|
|
||||||
return page;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Page<T> setPage(Page<T> page) {
|
|
||||||
this.page = page;
|
|
||||||
return page;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
@XmlTransient
|
|
||||||
public Map<String, String> getSqlMap() {
|
|
||||||
if (sqlMap == null) {
|
|
||||||
sqlMap = Maps.newHashMap();
|
|
||||||
}
|
|
||||||
return sqlMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSqlMap(Map<String, String> sqlMap) {
|
|
||||||
this.sqlMap = sqlMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取数据库名称
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public String getDbName() {
|
|
||||||
return Configurations.getStringProperty("jdbc.type", "mysql");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return ReflectionToStringBuilder.toString(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getAbsum() {
|
|
||||||
return absum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAbsum(Long absum) {
|
|
||||||
this.absum = absum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getCsum() {
|
|
||||||
return csum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCsum(Long csum) {
|
|
||||||
this.csum = csum;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,203 +0,0 @@
|
|||||||
/**
|
|
||||||
* @Title: StatLogEntity.java
|
|
||||||
* @Package com.nis.domain
|
|
||||||
* @Description: TODO(用一句话描述该文件做什么)
|
|
||||||
* @author (ddm)
|
|
||||||
* @date 2016年9月13日 上午10:49:01
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
package com.nis.domain;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlTransient;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
import com.nis.util.Configurations;
|
|
||||||
import com.nis.util.JsonDateSerializer;
|
|
||||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: StatLogEntity
|
|
||||||
* @Description: TODO(日志报表公共实体部分)
|
|
||||||
* @author (ddm)
|
|
||||||
* @date 2016年9月1日 上午10:16:54
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public abstract class StatLogEntity<T> implements Serializable {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么)
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = -5210683756718456730L;
|
|
||||||
|
|
||||||
@ApiModelProperty(value="私有标签", required=true)
|
|
||||||
protected Integer service;
|
|
||||||
@ApiModelProperty(value="生效系统", required=true)
|
|
||||||
protected Integer activeSys;
|
|
||||||
@ApiModelProperty(value="A版总计", required=true)
|
|
||||||
protected Long asum;
|
|
||||||
@ApiModelProperty(value="B版总计", required=true)
|
|
||||||
protected Long bsum;
|
|
||||||
@ApiModelProperty(value="全A+单B数量", required=true)
|
|
||||||
protected Long absum;
|
|
||||||
@ApiModelProperty(value="统计时间", required=true)
|
|
||||||
protected Date statTime;
|
|
||||||
|
|
||||||
protected String searchStatStartTime;
|
|
||||||
protected String searchStatEndTime;
|
|
||||||
protected String searchService;
|
|
||||||
protected String searchStatActiveSys;
|
|
||||||
|
|
||||||
|
|
||||||
@JsonSerialize(using=JsonDateSerializer.class)
|
|
||||||
public Date getStatTime() {
|
|
||||||
return statTime;
|
|
||||||
}
|
|
||||||
public void setStatTime(Date statTime) {
|
|
||||||
this.statTime = statTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getActiveSys() {
|
|
||||||
return activeSys;
|
|
||||||
}
|
|
||||||
public void setActiveSys(Integer activeSys) {
|
|
||||||
this.activeSys = activeSys;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getService() {
|
|
||||||
return service;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setService(Integer service) {
|
|
||||||
this.service = service;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Long getAbsum() {
|
|
||||||
return absum;
|
|
||||||
}
|
|
||||||
public Long getBsum() {
|
|
||||||
return bsum;
|
|
||||||
}
|
|
||||||
public void setAbsum(Long absum) {
|
|
||||||
this.absum = absum;
|
|
||||||
}
|
|
||||||
public void setBsum(Long bsum) {
|
|
||||||
this.bsum = bsum;
|
|
||||||
}
|
|
||||||
public Long getAsum() {
|
|
||||||
return asum;
|
|
||||||
}
|
|
||||||
public void setAsum(Long asum) {
|
|
||||||
this.asum = asum;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public String getSearchStatStartTime() {
|
|
||||||
return searchStatStartTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setSearchStatStartTime(String searchStatStartTime) {
|
|
||||||
this.searchStatStartTime = searchStatStartTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public String getSearchStatEndTime() {
|
|
||||||
return searchStatEndTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setSearchStatEndTime(String searchStatEndTime) {
|
|
||||||
this.searchStatEndTime = searchStatEndTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public String getSearchService() {
|
|
||||||
return searchService;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setSearchService(String searchService) {
|
|
||||||
this.searchService = searchService;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public String getSearchStatActiveSys() {
|
|
||||||
return searchStatActiveSys;
|
|
||||||
}
|
|
||||||
public void setSearchStatActiveSys(String searchStatActiveSys) {
|
|
||||||
this.searchStatActiveSys = searchStatActiveSys;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 当前实体分页对象
|
|
||||||
*/
|
|
||||||
protected Page<T> page;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义SQL(SQL标识,SQL内容)
|
|
||||||
*/
|
|
||||||
protected Map<String, String> sqlMap;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Title:
|
|
||||||
* @Description: TODO
|
|
||||||
* @param 入参
|
|
||||||
*/
|
|
||||||
public StatLogEntity() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
@XmlTransient
|
|
||||||
public Page<T> getPage() {
|
|
||||||
if (page == null){
|
|
||||||
page = new Page<T>();
|
|
||||||
}
|
|
||||||
return page;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Page<T> setPage(Page<T> page) {
|
|
||||||
this.page = page;
|
|
||||||
return page;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
@XmlTransient
|
|
||||||
public Map<String, String> getSqlMap() {
|
|
||||||
if (sqlMap == null){
|
|
||||||
sqlMap = Maps.newHashMap();
|
|
||||||
}
|
|
||||||
return sqlMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSqlMap(Map<String, String> sqlMap) {
|
|
||||||
this.sqlMap = sqlMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取数据库名称
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public String getDbName(){
|
|
||||||
return Configurations.getStringProperty("jdbc.type", "mysql");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return ReflectionToStringBuilder.toString(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
/**
|
|
||||||
* @Title: DfConfigCompile.java
|
|
||||||
* @Package com.nis.domain.restful
|
|
||||||
* @Description: TODO(用一句话描述该文件做什么)
|
|
||||||
* @author (darnell)
|
|
||||||
* @date 2016年8月29日 下午9:36:28
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import com.nis.domain.Page;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DfConfigCompile
|
|
||||||
* @Description: TODO(这里用一句话描述这个类的作用)
|
|
||||||
* @author (darnell)
|
|
||||||
* @date 2016年8月29日 下午9:36:28
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public class ConfigCompileTest extends ConfigCompile {
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 3662236229622771720L;
|
|
||||||
private Integer pagesNo; // 当前页码
|
|
||||||
private Integer pagesSize;// 每页显示条数
|
|
||||||
private Long pagesCount;// 总记录数,设置为“-1”表示不查询总数
|
|
||||||
private Page<ConfigCompileTest> page;
|
|
||||||
private String searchStartTime;
|
|
||||||
private String searchEndTime;
|
|
||||||
|
|
||||||
public Integer getPagesNo() {
|
|
||||||
return pagesNo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPagesNo(Integer pagesNo) {
|
|
||||||
this.pagesNo = pagesNo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getPagesSize() {
|
|
||||||
return pagesSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPagesSize(Integer pagesSize) {
|
|
||||||
this.pagesSize = pagesSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getPagesCount() {
|
|
||||||
return pagesCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPagesCount(Long pagesCount) {
|
|
||||||
this.pagesCount = pagesCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Page<ConfigCompileTest> getPage() {
|
|
||||||
return page;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPage(Page<ConfigCompileTest> page) {
|
|
||||||
this.page = page;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSearchStartTime() {
|
|
||||||
return searchStartTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSearchStartTime(String searchStartTime) {
|
|
||||||
this.searchStartTime = searchStartTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSearchEndTime() {
|
|
||||||
return searchEndTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSearchEndTime(String searchEndTime) {
|
|
||||||
this.searchEndTime = searchEndTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
public class ConfigGroupRelationTest extends ConfigGroupRelation{
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = -1253613918276476050L;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
/**
|
|
||||||
* @Title: ConfigSource.java
|
|
||||||
* @Package com.nis.domain.restful
|
|
||||||
* @Description: TODO(用一句话描述该文件做什么)
|
|
||||||
* @author (darnell)
|
|
||||||
* @date 2016年8月29日 下午9:31:24
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: ConfigSource
|
|
||||||
* @Description: TODO(这里用一句话描述这个类的作用)
|
|
||||||
* @author (darnell)
|
|
||||||
* @date 2016年8月29日 下午9:31:24
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public class ConfigSourceTest extends ConfigSource {
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = -2641336050368126171L;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
import com.nis.domain.BaseEntity;
|
|
||||||
import com.nis.util.JsonDateSerializer;
|
|
||||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @ClassName: DmbCk.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月9日 上午9:22:14
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public class DmbCk extends BaseEntity<DmbCk>{
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final long serialVersionUID = -2268609209854016029L;
|
|
||||||
@ApiModelProperty(value="国际出口ID", required=true)
|
|
||||||
private Long id;
|
|
||||||
@ApiModelProperty(value="出口名称", required=true)
|
|
||||||
private String name;
|
|
||||||
@ApiModelProperty(value="出口位置", required=true)
|
|
||||||
private String position;
|
|
||||||
@ApiModelProperty(value="通讯方法", required=true)
|
|
||||||
private String comOption;
|
|
||||||
@ApiModelProperty(value="操作员", required=true)
|
|
||||||
private Long czyid;
|
|
||||||
@ApiModelProperty(value="操作时间", required=true)
|
|
||||||
private Date opTime;
|
|
||||||
private Date lastUpdate;
|
|
||||||
private Long procSeq;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* lastUpdate
|
|
||||||
* @return lastUpdate
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public Date getLastUpdate() {
|
|
||||||
return lastUpdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param lastUpdate the lastUpdate to set
|
|
||||||
*/
|
|
||||||
public void setLastUpdate(Date lastUpdate) {
|
|
||||||
this.lastUpdate = lastUpdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* procSeq
|
|
||||||
* @return procSeq
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public Long getProcSeq() {
|
|
||||||
return procSeq;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param procSeq the procSeq to set
|
|
||||||
*/
|
|
||||||
public void setProcSeq(Long procSeq) {
|
|
||||||
this.procSeq = procSeq;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name == null ? null : name.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPosition() {
|
|
||||||
return position;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPosition(String position) {
|
|
||||||
this.position = position == null ? null : position.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getComOption() {
|
|
||||||
return comOption;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setComOption(String comOption) {
|
|
||||||
this.comOption = comOption == null ? null : comOption.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getCzyid() {
|
|
||||||
return czyid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCzyid(Long czyid) {
|
|
||||||
this.czyid = czyid;
|
|
||||||
}
|
|
||||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
|
||||||
@JsonSerialize(using=JsonDateSerializer.class)
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DmbCkSource.java
|
|
||||||
*@Package com.nis.domain.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author dell
|
|
||||||
*@date 2016年9月9日 上午9:53:04
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DmbCkSource.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月9日 上午9:53:04
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public class DmbCkSource extends ConfigCommonSource{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 262835095511967504L;
|
|
||||||
private static final String DEFAULT_VERSION = "1.0";
|
|
||||||
private List<DmbCk> dmbCkList;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建一个新的实例 DmbCkSource.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public DmbCkSource() {
|
|
||||||
super();
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
this.version=DEFAULT_VERSION;
|
|
||||||
}
|
|
||||||
public DmbCkSource(String version) {
|
|
||||||
this.version=version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return version
|
|
||||||
*/
|
|
||||||
public String getVersion() {
|
|
||||||
return version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param version 要设置的 version
|
|
||||||
*/
|
|
||||||
public void setVersion(String version) {
|
|
||||||
this.version = version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return operator
|
|
||||||
*/
|
|
||||||
public String getOperator() {
|
|
||||||
return operator;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param operator 要设置的 operator
|
|
||||||
*/
|
|
||||||
public void setOperator(String operator) {
|
|
||||||
this.operator = operator;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return opTime
|
|
||||||
*/
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param opTime 要设置的 opTime
|
|
||||||
*/
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return opAction
|
|
||||||
*/
|
|
||||||
public Integer getOpAction() {
|
|
||||||
return opAction;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param opAction 要设置的 opAction
|
|
||||||
*/
|
|
||||||
public void setOpAction(Integer opAction) {
|
|
||||||
this.opAction = opAction;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dmbCkList
|
|
||||||
* @return dmbCkList
|
|
||||||
*/
|
|
||||||
|
|
||||||
public List<DmbCk> getDmbCkList() {
|
|
||||||
return dmbCkList;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param dmbCkList the dmbCkList to set
|
|
||||||
*/
|
|
||||||
public void setDmbCkList(List<DmbCk> dmbCkList) {
|
|
||||||
this.dmbCkList = dmbCkList;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,168 +0,0 @@
|
|||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
import com.nis.domain.BaseEntity;
|
|
||||||
import com.nis.util.JsonDateSerializer;
|
|
||||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @ClassName: DmbPort.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月9日 上午9:23:08
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public class DmbPort extends BaseEntity<DmbPort>{
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final long serialVersionUID = -6308234862307401069L;
|
|
||||||
@ApiModelProperty(value="端口ID", required=true)
|
|
||||||
private Long id;
|
|
||||||
@ApiModelProperty(value="国际出口ID", required=true)
|
|
||||||
private Long entranceId;
|
|
||||||
@ApiModelProperty(value="端口名称", required=true)
|
|
||||||
private String portName;
|
|
||||||
@ApiModelProperty(value="是否使用", required=true)
|
|
||||||
private Integer isUsed;
|
|
||||||
@ApiModelProperty(value="管理IP", required=true)
|
|
||||||
private String ipDz;
|
|
||||||
@ApiModelProperty(value="分流设备", required=true)
|
|
||||||
private String portEquipment;
|
|
||||||
@ApiModelProperty(value="ODF端口", required=true)
|
|
||||||
private String odfPort;
|
|
||||||
@ApiModelProperty(value="机房地址", required=true)
|
|
||||||
private String addr;
|
|
||||||
@ApiModelProperty(value="骨干设备端口", required=true)
|
|
||||||
private String ckPort;
|
|
||||||
@ApiModelProperty(value="操作员", required=true)
|
|
||||||
private Long czyid;
|
|
||||||
@ApiModelProperty(value="操作时间", required=true)
|
|
||||||
private Date opTime;
|
|
||||||
private Date lastUpdate;
|
|
||||||
private Long procSeq;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* lastUpdate
|
|
||||||
* @return lastUpdate
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public Date getLastUpdate() {
|
|
||||||
return lastUpdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param lastUpdate the lastUpdate to set
|
|
||||||
*/
|
|
||||||
public void setLastUpdate(Date lastUpdate) {
|
|
||||||
this.lastUpdate = lastUpdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* procSeq
|
|
||||||
* @return procSeq
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public Long getProcSeq() {
|
|
||||||
return procSeq;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param procSeq the procSeq to set
|
|
||||||
*/
|
|
||||||
public void setProcSeq(Long procSeq) {
|
|
||||||
this.procSeq = procSeq;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getEntranceId() {
|
|
||||||
return entranceId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEntranceId(Long entranceId) {
|
|
||||||
this.entranceId = entranceId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPortName() {
|
|
||||||
return portName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPortName(String portName) {
|
|
||||||
this.portName = portName == null ? null : portName.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getIsUsed() {
|
|
||||||
return isUsed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsUsed(Integer isUsed) {
|
|
||||||
this.isUsed = isUsed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIpDz() {
|
|
||||||
return ipDz;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIpDz(String ipDz) {
|
|
||||||
this.ipDz = ipDz == null ? null : ipDz.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPortEquipment() {
|
|
||||||
return portEquipment;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPortEquipment(String portEquipment) {
|
|
||||||
this.portEquipment = portEquipment == null ? null : portEquipment.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getOdfPort() {
|
|
||||||
return odfPort;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOdfPort(String odfPort) {
|
|
||||||
this.odfPort = odfPort == null ? null : odfPort.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAddr() {
|
|
||||||
return addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAddr(String addr) {
|
|
||||||
this.addr = addr == null ? null : addr.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCkPort() {
|
|
||||||
return ckPort;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCkPort(String ckPort) {
|
|
||||||
this.ckPort = ckPort == null ? null : ckPort.trim();
|
|
||||||
}
|
|
||||||
public Long getCzyid() {
|
|
||||||
return czyid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCzyid(Long czyid) {
|
|
||||||
this.czyid = czyid;
|
|
||||||
}
|
|
||||||
@JsonSerialize(using=JsonDateSerializer.class)
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DmbPortSource.java
|
|
||||||
*@Package com.nis.domain.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author dell
|
|
||||||
*@date 2016年9月9日 上午9:53:04
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DmbPortSource.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月9日 上午9:53:04
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public class DmbPortSource extends ConfigCommonSource{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 262835095511967504L;
|
|
||||||
private static final String DEFAULT_VERSION = "1.0";
|
|
||||||
private List<DmbPort> dmbPortList;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建一个新的实例 DmbPortSource.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public DmbPortSource() {
|
|
||||||
super();
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
this.version=DEFAULT_VERSION;
|
|
||||||
}
|
|
||||||
public DmbPortSource(String version) {
|
|
||||||
this.version=version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return version
|
|
||||||
*/
|
|
||||||
public String getVersion() {
|
|
||||||
return version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param version 要设置的 version
|
|
||||||
*/
|
|
||||||
public void setVersion(String version) {
|
|
||||||
this.version = version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return operator
|
|
||||||
*/
|
|
||||||
public String getOperator() {
|
|
||||||
return operator;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param operator 要设置的 operator
|
|
||||||
*/
|
|
||||||
public void setOperator(String operator) {
|
|
||||||
this.operator = operator;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return opTime
|
|
||||||
*/
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param opTime 要设置的 opTime
|
|
||||||
*/
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return opAction
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getOpAction() {
|
|
||||||
return opAction;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param opAction 要设置的 opAction
|
|
||||||
*/
|
|
||||||
public void setOpAction(Integer opAction) {
|
|
||||||
this.opAction = opAction;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dmbPortList
|
|
||||||
* @return dmbPortList
|
|
||||||
*/
|
|
||||||
|
|
||||||
public List<DmbPort> getDmbPortList() {
|
|
||||||
return dmbPortList;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param dmbPortList the dmbPortList to set
|
|
||||||
*/
|
|
||||||
public void setDmbPortList(List<DmbPort> dmbPortList) {
|
|
||||||
this.dmbPortList = dmbPortList;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,227 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsFakeInfo.java
|
|
||||||
*@Package com.nis.domain.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author wx
|
|
||||||
*@date 2016年9月5日 上午10:03:16
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
import com.nis.domain.BaseEntity;
|
|
||||||
import com.nis.util.JsonDateSerializer;
|
|
||||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsFakeInfo.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月5日 上午10:03:16
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public class DnsFakeInfo extends BaseEntity<DnsFakeInfo> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 2614513161019844185L;
|
|
||||||
@ApiModelProperty(value="序号", required=true)
|
|
||||||
private Long id;
|
|
||||||
@ApiModelProperty(value="组号", required=true)
|
|
||||||
private Integer groupId;
|
|
||||||
@ApiModelProperty(value="信息域", required=true)
|
|
||||||
private String info;
|
|
||||||
@ApiModelProperty(value="有效标志,0无效,1有效", required=true)
|
|
||||||
private Integer isValid;
|
|
||||||
@ApiModelProperty(value="操作时间", required=true)
|
|
||||||
private Date opTime;
|
|
||||||
@ApiModelProperty(value="预留1", required=false)
|
|
||||||
private Integer yl1;
|
|
||||||
@ApiModelProperty(value="预留2", required=false)
|
|
||||||
private Integer yl2;
|
|
||||||
@ApiModelProperty(value="预留3", required=false)
|
|
||||||
private String yl3;
|
|
||||||
@ApiModelProperty(value="预留4", required=false)
|
|
||||||
private String yl4;
|
|
||||||
@ApiModelProperty(value="预留5", required=false)
|
|
||||||
private String yl5;
|
|
||||||
private Date lastUpdate;
|
|
||||||
private Long procSeq;
|
|
||||||
/**
|
|
||||||
* lastUpdate
|
|
||||||
* @return lastUpdate
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public Date getLastUpdate() {
|
|
||||||
return lastUpdate;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param lastUpdate the lastUpdate to set
|
|
||||||
*/
|
|
||||||
public void setLastUpdate(Date lastUpdate) {
|
|
||||||
this.lastUpdate = lastUpdate;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* procSeq
|
|
||||||
* @return procSeq
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public Long getProcSeq() {
|
|
||||||
return procSeq;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param procSeq the procSeq to set
|
|
||||||
*/
|
|
||||||
public void setProcSeq(Long procSeq) {
|
|
||||||
this.procSeq = procSeq;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* id
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param id the id to set
|
|
||||||
*/
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* groupId
|
|
||||||
* @return groupId
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getGroupId() {
|
|
||||||
return groupId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param groupId the groupId to set
|
|
||||||
*/
|
|
||||||
public void setGroupId(Integer groupId) {
|
|
||||||
this.groupId = groupId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* info
|
|
||||||
* @return info
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getInfo() {
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param info the info to set
|
|
||||||
*/
|
|
||||||
public void setInfo(String info) {
|
|
||||||
this.info = info;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* isValid
|
|
||||||
* @return isValid
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getIsValid() {
|
|
||||||
return isValid;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param isValid the isValid to set
|
|
||||||
*/
|
|
||||||
public void setIsValid(Integer isValid) {
|
|
||||||
this.isValid = isValid;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* opTime
|
|
||||||
* @return opTime
|
|
||||||
*/
|
|
||||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
|
||||||
@JsonSerialize(using=JsonDateSerializer.class)
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param opTime the opTime to set
|
|
||||||
*/
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* yl1
|
|
||||||
* @return yl1
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getYl1() {
|
|
||||||
return yl1;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param yl1 the yl1 to set
|
|
||||||
*/
|
|
||||||
public void setYl1(Integer yl1) {
|
|
||||||
this.yl1 = yl1;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* yl2
|
|
||||||
* @return yl2
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getYl2() {
|
|
||||||
return yl2;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param yl2 the yl2 to set
|
|
||||||
*/
|
|
||||||
public void setYl2(Integer yl2) {
|
|
||||||
this.yl2 = yl2;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* yl3
|
|
||||||
* @return yl3
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getYl3() {
|
|
||||||
return yl3;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param yl3 the yl3 to set
|
|
||||||
*/
|
|
||||||
public void setYl3(String yl3) {
|
|
||||||
this.yl3 = yl3;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* yl4
|
|
||||||
* @return yl4
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getYl4() {
|
|
||||||
return yl4;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param yl4 the yl4 to set
|
|
||||||
*/
|
|
||||||
public void setYl4(String yl4) {
|
|
||||||
this.yl4 = yl4;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* yl5
|
|
||||||
* @return yl5
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getYl5() {
|
|
||||||
return yl5;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param yl5 the yl5 to set
|
|
||||||
*/
|
|
||||||
public void setYl5(String yl5) {
|
|
||||||
this.yl5 = yl5;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,125 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsFakeInfoSource.java
|
|
||||||
*@Package com.nis.domain.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author dell
|
|
||||||
*@date 2016年9月7日 下午6:26:06
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsFakeInfoSource.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月7日 下午6:26:06
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public class DnsFakeInfoSource extends ConfigCommonSource{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final long serialVersionUID = -4075912540188044069L;
|
|
||||||
private static final String DEFAULT_VERSION = "1.0";
|
|
||||||
private List<DnsFakeInfo> dnsFakeInfoList;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建一个新的实例 DnsFakeInfoSource.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public DnsFakeInfoSource() {
|
|
||||||
super();
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
this.version=DEFAULT_VERSION;
|
|
||||||
}
|
|
||||||
public DnsFakeInfoSource(String version) {
|
|
||||||
this.version=version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return version
|
|
||||||
*/
|
|
||||||
public String getVersion() {
|
|
||||||
return version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param version 要设置的 version
|
|
||||||
*/
|
|
||||||
public void setVersion(String version) {
|
|
||||||
this.version = version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return operator
|
|
||||||
*/
|
|
||||||
public String getOperator() {
|
|
||||||
return operator;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param operator 要设置的 operator
|
|
||||||
*/
|
|
||||||
public void setOperator(String operator) {
|
|
||||||
this.operator = operator;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return opTime
|
|
||||||
*/
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param opTime 要设置的 opTime
|
|
||||||
*/
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return opAction
|
|
||||||
*/
|
|
||||||
public Integer getOpAction() {
|
|
||||||
return opAction;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param opAction 要设置的 opAction
|
|
||||||
*/
|
|
||||||
public void setOpAction(Integer opAction) {
|
|
||||||
this.opAction = opAction;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* getDnsFakeInfoList(这里用一句话描述这个方法的作用)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @return
|
|
||||||
*List<DnsFakeInfo>
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public List<DnsFakeInfo> getDnsFakeInfoList() {
|
|
||||||
return dnsFakeInfoList;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param dnsGroupTypeList the dnsGroupTypeList to set
|
|
||||||
*/
|
|
||||||
public void setDnsFakeInfoList(List<DnsFakeInfo> dnsFakeIpList) {
|
|
||||||
this.dnsFakeInfoList = dnsFakeIpList;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,391 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsFakeIp.java
|
|
||||||
*@Package com.nis.domain.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author dell
|
|
||||||
*@date 2016年9月3日 下午7:59:34
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
import com.nis.domain.BaseEntity;
|
|
||||||
import com.nis.util.JsonDateSerializer;
|
|
||||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsFakeIp.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月3日 下午7:59:34
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public class DnsFakeIp extends BaseEntity<DnsFakeIp> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final long serialVersionUID = -4761419421560750644L;
|
|
||||||
@ApiModelProperty(value="序号", required=true)
|
|
||||||
private Long id;
|
|
||||||
@ApiModelProperty(value="组号", required=true)
|
|
||||||
private Integer groupId;
|
|
||||||
@ApiModelProperty(value="地址类型", required=true)
|
|
||||||
private Integer addrType;
|
|
||||||
@ApiModelProperty(value="源IP地址", required=true)
|
|
||||||
private String srcIp;
|
|
||||||
@ApiModelProperty(value="源IP掩码", required=true)
|
|
||||||
private String maskSrcIp;
|
|
||||||
@ApiModelProperty(value="源端口", required=true)
|
|
||||||
private String srcPort;
|
|
||||||
@ApiModelProperty(value="源端口掩码", required=true)
|
|
||||||
private String maskSrcPort;
|
|
||||||
@ApiModelProperty(value="目的IP", required=true)
|
|
||||||
private String dstIp;
|
|
||||||
@ApiModelProperty(value="目的IP掩码", required=true)
|
|
||||||
private String maskDstIp;
|
|
||||||
@ApiModelProperty(value="目的端口", required=true)
|
|
||||||
private String dstPort;
|
|
||||||
@ApiModelProperty(value="目的端口掩码", required=true)
|
|
||||||
private String maskDstPort;
|
|
||||||
@ApiModelProperty(value="协议(tcp/udp)", required=true)
|
|
||||||
private Integer protocol;
|
|
||||||
@ApiModelProperty(value="方向,0双向,1单向", required=true)
|
|
||||||
private Integer direction;
|
|
||||||
@ApiModelProperty(value="有效标志, 0无效,1有效", required=true)
|
|
||||||
private Integer isValid;
|
|
||||||
@ApiModelProperty(value="操作时间", required=true)
|
|
||||||
private Date opTime;
|
|
||||||
@ApiModelProperty(value="预留1", required=false)
|
|
||||||
private Integer yl1;
|
|
||||||
@ApiModelProperty(value="预留2", required=false)
|
|
||||||
private Integer yl2;
|
|
||||||
@ApiModelProperty(value="预留3", required=false)
|
|
||||||
private String yl3;
|
|
||||||
@ApiModelProperty(value="预留4", required=false)
|
|
||||||
private String yl4;
|
|
||||||
@ApiModelProperty(value="预留5", required=false)
|
|
||||||
private String yl5;
|
|
||||||
private Date lastUpdate;
|
|
||||||
private Long procSeq;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* lastUpdate
|
|
||||||
* @return lastUpdate
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public Date getLastUpdate() {
|
|
||||||
return lastUpdate;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param lastUpdate the lastUpdate to set
|
|
||||||
*/
|
|
||||||
public void setLastUpdate(Date lastUpdate) {
|
|
||||||
this.lastUpdate = lastUpdate;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* procSeq
|
|
||||||
* @return procSeq
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public Long getProcSeq() {
|
|
||||||
return procSeq;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param procSeq the procSeq to set
|
|
||||||
*/
|
|
||||||
public void setProcSeq(Long procSeq) {
|
|
||||||
this.procSeq = procSeq;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* id
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* maskSrcIp
|
|
||||||
* @return maskSrcIp
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getMaskSrcIp() {
|
|
||||||
return maskSrcIp;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param maskSrcIp the maskSrcIp to set
|
|
||||||
*/
|
|
||||||
public void setMaskSrcIp(String maskSrcIp) {
|
|
||||||
this.maskSrcIp = maskSrcIp;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param id the id to set
|
|
||||||
*/
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* groupId
|
|
||||||
* @return groupId
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getGroupId() {
|
|
||||||
return groupId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param groupId the groupId to set
|
|
||||||
*/
|
|
||||||
public void setGroupId(Integer groupId) {
|
|
||||||
this.groupId = groupId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* addrType
|
|
||||||
* @return addrType
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getAddrType() {
|
|
||||||
return addrType;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param addrType the addrType to set
|
|
||||||
*/
|
|
||||||
public void setAddrType(Integer addrType) {
|
|
||||||
this.addrType = addrType;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* srcIp
|
|
||||||
* @return srcIp
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getSrcIp() {
|
|
||||||
return srcIp;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param srcIp the srcIp to set
|
|
||||||
*/
|
|
||||||
public void setSrcIp(String srcIp) {
|
|
||||||
this.srcIp = srcIp;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* maskSrcPort
|
|
||||||
* @return maskSrcPort
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getMaskSrcPort() {
|
|
||||||
return maskSrcPort;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param maskSrcPort the maskSrcPort to set
|
|
||||||
*/
|
|
||||||
public void setMaskSrcPort(String maskSrcPort) {
|
|
||||||
this.maskSrcPort = maskSrcPort;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* srcPort
|
|
||||||
* @return srcPort
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getSrcPort() {
|
|
||||||
return srcPort;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param srcPort the srcPort to set
|
|
||||||
*/
|
|
||||||
public void setSrcPort(String srcPort) {
|
|
||||||
this.srcPort = srcPort;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* dstIp
|
|
||||||
* @return dstIp
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getDstIp() {
|
|
||||||
return dstIp;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param dstIp the dstIp to set
|
|
||||||
*/
|
|
||||||
public void setDstIp(String dstIp) {
|
|
||||||
this.dstIp = dstIp;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* maskDstIp
|
|
||||||
* @return maskDstIp
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getMaskDstIp() {
|
|
||||||
return maskDstIp;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param maskDstIp the maskDstIp to set
|
|
||||||
*/
|
|
||||||
public void setMaskDstIp(String maskDstIp) {
|
|
||||||
this.maskDstIp = maskDstIp;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* dstPort
|
|
||||||
* @return dstPort
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getDstPort() {
|
|
||||||
return dstPort;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param dstPort the dstPort to set
|
|
||||||
*/
|
|
||||||
public void setDstPort(String dstPort) {
|
|
||||||
this.dstPort = dstPort;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* maskDstPort
|
|
||||||
* @return maskDstPort
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getMaskDstPort() {
|
|
||||||
return maskDstPort;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param maskDstPort the maskDstPort to set
|
|
||||||
*/
|
|
||||||
public void setMaskDstPort(String maskDstPort) {
|
|
||||||
this.maskDstPort = maskDstPort;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* protocol
|
|
||||||
* @return protocol
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getProtocol() {
|
|
||||||
return protocol;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param protocol the protocol to set
|
|
||||||
*/
|
|
||||||
public void setProtocol(Integer protocol) {
|
|
||||||
this.protocol = protocol;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* direction
|
|
||||||
* @return direction
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getDirection() {
|
|
||||||
return direction;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param direction the direction to set
|
|
||||||
*/
|
|
||||||
public void setDirection(Integer direction) {
|
|
||||||
this.direction = direction;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* isValid
|
|
||||||
* @return isValid
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getIsValid() {
|
|
||||||
return isValid;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param isValid the isValid to set
|
|
||||||
*/
|
|
||||||
public void setIsValid(Integer isValid) {
|
|
||||||
this.isValid = isValid;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* optTime
|
|
||||||
* @return optTime
|
|
||||||
*/
|
|
||||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
|
||||||
@JsonSerialize(using=JsonDateSerializer.class)
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param optTime the optTime to set
|
|
||||||
*/
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* yl1
|
|
||||||
* @return yl1
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getYl1() {
|
|
||||||
return yl1;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param yl1 the yl1 to set
|
|
||||||
*/
|
|
||||||
public void setYl1(Integer yl1) {
|
|
||||||
this.yl1 = yl1;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* yl2
|
|
||||||
* @return yl2
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getYl2() {
|
|
||||||
return yl2;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param yl2 the yl2 to set
|
|
||||||
*/
|
|
||||||
public void setYl2(Integer yl2) {
|
|
||||||
this.yl2 = yl2;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* yl3
|
|
||||||
* @return yl3
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getYl3() {
|
|
||||||
return yl3;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param yl3 the yl3 to set
|
|
||||||
*/
|
|
||||||
public void setYl3(String yl3) {
|
|
||||||
this.yl3 = yl3;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* yl4
|
|
||||||
* @return yl4
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getYl4() {
|
|
||||||
return yl4;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param yl4 the yl4 to set
|
|
||||||
*/
|
|
||||||
public void setYl4(String yl4) {
|
|
||||||
this.yl4 = yl4;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* yl5
|
|
||||||
* @return yl5
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getYl5() {
|
|
||||||
return yl5;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param yl5 the yl5 to set
|
|
||||||
*/
|
|
||||||
public void setYl5(String yl5) {
|
|
||||||
this.yl5 = yl5;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,125 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsFakeIpSource.java
|
|
||||||
*@Package com.nis.domain.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author dell
|
|
||||||
*@date 2016年9月7日 下午6:26:06
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsFakeIpSource.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (dell)
|
|
||||||
* @date 2016年9月7日 下午6:26:06
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public class DnsFakeIpSource extends ConfigCommonSource{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final long serialVersionUID = -6785885766516678348L;
|
|
||||||
private static final String DEFAULT_VERSION = "1.0";
|
|
||||||
private List<DnsFakeIp> dnsFakeIpList;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建一个新的实例 DnsGroupTypeSource.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public DnsFakeIpSource() {
|
|
||||||
super();
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
this.version=DEFAULT_VERSION;
|
|
||||||
}
|
|
||||||
public DnsFakeIpSource(String version) {
|
|
||||||
this.version=version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return version
|
|
||||||
*/
|
|
||||||
public String getVersion() {
|
|
||||||
return version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param version 要设置的 version
|
|
||||||
*/
|
|
||||||
public void setVersion(String version) {
|
|
||||||
this.version = version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return operator
|
|
||||||
*/
|
|
||||||
public String getOperator() {
|
|
||||||
return operator;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param operator 要设置的 operator
|
|
||||||
*/
|
|
||||||
public void setOperator(String operator) {
|
|
||||||
this.operator = operator;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return opTime
|
|
||||||
*/
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param opTime 要设置的 opTime
|
|
||||||
*/
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return opAction
|
|
||||||
*/
|
|
||||||
public Integer getOpAction() {
|
|
||||||
return opAction;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param opAction 要设置的 opAction
|
|
||||||
*/
|
|
||||||
public void setOpAction(Integer opAction) {
|
|
||||||
this.opAction = opAction;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dnsResponseStrategyList
|
|
||||||
* @return dnsResponseStrategyList
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* dnsGroupTypeList
|
|
||||||
* @return dnsGroupTypeList
|
|
||||||
*/
|
|
||||||
|
|
||||||
public List<DnsFakeIp> getDnsFakeIpList() {
|
|
||||||
return dnsFakeIpList;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param dnsGroupTypeList the dnsGroupTypeList to set
|
|
||||||
*/
|
|
||||||
public void setDnsFakeIpList(List<DnsFakeIp> dnsFakeIpList) {
|
|
||||||
this.dnsFakeIpList = dnsFakeIpList;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,245 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsGroupType.java
|
|
||||||
*@Package com.nis.domain.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author dell
|
|
||||||
*@date 2016年9月3日 下午7:47:28
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
import com.nis.domain.BaseEntity;
|
|
||||||
import com.nis.util.JsonDateSerializer;
|
|
||||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsGroupType.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月3日 下午7:47:28
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public class DnsGroupType extends BaseEntity<DnsGroupType> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final long serialVersionUID = -7012538382953700633L;
|
|
||||||
@ApiModelProperty(value="序号", required=true)
|
|
||||||
private Long id;
|
|
||||||
@ApiModelProperty(value="组号", required=true)
|
|
||||||
private Integer groupId;
|
|
||||||
@ApiModelProperty(value="组名", required=true)
|
|
||||||
private String groupName;
|
|
||||||
@ApiModelProperty(value="应答类型号", required=true)
|
|
||||||
private Integer resTypeId;
|
|
||||||
@ApiModelProperty(value="操作时间", required=true)
|
|
||||||
private Date opTime;
|
|
||||||
@ApiModelProperty(value="有效标志", required=true)
|
|
||||||
private Integer isValid;
|
|
||||||
@ApiModelProperty(value="预留1", required=false)
|
|
||||||
private Integer yl1;
|
|
||||||
@ApiModelProperty(value="预留2", required=false)
|
|
||||||
private Integer yl2;
|
|
||||||
@ApiModelProperty(value="预留3", required=false)
|
|
||||||
private String yl3;
|
|
||||||
@ApiModelProperty(value="预留4", required=false)
|
|
||||||
private String yl4;
|
|
||||||
@ApiModelProperty(value="预留5", required=false)
|
|
||||||
private String yl5;
|
|
||||||
|
|
||||||
private Date lastUpdate;
|
|
||||||
private Long procSeq;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* groupName
|
|
||||||
* @return groupName
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getGroupName() {
|
|
||||||
return groupName;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param groupName the groupName to set
|
|
||||||
*/
|
|
||||||
public void setGroupName(String groupName) {
|
|
||||||
this.groupName = groupName;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* lastUpdate
|
|
||||||
* @return lastUpdate
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public Date getLastUpdate() {
|
|
||||||
return lastUpdate;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param lastUpdate the lastUpdate to set
|
|
||||||
*/
|
|
||||||
public void setLastUpdate(Date lastUpdate) {
|
|
||||||
this.lastUpdate = lastUpdate;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* procSeq
|
|
||||||
* @return procSeq
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public Long getProcSeq() {
|
|
||||||
return procSeq;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param procSeq the procSeq to set
|
|
||||||
*/
|
|
||||||
public void setProcSeq(Long procSeq) {
|
|
||||||
this.procSeq = procSeq;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* id
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param id the id to set
|
|
||||||
*/
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* groupId
|
|
||||||
* @return groupId
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getGroupId() {
|
|
||||||
return groupId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param groupId the groupId to set
|
|
||||||
*/
|
|
||||||
public void setGroupId(Integer groupId) {
|
|
||||||
this.groupId = groupId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* resTypeId
|
|
||||||
* @return resTypeId
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getResTypeId() {
|
|
||||||
return resTypeId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param resTypeId the resTypeId to set
|
|
||||||
*/
|
|
||||||
public void setResTypeId(Integer resTypeId) {
|
|
||||||
this.resTypeId = resTypeId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* opTime
|
|
||||||
* @return opTime
|
|
||||||
*/
|
|
||||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
|
||||||
@JsonSerialize(using=JsonDateSerializer.class)
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param opTime the opTime to set
|
|
||||||
*/
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* isValid
|
|
||||||
* @return isValid
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getIsValid() {
|
|
||||||
return isValid;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param isValid the isValid to set
|
|
||||||
*/
|
|
||||||
public void setIsValid(Integer isValid) {
|
|
||||||
this.isValid = isValid;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* yl1
|
|
||||||
* @return yl1
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getYl1() {
|
|
||||||
return yl1;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param yl1 the yl1 to set
|
|
||||||
*/
|
|
||||||
public void setYl1(Integer yl1) {
|
|
||||||
this.yl1 = yl1;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* yl2
|
|
||||||
* @return yl2
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getYl2() {
|
|
||||||
return yl2;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param yl2 the yl2 to set
|
|
||||||
*/
|
|
||||||
public void setYl2(Integer yl2) {
|
|
||||||
this.yl2 = yl2;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* yl3
|
|
||||||
* @return yl3
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getYl3() {
|
|
||||||
return yl3;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param yl3 the yl3 to set
|
|
||||||
*/
|
|
||||||
public void setYl3(String yl3) {
|
|
||||||
this.yl3 = yl3;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* yl4
|
|
||||||
* @return yl4
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getYl4() {
|
|
||||||
return yl4;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param yl4 the yl4 to set
|
|
||||||
*/
|
|
||||||
public void setYl4(String yl4) {
|
|
||||||
this.yl4 = yl4;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* yl5
|
|
||||||
* @return yl5
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getYl5() {
|
|
||||||
return yl5;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param yl5 the yl5 to set
|
|
||||||
*/
|
|
||||||
public void setYl5(String yl5) {
|
|
||||||
this.yl5 = yl5;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,124 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsGroupTypeSource.java
|
|
||||||
*@Package com.nis.domain.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author dell
|
|
||||||
*@date 2016年9月7日 下午3:32:18
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsGroupTypeSource.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月7日 下午3:32:18
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public class DnsGroupTypeSource extends ConfigCommonSource{
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 4829973369982149866L;
|
|
||||||
private static final String DEFAULT_VERSION = "1.0";
|
|
||||||
private List<DnsGroupType> dnsGroupTypeList;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建一个新的实例 DnsGroupTypeSource.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public DnsGroupTypeSource() {
|
|
||||||
super();
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
this.version=DEFAULT_VERSION;
|
|
||||||
}
|
|
||||||
public DnsGroupTypeSource(String version) {
|
|
||||||
this.version=version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return version
|
|
||||||
*/
|
|
||||||
public String getVersion() {
|
|
||||||
return version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param version 要设置的 version
|
|
||||||
*/
|
|
||||||
public void setVersion(String version) {
|
|
||||||
this.version = version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return operator
|
|
||||||
*/
|
|
||||||
public String getOperator() {
|
|
||||||
return operator;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param operator 要设置的 operator
|
|
||||||
*/
|
|
||||||
public void setOperator(String operator) {
|
|
||||||
this.operator = operator;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return opTime
|
|
||||||
*/
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param opTime 要设置的 opTime
|
|
||||||
*/
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return opAction
|
|
||||||
*/
|
|
||||||
public Integer getOpAction() {
|
|
||||||
return opAction;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param opAction 要设置的 opAction
|
|
||||||
*/
|
|
||||||
public void setOpAction(Integer opAction) {
|
|
||||||
this.opAction = opAction;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dnsResponseStrategyList
|
|
||||||
* @return dnsResponseStrategyList
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* dnsGroupTypeList
|
|
||||||
* @return dnsGroupTypeList
|
|
||||||
*/
|
|
||||||
|
|
||||||
public List<DnsGroupType> getDnsGroupTypeList() {
|
|
||||||
return dnsGroupTypeList;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param dnsGroupTypeList the dnsGroupTypeList to set
|
|
||||||
*/
|
|
||||||
public void setDnsGroupTypeList(List<DnsGroupType> dnsGroupTypeList) {
|
|
||||||
this.dnsGroupTypeList = dnsGroupTypeList;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,457 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsResponseStrategy.java
|
|
||||||
*@Package com.nis.domain.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author dell
|
|
||||||
*@date 2016年9月3日 下午7:01:02
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
import com.nis.domain.BaseEntity;
|
|
||||||
import com.nis.util.JsonDateSerializer;
|
|
||||||
import com.wordnik.swagger.annotations.ApiModel;
|
|
||||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsResponseStrategy.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月3日 下午7:01:02
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@ApiModel
|
|
||||||
|
|
||||||
public class DnsResponseStrategy extends BaseEntity<DnsResponseStrategy> {
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final long serialVersionUID = -4484073380296557600L;
|
|
||||||
@ApiModelProperty(value="序号", required=true)
|
|
||||||
private Long id;
|
|
||||||
@ApiModelProperty(value="请求策略号", required=true)
|
|
||||||
private Integer reqStrateId;
|
|
||||||
@ApiModelProperty(value="策略名称", required=true)
|
|
||||||
private String strateName;
|
|
||||||
@ApiModelProperty(value="应答组1的组号", required=false)
|
|
||||||
private Integer resGroupOneId;
|
|
||||||
@ApiModelProperty(value="应答组1的应答数", required=false)
|
|
||||||
private Integer resGroupOneNum;
|
|
||||||
@ApiModelProperty(value="应答组2的组号", required=false)
|
|
||||||
private Integer resGroupTwoId;
|
|
||||||
@ApiModelProperty(value="应答组2的应答数", required=false)
|
|
||||||
private Integer resGroupTwoNum;
|
|
||||||
@ApiModelProperty(value="应答组3的组号", required=false)
|
|
||||||
private Integer resGroupThreeId;
|
|
||||||
@ApiModelProperty(value="应答组3的应答数", required=false)
|
|
||||||
private Integer resGroupThreeNum;
|
|
||||||
@ApiModelProperty(value="应答组4的组号", required=false)
|
|
||||||
private Integer resGroupFourId;
|
|
||||||
@ApiModelProperty(value="应答组4的应答数", required=false)
|
|
||||||
private Integer resGroupFourNum;
|
|
||||||
@ApiModelProperty(value="应答组5的组号", required=false)
|
|
||||||
private Integer resGroupFiveId;
|
|
||||||
@ApiModelProperty(value="应答组5的应答数", required=false)
|
|
||||||
private Integer resGroupFiveNum;
|
|
||||||
@ApiModelProperty(value="Auth记录组号", required=false)
|
|
||||||
private Integer authGroup;
|
|
||||||
@ApiModelProperty(value="Additional记录组号", required=false)
|
|
||||||
private Integer addGroup;
|
|
||||||
@ApiModelProperty(value="操作时间", required=true)
|
|
||||||
private Date opTime;
|
|
||||||
@ApiModelProperty(value="有效标识", required=true)
|
|
||||||
private Integer isValid;
|
|
||||||
@ApiModelProperty(value="预留1", required=false)
|
|
||||||
private Integer yl1;
|
|
||||||
@ApiModelProperty(value="预留2", required=false)
|
|
||||||
private Integer yl2;
|
|
||||||
@ApiModelProperty(value="预留3", required=false)
|
|
||||||
private String yl3;
|
|
||||||
@ApiModelProperty(value="预留4", required=false)
|
|
||||||
private String yl4;
|
|
||||||
@ApiModelProperty(value="预留5", required=false)
|
|
||||||
private String yl5;
|
|
||||||
private Date lastUpdate;
|
|
||||||
private Long procSeq;
|
|
||||||
@ApiModelProperty(value="最小生存时间", required=true)
|
|
||||||
private Integer minTtl;
|
|
||||||
@ApiModelProperty(value="最大生存时间", required=true)
|
|
||||||
private Integer maxTtl;
|
|
||||||
/**
|
|
||||||
* lastUpdate
|
|
||||||
* @return lastUpdate
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public Date getLastUpdate() {
|
|
||||||
return lastUpdate;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param lastUpdate the lastUpdate to set
|
|
||||||
*/
|
|
||||||
public void setLastUpdate(Date lastUpdate) {
|
|
||||||
this.lastUpdate = lastUpdate;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* procSeq
|
|
||||||
* @return procSeq
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public Long getProcSeq() {
|
|
||||||
return procSeq;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param procSeq the procSeq to set
|
|
||||||
*/
|
|
||||||
public void setProcSeq(Long procSeq) {
|
|
||||||
this.procSeq = procSeq;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* id
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param id the id to set
|
|
||||||
*/
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* reqStrateId
|
|
||||||
* @return reqStrateId
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getReqStrateId() {
|
|
||||||
return reqStrateId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param reqStrateId the reqStrateId to set
|
|
||||||
*/
|
|
||||||
public void setReqStrateId(Integer reqStrateId) {
|
|
||||||
this.reqStrateId = reqStrateId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* strateName
|
|
||||||
* @return strateName
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getStrateName() {
|
|
||||||
return strateName;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param strateName the strateName to set
|
|
||||||
*/
|
|
||||||
public void setStrateName(String strateName) {
|
|
||||||
this.strateName = strateName;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* resGroupOneId
|
|
||||||
* @return resGroupOneId
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getResGroupOneId() {
|
|
||||||
return resGroupOneId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param resGroupOneId the resGroupOneId to set
|
|
||||||
*/
|
|
||||||
public void setResGroupOneId(Integer resGroupOneId) {
|
|
||||||
this.resGroupOneId = resGroupOneId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* resGroupOneNum
|
|
||||||
* @return resGroupOneNum
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getResGroupOneNum() {
|
|
||||||
return resGroupOneNum;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param resGroupOneNum the resGroupOneNum to set
|
|
||||||
*/
|
|
||||||
public void setResGroupOneNum(Integer resGroupOneNum) {
|
|
||||||
this.resGroupOneNum = resGroupOneNum;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* resGroupTwoId
|
|
||||||
* @return resGroupTwoId
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getResGroupTwoId() {
|
|
||||||
return resGroupTwoId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param resGroupTwoId the resGroupTwoId to set
|
|
||||||
*/
|
|
||||||
public void setResGroupTwoId(Integer resGroupTwoId) {
|
|
||||||
this.resGroupTwoId = resGroupTwoId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* resGroupTwoNum
|
|
||||||
* @return resGroupTwoNum
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getResGroupTwoNum() {
|
|
||||||
return resGroupTwoNum;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param resGroupTwoNum the resGroupTwoNum to set
|
|
||||||
*/
|
|
||||||
public void setResGroupTwoNum(Integer resGroupTwoNum) {
|
|
||||||
this.resGroupTwoNum = resGroupTwoNum;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* authGroup
|
|
||||||
* @return authGroup
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getAuthGroup() {
|
|
||||||
return authGroup;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param authGroup the authGroup to set
|
|
||||||
*/
|
|
||||||
public void setAuthGroup(Integer authGroup) {
|
|
||||||
this.authGroup = authGroup;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* addGroup
|
|
||||||
* @return addGroup
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getAddGroup() {
|
|
||||||
return addGroup;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param addGroup the addGroup to set
|
|
||||||
*/
|
|
||||||
public void setAddGroup(Integer addGroup) {
|
|
||||||
this.addGroup = addGroup;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* opTime
|
|
||||||
* @return opTime
|
|
||||||
*/
|
|
||||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
|
||||||
@JsonSerialize(using=JsonDateSerializer.class)
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param opTime the opTime to set
|
|
||||||
*/
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* isValid
|
|
||||||
* @return isValid
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getIsValid() {
|
|
||||||
return isValid;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param isValid the isValid to set
|
|
||||||
*/
|
|
||||||
public void setIsValid(Integer isValid) {
|
|
||||||
this.isValid = isValid;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* yl1
|
|
||||||
* @return yl1
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getYl1() {
|
|
||||||
return yl1;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param yl1 the yl1 to set
|
|
||||||
*/
|
|
||||||
public void setYl1(Integer yl1) {
|
|
||||||
this.yl1 = yl1;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* yl2
|
|
||||||
* @return yl2
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getYl2() {
|
|
||||||
return yl2;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param yl2 the yl2 to set
|
|
||||||
*/
|
|
||||||
public void setYl2(Integer yl2) {
|
|
||||||
this.yl2 = yl2;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* yl3
|
|
||||||
* @return yl3
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getYl3() {
|
|
||||||
return yl3;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param yl3 the yl3 to set
|
|
||||||
*/
|
|
||||||
public void setYl3(String yl3) {
|
|
||||||
this.yl3 = yl3;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* yl4
|
|
||||||
* @return yl4
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getYl4() {
|
|
||||||
return yl4;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param yl4 the yl4 to set
|
|
||||||
*/
|
|
||||||
public void setYl4(String yl4) {
|
|
||||||
this.yl4 = yl4;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* yl5
|
|
||||||
* @return yl5
|
|
||||||
*/
|
|
||||||
|
|
||||||
public String getYl5() {
|
|
||||||
return yl5;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param yl5 the yl5 to set
|
|
||||||
*/
|
|
||||||
public void setYl5(String yl5) {
|
|
||||||
this.yl5 = yl5;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* minTtl
|
|
||||||
* @return minTtl
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getMinTtl() {
|
|
||||||
return minTtl;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param minTtl the minTtl to set
|
|
||||||
*/
|
|
||||||
public void setMinTtl(Integer minTtl) {
|
|
||||||
this.minTtl = minTtl;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* maxTtl
|
|
||||||
* @return maxTtl
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getMaxTtl() {
|
|
||||||
return maxTtl;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param maxTtl the maxTtl to set
|
|
||||||
*/
|
|
||||||
public void setMaxTtl(Integer maxTtl) {
|
|
||||||
this.maxTtl = maxTtl;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* resGroupThreeId
|
|
||||||
* @return resGroupThreeId
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getResGroupThreeId() {
|
|
||||||
return resGroupThreeId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param resGroupThreeId the resGroupThreeId to set
|
|
||||||
*/
|
|
||||||
public void setResGroupThreeId(Integer resGroupThreeId) {
|
|
||||||
this.resGroupThreeId = resGroupThreeId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* resGroupThreeNum
|
|
||||||
* @return resGroupThreeNum
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getResGroupThreeNum() {
|
|
||||||
return resGroupThreeNum;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param resGroupThreeNum the resGroupThreeNum to set
|
|
||||||
*/
|
|
||||||
public void setResGroupThreeNum(Integer resGroupThreeNum) {
|
|
||||||
this.resGroupThreeNum = resGroupThreeNum;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* resGroupFourId
|
|
||||||
* @return resGroupFourId
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getResGroupFourId() {
|
|
||||||
return resGroupFourId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param resGroupFourId the resGroupFourId to set
|
|
||||||
*/
|
|
||||||
public void setResGroupFourId(Integer resGroupFourId) {
|
|
||||||
this.resGroupFourId = resGroupFourId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* resGroupFourNum
|
|
||||||
* @return resGroupFourNum
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getResGroupFourNum() {
|
|
||||||
return resGroupFourNum;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param resGroupFourNum the resGroupFourNum to set
|
|
||||||
*/
|
|
||||||
public void setResGroupFourNum(Integer resGroupFourNum) {
|
|
||||||
this.resGroupFourNum = resGroupFourNum;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* resGroupFiveId
|
|
||||||
* @return resGroupFiveId
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getResGroupFiveId() {
|
|
||||||
return resGroupFiveId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param resGroupFiveId the resGroupFiveId to set
|
|
||||||
*/
|
|
||||||
public void setResGroupFiveId(Integer resGroupFiveId) {
|
|
||||||
this.resGroupFiveId = resGroupFiveId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* resGroupFiveNum
|
|
||||||
* @return resGroupFiveNum
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getResGroupFiveNum() {
|
|
||||||
return resGroupFiveNum;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param resGroupFiveNum the resGroupFiveNum to set
|
|
||||||
*/
|
|
||||||
public void setResGroupFiveNum(Integer resGroupFiveNum) {
|
|
||||||
this.resGroupFiveNum = resGroupFiveNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,122 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsResponseStrategySource.java
|
|
||||||
*@Package com.nis.domain.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author dell
|
|
||||||
*@date 2016年9月6日 上午9:00:41
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsResponseStrategySource.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月6日 上午9:00:41
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public class DnsResponseStrategySource extends ConfigCommonSource {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 2810461787654112507L;
|
|
||||||
private static final String DEFAULT_VERSION = "1.0";
|
|
||||||
private List<DnsResponseStrategy> dnsResponseStrategyList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建一个新的实例 DnsResponseStrategySource.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public DnsResponseStrategySource() {
|
|
||||||
super();
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
this.version=DEFAULT_VERSION;
|
|
||||||
}
|
|
||||||
public DnsResponseStrategySource(String version) {
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
this.version=version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return version
|
|
||||||
*/
|
|
||||||
public String getVersion() {
|
|
||||||
return version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param version 要设置的 version
|
|
||||||
*/
|
|
||||||
public void setVersion(String version) {
|
|
||||||
this.version = version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return operator
|
|
||||||
*/
|
|
||||||
public String getOperator() {
|
|
||||||
return operator;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param operator 要设置的 operator
|
|
||||||
*/
|
|
||||||
public void setOperator(String operator) {
|
|
||||||
this.operator = operator;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return opTime
|
|
||||||
*/
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param opTime 要设置的 opTime
|
|
||||||
*/
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return opAction
|
|
||||||
*/
|
|
||||||
public Integer getOpAction() {
|
|
||||||
return opAction;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param opAction 要设置的 opAction
|
|
||||||
*/
|
|
||||||
public void setOpAction(Integer opAction) {
|
|
||||||
this.opAction = opAction;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dnsResponseStrategyList
|
|
||||||
* @return dnsResponseStrategyList
|
|
||||||
*/
|
|
||||||
|
|
||||||
public List<DnsResponseStrategy> getDnsResponseStrategyList() {
|
|
||||||
return dnsResponseStrategyList;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param dnsResponseStrategyList the dnsResponseStrategyList to set
|
|
||||||
*/
|
|
||||||
public void setDnsResponseStrategyList(List<DnsResponseStrategy> dnsResponseStrategyList) {
|
|
||||||
this.dnsResponseStrategyList = dnsResponseStrategyList;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
import com.nis.domain.BaseEntity;
|
|
||||||
import com.nis.util.JsonDateSerializer;
|
|
||||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
public class EncryptProtoRandom extends BaseEntity<EncryptProtoRandom>{
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 9207461727413894109L;
|
|
||||||
@ApiModelProperty(value="序号", required=true)
|
|
||||||
private Long id;
|
|
||||||
@ApiModelProperty(value="比例值", required=true)
|
|
||||||
private Integer randomValue;
|
|
||||||
@ApiModelProperty(value="协议编号", required=true)
|
|
||||||
private Integer proto;
|
|
||||||
@ApiModelProperty(value="操作时间", required=true)
|
|
||||||
private Date opTime;
|
|
||||||
@ApiModelProperty(value="有效标志", required=true)
|
|
||||||
private Integer isValid;
|
|
||||||
private Long procSeq;
|
|
||||||
private Date lastUpdate;
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see com.nis.domain.BaseEntity#getId()
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Long getId() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return super.getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see com.nis.domain.BaseEntity#setId(java.lang.Long)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void setId(Long id) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.setId(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getRandomValue() {
|
|
||||||
return randomValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRandomValue(Integer randomValue) {
|
|
||||||
this.randomValue = randomValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getProto() {
|
|
||||||
return proto;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProto(Integer proto) {
|
|
||||||
this.proto = proto;
|
|
||||||
}
|
|
||||||
@JsonSerialize(using=JsonDateSerializer.class)
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getIsValid() {
|
|
||||||
return isValid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsValid(Integer isValid) {
|
|
||||||
this.isValid = isValid;
|
|
||||||
}
|
|
||||||
@JsonIgnore
|
|
||||||
public Long getProcSeq() {
|
|
||||||
return procSeq;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProcSeq(Long procSeq) {
|
|
||||||
this.procSeq = procSeq;
|
|
||||||
}
|
|
||||||
@JsonIgnore
|
|
||||||
public Date getLastUpdate() {
|
|
||||||
return lastUpdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLastUpdate(Date lastUpdate) {
|
|
||||||
this.lastUpdate = lastUpdate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,128 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: EncryptProtoRandomSource.java
|
|
||||||
*@Package com.nis.domain.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author dell
|
|
||||||
*@date 2016年9月27日 上午8:57:57
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: EncryptProtoRandomSource.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月27日 上午8:57:57
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public class EncryptProtoRandomSource extends ConfigCommonSource{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final long serialVersionUID = -4303849898919494205L;
|
|
||||||
private static final String DEFAULT_VERSION = "1.0";
|
|
||||||
private List<EncryptProtoRandom> encryptProtoRandomList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建一个新的实例 EncryptProtoRandomSource.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public EncryptProtoRandomSource() {
|
|
||||||
super();
|
|
||||||
this.version=DEFAULT_VERSION;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建一个新的实例 EncryptProtoRandomSource.
|
|
||||||
*
|
|
||||||
* @param encryptProtoRandomList
|
|
||||||
*/
|
|
||||||
public EncryptProtoRandomSource(List<EncryptProtoRandom> encryptProtoRandomList) {
|
|
||||||
this.encryptProtoRandomList = encryptProtoRandomList;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return version
|
|
||||||
*/
|
|
||||||
public String getVersion() {
|
|
||||||
return version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param version 要设置的 version
|
|
||||||
*/
|
|
||||||
public void setVersion(String version) {
|
|
||||||
this.version = version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return operator
|
|
||||||
*/
|
|
||||||
public String getOperator() {
|
|
||||||
return operator;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param operator 要设置的 operator
|
|
||||||
*/
|
|
||||||
public void setOperator(String operator) {
|
|
||||||
this.operator = operator;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return opTime
|
|
||||||
*/
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param opTime 要设置的 opTime
|
|
||||||
*/
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return opAction
|
|
||||||
*/
|
|
||||||
public Integer getOpAction() {
|
|
||||||
return opAction;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param opAction 要设置的 opAction
|
|
||||||
*/
|
|
||||||
public void setOpAction(Integer opAction) {
|
|
||||||
this.opAction = opAction;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* encryptProtoRandomList
|
|
||||||
* @return encryptProtoRandomList
|
|
||||||
*/
|
|
||||||
|
|
||||||
public List<EncryptProtoRandom> getEncryptProtoRandomList() {
|
|
||||||
return encryptProtoRandomList;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param encryptProtoRandomList the encryptProtoRandomList to set
|
|
||||||
*/
|
|
||||||
public void setEncryptProtoRandomList(List<EncryptProtoRandom> encryptProtoRandomList) {
|
|
||||||
this.encryptProtoRandomList = encryptProtoRandomList;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,182 +0,0 @@
|
|||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import com.nis.domain.BaseEntity;
|
|
||||||
|
|
||||||
public class FakeIpConfigCompile extends BaseEntity<FakeIpConfigCompile>{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final long serialVersionUID = -4840694519393346179L;
|
|
||||||
|
|
||||||
private Long compileId;
|
|
||||||
|
|
||||||
private Integer service;
|
|
||||||
|
|
||||||
private Integer action;
|
|
||||||
|
|
||||||
private Integer doBlacklist;
|
|
||||||
|
|
||||||
private Integer doLog;
|
|
||||||
|
|
||||||
private String effectiveRange;
|
|
||||||
|
|
||||||
private String userRegion;
|
|
||||||
|
|
||||||
private Integer isValid;
|
|
||||||
|
|
||||||
private Date opTime;
|
|
||||||
|
|
||||||
private Integer groupNum;
|
|
||||||
private Integer activeSys;
|
|
||||||
private Date lastUpdate;
|
|
||||||
private Long procSeq;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* activeSys
|
|
||||||
* @return activeSys
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Integer getActiveSys() {
|
|
||||||
return activeSys;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param activeSys the activeSys to set
|
|
||||||
*/
|
|
||||||
public void setActiveSys(Integer activeSys) {
|
|
||||||
this.activeSys = activeSys;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* lastUpdate
|
|
||||||
* @return lastUpdate
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Date getLastUpdate() {
|
|
||||||
return lastUpdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param lastUpdate the lastUpdate to set
|
|
||||||
*/
|
|
||||||
public void setLastUpdate(Date lastUpdate) {
|
|
||||||
this.lastUpdate = lastUpdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* procSeq
|
|
||||||
* @return procSeq
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Long getProcSeq() {
|
|
||||||
return procSeq;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param procSeq the procSeq to set
|
|
||||||
*/
|
|
||||||
public void setProcSeq(Long procSeq) {
|
|
||||||
this.procSeq = procSeq;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建一个新的实例 FakeIpConfigCompile.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public FakeIpConfigCompile() {
|
|
||||||
this.service=0;
|
|
||||||
this.doBlacklist=0;
|
|
||||||
this.doLog=0;
|
|
||||||
this.effectiveRange="0";
|
|
||||||
this.userRegion="0";
|
|
||||||
this.isValid=1;
|
|
||||||
this.opTime=new Date();
|
|
||||||
this.groupNum=1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getCompileId() {
|
|
||||||
return compileId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCompileId(Long compileId) {
|
|
||||||
this.compileId = compileId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getService() {
|
|
||||||
return service;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setService(Integer service) {
|
|
||||||
this.service = service;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getAction() {
|
|
||||||
return action;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAction(Integer action) {
|
|
||||||
this.action = action;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getDoBlacklist() {
|
|
||||||
return doBlacklist;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDoBlacklist(Integer doBlacklist) {
|
|
||||||
this.doBlacklist = doBlacklist;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getDoLog() {
|
|
||||||
return doLog;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDoLog(Integer doLog) {
|
|
||||||
this.doLog = doLog;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEffectiveRange() {
|
|
||||||
return effectiveRange;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEffectiveRange(String effectiveRange) {
|
|
||||||
this.effectiveRange = effectiveRange;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUserRegion() {
|
|
||||||
return userRegion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserRegion(String userRegion) {
|
|
||||||
this.userRegion = userRegion == null ? null : userRegion.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getIsValid() {
|
|
||||||
return isValid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsValid(Integer isValid) {
|
|
||||||
this.isValid = isValid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getGroupNum() {
|
|
||||||
return groupNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGroupNum(Integer groupNum) {
|
|
||||||
this.groupNum = groupNum;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import com.nis.domain.BaseEntity;
|
|
||||||
|
|
||||||
public class FakeIpConfigGroup extends BaseEntity<FakeIpConfigGroup>{
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 2903914645692214990L;
|
|
||||||
|
|
||||||
private Integer groupId;
|
|
||||||
|
|
||||||
private Long compileId;
|
|
||||||
|
|
||||||
private Integer isValid;
|
|
||||||
|
|
||||||
private Date opTime;
|
|
||||||
private Date lastUpdate;
|
|
||||||
private Long procSeq;
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* id
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param id the id to set
|
|
||||||
*/
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* lastUpdate
|
|
||||||
* @return lastUpdate
|
|
||||||
*/
|
|
||||||
public Date getLastUpdate() {
|
|
||||||
return lastUpdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param lastUpdate the lastUpdate to set
|
|
||||||
*/
|
|
||||||
public void setLastUpdate(Date lastUpdate) {
|
|
||||||
this.lastUpdate = lastUpdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* procSeq
|
|
||||||
* @return procSeq
|
|
||||||
*/
|
|
||||||
public Long getProcSeq() {
|
|
||||||
return procSeq;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param procSeq the procSeq to set
|
|
||||||
*/
|
|
||||||
public void setProcSeq(Long procSeq) {
|
|
||||||
this.procSeq = procSeq;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建一个新的实例 FakeIpConfigGroup.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public FakeIpConfigGroup() {
|
|
||||||
this.isValid=1;
|
|
||||||
this.opTime=new Date();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getGroupId() {
|
|
||||||
return groupId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGroupId(Integer groupId) {
|
|
||||||
this.groupId = groupId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getCompileId() {
|
|
||||||
return compileId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCompileId(Long compileId) {
|
|
||||||
this.compileId = compileId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getIsValid() {
|
|
||||||
return isValid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsValid(Integer isValid) {
|
|
||||||
this.isValid = isValid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
import com.nis.domain.BaseEntity;
|
|
||||||
import com.nis.util.JsonDateSerializer;
|
|
||||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @ClassName: FwqInfo.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月9日 上午9:14:52
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public class FwqInfo extends BaseEntity<FwqInfo>{
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final long serialVersionUID = -7679262194839780624L;
|
|
||||||
@ApiModelProperty(value="配置ID", required=true)
|
|
||||||
private Long id;
|
|
||||||
@ApiModelProperty(value="服务器名称", required=true)
|
|
||||||
private String name;
|
|
||||||
@ApiModelProperty(value="国际出入口编号", required=true)
|
|
||||||
private Long entranceId;
|
|
||||||
@ApiModelProperty(value="操作员", required=true)
|
|
||||||
private Long czyid;
|
|
||||||
@ApiModelProperty(value="操作时间", required=true)
|
|
||||||
private Date opTime;
|
|
||||||
private Date lastUpdate;
|
|
||||||
private Long procSeq;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* lastUpdate
|
|
||||||
* @return lastUpdate
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public Date getLastUpdate() {
|
|
||||||
return lastUpdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param lastUpdate the lastUpdate to set
|
|
||||||
*/
|
|
||||||
public void setLastUpdate(Date lastUpdate) {
|
|
||||||
this.lastUpdate = lastUpdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* procSeq
|
|
||||||
* @return procSeq
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public Long getProcSeq() {
|
|
||||||
return procSeq;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param procSeq the procSeq to set
|
|
||||||
*/
|
|
||||||
public void setProcSeq(Long procSeq) {
|
|
||||||
this.procSeq = procSeq;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name == null ? null : name.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getEntranceId() {
|
|
||||||
return entranceId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEntranceId(Long entranceId) {
|
|
||||||
this.entranceId = entranceId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getCzyid() {
|
|
||||||
return czyid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCzyid(Long czyid) {
|
|
||||||
this.czyid = czyid;
|
|
||||||
}
|
|
||||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
|
||||||
@JsonSerialize(using=JsonDateSerializer.class)
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: FwqInfoSource.java
|
|
||||||
*@Package com.nis.domain.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author dell
|
|
||||||
*@date 2016年9月9日 上午9:53:04
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: FwqInfoSource.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月9日 上午9:53:04
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public class FwqInfoSource extends ConfigCommonSource{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 262835095511967504L;
|
|
||||||
private static final String DEFAULT_VERSION = "1.0";
|
|
||||||
private List<FwqInfo> fwqInfoList;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建一个新的实例 FwqInfoSource.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public FwqInfoSource() {
|
|
||||||
super();
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
this.version=DEFAULT_VERSION;
|
|
||||||
}
|
|
||||||
public FwqInfoSource(String version) {
|
|
||||||
this.version=version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return version
|
|
||||||
*/
|
|
||||||
public String getVersion() {
|
|
||||||
return version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param version 要设置的 version
|
|
||||||
*/
|
|
||||||
public void setVersion(String version) {
|
|
||||||
this.version = version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return operator
|
|
||||||
*/
|
|
||||||
public String getOperator() {
|
|
||||||
return operator;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param operator 要设置的 operator
|
|
||||||
*/
|
|
||||||
public void setOperator(String operator) {
|
|
||||||
this.operator = operator;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return opTime
|
|
||||||
*/
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param opTime 要设置的 opTime
|
|
||||||
*/
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return opAction
|
|
||||||
*/
|
|
||||||
public Integer getOpAction() {
|
|
||||||
return opAction;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param opAction 要设置的 opAction
|
|
||||||
*/
|
|
||||||
public void setOpAction(Integer opAction) {
|
|
||||||
this.opAction = opAction;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* fwqInfoList
|
|
||||||
* @return fwqInfoList
|
|
||||||
*/
|
|
||||||
|
|
||||||
public List<FwqInfo> getFwqInfoList() {
|
|
||||||
return fwqInfoList;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param fwqInfoList the fwqInfoList to set
|
|
||||||
*/
|
|
||||||
public void setFwqInfoList(List<FwqInfo> fwqInfoList) {
|
|
||||||
this.fwqInfoList = fwqInfoList;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
/**
|
|
||||||
* @Title: StrRegion.java
|
|
||||||
* @Package com.nis.domain.restful
|
|
||||||
* @Description: TODO(用一句话描述该文件做什么)
|
|
||||||
* @author (darnell)
|
|
||||||
* @date 2016年8月29日 下午10:29:45
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: StrRegion
|
|
||||||
* @Description: TODO(这里用一句话描述这个类的作用)
|
|
||||||
* @author (darnell)
|
|
||||||
* @date 2016年8月29日 下午10:29:45
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public class IpRegionTest extends IpRegion {
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 5051062513980968866L;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,131 +0,0 @@
|
|||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
import com.nis.domain.BaseEntity;
|
|
||||||
import com.nis.util.JsonDateSerializer;
|
|
||||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @ClassName: JdjInfo.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月9日 上午9:17:52
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public class JdjInfo extends BaseEntity<JdjInfo>{
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1972462456394453087L;
|
|
||||||
@ApiModelProperty(value="配置ID", required=true)
|
|
||||||
private Long id;
|
|
||||||
@ApiModelProperty(value="节点机名称", required=true)
|
|
||||||
private String name;
|
|
||||||
@ApiModelProperty(value="服务器ID", required=true)
|
|
||||||
private Long fwqId;
|
|
||||||
@ApiModelProperty(value="监测IP", required=true)
|
|
||||||
private String jcIp;
|
|
||||||
@ApiModelProperty(value="封堵IP", required=true)
|
|
||||||
private String fdIp;
|
|
||||||
@ApiModelProperty(value="操作员", required=true)
|
|
||||||
private Long czyid;
|
|
||||||
@ApiModelProperty(value="操作时间", required=true)
|
|
||||||
private Date opTime;
|
|
||||||
private Date lastUpdate;
|
|
||||||
private Long procSeq;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* lastUpdate
|
|
||||||
* @return lastUpdate
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public Date getLastUpdate() {
|
|
||||||
return lastUpdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param lastUpdate the lastUpdate to set
|
|
||||||
*/
|
|
||||||
public void setLastUpdate(Date lastUpdate) {
|
|
||||||
this.lastUpdate = lastUpdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* procSeq
|
|
||||||
* @return procSeq
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
|
||||||
public Long getProcSeq() {
|
|
||||||
return procSeq;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param procSeq the procSeq to set
|
|
||||||
*/
|
|
||||||
public void setProcSeq(Long procSeq) {
|
|
||||||
this.procSeq = procSeq;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name == null ? null : name.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getFwqId() {
|
|
||||||
return fwqId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFwqId(Long fwqId) {
|
|
||||||
this.fwqId = fwqId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getJcIp() {
|
|
||||||
return jcIp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setJcIp(String jcIp) {
|
|
||||||
this.jcIp = jcIp == null ? null : jcIp.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFdIp() {
|
|
||||||
return fdIp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFdIp(String fdIp) {
|
|
||||||
this.fdIp = fdIp == null ? null : fdIp.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getCzyid() {
|
|
||||||
return czyid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCzyid(Long czyid) {
|
|
||||||
this.czyid = czyid;
|
|
||||||
}
|
|
||||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
|
||||||
@JsonSerialize(using=JsonDateSerializer.class)
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: JdjInfoSource.java
|
|
||||||
*@Package com.nis.domain.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author dell
|
|
||||||
*@date 2016年9月9日 上午9:53:04
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: JdjInfoSource.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月9日 上午9:53:04
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public class JdjInfoSource extends ConfigCommonSource{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 262835095511967504L;
|
|
||||||
private static final String DEFAULT_VERSION = "1.0";
|
|
||||||
private List<JdjInfo> jdjInfoList;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建一个新的实例 JdjInfoSource.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public JdjInfoSource() {
|
|
||||||
super();
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
this.version=DEFAULT_VERSION;
|
|
||||||
}
|
|
||||||
public JdjInfoSource(String version) {
|
|
||||||
this.version=version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return version
|
|
||||||
*/
|
|
||||||
public String getVersion() {
|
|
||||||
return version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param version 要设置的 version
|
|
||||||
*/
|
|
||||||
public void setVersion(String version) {
|
|
||||||
this.version = version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return operator
|
|
||||||
*/
|
|
||||||
public String getOperator() {
|
|
||||||
return operator;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param operator 要设置的 operator
|
|
||||||
*/
|
|
||||||
public void setOperator(String operator) {
|
|
||||||
this.operator = operator;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return opTime
|
|
||||||
*/
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param opTime 要设置的 opTime
|
|
||||||
*/
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return opAction
|
|
||||||
*/
|
|
||||||
public Integer getOpAction() {
|
|
||||||
return opAction;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param opAction 要设置的 opAction
|
|
||||||
*/
|
|
||||||
public void setOpAction(Integer opAction) {
|
|
||||||
this.opAction = opAction;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* jdjInfoList
|
|
||||||
* @return jdjInfoList
|
|
||||||
*/
|
|
||||||
|
|
||||||
public List<JdjInfo> getJdjInfoList() {
|
|
||||||
return jdjInfoList;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param jdjInfoList the jdjInfoList to set
|
|
||||||
*/
|
|
||||||
public void setJdjInfoList(List<JdjInfo> jdjInfoList) {
|
|
||||||
this.jdjInfoList = jdjInfoList;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
/**
|
|
||||||
* @Title: NumRegion.java
|
|
||||||
* @Package com.nis.domain.restful
|
|
||||||
* @Description: TODO(用一句话描述该文件做什么)
|
|
||||||
* @author (darnell)
|
|
||||||
* @date 2016年8月29日 下午10:46:00
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
package com.nis.domain.restful;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: NumRegion
|
|
||||||
* @Description: TODO(这里用一句话描述这个类的作用)
|
|
||||||
* @author (darnell)
|
|
||||||
* @date 2016年8月29日 下午10:46:00
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
public class NumRegionTest extends NumRegion{
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 8992364895523569799L;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -32,8 +32,7 @@ public enum RestBusinessCode {
|
|||||||
/**
|
/**
|
||||||
* 操作行为错误,1-插入2-更新 3-删除4-查询 ,插入时选择了删除这种错误返回该异常代码
|
* 操作行为错误,1-插入2-更新 3-删除4-查询 ,插入时选择了删除这种错误返回该异常代码
|
||||||
*/
|
*/
|
||||||
|
op_action_error (4002000,"不正确的操作行为"),
|
||||||
op_action_error (1003,"不正确的操作行为"),
|
|
||||||
|
|
||||||
config_integrity_error (1004,"配置完整性错误或数据格式错误"),
|
config_integrity_error (1004,"配置完整性错误或数据格式错误"),
|
||||||
|
|
||||||
@@ -79,11 +78,11 @@ public enum RestBusinessCode {
|
|||||||
ActionIsNull(4001004, "Maat配置的action不能为空"),
|
ActionIsNull(4001004, "Maat配置的action不能为空"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编译配置的的compileId不能为空
|
* 编译配置的doBlacklist不能为空
|
||||||
*/
|
*/
|
||||||
DoBlacklistIsNull(4001005, "Maat配置的doBlacklist不能为空"),
|
DoBlacklistIsNull(4001005, "Maat配置的doBlacklist不能为空"),
|
||||||
/**
|
/**
|
||||||
* 编译配置的的compileId不能为空
|
* 编译配置的的doBlacklist不在有效范围
|
||||||
*/
|
*/
|
||||||
DoBlacklistIsWrongRange(4001006, "Maat配置的doBlacklist的值不在有效范围"),
|
DoBlacklistIsWrongRange(4001006, "Maat配置的doBlacklist的值不在有效范围"),
|
||||||
|
|
||||||
@@ -92,7 +91,7 @@ public enum RestBusinessCode {
|
|||||||
*/
|
*/
|
||||||
DoLogIsNull(4001007, "Maat编译配置的doLog不能为空"),
|
DoLogIsNull(4001007, "Maat编译配置的doLog不能为空"),
|
||||||
/**
|
/**
|
||||||
* 编译配置的的doLog不能为空
|
* 编译配置的的doLog不在有效范围
|
||||||
*/
|
*/
|
||||||
DoLogIsWrongRange(4001008, "Maat配置的doLog的值不在有效范围"),
|
DoLogIsWrongRange(4001008, "Maat配置的doLog的值不在有效范围"),
|
||||||
/**
|
/**
|
||||||
@@ -155,9 +154,9 @@ public enum RestBusinessCode {
|
|||||||
// GroupsOpTimeIsNull(400137, "编译配置的的配置分组的opTime不能为空"),
|
// GroupsOpTimeIsNull(400137, "编译配置的的配置分组的opTime不能为空"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 域配置的groupid在配置分组关系中不存在
|
* 域配置的groupId在配置分组关系中不存在
|
||||||
*/
|
*/
|
||||||
RegionsGroupIdIsNotFound(4001103, "域配置的groupid在配置分组关系中不存在"),
|
RegionsGroupIdIsNotFound(4001103, "域配置的groupId在配置分组关系中不存在"),
|
||||||
/**
|
/**
|
||||||
*域配置的regionId不能为空
|
*域配置的regionId不能为空
|
||||||
*/
|
*/
|
||||||
@@ -252,7 +251,7 @@ public enum RestBusinessCode {
|
|||||||
/**
|
/**
|
||||||
* 字符串类域配置的exprType不能为空
|
* 字符串类域配置的exprType不能为空
|
||||||
*/
|
*/
|
||||||
ExprTypeIsNull(4001403,"字符串类域配置的keywords不能为空"),
|
ExprTypeIsNull(4001403,"字符串类域配置的exprType不能为空"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字符串类域配置的matchMethod不能为空
|
* 字符串类域配置的matchMethod不能为空
|
||||||
@@ -356,12 +355,12 @@ public enum RestBusinessCode {
|
|||||||
IsValidNonUniq(4002011, "状态更新操作,所有配置的isValid值必须相同"),
|
IsValidNonUniq(4002011, "状态更新操作,所有配置的isValid值必须相同"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配置分组中同一groupId出现多次
|
* 配置分组中同一groupId不能重复出现多次
|
||||||
*/
|
*/
|
||||||
GroupIdIsRepeat(4002100,"Maat配置分组groupId不能重复"),
|
GroupIdIsRepeat(4002100,"Maat配置分组中groupId不能重复出现多次"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tableName与编译配置业务类型不一致
|
* 当前编译配置service与域配置tableName的关系不存在
|
||||||
*/
|
*/
|
||||||
TableNameUnmatchService(4002101, "当前编译配置service与域配置tableName的关系不存在"),
|
TableNameUnmatchService(4002101, "当前编译配置service与域配置tableName的关系不存在"),
|
||||||
|
|
||||||
@@ -374,14 +373,14 @@ public enum RestBusinessCode {
|
|||||||
*/
|
*/
|
||||||
UpBoundaryIsWrongRange(4002201, "数值域-配置upBoundary值不在有效范围内"),
|
UpBoundaryIsWrongRange(4002201, "数值域-配置upBoundary值不在有效范围内"),
|
||||||
/**
|
/**
|
||||||
*数值域配置的lowBoundary大于upBoundary值
|
*数值域-配置lowBoundary必须小于upBoundary
|
||||||
*/
|
*/
|
||||||
LowBoundaryGTUpBoundary(4002202, "数值域-配置lowBoundary必须小于upBoundary"),
|
LowBoundaryGTUpBoundary(4002202, "数值域-配置lowBoundary必须小于upBoundary"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IP类域配置的direction的值不在有效范围
|
* IP类域配置的direction的值不在有效范围,只能是0或1
|
||||||
*/
|
*/
|
||||||
DirectionIsWrongRange(4002300,"IP类域-direction的值只能是0或1"),
|
DirectionIsWrongRange(4002300,"IP类域-direction的值不在有效范围,只能是0或1"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IP类域配置的IP或IpMask与addrType不一致
|
* IP类域配置的IP或IpMask与addrType不一致
|
||||||
@@ -423,20 +422,20 @@ public enum RestBusinessCode {
|
|||||||
ServiceIsWrong(4002600,"service的值配置不正确"),
|
ServiceIsWrong(4002600,"service的值配置不正确"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 回调类ipType属性只能为4(IPV4)、6(IPV6)
|
* 回调类-ipType属性值不在有效范围
|
||||||
*/
|
*/
|
||||||
IpTypeIsWrong(4002601,"ipType属性只能为4(IPV4)、6(IPV6)"),
|
IpTypeIsWrong(4002601,"回调类-ipType属性值不在有效范围"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 回调类的XX属性不是数值类型
|
* 回调类的XX属性不是数值类型
|
||||||
*/
|
*/
|
||||||
MastNumberic(4002602,"属性值不是数值类型"),
|
MastNumberic(4002602,"属性值不是数值类型"),
|
||||||
/**
|
/**
|
||||||
* 回调类的XX属性不是数值类型
|
* 回调类的XX属性不是日期类型或不是规范的日期串
|
||||||
*/
|
*/
|
||||||
MastDate(4002602,"属性值不是日期类型"),
|
MastDate(4002602,"属性值不是日期类型或不是规范的日期串"),
|
||||||
/**
|
/**
|
||||||
* 回调类的XX属性不是数值类型
|
* 回调类的IP或Mask与addrType不一致
|
||||||
*/
|
*/
|
||||||
IpIsUnMatchType(4002603,"配置IP或Mask与addrType不一致"),
|
IpIsUnMatchType(4002603,"配置IP或Mask与addrType不一致"),
|
||||||
/**
|
/**
|
||||||
@@ -575,22 +574,9 @@ public enum RestBusinessCode {
|
|||||||
* 状态更新操作中更新内容Map不能为空
|
* 状态更新操作中更新内容Map不能为空
|
||||||
*/
|
*/
|
||||||
ConfigInfoMapIsNull(5004005,"状态更新操作中更新内容Map不能为空"),
|
ConfigInfoMapIsNull(5004005,"状态更新操作中更新内容Map不能为空"),
|
||||||
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private final int value; //错误码
|
private final int value; //错误码
|
||||||
private final String errorReason; //错误原因
|
private final String errorReason; //错误原因
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -63,43 +63,43 @@ public class ConfigSourcesController extends BaseRestController {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
ConfigRedisService configRedisService;
|
ConfigRedisService configRedisService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping(value = "/cfg/v1/configSources", method = RequestMethod.POST)
|
@RequestMapping(value = "/cfg/v1/configSources", method = RequestMethod.POST)
|
||||||
@ApiOperation(value = "MAAT规则存储接口", httpMethod = "POST", response = Map.class, notes = "接收MAAT规则数据,存储到流量处理平台配置线中")
|
@ApiOperation(value = "MAAT规则存储接口", httpMethod = "POST", response = Map.class, notes = "接收MAAT规则数据,存储到流量处理平台配置线中")
|
||||||
@ApiParam(value = "MAAT规则对象", name = "configSource", required = true)
|
@ApiParam(value = "MAAT规则对象", name = "configSource", required = true)
|
||||||
public Map createMaatConfigSource(@RequestBody ConfigSource configSource, HttpServletRequest request,
|
public Map createMaatConfigSource(@RequestBody ConfigSource configSource, HttpServletRequest request,
|
||||||
HttpServletResponse response) {
|
HttpServletResponse response) {
|
||||||
CompileVal.setBusinessCode(null);
|
|
||||||
ConfigSourcesService.setMsgList(new ArrayList<Exception>());// 清除上次记录的日志信息
|
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
|
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
|
||||||
configSource);
|
configSource);
|
||||||
|
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
if (null != configSource && null != configSource.getConfigCompileList()
|
try {
|
||||||
&& configSource.getConfigCompileList().size() > 0) {
|
if (null != configSource && null != configSource.getConfigCompileList()
|
||||||
checkOpAction(thread, System.currentTimeMillis() - start, configSource.getOpAction(), Constants.OPACTION_POST);
|
&& configSource.getConfigCompileList().size() > 0) {
|
||||||
// 验证配置编译数据
|
checkOpAction(thread, System.currentTimeMillis() - start, configSource.getOpAction(), Constants.OPACTION_POST);
|
||||||
validateConfigSource(thread, start, configSource);
|
// 验证配置编译数据
|
||||||
String msg = configSourcesService.saveMaatConfig(thread, start, configSource.getConfigCompileList(), sb);
|
validateConfigSource(thread, start, configSource);
|
||||||
|
configSourcesService.saveMaatConfig(thread, start, configSource.getConfigCompileList(), sb);
|
||||||
if ("error".equals(msg)) {
|
} else {
|
||||||
Exception exception = ConfigSourcesService.getMsgList().get(0);
|
throw new RestServiceException("Maat规则不能为空",
|
||||||
if (exception instanceof RestServiceException) {
|
RestBusinessCode.ConfigSourceIsNull.getValue());
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start,
|
|
||||||
"Maat 规则存储异常:" + exception.getMessage(), CompileVal.getBusinessCode());
|
|
||||||
}else{
|
|
||||||
throw new ServiceRuntimeException(thread, System.currentTimeMillis() - start,
|
|
||||||
"Maat 规则存储异常:" + exception.getMessage(), CompileVal.getBusinessCode());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} catch (Exception e) {
|
||||||
thread.setExceptionInfo("Maat规则不能为空");
|
// TODO: handle exception
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "Maat规则不能为空",
|
thread.setExceptionInfo("Maat 规则存储异常:" + e.getMessage());
|
||||||
RestBusinessCode.missing_args.getValue());
|
if (e instanceof RestServiceException) {
|
||||||
|
throw new RestServiceException(thread, System.currentTimeMillis() - start,
|
||||||
|
"Maat 规则存储异常:" + e.getMessage(), ((RestServiceException) e).getErrorCode());
|
||||||
|
}else if(e instanceof ServiceRuntimeException) {
|
||||||
|
throw new ServiceRuntimeException(thread, System.currentTimeMillis() - start,
|
||||||
|
"Maat 规则存储异常:" + e.getMessage(), ((ServiceRuntimeException) e).getErrorCode());
|
||||||
|
}else{
|
||||||
|
throw new ServiceRuntimeException(thread, System.currentTimeMillis() - start,
|
||||||
|
"Maat 规则存储异常:" + e.getMessage(), RestBusinessCode.service_runtime_error.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response,
|
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response,
|
||||||
@@ -111,171 +111,44 @@ public class ConfigSourcesController extends BaseRestController {
|
|||||||
@ApiParam(value = "MAAT规则对象", name = "configSource", required = true)
|
@ApiParam(value = "MAAT规则对象", name = "configSource", required = true)
|
||||||
public Map updateConfigSource(@RequestBody ConfigSource configSource, HttpServletRequest request,
|
public Map updateConfigSource(@RequestBody ConfigSource configSource, HttpServletRequest request,
|
||||||
HttpServletResponse response) {
|
HttpServletResponse response) {
|
||||||
CompileVal.setBusinessCode(null);
|
|
||||||
ConfigSourcesService.setMsgList(new ArrayList<Exception>());// 清除上次记录的日志信息
|
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_PUT, request,
|
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_PUT, request,
|
||||||
configSource);
|
configSource);
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
if (null == configSource.getOpTime()) {
|
try {
|
||||||
configSource.setOpTime(new Date());
|
if (null == configSource.getOpTime()) {
|
||||||
}
|
configSource.setOpTime(new Date());
|
||||||
if (null != configSource && null != configSource.getConfigCompileList()
|
}
|
||||||
&& configSource.getConfigCompileList().size() > 0) {
|
if (null != configSource && null != configSource.getConfigCompileList()
|
||||||
int opAction = configSource.getOpAction();
|
&& configSource.getConfigCompileList().size() > 0) {
|
||||||
checkOpAction(thread, System.currentTimeMillis() - start, opAction, 2);
|
int opAction = configSource.getOpAction();
|
||||||
String msg = "";
|
checkOpAction(thread, System.currentTimeMillis() - start, opAction, 2);
|
||||||
ConfigCompile compile = configSource.getConfigCompileList().get(0);
|
configSourcesService.updateConfigSources(thread, start, configSource.getConfigCompileList(),
|
||||||
// zdx 20180528改为调用rkg接口取消配置
|
configSource.getOpTime(), sb);
|
||||||
msg = configSourcesService.updateConfigSources(thread, start, configSource.getConfigCompileList(),
|
|
||||||
configSource.getOpTime(), sb);
|
} else {
|
||||||
|
throw new RestServiceException("Maat规则不能为空" + sb.toString(),
|
||||||
if (msg.equals("error")) {
|
RestBusinessCode.ConfigSourceIsNull.getValue());
|
||||||
Exception exception = ConfigSourcesService.getMsgList().get(0);
|
}
|
||||||
if (exception instanceof RestServiceException) {
|
} catch (Exception e) {
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start,
|
// TODO: handle exception
|
||||||
"MAAT规则状态更新时出现异常:" + exception.getMessage(),CompileVal.getBusinessCode());
|
thread.setExceptionInfo("MAAT规则状态更新时出现异常:" + e.getMessage());
|
||||||
}else {
|
if (e instanceof RestServiceException) {
|
||||||
throw new ServiceRuntimeException(thread, System.currentTimeMillis() - start,
|
throw new RestServiceException(thread, System.currentTimeMillis() - start,
|
||||||
"MAAT规则状态更新时出现异常:" + exception.getMessage(),CompileVal.getBusinessCode());
|
"MAAT规则状态更新时出现异常:" + e.getMessage(), ((RestServiceException) e).getErrorCode());
|
||||||
}
|
}else if(e instanceof ServiceRuntimeException) {
|
||||||
|
throw new ServiceRuntimeException(thread, System.currentTimeMillis() - start,
|
||||||
|
"MAAT规则状态更新时出现异常:" + e.getMessage(), ((ServiceRuntimeException) e).getErrorCode());
|
||||||
|
}else{
|
||||||
|
throw new ServiceRuntimeException(thread, System.currentTimeMillis() - start,
|
||||||
|
"MAAT规则状态更新时出现异常:" + e.getMessage(), RestBusinessCode.service_runtime_error.getValue());
|
||||||
}
|
}
|
||||||
// configSourcesService.updateConfigSource(thread, start,
|
|
||||||
// configSource.getConfigCompileList(),
|
|
||||||
// configSource.getOpTime(), sb);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
thread.setExceptionInfo("Maat规则不能为空");
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "Maat规则不能为空" + sb.toString(),
|
|
||||||
RestBusinessCode.missing_args.getValue());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response,
|
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response,
|
||||||
"Maat规则状态更新成功" + sb.toString(), Constants.IS_DEBUG ? configSource : null);
|
"Maat规则状态更新成功" + sb.toString(), Constants.IS_DEBUG ? configSource : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/cfg/v1/configModifySources", method = RequestMethod.PUT)
|
|
||||||
@ApiOperation(value = "MAAT规则修改接口", httpMethod = "PUT", response = Map.class, notes = "接收Maat规则,对其规则内容进行修改")
|
|
||||||
@ApiParam(value = "MAAT规则对象", name = "configSource", required = true)
|
|
||||||
public Map configModifySources(@RequestBody ConfigSource configSource, HttpServletRequest request,
|
|
||||||
HttpServletResponse response) {
|
|
||||||
ConfigSourcesService.setMsgList(new ArrayList<Exception>());// 清除上次记录的日志信息
|
|
||||||
long start = System.currentTimeMillis();
|
|
||||||
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_PUT, request,
|
|
||||||
configSource);
|
|
||||||
StringBuffer sb = new StringBuffer();
|
|
||||||
if (null != configSource && null != configSource.getConfigCompileList()
|
|
||||||
&& configSource.getConfigCompileList().size() > 0) {
|
|
||||||
int opAction = configSource.getOpAction();
|
|
||||||
checkOpAction(thread, System.currentTimeMillis() - start, opAction, 2);
|
|
||||||
// 验证配置编译数据
|
|
||||||
validateConfigSource(thread, start, configSource);
|
|
||||||
try {
|
|
||||||
List<ConfigCompile> configCompileList = configSource.getConfigCompileList();
|
|
||||||
if (null != configCompileList && configCompileList.size() > 0) {
|
|
||||||
int count = 0;
|
|
||||||
for (ConfigCompile configCompile : configCompileList) {
|
|
||||||
Long compileId = configCompile.getCompileId();
|
|
||||||
if (null == compileId) {
|
|
||||||
thread.setExceptionInfo("编译配置id不能为空");
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "编译配置id不能为空",
|
|
||||||
RestBusinessCode.missing_args.getValue());
|
|
||||||
}
|
|
||||||
// if ((configCompile.getActiveSys() != null) ||
|
|
||||||
// (configCompile.getEffectiveRange() != null
|
|
||||||
// && !configCompile.getEffectiveRange().equals(""))) {
|
|
||||||
// count++;
|
|
||||||
// configSourcesService.setCompileInvalid(configCompile);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
if (count > 0) {
|
|
||||||
Thread.sleep(14000);
|
|
||||||
}
|
|
||||||
String str = configSourcesService.configModifySources(configCompileList);
|
|
||||||
if (str.equals("idIsNull")) {
|
|
||||||
thread.setExceptionInfo("编译配置id不能为空");
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "编译配置id不能为空",
|
|
||||||
RestBusinessCode.missing_args.getValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
thread.setExceptionInfo("编译配置数据不能为空");
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "编译配置数据不能为空",
|
|
||||||
RestBusinessCode.missing_args.getValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
List<ConfigCompile> configCompileList = configSource.getConfigCompileList();
|
|
||||||
if (null != configCompileList && configCompileList.size() > 0) {
|
|
||||||
for (ConfigCompile configCompile : configCompileList) {
|
|
||||||
Long compileId = configCompile.getCompileId();
|
|
||||||
if (null == compileId) {
|
|
||||||
thread.setExceptionInfo("编译配置id不能为空");
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "编译配置id不能为空",
|
|
||||||
RestBusinessCode.missing_args.getValue());
|
|
||||||
}
|
|
||||||
// if ((configCompile.getActiveSys() != null) ||
|
|
||||||
// (configCompile.getEffectiveRange() != null
|
|
||||||
// && !configCompile.getEffectiveRange().equals(""))) {
|
|
||||||
// try {
|
|
||||||
// configSourcesService.setCompileValid(configCompile);
|
|
||||||
// } catch (Exception e1) {
|
|
||||||
// String errorCode = "";
|
|
||||||
// String message = e.getMessage();
|
|
||||||
// if (null != message && message.length() > 0) {
|
|
||||||
// int index = message.toUpperCase().indexOf("ORA-");
|
|
||||||
// if (index != -1) {
|
|
||||||
// errorCode = message.substring(index + 4, index + 9);
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// Map<Integer, String> throwExceptionInfo = OracleErrorCodeUtil
|
|
||||||
// .throwExceptionInfo(errorCode);
|
|
||||||
// for (int errorNum : throwExceptionInfo.keySet()) {
|
|
||||||
// if (errorNum == 998) {
|
|
||||||
// thread.setExceptionInfo(e.toString());
|
|
||||||
// } else {
|
|
||||||
// thread.setExceptionInfo(throwExceptionInfo.get(errorNum));
|
|
||||||
// }
|
|
||||||
// throw new RestServiceException(thread, System.currentTimeMillis() - start,
|
|
||||||
// throwExceptionInfo.get(errorNum), errorNum);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String errorCode = "";
|
|
||||||
String message = e.getMessage();
|
|
||||||
if (null != message && message.length() > 0) {
|
|
||||||
int index = message.toUpperCase().indexOf("ORA-");
|
|
||||||
if (index != -1) {
|
|
||||||
errorCode = message.substring(index + 4, index + 9);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Map<Integer, String> throwExceptionInfo = OracleErrorCodeUtil.throwExceptionInfo(errorCode);
|
|
||||||
for (int errorNum : throwExceptionInfo.keySet()) {
|
|
||||||
if (errorNum == 998) {
|
|
||||||
thread.setExceptionInfo(e.toString());
|
|
||||||
} else {
|
|
||||||
thread.setExceptionInfo(throwExceptionInfo.get(errorNum));
|
|
||||||
}
|
|
||||||
throw new ServiceRuntimeException(thread, System.currentTimeMillis() - start,
|
|
||||||
throwExceptionInfo.get(errorNum), errorNum);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
thread.setExceptionInfo("编译配置数据不能为空");
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "编译配置数据不能为空",
|
|
||||||
RestBusinessCode.missing_args.getValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response,
|
|
||||||
"修改编译配置数据成功" + sb.toString(), Constants.IS_DEBUG ? configSource : null);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void validateConfigSource(AuditLogThread thread, long start, ConfigSource configSource) {
|
private void validateConfigSource(AuditLogThread thread, long start, ConfigSource configSource) {
|
||||||
String errorInfo = "";
|
String errorInfo = "";
|
||||||
|
|
||||||
@@ -294,7 +167,7 @@ public class ConfigSourcesController extends BaseRestController {
|
|||||||
|
|
||||||
if (configCompileList.size() <= 0) {
|
if (configCompileList.size() <= 0) {
|
||||||
errorInfo = "Maat规则不能为空";
|
errorInfo = "Maat规则不能为空";
|
||||||
}
|
}
|
||||||
if (!errorInfo.equals("")) {
|
if (!errorInfo.equals("")) {
|
||||||
thread.setExceptionInfo(errorInfo);
|
thread.setExceptionInfo(errorInfo);
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, errorInfo,
|
throw new RestServiceException(thread, System.currentTimeMillis() - start, errorInfo,
|
||||||
@@ -307,24 +180,27 @@ public class ConfigSourcesController extends BaseRestController {
|
|||||||
@ApiOperation(value = "回调(通用)规则存储接口", httpMethod = "POST", response = Map.class, notes = "接收回调规则数据,格式为结构化行列式JSON,存储到流量处理平台配置线中")
|
@ApiOperation(value = "回调(通用)规则存储接口", httpMethod = "POST", response = Map.class, notes = "接收回调规则数据,格式为结构化行列式JSON,存储到流量处理平台配置线中")
|
||||||
public Map createCommonConfigSource(@RequestBody String jsonString, HttpServletRequest request,
|
public Map createCommonConfigSource(@RequestBody String jsonString, HttpServletRequest request,
|
||||||
HttpServletResponse response) {
|
HttpServletResponse response) {
|
||||||
CompileVal.setBusinessCode(null);
|
|
||||||
ConfigSourcesService.setMsgList(new ArrayList<Exception>());// 清除上次记录的日志信息
|
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
|
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
|
||||||
null);
|
null);
|
||||||
|
|
||||||
String msg = configSourcesService.saveCommonSources(thread, start, jsonString);
|
try {
|
||||||
if (msg.equals("error")) {
|
configSourcesService.saveCommonSources(thread, start, jsonString);
|
||||||
Exception exception = ConfigSourcesService.getMsgList().get(0);
|
} catch (Exception e) {
|
||||||
if (exception instanceof RestServiceException) {
|
// TODO: handle exception
|
||||||
|
thread.setExceptionInfo("回调规则存储异常:" + e.getMessage());
|
||||||
|
if (e instanceof RestServiceException) {
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start,
|
throw new RestServiceException(thread, System.currentTimeMillis() - start,
|
||||||
"回调规则存储异常:" + exception.getMessage(), CompileVal.getBusinessCode());
|
"回调规则存储异常:" + e.getMessage(), ((RestServiceException) e).getErrorCode());
|
||||||
|
}else if (e instanceof ServiceRuntimeException) {
|
||||||
|
throw new RestServiceException(thread, System.currentTimeMillis() - start,
|
||||||
|
"回调规则存储异常:" + e.getMessage(), ((ServiceRuntimeException) e).getErrorCode());
|
||||||
}else {
|
}else {
|
||||||
throw new ServiceRuntimeException(thread, System.currentTimeMillis() - start,
|
throw new ServiceRuntimeException(thread, System.currentTimeMillis() - start,
|
||||||
"回调规则存储异常:" + exception.getMessage(), CompileVal.getBusinessCode());
|
"回调规则存储异常:" + e.getMessage(), RestBusinessCode.service_runtime_error.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response, "回调规则下发成功",
|
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response, "回调规则下发成功",
|
||||||
Constants.IS_DEBUG ? jsonString : null);
|
Constants.IS_DEBUG ? jsonString : null);
|
||||||
}
|
}
|
||||||
@@ -334,23 +210,27 @@ public class ConfigSourcesController extends BaseRestController {
|
|||||||
@ApiOperation(value = "回调(通用)规则状态更新接口", httpMethod = "PUT", response = Map.class, notes = "接收回调规则,对其状态置为失效")
|
@ApiOperation(value = "回调(通用)规则状态更新接口", httpMethod = "PUT", response = Map.class, notes = "接收回调规则,对其状态置为失效")
|
||||||
public Map updateCommonConfigSource(@RequestBody String jsonString, HttpServletRequest request,
|
public Map updateCommonConfigSource(@RequestBody String jsonString, HttpServletRequest request,
|
||||||
HttpServletResponse response) {
|
HttpServletResponse response) {
|
||||||
CompileVal.setBusinessCode(null);
|
|
||||||
ConfigSourcesService.setMsgList(new ArrayList<Exception>());// 清除上次记录的日志信息
|
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_PUT, request,
|
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_PUT, request,
|
||||||
jsonString);
|
jsonString);
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
String msg = configSourcesService.updateCommonSources(thread, start, jsonString, new Date(), sb);
|
try {
|
||||||
if (msg.equals("error")) {
|
configSourcesService.updateCommonSources(thread, start, jsonString, new Date(), sb);
|
||||||
Exception exception = ConfigSourcesService.getMsgList().get(0);
|
} catch (Exception e) {
|
||||||
if (exception instanceof RestServiceException) {
|
// TODO: handle exception
|
||||||
|
thread.setExceptionInfo("回调规则状态更新异常:" + e.getMessage());
|
||||||
|
if (e instanceof RestServiceException) {
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start,
|
throw new RestServiceException(thread, System.currentTimeMillis() - start,
|
||||||
"回调规则状态更新异常:" + exception.getMessage(), CompileVal.getBusinessCode());
|
"回调规则状态更新异常:" + e.getMessage(), ((RestServiceException) e).getErrorCode());
|
||||||
|
}else if (e instanceof ServiceRuntimeException) {
|
||||||
|
throw new RestServiceException(thread, System.currentTimeMillis() - start,
|
||||||
|
"回调规则状态更新异常:" + e.getMessage(), ((ServiceRuntimeException) e).getErrorCode());
|
||||||
}else {
|
}else {
|
||||||
throw new ServiceRuntimeException(thread, System.currentTimeMillis() - start,
|
throw new ServiceRuntimeException(thread, System.currentTimeMillis() - start,
|
||||||
"回调规则状态更新异常:" + exception.getMessage(), CompileVal.getBusinessCode());
|
"回调规则状态更新异常:" + e.getMessage(), RestBusinessCode.service_runtime_error.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response, "回调规则状态更新成功",
|
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response, "回调规则状态更新成功",
|
||||||
Constants.IS_DEBUG ? jsonString : null);
|
Constants.IS_DEBUG ? jsonString : null);
|
||||||
}
|
}
|
||||||
@@ -360,7 +240,6 @@ public class ConfigSourcesController extends BaseRestController {
|
|||||||
@ApiParam(value = "样例文件上传服务", name = "MultipartFile", required = true)
|
@ApiParam(value = "样例文件上传服务", name = "MultipartFile", required = true)
|
||||||
public Map fileUploadSource(@RequestBody MultipartFile file, HttpServletRequest request,
|
public Map fileUploadSource(@RequestBody MultipartFile file, HttpServletRequest request,
|
||||||
HttpServletResponse response) {
|
HttpServletResponse response) {
|
||||||
ConfigSourcesService.setMsgList(new ArrayList<Exception>());// 清除上次记录的日志信息
|
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
|
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
|
||||||
null);
|
null);
|
||||||
@@ -369,9 +248,7 @@ public class ConfigSourcesController extends BaseRestController {
|
|||||||
FileDesc fileDesc = (FileDesc) JSONObject.toBean(JSONObject.fromObject(request.getHeader("File-Desc")),
|
FileDesc fileDesc = (FileDesc) JSONObject.toBean(JSONObject.fromObject(request.getHeader("File-Desc")),
|
||||||
FileDesc.class);
|
FileDesc.class);
|
||||||
if (null == file) {
|
if (null == file) {
|
||||||
thread.setExceptionInfo("请选择上传文件到file参数");
|
throw new RestServiceException("请选择上传文件到file参数", RestBusinessCode.FileIsNull.getValue());
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "请选择上传文件到file参数",
|
|
||||||
RestBusinessCode.FileIsNull.getValue());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!StringUtil.isEmpty(fileDesc.getChecksum())) {
|
if (!StringUtil.isEmpty(fileDesc.getChecksum())) {
|
||||||
@@ -380,9 +257,7 @@ public class ConfigSourcesController extends BaseRestController {
|
|||||||
// String md5 = DigestUtils.md5Hex(file.getBytes());
|
// String md5 = DigestUtils.md5Hex(file.getBytes());
|
||||||
System.out.println("----------------------------MD5:'" + md5 + "'==='" + fileDesc.getChecksum() + "'");
|
System.out.println("----------------------------MD5:'" + md5 + "'==='" + fileDesc.getChecksum() + "'");
|
||||||
if (!md5.equals(fileDesc.getChecksum())) {
|
if (!md5.equals(fileDesc.getChecksum())) {
|
||||||
thread.setExceptionInfo("checksum与文件MD5值不一致");
|
throw new RestServiceException("checksum与文件MD5值不一致", RestBusinessCode.CheckSumIsWrong.getValue());
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "checksum与文件MD5值不一致",
|
|
||||||
RestBusinessCode.CheckSumIsWrong.getValue());
|
|
||||||
}
|
}
|
||||||
String ext = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1);
|
String ext = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1);
|
||||||
FastDFSFile fdsfile = new FastDFSFile(file.getBytes(), file.getOriginalFilename(), ext);
|
FastDFSFile fdsfile = new FastDFSFile(file.getBytes(), file.getOriginalFilename(), ext);
|
||||||
@@ -399,11 +274,13 @@ public class ConfigSourcesController extends BaseRestController {
|
|||||||
}catch (IOException e) {
|
}catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
logger.error(RestBusinessCode.FileUploadFailure.getErrorReason()+":"+e.getMessage());
|
logger.error(RestBusinessCode.FileUploadFailure.getErrorReason()+":"+e.getMessage());
|
||||||
|
thread.setExceptionInfo(RestBusinessCode.FileUploadFailure.getErrorReason()+":"+e.getMessage());
|
||||||
throw new ServiceRuntimeException(thread, System.currentTimeMillis() - start,
|
throw new ServiceRuntimeException(thread, System.currentTimeMillis() - start,
|
||||||
RestBusinessCode.FileUploadFailure.getErrorReason()+":"+ e.getMessage(), RestBusinessCode.FileUploadFailure.getValue());
|
RestBusinessCode.FileUploadFailure.getErrorReason()+":"+ e.getMessage(), RestBusinessCode.FileUploadFailure.getValue());
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
// TODO: handle exception
|
// TODO: handle exception
|
||||||
logger.error(e.getMessage());
|
logger.error("文件上传异常:" +e.getMessage());
|
||||||
|
thread.setExceptionInfo("文件上传异常:" + e.getMessage());
|
||||||
if (e instanceof RestServiceException) {
|
if (e instanceof RestServiceException) {
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start,
|
throw new RestServiceException(thread, System.currentTimeMillis() - start,
|
||||||
e.getMessage(), ((RestServiceException) e).getErrorCode());
|
e.getMessage(), ((RestServiceException) e).getErrorCode());
|
||||||
@@ -430,47 +307,38 @@ public class ConfigSourcesController extends BaseRestController {
|
|||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
|
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
|
||||||
file, null);
|
file, null);
|
||||||
if (file == null) {
|
|
||||||
thread.setExceptionInfo("请上传获取摘要的文件到file");
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "请上传获取摘要的文件到file参数",
|
|
||||||
RestBusinessCode.FileIsNull.getValue());
|
|
||||||
}
|
|
||||||
JSONObject resultObject = new JSONObject();
|
JSONObject resultObject = new JSONObject();
|
||||||
FileDesc fileDesc = (FileDesc) JSONObject.toBean(JSONObject.fromObject(request.getHeader("File-Desc")),
|
|
||||||
FileDesc.class);
|
|
||||||
try {
|
try {
|
||||||
|
if (file == null) {
|
||||||
|
throw new RestServiceException("请上传获取摘要的文件到file参数", RestBusinessCode.FileIsNull.getValue());
|
||||||
|
}
|
||||||
|
FileDesc fileDesc = (FileDesc) JSONObject.toBean(JSONObject.fromObject(request.getHeader("File-Desc")),
|
||||||
|
FileDesc.class);
|
||||||
if (!StringUtil.isEmpty(fileDesc.getChecksum())) {
|
if (!StringUtil.isEmpty(fileDesc.getChecksum())) {
|
||||||
// 验证Md5
|
// 验证Md5
|
||||||
|
|
||||||
String md5 = DigestUtils.md5Hex(file.getInputStream());
|
String md5 = DigestUtils.md5Hex(file.getInputStream());
|
||||||
System.out.println("----------------------------MD5:'" + md5 + "'==='" + fileDesc.getChecksum() + "'");
|
System.out.println("----------------------------MD5:'" + md5 + "'==='" + fileDesc.getChecksum() + "'");
|
||||||
if (!md5.equals(fileDesc.getChecksum())) {
|
if (!md5.equals(fileDesc.getChecksum())) {
|
||||||
thread.setExceptionInfo("checksum与文件MD5值不一致");
|
throw new RestServiceException("checksum与文件MD5值不一致",
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "checksum与文件MD5值不一致",
|
|
||||||
RestBusinessCode.CheckSumIsWrong.getValue());
|
RestBusinessCode.CheckSumIsWrong.getValue());
|
||||||
}
|
}
|
||||||
String ext = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1);
|
String ext = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1);
|
||||||
FastDFSFile fdsfile = new FastDFSFile(file.getBytes(), file.getOriginalFilename(), ext);
|
FastDFSFile fdsfile = new FastDFSFile(file.getBytes(), file.getOriginalFilename(), ext);
|
||||||
// NameValuePair[] meta_list = new NameValuePair[5];
|
|
||||||
// meta_list[0] = new NameValuePair("fileName", file.getOriginalFilename());
|
|
||||||
// meta_list[1] = new NameValuePair("fileLength",
|
|
||||||
// String.valueOf(file.getSize()));
|
|
||||||
// meta_list[2] = new NameValuePair("fileExt", ext);
|
|
||||||
// meta_list[3] = new NameValuePair("fileAuthor", "rkg");
|
|
||||||
// meta_list[4] = new NameValuePair("fileMd5", md5);
|
|
||||||
logger.info("-----------------调用接口上传文件---------------");
|
logger.info("-----------------调用接口上传文件---------------");
|
||||||
String filePath = FileManager.upload(fdsfile, null);
|
String filePath = FileManager.upload(fdsfile, null);
|
||||||
// resultObject.put("path", filePath.substring(filePath.indexOf("group")));
|
|
||||||
resultObject.put("accessUrl", filePath);
|
resultObject.put("accessUrl", filePath);
|
||||||
}
|
}
|
||||||
}catch (IOException e) {
|
}catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
logger.error(RestBusinessCode.FileUploadFailure.getErrorReason()+":"+e.getMessage());
|
logger.error(RestBusinessCode.FileUploadFailure.getErrorReason()+":"+e.getMessage());
|
||||||
|
thread.setExceptionInfo(RestBusinessCode.FileUploadFailure.getErrorReason()+":"+ e.getMessage());
|
||||||
throw new ServiceRuntimeException(thread, System.currentTimeMillis() - start,
|
throw new ServiceRuntimeException(thread, System.currentTimeMillis() - start,
|
||||||
RestBusinessCode.FileUploadFailure.getErrorReason()+":"+ e.getMessage(), RestBusinessCode.FileUploadFailure.getValue());
|
RestBusinessCode.FileUploadFailure.getErrorReason()+":"+ e.getMessage(), RestBusinessCode.FileUploadFailure.getValue());
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
// TODO: handle exception
|
// TODO: handle exception
|
||||||
logger.error(e.getMessage());
|
logger.error(RestBusinessCode.FileUploadFailure.getErrorReason()+":"+e.getMessage());
|
||||||
|
thread.setExceptionInfo(RestBusinessCode.FileUploadFailure.getErrorReason()+":"+ e.getMessage());
|
||||||
if (e instanceof RestServiceException) {
|
if (e instanceof RestServiceException) {
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start,
|
throw new RestServiceException(thread, System.currentTimeMillis() - start,
|
||||||
e.getMessage(), ((RestServiceException) e).getErrorCode());
|
e.getMessage(), ((RestServiceException) e).getErrorCode());
|
||||||
@@ -481,16 +349,15 @@ public class ConfigSourcesController extends BaseRestController {
|
|||||||
throw new ServiceRuntimeException(thread, System.currentTimeMillis() - start,
|
throw new ServiceRuntimeException(thread, System.currentTimeMillis() - start,
|
||||||
e.getMessage(), RestBusinessCode.FileUploadFailure.getValue());
|
e.getMessage(), RestBusinessCode.FileUploadFailure.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
String tempFilePath = request.getRealPath(File.separator) + "upload" + File.separator
|
String tempFilePath = request.getRealPath(File.separator) + "upload" + File.separator
|
||||||
+ (new Date()).getTime() + file.getOriginalFilename();
|
+ (new Date()).getTime() + file.getOriginalFilename();
|
||||||
file.transferTo(new File(tempFilePath));
|
file.transferTo(new File(tempFilePath));
|
||||||
//System.out.println("------------" + tempFilePath);
|
//System.out.println("------------" + tempFilePath);
|
||||||
System.out.println("摘要获取开始:---------------");
|
logger.info("摘要获取开始:---------------");
|
||||||
String digestStr = configSourcesService.getDigestGen(request.getRealPath(File.separator), tempFilePath);
|
String digestStr = configSourcesService.getDigestGen(request.getRealPath(File.separator), tempFilePath);
|
||||||
System.out.println("摘要获取结束:---------------:"+digestStr);
|
logger.info("摘要获取结束:---------------:"+digestStr);
|
||||||
resultObject.put("digest", digestStr);
|
resultObject.put("digest", digestStr);
|
||||||
resultObject.put("rawLen", file.getSize());
|
resultObject.put("rawLen", file.getSize());
|
||||||
FileUtils.deleteFile(tempFilePath);
|
FileUtils.deleteFile(tempFilePath);
|
||||||
@@ -498,7 +365,7 @@ public class ConfigSourcesController extends BaseRestController {
|
|||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error(RestBusinessCode.GetFileDigestFailure.getValue()+":"+e.getMessage()+",请检查摘要获取工具是否安装成功");
|
logger.error(RestBusinessCode.GetFileDigestFailure.getValue()+":"+e.getMessage()+",请检查摘要获取工具是否安装成功");
|
||||||
// thread.setExceptionInfo("摘要获取过程中出现异常");
|
thread.setExceptionInfo("摘要获取过程中出现异常:"+e.getMessage()+",请检查摘要获取工具是否安装成功");
|
||||||
throw new ServiceRuntimeException(thread, System.currentTimeMillis() - start, RestBusinessCode.GetFileDigestFailure.getValue()+":"+e.getMessage()+",请检查摘要获取工具是否安装成功",
|
throw new ServiceRuntimeException(thread, System.currentTimeMillis() - start, RestBusinessCode.GetFileDigestFailure.getValue()+":"+e.getMessage()+",请检查摘要获取工具是否安装成功",
|
||||||
RestBusinessCode.GetFileDigestFailure.getValue());
|
RestBusinessCode.GetFileDigestFailure.getValue());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,223 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DmbCkController.java
|
|
||||||
*@Package com.nis.web.controller.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author wx
|
|
||||||
*@date 2016年9月7日 下午3:58:16
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.controller.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import com.nis.web.service.AuditLogThread;
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.DmbCk;
|
|
||||||
import com.nis.domain.restful.DmbCkSource;
|
|
||||||
import com.nis.restful.RestBusinessCode;
|
|
||||||
import com.nis.restful.RestServiceException;
|
|
||||||
import com.nis.util.Constants;
|
|
||||||
import com.nis.util.OracleErrorCodeUtil;
|
|
||||||
import com.nis.util.StringUtil;
|
|
||||||
import com.nis.web.controller.BaseRestController;
|
|
||||||
import com.nis.web.service.ServicesRequestLogService;
|
|
||||||
import com.nis.web.service.restful.DmbCkService;
|
|
||||||
import com.wordnik.swagger.annotations.ApiOperation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DmbCkController.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月7日 下午3:58:16
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
//@RequestMapping("${servicePath}/cfg/v1")
|
|
||||||
public class DmbCkController extends BaseRestController {
|
|
||||||
protected final Logger logger = Logger.getLogger(this.getClass());
|
|
||||||
@Autowired
|
|
||||||
protected DmbCkService dmbCkService;
|
|
||||||
@Autowired
|
|
||||||
protected ServicesRequestLogService servicesRequestLogService;
|
|
||||||
// @Autowired
|
|
||||||
// protected CommonConfigService commonConfigService;
|
|
||||||
// @Autowired
|
|
||||||
// protected RedisDao redisDao;
|
|
||||||
/**
|
|
||||||
* saveDmbCkBatch(多条新增)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param DmbCkSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dmbCkSources", method = RequestMethod.POST)
|
|
||||||
@ApiOperation(value = "保存运营商信息", httpMethod = "POST", notes = "save provider info")
|
|
||||||
public Map saveDmbCkBatch(@RequestBody DmbCkSource dmbCkSource, HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dmbCkSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start, dmbCkSource.getOpAction(), Constants.OPACTION_POST);
|
|
||||||
try{
|
|
||||||
this.chekckData(dmbCkSource);
|
|
||||||
dmbCkService.saveDmbCkBatch(dmbCkSource.getDmbCkList());
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DMB_CK", dmbCkSource.getOpTime());
|
|
||||||
// redisDao.saveMaps(dmbCkSource.getDmbCkList(), "DMB_CK", DmbCk.class, "id");
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
if(e instanceof RestServiceException) throw e;
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"保存运营商信息失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"保存运营商信息成功",dmbCkSource.getDmbCkList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* updateDmbCkBatch(多条更新)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param DmbCkSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dmbCkSources", method = RequestMethod.PUT)
|
|
||||||
@ApiOperation(value = "更新运营商信息", httpMethod = "PUT", notes = "update provider info")
|
|
||||||
public Map updateDmbCkBatch(@RequestBody DmbCkSource dmbCkSource, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dmbCkSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,dmbCkSource.getOpAction(), Constants.OPACTION_PUT);
|
|
||||||
try{
|
|
||||||
this.chekckData(dmbCkSource);
|
|
||||||
dmbCkService.updateDmbCkBatch(dmbCkSource.getDmbCkList());
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DMB_CK", dmbCkSource.getOpTime());
|
|
||||||
// redisDao.updateMaps(dmbCkSource.getDmbCkList(), "DMB_CK", DmbCk.class, "id");
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
if(e instanceof RestServiceException) throw e;
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"更新运营商信息失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"更新运营商信息成功",dmbCkSource.getDmbCkList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* deleteDmbCk(单条删除)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param id
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dmbCkSources/{id}", method = RequestMethod.DELETE)
|
|
||||||
@ApiOperation(value = "删除运营商信息", httpMethod = "DELETE", notes = "delete provider info")
|
|
||||||
public Map deleteDmbCk(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id);
|
|
||||||
try{
|
|
||||||
dmbCkService.removeDmbCk(id);
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DMB_CK", new Date());
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
if(e instanceof RestServiceException) throw e;
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除运营商信息失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"删除成功",id);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* deleteDmbCk(多条删除)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param DmbCkSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dmbCkSources", method = RequestMethod.DELETE)
|
|
||||||
@ApiOperation(value = "删除运营商信息", httpMethod = "DELETE", notes = "delete provider info")
|
|
||||||
public Map deleteDmbCk(@RequestBody DmbCkSource dmbCkSource, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dmbCkSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,dmbCkSource.getOpAction(), Constants.OPACTION_DELETE);
|
|
||||||
try{
|
|
||||||
dmbCkService.removeDmbCkBatch(dmbCkSource.getDmbCkList());
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DMB_CK", dmbCkSource.getOpTime());
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
if(e instanceof RestServiceException) throw e;
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除运营商信息失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"批量删除成功",dmbCkSource.getDmbCkList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* chekckData(操作验证时间)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param entity
|
|
||||||
* @return
|
|
||||||
*boolean
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
private void chekckData(DmbCkSource entity){
|
|
||||||
Date now=new Date();
|
|
||||||
for(DmbCk dmbCk :entity.getDmbCkList()){
|
|
||||||
dmbCk.setLastUpdate(now);
|
|
||||||
if(dmbCk.getOpTime()==null)
|
|
||||||
dmbCk.setOpTime(entity.getOpTime());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,223 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DmbPortController.java
|
|
||||||
*@Package com.nis.web.controller.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author wx
|
|
||||||
*@date 2016年9月7日 下午3:58:16
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.controller.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.DmbPort;
|
|
||||||
import com.nis.domain.restful.DmbPortSource;
|
|
||||||
import com.nis.restful.RestBusinessCode;
|
|
||||||
import com.nis.restful.RestServiceException;
|
|
||||||
import com.nis.util.Constants;
|
|
||||||
import com.nis.util.OracleErrorCodeUtil;
|
|
||||||
import com.nis.util.StringUtil;
|
|
||||||
import com.nis.web.controller.BaseRestController;
|
|
||||||
import com.nis.web.service.AuditLogThread;
|
|
||||||
import com.nis.web.service.ServicesRequestLogService;
|
|
||||||
import com.nis.web.service.restful.DmbPortService;
|
|
||||||
import com.wordnik.swagger.annotations.ApiOperation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DmbPortController.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月7日 下午3:58:16
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
//@RequestMapping("${servicePath}/cfg/v1")
|
|
||||||
public class DmbPortController extends BaseRestController {
|
|
||||||
protected final Logger logger = Logger.getLogger(this.getClass());
|
|
||||||
@Autowired
|
|
||||||
protected DmbPortService dmbPortService;
|
|
||||||
@Autowired
|
|
||||||
protected ServicesRequestLogService servicesRequestLogService;
|
|
||||||
// @Autowired
|
|
||||||
// protected CommonConfigService commonConfigService;
|
|
||||||
// @Autowired
|
|
||||||
// protected RedisDao redisDao;
|
|
||||||
/**
|
|
||||||
* saveDmbPortBatch(多条新增)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param DmbPortSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dmbPortSources", method = RequestMethod.POST)
|
|
||||||
@ApiOperation(value = "保存运营商端口信息", httpMethod = "POST", notes = "save provider port info")
|
|
||||||
public Map saveDmbPortBatch(@RequestBody DmbPortSource dmbPortSource, HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dmbPortSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,dmbPortSource.getOpAction(), Constants.OPACTION_POST);
|
|
||||||
try{
|
|
||||||
this.chekckData(dmbPortSource);
|
|
||||||
dmbPortService.saveDmbPortBatch(dmbPortSource.getDmbPortList());
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DMB_PORT", dmbPortSource.getOpTime());
|
|
||||||
// redisDao.saveMaps(dmbPortSource.getDmbPortList(), "DMB_PORT", DmbPort.class, "id");
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
if(e instanceof RestServiceException) throw e;
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"保存运营商端口信息失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"保存运营商端口信息成功",dmbPortSource.getDmbPortList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* updateDmbPortBatch(多条更新)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param DmbPortSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dmbPortSources", method = RequestMethod.PUT)
|
|
||||||
@ApiOperation(value = "更新运营商端口信息", httpMethod = "PUT", notes = "update provider port info")
|
|
||||||
public Map updateDmbPortBatch(@RequestBody DmbPortSource dmbPortSource, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dmbPortSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,dmbPortSource.getOpAction(), Constants.OPACTION_PUT);
|
|
||||||
try{
|
|
||||||
this.chekckData(dmbPortSource);
|
|
||||||
dmbPortService.updateDmbPortBatch(dmbPortSource.getDmbPortList());
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DMB_PORT", dmbPortSource.getOpTime());
|
|
||||||
// redisDao.updateMaps(dmbPortSource.getDmbPortList(), "DMB_PORT", DmbPort.class, "id");
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
if(e instanceof RestServiceException) throw e;
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"更新运营商端口信息失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"更新运营商端口信息成功",dmbPortSource.getDmbPortList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* deleteDmbPort(单条删除)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param id
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dmbPortSources/{id}", method = RequestMethod.DELETE)
|
|
||||||
@ApiOperation(value = "删除运营商端口信息", httpMethod = "DELETE", notes = "delete provider port info")
|
|
||||||
public Map deleteDmbPort(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id);
|
|
||||||
try{
|
|
||||||
dmbPortService.removeDmbPort(id);
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DMB_PORT", new Date());
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
if(e instanceof RestServiceException) throw e;
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除运营商端口信息失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"删除成功",id);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* deleteDmbPort(多条删除)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param DmbPortSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dmbPortSources", method = RequestMethod.DELETE)
|
|
||||||
@ApiOperation(value = "删除运营商端口信息", httpMethod = "DELETE", notes = "delete provider port info")
|
|
||||||
public Map deleteDmbPort(@RequestBody DmbPortSource dmbPortSource, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dmbPortSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,dmbPortSource.getOpAction(), Constants.OPACTION_DELETE);
|
|
||||||
try{
|
|
||||||
dmbPortService.removeDmbPortBatch(dmbPortSource.getDmbPortList());
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DMB_PORT", dmbPortSource.getOpTime());
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
if(e instanceof RestServiceException) throw e;
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除运营商端口信息失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"批量删除成功",dmbPortSource.getDmbPortList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* chekckData(操作验证时间)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param entity
|
|
||||||
* @return
|
|
||||||
*boolean
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
private void chekckData(DmbPortSource entity){
|
|
||||||
Date now=new Date();
|
|
||||||
for(DmbPort dmbPort :entity.getDmbPortList()){
|
|
||||||
dmbPort.setLastUpdate(now);
|
|
||||||
if(dmbPort.getOpTime()==null)
|
|
||||||
dmbPort.setOpTime(entity.getOpTime());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,250 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsFakeInfoController.java
|
|
||||||
*@Package com.nis.web.controller.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author wx
|
|
||||||
*@date 2016年9月7日 下午3:58:16
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.controller.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import com.nis.web.service.AuditLogThread;
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.DnsFakeInfo;
|
|
||||||
import com.nis.domain.restful.DnsFakeInfoSource;
|
|
||||||
import com.nis.restful.RestBusinessCode;
|
|
||||||
import com.nis.restful.RestServiceException;
|
|
||||||
import com.nis.util.Constants;
|
|
||||||
import com.nis.util.OracleErrorCodeUtil;
|
|
||||||
import com.nis.util.StringUtil;
|
|
||||||
import com.nis.web.controller.BaseRestController;
|
|
||||||
import com.nis.web.service.ServicesRequestLogService;
|
|
||||||
import com.nis.web.service.restful.DnsFakeInfoService;
|
|
||||||
import com.wordnik.swagger.annotations.ApiOperation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsFakeInfoController.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月7日 下午3:58:16
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
//@RequestMapping("${servicePath}/cfg/v1")
|
|
||||||
public class DnsFakeInfoController extends BaseRestController {
|
|
||||||
protected final Logger logger = Logger.getLogger(this.getClass());
|
|
||||||
@Autowired
|
|
||||||
protected DnsFakeInfoService dnsFakeInfoService;
|
|
||||||
@Autowired
|
|
||||||
protected ServicesRequestLogService servicesRequestLogService;
|
|
||||||
// @Autowired
|
|
||||||
// protected CommonConfigService commonConfigService;
|
|
||||||
// @Autowired
|
|
||||||
// protected RedisDao redisDao;
|
|
||||||
/**
|
|
||||||
* saveDnsFakeInfoBatch(多条新增)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param DnsFakeInfoSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dnsFakeInfoSources", method = RequestMethod.POST)
|
|
||||||
@ApiOperation(value = "保存DNS欺骗信息", httpMethod = "POST", notes = "save dns fake info")
|
|
||||||
public Map saveDnsFakeInfoBatch(@RequestBody DnsFakeInfoSource dnsFakeInfoSource, HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dnsFakeInfoSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsFakeInfoSource.getOpAction(), Constants.OPACTION_POST);
|
|
||||||
try{
|
|
||||||
if(chekckData(dnsFakeInfoSource,false)){
|
|
||||||
dnsFakeInfoService.saveDnsFakeInfoBatch(dnsFakeInfoSource.getDnsFakeInfoList());
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DNS_FAKE_INFO", dnsFakeInfoSource.getOpTime());
|
|
||||||
// redisDao.saveMaps(dnsFakeInfoSource.getDnsFakeInfoList(), "DNS_FAKE_INFO", DnsFakeInfo.class, "id");
|
|
||||||
}else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"保存DNS欺骗信息失败,组号不能小于0且2-100组号不可使用",RestBusinessCode.unknow_error.getValue());
|
|
||||||
}catch(RestServiceException e){
|
|
||||||
throw e;
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"保存DNS欺骗信息失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"保存DNS欺骗信息成功",dnsFakeInfoSource.getDnsFakeInfoList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* updateDnsFakeInfoBatch(多条更新)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param DnsFakeInfoSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dnsFakeInfoSources", method = RequestMethod.PUT)
|
|
||||||
@ApiOperation(value = "更新DNS欺骗信息", httpMethod = "PUT", notes = "update dns fake info")
|
|
||||||
public Map updateDnsFakeInfoBatch(@RequestBody DnsFakeInfoSource dnsFakeInfoSource, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dnsFakeInfoSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsFakeInfoSource.getOpAction(), Constants.OPACTION_PUT);
|
|
||||||
try{
|
|
||||||
if(chekckData(dnsFakeInfoSource,true)){
|
|
||||||
dnsFakeInfoService.updateDnsFakeInfoBatch(dnsFakeInfoSource.getDnsFakeInfoList());
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DNS_FAKE_INFO", dnsFakeInfoSource.getOpTime());
|
|
||||||
// redisDao.updateMaps(dnsFakeInfoSource.getDnsFakeInfoList(), "DNS_FAKE_INFO", DnsFakeInfo.class, "id");
|
|
||||||
}else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"更新DNS欺骗信息失败,组号不能小于0且2-100组号不可使用",RestBusinessCode.unknow_error.getValue());
|
|
||||||
}catch(RestServiceException e){
|
|
||||||
throw e;
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"更新DNS欺骗信息失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"更新DNS欺骗信息成功",dnsFakeInfoSource.getDnsFakeInfoList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* deleteDnsFakeInfo(单条删除)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param id
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dnsFakeInfoSources/{id}", method = RequestMethod.DELETE)
|
|
||||||
@ApiOperation(value = "删除DNS欺骗信息", httpMethod = "DELETE", notes = "delete dns fake info")
|
|
||||||
public Map deleteDnsFakeInfo(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id);
|
|
||||||
try{
|
|
||||||
boolean isValid=dnsFakeInfoService.isValid(id);
|
|
||||||
if(!isValid){
|
|
||||||
dnsFakeInfoService.removeDnsFakeInfo(id);
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DNS_FAKE_INFO", new Date());
|
|
||||||
}else{
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除DNS欺骗信息失败,不能删除有效的DNS欺骗信息",RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
}catch(RestServiceException e){
|
|
||||||
throw e;
|
|
||||||
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除DNS欺骗信息失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"删除成功",id);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* deleteDnsFakeInfo(多条删除)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param DnsFakeInfoSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dnsFakeInfoSources", method = RequestMethod.DELETE)
|
|
||||||
@ApiOperation(value = "删除DNS欺骗信息", httpMethod = "DELETE", notes = "delete dns fake info")
|
|
||||||
public Map deleteDnsFakeInfo(@RequestBody DnsFakeInfoSource dnsFakeInfoSource, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dnsFakeInfoSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsFakeInfoSource.getOpAction(), Constants.OPACTION_DELETE);
|
|
||||||
try{
|
|
||||||
boolean isValid=dnsFakeInfoService.isValid(dnsFakeInfoSource.getDnsFakeInfoList());
|
|
||||||
if(isValid){
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除DNS欺骗信息失败,包含有效的DNS欺骗信息",RestBusinessCode.unknow_error.getValue());
|
|
||||||
}else{
|
|
||||||
dnsFakeInfoService.removeDnsFakeInfoBatch(dnsFakeInfoSource.getDnsFakeInfoList());
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DNS_FAKE_INFO", dnsFakeInfoSource.getOpTime());
|
|
||||||
}
|
|
||||||
}catch(RestServiceException e){
|
|
||||||
throw e;
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除DNS欺骗信息失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"批量删除成功",dnsFakeInfoSource.getDnsFakeInfoList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* chekckData(0-1组号以及100以外的组号可以使用)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param entityList
|
|
||||||
* @param update 是否是更新请求
|
|
||||||
* @return
|
|
||||||
*boolean
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
private boolean chekckData(DnsFakeInfoSource entity,boolean update){
|
|
||||||
int ok=1;
|
|
||||||
Date now=new Date();
|
|
||||||
for(DnsFakeInfo dnsFakeInfo :entity.getDnsFakeInfoList()){
|
|
||||||
dnsFakeInfo.setLastUpdate(now);
|
|
||||||
if(dnsFakeInfo.getOpTime()==null)
|
|
||||||
dnsFakeInfo.setOpTime(entity.getOpTime());
|
|
||||||
// if(update&&dnsFakeInfo.getGroupId()==null)continue;
|
|
||||||
// if(dnsFakeInfo.getGroupId().intValue()<0||(2<dnsFakeInfo.getGroupId().intValue()&&dnsFakeInfo.getGroupId().intValue()<=100)){
|
|
||||||
// ok=0;
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
return ok==1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,249 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsFakeIpController.java
|
|
||||||
*@Package com.nis.web.controller.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author wx
|
|
||||||
*@date 2016年9月7日 下午3:58:16
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.controller.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.DnsFakeIp;
|
|
||||||
import com.nis.domain.restful.DnsFakeIpSource;
|
|
||||||
import com.nis.restful.RestBusinessCode;
|
|
||||||
import com.nis.restful.RestServiceException;
|
|
||||||
import com.nis.util.Constants;
|
|
||||||
import com.nis.util.OracleErrorCodeUtil;
|
|
||||||
import com.nis.util.StringUtil;
|
|
||||||
import com.nis.web.controller.BaseRestController;
|
|
||||||
import com.nis.web.service.AuditLogThread;
|
|
||||||
import com.nis.web.service.ServicesRequestLogService;
|
|
||||||
import com.nis.web.service.restful.DnsFakeIpService;
|
|
||||||
import com.wordnik.swagger.annotations.ApiOperation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsFakeIpController.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (dell)
|
|
||||||
* @date 2016年9月7日 下午3:58:16
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
//@RequestMapping("${servicePath}/cfg/v1")
|
|
||||||
public class DnsFakeIpController extends BaseRestController {
|
|
||||||
protected final Logger logger = Logger.getLogger(this.getClass());
|
|
||||||
@Autowired
|
|
||||||
protected DnsFakeIpService dnsFakeIpService;
|
|
||||||
@Autowired
|
|
||||||
protected ServicesRequestLogService servicesRequestLogService;
|
|
||||||
// @Autowired
|
|
||||||
// protected RedisDao redisDao;
|
|
||||||
/**
|
|
||||||
* saveDnsFakeIpBatch(多条新增)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param DnsFakeIpSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dnsFakeIpSources", method = RequestMethod.POST)
|
|
||||||
@ApiOperation(value = "保存DNS欺骗IP地址", httpMethod = "POST", notes = "save dns fake ip")
|
|
||||||
public Map saveDnsFakeIpBatch(@RequestBody DnsFakeIpSource dnsFakeIpSource, HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dnsFakeIpSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsFakeIpSource.getOpAction(), Constants.OPACTION_POST);
|
|
||||||
try{
|
|
||||||
if(chekckData(dnsFakeIpSource,false)){
|
|
||||||
dnsFakeIpService.saveDnsFakeIpBatch(dnsFakeIpSource.getDnsFakeIpList());
|
|
||||||
}else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"保存DNS欺骗IP地址失败,组号不能小于0且2-100组号不可使用",RestBusinessCode.unknow_error.getValue());
|
|
||||||
}catch(RestServiceException e){
|
|
||||||
throw e;
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"保存DNS欺骗IP地址失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"保存DNS欺骗IP地址成功",dnsFakeIpSource.getDnsFakeIpList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* updateDnsFakeIpBatch(多条更新)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param DnsFakeIpSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dnsFakeIpSources", method = RequestMethod.PUT)
|
|
||||||
@ApiOperation(value = "更新DNS欺骗IP地址", httpMethod = "PUT", notes = "update dns fake ip")
|
|
||||||
public Map updateDnsFakeIpBatch(@RequestBody DnsFakeIpSource dnsFakeIpSource, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dnsFakeIpSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsFakeIpSource.getOpAction(), Constants.OPACTION_PUT);
|
|
||||||
try{
|
|
||||||
if(chekckData(dnsFakeIpSource,true)){
|
|
||||||
dnsFakeIpService.updateDnsFakeIpBatch(dnsFakeIpSource.getDnsFakeIpList());
|
|
||||||
// redisDao.updateMaps(dnsFakeIpSource.getDnsFakeIpList(), "DNS_FAKE_IP", DnsFakeIp.class, "id");
|
|
||||||
}else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"更新DNS欺骗IP地址失败,组号不能小于0且2-100组号不可使用",RestBusinessCode.unknow_error.getValue());
|
|
||||||
}catch(RestServiceException e){
|
|
||||||
throw e;
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"更新DNS欺骗IP地址失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"更新DNS欺骗IP地址成功",dnsFakeIpSource.getDnsFakeIpList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* deleteDnsFakeIp(单条删除)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param id
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dnsFakeIpSources/{id}", method = RequestMethod.DELETE)
|
|
||||||
@ApiOperation(value = "删除DNS欺骗IP地址", httpMethod = "DELETE", notes = "delete dns fake ip")
|
|
||||||
public Map deleteDnsFakeIp(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id);
|
|
||||||
try{
|
|
||||||
boolean isValid=dnsFakeIpService.isValid(id);
|
|
||||||
if(!isValid){
|
|
||||||
dnsFakeIpService.removeDnsFakeIp(id);
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DNS_FAKE_IP", new Date());
|
|
||||||
}else{
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除DNS欺骗IP地址失败,不能删除有效的DNS欺骗IP地址",RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
}catch(RestServiceException e){
|
|
||||||
throw e;
|
|
||||||
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除DNS欺骗IP地址失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"删除成功",id);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* deleteDnsFakeIp(多条删除)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param DnsFakeIpSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dnsFakeIpSources", method = RequestMethod.DELETE)
|
|
||||||
@ApiOperation(value = "删除DNS欺骗IP地址", httpMethod = "DELETE", notes = "delete dns fake ip")
|
|
||||||
public Map deleteDnsFakeIp(@RequestBody DnsFakeIpSource dnsFakeIpSource, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dnsFakeIpSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsFakeIpSource.getOpAction(), Constants.OPACTION_DELETE);
|
|
||||||
try{
|
|
||||||
boolean isValid=dnsFakeIpService.isValid(dnsFakeIpSource.getDnsFakeIpList());
|
|
||||||
if(isValid){
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除DNS欺骗IP地址失败,包含有效的DNS欺骗IP地址",RestBusinessCode.unknow_error.getValue());
|
|
||||||
}else{
|
|
||||||
dnsFakeIpService.removeDnsFakeIpBatch(dnsFakeIpSource.getDnsFakeIpList());
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DNS_FAKE_IP", dnsFakeIpSource.getOpTime());
|
|
||||||
}
|
|
||||||
}catch(RestServiceException e){
|
|
||||||
throw e;
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除DNS欺骗IP地址失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"批量删除成功",dnsFakeIpSource.getDnsFakeIpList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* chekckData(0-1组号以及100以外的组号可以使用)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param entityList
|
|
||||||
* @param update 是否是更新请求
|
|
||||||
* @return
|
|
||||||
*boolean
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
private boolean chekckData(DnsFakeIpSource entity,boolean update){
|
|
||||||
int ok=1;
|
|
||||||
Date now=new Date();
|
|
||||||
for(DnsFakeIp dnsFakeIp :entity.getDnsFakeIpList()){
|
|
||||||
dnsFakeIp.setLastUpdate(now);
|
|
||||||
if(dnsFakeIp.getOpTime()==null)
|
|
||||||
dnsFakeIp.setOpTime(entity.getOpTime());
|
|
||||||
if(!update){//insert需要判断默认值,保存完毕返回完整对象
|
|
||||||
if(dnsFakeIp.getProtocol()==null)dnsFakeIp.setProtocol(0);
|
|
||||||
if(dnsFakeIp.getDirection()==null)dnsFakeIp.setDirection(0);
|
|
||||||
}
|
|
||||||
if(update&&dnsFakeIp.getGroupId()==null)continue;
|
|
||||||
if(dnsFakeIp.getGroupId().intValue()<0||(2<dnsFakeIp.getGroupId().intValue()&&dnsFakeIp.getGroupId().intValue()<=100)){
|
|
||||||
ok=0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ok==1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,249 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsGroupTypeController.java
|
|
||||||
*@Package com.nis.web.controller.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author dell
|
|
||||||
*@date 2016年9月7日 下午3:58:16
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.controller.restful;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import com.nis.web.service.AuditLogThread;
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.DnsGroupType;
|
|
||||||
import com.nis.domain.restful.DnsGroupTypeSource;
|
|
||||||
import com.nis.restful.RestBusinessCode;
|
|
||||||
import com.nis.restful.RestServiceException;
|
|
||||||
import com.nis.util.Constants;
|
|
||||||
import com.nis.util.OracleErrorCodeUtil;
|
|
||||||
import com.nis.util.StringUtil;
|
|
||||||
import com.nis.web.controller.BaseRestController;
|
|
||||||
import com.nis.web.service.ServicesRequestLogService;
|
|
||||||
import com.nis.web.service.restful.DnsGroupTypeService;
|
|
||||||
import com.wordnik.swagger.annotations.ApiOperation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsGroupTypeController.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (dell)
|
|
||||||
* @date 2016年9月7日 下午3:58:16
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
//@RequestMapping("${servicePath}/cfg/v1")
|
|
||||||
public class DnsGroupTypeController extends BaseRestController {
|
|
||||||
protected final Logger logger = Logger.getLogger(this.getClass());
|
|
||||||
@Autowired
|
|
||||||
protected DnsGroupTypeService dnsGroupTypeService;
|
|
||||||
@Autowired
|
|
||||||
protected ServicesRequestLogService servicesRequestLogService;
|
|
||||||
// @Autowired
|
|
||||||
// protected CommonConfigService commonConfigService;
|
|
||||||
// @Autowired
|
|
||||||
// protected RedisDao redisDao;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* saveDnsGroupTypeBatch(多条新增)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param DnsGroupTypeSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dnsGroupTypeSources", method = RequestMethod.POST)
|
|
||||||
@ApiOperation(value = "保存DNS分组类型", httpMethod = "POST", notes = "save dns group type")
|
|
||||||
public Map saveDnsGroupTypeBatch(@RequestBody DnsGroupTypeSource dnsGroupTypeSource, HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dnsGroupTypeSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsGroupTypeSource.getOpAction(), Constants.OPACTION_POST);
|
|
||||||
try{
|
|
||||||
// if(chekckData(dnsGroupTypeSource/*,false*/))
|
|
||||||
chekckData(thread,start,dnsGroupTypeSource,Constants.OPACTION_POST);
|
|
||||||
dnsGroupTypeService.saveDnsGroupTypeBatch(thread,start,dnsGroupTypeSource.getDnsGroupTypeList());
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DNS_GROUP_TYPE", dnsGroupTypeSource.getOpTime());
|
|
||||||
// redisDao.saveMaps(dnsGroupTypeSource.getDnsGroupTypeList(), "DNS_GROUP_TYPE", DnsGroupType.class, "id");
|
|
||||||
// else
|
|
||||||
// throw new RestServiceException("保存DNS分组类型失败,组号不能小于0且2-100组号不可使用",RestBusinessCode.unknow_error.getValue());
|
|
||||||
}catch(RestServiceException e){
|
|
||||||
throw e;
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"保存DNS分组类型失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"保存DNS分组类型成功",dnsGroupTypeSource.getDnsGroupTypeList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* updateDnsGroupTypeBatch(多条更新)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param DnsGroupTypeSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dnsGroupTypeSources", method = RequestMethod.PUT)
|
|
||||||
@ApiOperation(value = "更新DNS分组类型", httpMethod = "PUT", notes = "update dns group type")
|
|
||||||
public Map updateDnsGroupTypeBatch(@RequestBody DnsGroupTypeSource dnsGroupTypeSource, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dnsGroupTypeSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsGroupTypeSource.getOpAction(), Constants.OPACTION_PUT);
|
|
||||||
try{
|
|
||||||
// if(chekckData(dnsGroupTypeSource/*,true*/))
|
|
||||||
chekckData(thread,start,dnsGroupTypeSource,Constants.OPACTION_PUT);
|
|
||||||
dnsGroupTypeService.updateDnsGroupTypeBatch(thread,start,dnsGroupTypeSource.getDnsGroupTypeList());
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DNS_GROUP_TYPE", dnsGroupTypeSource.getOpTime());
|
|
||||||
// redisDao.updateMaps(dnsGroupTypeSource.getDnsGroupTypeList(), "DNS_GROUP_TYPE", DnsGroupType.class, "id");
|
|
||||||
// else
|
|
||||||
// throw new RestServiceException("更新DNS分组类型失败,组号不能小于0且2-100组号不可使用",RestBusinessCode.unknow_error.getValue());
|
|
||||||
}catch(RestServiceException e){
|
|
||||||
throw e;
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"更新DNS分组类型失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"更新DNS分组类型成功",dnsGroupTypeSource.getDnsGroupTypeList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* deleteDnsGroupType(单条删除)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param id
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dnsGroupTypeSources/{id}", method = RequestMethod.DELETE)
|
|
||||||
@ApiOperation(value = "删除DNS分组类型", httpMethod = "DELETE", notes = "delete dns group type")
|
|
||||||
public Map deleteDnsGroupType(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id);
|
|
||||||
try{
|
|
||||||
boolean isValid=dnsGroupTypeService.isValid(id);
|
|
||||||
if(!isValid){
|
|
||||||
dnsGroupTypeService.removeDnsGroupType(id);
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DNS_GROUP_TYPE", new Date());
|
|
||||||
}else{
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"不能删除有效的DNS分组类型");
|
|
||||||
}
|
|
||||||
}catch(RestServiceException e){
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除DNS分组类型失败,"+e.getMessage(), RestBusinessCode.unknow_error.getValue());
|
|
||||||
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除DNS分组类型失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"删除成功",id);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* deleteDnsGroupType(多条删除)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param DnsGroupTypeSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dnsGroupTypeSources", method = RequestMethod.DELETE)
|
|
||||||
@ApiOperation(value = "删除DNS分组类型", httpMethod = "DELETE", notes = "delete dns group type")
|
|
||||||
public Map deleteDnsGroupType(@RequestBody DnsGroupTypeSource dnsGroupTypeSource, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dnsGroupTypeSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsGroupTypeSource.getOpAction(), Constants.OPACTION_DELETE);
|
|
||||||
try{
|
|
||||||
boolean isValid=dnsGroupTypeService.isValid(dnsGroupTypeSource.getDnsGroupTypeList());
|
|
||||||
if(isValid){
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"包含有效的DNS分组类型");
|
|
||||||
}else{
|
|
||||||
dnsGroupTypeService.removeDnsGroupTypeBatch(dnsGroupTypeSource.getDnsGroupTypeList());
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DNS_GROUP_TYPE", dnsGroupTypeSource.getOpTime());
|
|
||||||
}
|
|
||||||
}catch(RestServiceException e){
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除DNS分组类型失败,"+e.getMessage(), RestBusinessCode.unknow_error.getValue());
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除DNS分组类型失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"批量删除成功",dnsGroupTypeSource.getDnsGroupTypeList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* chekckData(0-1组号以及100以外的组号可以使用)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param entityList
|
|
||||||
* @param update 是否是更新请求
|
|
||||||
* @return
|
|
||||||
*boolean
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
private void chekckData(AuditLogThread thread, long start, DnsGroupTypeSource entity, int opAction){
|
|
||||||
for(DnsGroupType dnsGroupType :entity.getDnsGroupTypeList()){
|
|
||||||
if(dnsGroupType.getOpTime()==null)
|
|
||||||
dnsGroupType.setOpTime(entity.getOpTime());
|
|
||||||
if(opAction==Constants.OPACTION_PUT&&dnsGroupType.getGroupId()==null)continue;
|
|
||||||
else if(dnsGroupType.getGroupId()==null){
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis(), "组号为空", RestBusinessCode.missing_args.getValue());
|
|
||||||
}else if(dnsGroupType.getGroupId().intValue()<=100){
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis(), "组号小于等于100", RestBusinessCode.wrong_range.getValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,262 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsResponseStrategy.java
|
|
||||||
*@Package com.nis.web.controller.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author dell
|
|
||||||
*@date 2016年9月5日 下午4:12:27
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.controller.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.DnsResponseStrategy;
|
|
||||||
import com.nis.domain.restful.DnsResponseStrategySource;
|
|
||||||
import com.nis.restful.RestBusinessCode;
|
|
||||||
import com.nis.restful.RestServiceException;
|
|
||||||
import com.nis.util.Constants;
|
|
||||||
import com.nis.util.OracleErrorCodeUtil;
|
|
||||||
import com.nis.util.StringUtil;
|
|
||||||
import com.nis.web.controller.BaseRestController;
|
|
||||||
import com.nis.web.service.AuditLogThread;
|
|
||||||
import com.nis.web.service.ServicesRequestLogService;
|
|
||||||
import com.nis.web.service.restful.DnsResponseStrategyService;
|
|
||||||
import com.wordnik.swagger.annotations.ApiOperation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsResponseStrategyController.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月5日 下午4:12:27
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
//@RequestMapping("${servicePath}/cfg/v1")
|
|
||||||
public class DnsResponseStrategyController extends BaseRestController {
|
|
||||||
protected final Logger logger = Logger.getLogger(this.getClass());
|
|
||||||
@Autowired
|
|
||||||
protected DnsResponseStrategyService dnsResponseStrategyService;
|
|
||||||
// @Autowired
|
|
||||||
// protected RedisDao redisDao;
|
|
||||||
@Autowired
|
|
||||||
protected ServicesRequestLogService servicesRequestLogService;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* saveDnsResponseStrategyBatch(多条新增)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param dnsResponseStrategySource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dnsResponseStrategySources", method = RequestMethod.POST)
|
|
||||||
@ApiOperation(value = "保存DNS响应策略", httpMethod = "POST", notes = "save dns response strategy")
|
|
||||||
public Map saveDnsResponseStrategyBatch(@RequestBody DnsResponseStrategySource dnsResponseStrategySource, HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dnsResponseStrategySource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsResponseStrategySource.getOpAction(), Constants.OPACTION_POST);
|
|
||||||
try{
|
|
||||||
chekckData(thread,start,dnsResponseStrategySource,Constants.OPACTION_POST);
|
|
||||||
dnsResponseStrategyService.saveDnsResponseStrategyBatch(thread,start,dnsResponseStrategySource.getDnsResponseStrategyList());
|
|
||||||
// redisDao.saveMaps(dnsResponseStrategySource.getDnsResponseStrategyList(), "DNS_RESPONSE_STRATEGY", DnsResponseStrategy.class, "id");
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
if(e instanceof RestServiceException){
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
e.printStackTrace();
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"保存DNS响应策略失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"保存DNS响应策略成功",dnsResponseStrategySource.getDnsResponseStrategyList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* updateDnsResponseStrategyBatch(多条更新)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param dnsResponseStrategySource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dnsResponseStrategySources", method = RequestMethod.PUT)
|
|
||||||
@ApiOperation(value = "更新DNS响应策略", httpMethod = "PUT", notes = "update dns response strategy")
|
|
||||||
public Map updateDnsResponseStrategyBatch(@RequestBody DnsResponseStrategySource dnsResponseStrategySource, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dnsResponseStrategySource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsResponseStrategySource.getOpAction(), Constants.OPACTION_PUT);
|
|
||||||
try{
|
|
||||||
chekckData(thread,start,dnsResponseStrategySource,Constants.OPACTION_PUT);
|
|
||||||
dnsResponseStrategyService.updateDnsResponseStrategyBatch(thread,start,dnsResponseStrategySource.getDnsResponseStrategyList());
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DNS_RESPONSE_STRATEGY", dnsResponseStrategySource.getOpTime());
|
|
||||||
// redisDao.updateMaps(dnsResponseStrategySource.getDnsResponseStrategyList(), "DNS_RESPONSE_STRATEGY", DnsResponseStrategy.class, "id");
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
if(e instanceof RestServiceException){
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"更新DNS响应策略失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"更新DNS响应策略成功",dnsResponseStrategySource.getDnsResponseStrategyList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* deleteDnsResponseStrategy(单条删除)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param id
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dnsResponseStrategySources/{id}", method = RequestMethod.DELETE)
|
|
||||||
@ApiOperation(value = "删除DNS响应策略", httpMethod = "DELETE", notes = "delete dns response strategy")
|
|
||||||
public Map deleteDnsResponseStrategy(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id);
|
|
||||||
try{
|
|
||||||
boolean isValid=dnsResponseStrategyService.isValid(id);
|
|
||||||
if(!isValid){
|
|
||||||
dnsResponseStrategyService.removeDnsResponseStrategy(id);
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DNS_RESPONSE_STRATEGY", new Date());
|
|
||||||
}else{
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除DNS响应策略失败,不能删除有效的DNS响应策略", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
}catch(RestServiceException e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
throw e;
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除DNS响应策略失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"删除成功",id);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* deleteDnsResponseStrategy(多条删除)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param dnsResponseStrategySource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/dnsResponseStrategySources", method = RequestMethod.DELETE)
|
|
||||||
@ApiOperation(value = "删除DNS响应策略", httpMethod = "DELETE", notes = "delete dns response strategy")
|
|
||||||
public Map deleteDnsResponseStrategy(@RequestBody DnsResponseStrategySource dnsResponseStrategySource, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dnsResponseStrategySource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsResponseStrategySource.getOpAction(), Constants.OPACTION_DELETE);
|
|
||||||
try{
|
|
||||||
boolean isValid=dnsResponseStrategyService.isValid(dnsResponseStrategySource.getDnsResponseStrategyList());
|
|
||||||
if(isValid){
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除DNS响应策略失败,包含有效的DNS响应策略",RestBusinessCode.unknow_error.getValue());
|
|
||||||
}else
|
|
||||||
dnsResponseStrategyService.removeDnsResponseStrategyBatch(dnsResponseStrategySource.getDnsResponseStrategyList());
|
|
||||||
}catch(RestServiceException e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
throw e;
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除DNS响应策略失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"批量删除成功",dnsResponseStrategySource.getDnsResponseStrategyList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* chekckData(验证数据,减少遍历次数,尽量在此方法内验证数据)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param entity
|
|
||||||
*void
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
private void chekckData(AuditLogThread thread, long start, DnsResponseStrategySource entity, int opAction){
|
|
||||||
Date now =new Date();
|
|
||||||
|
|
||||||
for(DnsResponseStrategy dnsResponseStrategy :entity.getDnsResponseStrategyList()){
|
|
||||||
checkReqStrateId(thread,start,dnsResponseStrategy,opAction);
|
|
||||||
dnsResponseStrategy.setLastUpdate(now);
|
|
||||||
if(dnsResponseStrategy.getOpTime()==null)
|
|
||||||
dnsResponseStrategy.setOpTime(entity.getOpTime());
|
|
||||||
if(opAction==Constants.OPACTION_POST){//新增数据时设置默认值
|
|
||||||
if(dnsResponseStrategy.getResGroupOneId()==null)dnsResponseStrategy.setResGroupOneId(0);
|
|
||||||
if(dnsResponseStrategy.getResGroupOneNum()==null)dnsResponseStrategy.setResGroupOneNum(0);
|
|
||||||
if(dnsResponseStrategy.getResGroupTwoId()==null)dnsResponseStrategy.setResGroupTwoId(0);
|
|
||||||
if(dnsResponseStrategy.getResGroupTwoNum()==null)dnsResponseStrategy.setResGroupTwoNum(0);
|
|
||||||
if(dnsResponseStrategy.getResGroupThreeId()==null)dnsResponseStrategy.setResGroupThreeId(0);
|
|
||||||
if(dnsResponseStrategy.getResGroupThreeNum()==null)dnsResponseStrategy.setResGroupThreeNum(0);
|
|
||||||
if(dnsResponseStrategy.getResGroupFourId()==null)dnsResponseStrategy.setResGroupFourId(0);
|
|
||||||
if(dnsResponseStrategy.getResGroupFourNum()==null)dnsResponseStrategy.setResGroupFourNum(0);
|
|
||||||
if(dnsResponseStrategy.getResGroupFiveId()==null)dnsResponseStrategy.setResGroupFiveId(0);
|
|
||||||
if(dnsResponseStrategy.getResGroupFiveNum()==null)dnsResponseStrategy.setResGroupFiveNum(0);
|
|
||||||
if(dnsResponseStrategy.getAddGroup()==null)dnsResponseStrategy.setAddGroup(0);
|
|
||||||
if(dnsResponseStrategy.getAuthGroup()==null)dnsResponseStrategy.setAuthGroup(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
private void checkReqStrateId(AuditLogThread thread, long start, DnsResponseStrategy dnsResponseStrategy, int opAction){
|
|
||||||
//update时可以为空
|
|
||||||
if(opAction==Constants.OPACTION_PUT&&dnsResponseStrategy.getReqStrateId()==null)return;
|
|
||||||
if(dnsResponseStrategy.getReqStrateId()==null){
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis(), "请求策略号为空", RestBusinessCode.missing_args.getValue());
|
|
||||||
}else if(dnsResponseStrategy.getReqStrateId()<=100){
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis(), "请求策略号小于等于100", RestBusinessCode.wrong_range.getValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,223 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: EncryptProtoRandomController.java
|
|
||||||
*@Package com.nis.web.controller.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author wx
|
|
||||||
*@date 2016年9月7日 下午3:58:16
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.controller.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import com.nis.web.service.AuditLogThread;
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.EncryptProtoRandom;
|
|
||||||
import com.nis.domain.restful.EncryptProtoRandomSource;
|
|
||||||
import com.nis.restful.RestBusinessCode;
|
|
||||||
import com.nis.restful.RestServiceException;
|
|
||||||
import com.nis.util.Constants;
|
|
||||||
import com.nis.util.OracleErrorCodeUtil;
|
|
||||||
import com.nis.util.StringUtil;
|
|
||||||
import com.nis.web.controller.BaseRestController;
|
|
||||||
import com.nis.web.service.ServicesRequestLogService;
|
|
||||||
import com.nis.web.service.restful.EncryptProtoRandomService;
|
|
||||||
import com.wordnik.swagger.annotations.ApiOperation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: EncryptProtoRandomController.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月7日 下午3:58:16
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
//@RequestMapping("${servicePath}/cfg/v1")
|
|
||||||
public class EncryptProtoRandomController extends BaseRestController {
|
|
||||||
protected final Logger logger = Logger.getLogger(this.getClass());
|
|
||||||
@Autowired
|
|
||||||
protected EncryptProtoRandomService encryptProtoRandomService;
|
|
||||||
@Autowired
|
|
||||||
protected ServicesRequestLogService servicesRequestLogService;
|
|
||||||
// @Autowired
|
|
||||||
// protected CommonConfigService commonConfigService;
|
|
||||||
// @Autowired
|
|
||||||
// protected RedisDao redisDao;
|
|
||||||
/**
|
|
||||||
* saveEncryptProtoRandomBatch(多条新增)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param EncryptProtoRandomSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/encryptProtoRandomSources", method = RequestMethod.POST)
|
|
||||||
@ApiOperation(value = "保存加密类协议随机封堵配置", httpMethod = "POST", notes = "save encrypt_proto_random")
|
|
||||||
public Map saveEncryptProtoRandomBatch(@RequestBody EncryptProtoRandomSource encryptProtoRandomSource, HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, encryptProtoRandomSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,encryptProtoRandomSource.getOpAction(), Constants.OPACTION_POST);
|
|
||||||
try{
|
|
||||||
this.chekckData(encryptProtoRandomSource);
|
|
||||||
encryptProtoRandomService.saveEncryptProtoRandomBatch(encryptProtoRandomSource.getEncryptProtoRandomList());
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DMB_CK", encryptProtoRandomSource.getOpTime());
|
|
||||||
// redisDao.saveMaps(encryptProtoRandomSource.getEncryptProtoRandomList(), "DMB_CK", EncryptProtoRandom.class, "id");
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
if(e instanceof RestServiceException) throw e;
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"保存加密类协议随机封堵配置失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"保存加密类协议随机封堵配置成功",encryptProtoRandomSource.getEncryptProtoRandomList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* updateEncryptProtoRandomBatch(多条更新)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param EncryptProtoRandomSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/encryptProtoRandomSources", method = RequestMethod.PUT)
|
|
||||||
@ApiOperation(value = "更新加密类协议随机封堵配置", httpMethod = "PUT", notes = "update encrypt_proto_random")
|
|
||||||
public Map updateEncryptProtoRandomBatch(@RequestBody EncryptProtoRandomSource encryptProtoRandomSource, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, encryptProtoRandomSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,encryptProtoRandomSource.getOpAction(), Constants.OPACTION_PUT);
|
|
||||||
try{
|
|
||||||
this.chekckData(encryptProtoRandomSource);
|
|
||||||
encryptProtoRandomService.updateEncryptProtoRandomBatch(encryptProtoRandomSource.getEncryptProtoRandomList());
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DMB_CK", encryptProtoRandomSource.getOpTime());
|
|
||||||
// redisDao.updateMaps(encryptProtoRandomSource.getEncryptProtoRandomList(), "DMB_CK", EncryptProtoRandom.class, "id");
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
if(e instanceof RestServiceException) throw e;
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"更新加密类协议随机封堵配置失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"更新加密类协议随机封堵配置成功",encryptProtoRandomSource.getEncryptProtoRandomList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* deleteEncryptProtoRandom(单条删除)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param id
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/encryptProtoRandomSources/{id}", method = RequestMethod.DELETE)
|
|
||||||
@ApiOperation(value = "删除加密类协议随机封堵配置", httpMethod = "DELETE", notes = "delete encrypt_proto_random")
|
|
||||||
public Map deleteEncryptProtoRandom(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id);
|
|
||||||
try{
|
|
||||||
encryptProtoRandomService.removeEncryptProtoRandom(id);
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DMB_CK", new Date());
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
if(e instanceof RestServiceException) throw e;
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除加密类协议随机封堵配置失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"删除成功",id);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* deleteEncryptProtoRandom(多条删除)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param EncryptProtoRandomSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/encryptProtoRandomSources", method = RequestMethod.DELETE)
|
|
||||||
@ApiOperation(value = "删除加密类协议随机封堵配置", httpMethod = "DELETE", notes = "delete encrypt_proto_random")
|
|
||||||
public Map deleteEncryptProtoRandom(@RequestBody EncryptProtoRandomSource encryptProtoRandomSource, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, encryptProtoRandomSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,encryptProtoRandomSource.getOpAction(), Constants.OPACTION_DELETE);
|
|
||||||
try{
|
|
||||||
encryptProtoRandomService.removeEncryptProtoRandomBatch(encryptProtoRandomSource.getEncryptProtoRandomList());
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("DMB_CK", encryptProtoRandomSource.getOpTime());
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
if(e instanceof RestServiceException) throw e;
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除加密类协议随机封堵配置失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"批量删除成功",encryptProtoRandomSource.getEncryptProtoRandomList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* chekckData(操作验证时间)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param entity
|
|
||||||
* @return
|
|
||||||
*boolean
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
private void chekckData(EncryptProtoRandomSource entity){
|
|
||||||
Date now=new Date();
|
|
||||||
for(EncryptProtoRandom encryptProtoRandom :entity.getEncryptProtoRandomList()){
|
|
||||||
encryptProtoRandom.setLastUpdate(now);
|
|
||||||
if(encryptProtoRandom.getOpTime()==null)
|
|
||||||
encryptProtoRandom.setOpTime(entity.getOpTime());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,223 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: FwqInfoController.java
|
|
||||||
*@Package com.nis.web.controller.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author wx
|
|
||||||
*@date 2016年9月7日 下午3:58:16
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.controller.restful;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.FwqInfo;
|
|
||||||
import com.nis.domain.restful.FwqInfoSource;
|
|
||||||
import com.nis.restful.RestBusinessCode;
|
|
||||||
import com.nis.restful.RestServiceException;
|
|
||||||
import com.nis.util.Constants;
|
|
||||||
import com.nis.util.OracleErrorCodeUtil;
|
|
||||||
import com.nis.util.StringUtil;
|
|
||||||
import com.nis.web.controller.BaseRestController;
|
|
||||||
import com.nis.web.service.AuditLogThread;
|
|
||||||
import com.nis.web.service.ServicesRequestLogService;
|
|
||||||
import com.nis.web.service.restful.FwqInfoService;
|
|
||||||
import com.wordnik.swagger.annotations.ApiOperation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: FwqInfoController.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月7日 下午3:58:16
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
//@RequestMapping("${servicePath}/cfg/v1")
|
|
||||||
public class FwqInfoController extends BaseRestController {
|
|
||||||
protected final Logger logger = Logger.getLogger(this.getClass());
|
|
||||||
@Autowired
|
|
||||||
protected FwqInfoService fwqInfoService;
|
|
||||||
@Autowired
|
|
||||||
protected ServicesRequestLogService servicesRequestLogService;
|
|
||||||
// @Autowired
|
|
||||||
// protected CommonConfigService commonConfigService;
|
|
||||||
// @Autowired
|
|
||||||
// protected RedisDao redisDao;
|
|
||||||
/**
|
|
||||||
* saveFwqInfoBatch(多条新增)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param FwqInfoSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/fwqInfoSources", method = RequestMethod.POST)
|
|
||||||
@ApiOperation(value = "保存服务器信息", httpMethod = "POST", notes = "save server info")
|
|
||||||
public Map saveFwqInfoBatch(@RequestBody FwqInfoSource fwqInfoSource, HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, fwqInfoSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,fwqInfoSource.getOpAction(), Constants.OPACTION_POST);
|
|
||||||
try{
|
|
||||||
chekckData(fwqInfoSource);
|
|
||||||
fwqInfoService.saveFwqInfoBatch(fwqInfoSource.getFwqInfoList());
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("FWQ_INFO", fwqInfoSource.getOpTime());
|
|
||||||
// redisDao.saveMaps(fwqInfoSource.getFwqInfoList(), "FWQ_INFO", FwqInfo.class, "id");
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
if(e instanceof RestServiceException) throw e;
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"保存服务器信息失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"保存服务器信息成功",fwqInfoSource.getFwqInfoList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* updateFwqInfoBatch(多条更新)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param FwqInfoSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/fwqInfoSources", method = RequestMethod.PUT)
|
|
||||||
@ApiOperation(value = "更新服务器信息", httpMethod = "PUT", notes = "update server info")
|
|
||||||
public Map updateFwqInfoBatch(@RequestBody FwqInfoSource fwqInfoSource, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, fwqInfoSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,fwqInfoSource.getOpAction(), Constants.OPACTION_PUT);
|
|
||||||
try{
|
|
||||||
chekckData(fwqInfoSource);
|
|
||||||
fwqInfoService.updateFwqInfoBatch(fwqInfoSource.getFwqInfoList());
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("FWQ_INFO", fwqInfoSource.getOpTime());
|
|
||||||
// redisDao.updateMaps(fwqInfoSource.getFwqInfoList(), "FWQ_INFO", FwqInfo.class, "id");
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
if(e instanceof RestServiceException) throw e;
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"更新服务器信息失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"更新服务器信息成功",fwqInfoSource.getFwqInfoList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* deleteFwqInfo(单条删除)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param id
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/fwqInfoSources/{id}", method = RequestMethod.DELETE)
|
|
||||||
@ApiOperation(value = "删除服务器信息", httpMethod = "DELETE", notes = "delete server info")
|
|
||||||
public Map deleteFwqInfo(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id);
|
|
||||||
try{
|
|
||||||
fwqInfoService.removeFwqInfo(id);
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("FWQ_INFO", new Date());
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
if(e instanceof RestServiceException) throw e;
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除服务器信息失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"删除成功",id);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* deleteFwqInfo(多条删除)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param FwqInfoSource
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*Map
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@RequestMapping(value = "/fwqInfoSources", method = RequestMethod.DELETE)
|
|
||||||
@ApiOperation(value = "删除服务器信息", httpMethod = "DELETE", notes = "delete server info")
|
|
||||||
public Map deleteFwqInfo(@RequestBody FwqInfoSource fwqInfoSource, HttpServletRequest request, HttpServletResponse response){
|
|
||||||
long start=System.currentTimeMillis();
|
|
||||||
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, fwqInfoSource);
|
|
||||||
super.checkOpAction(thread,System.currentTimeMillis()-start,fwqInfoSource.getOpAction(), Constants.OPACTION_DELETE);
|
|
||||||
try{
|
|
||||||
fwqInfoService.removeFwqInfoBatch(fwqInfoSource.getFwqInfoList());
|
|
||||||
// commonConfigService.saveOrUpdateConfigState("FWQ_INFO", fwqInfoSource.getOpTime());
|
|
||||||
}catch(Exception e){
|
|
||||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.getMessage());
|
|
||||||
logger.error(e.getCause());
|
|
||||||
if(e instanceof RestServiceException) throw e;
|
|
||||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
|
||||||
if(!StringUtil.isEmpty(info))
|
|
||||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
|
||||||
else
|
|
||||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除服务器信息失败", RestBusinessCode.unknow_error.getValue());
|
|
||||||
}
|
|
||||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"批量删除成功",fwqInfoSource.getFwqInfoList());
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* chekckData(操作验证时间)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param entity
|
|
||||||
* @return
|
|
||||||
*boolean
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
private void chekckData(FwqInfoSource entity){
|
|
||||||
Date now =new Date();
|
|
||||||
for(FwqInfo fwqInfo :entity.getFwqInfoList()){
|
|
||||||
fwqInfo.setLastUpdate(now);
|
|
||||||
if(fwqInfo.getOpTime()==null)
|
|
||||||
fwqInfo.setOpTime(entity.getOpTime());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -11,6 +11,7 @@ import java.util.UUID;
|
|||||||
|
|
||||||
import com.nis.domain.restful.*;
|
import com.nis.domain.restful.*;
|
||||||
import com.nis.web.service.AuditLogThread;
|
import com.nis.web.service.AuditLogThread;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
@@ -379,32 +380,39 @@ public class MaatTestController {
|
|||||||
public String testSaveMaatMore(@RequestParam(required = true) Integer service,
|
public String testSaveMaatMore(@RequestParam(required = true) Integer service,
|
||||||
@RequestParam(required = true) Integer saveCount, Integer forCount) {
|
@RequestParam(required = true) Integer saveCount, Integer forCount) {
|
||||||
List<String> list = new ArrayList<String>();
|
List<String> list = new ArrayList<String>();
|
||||||
for (int a = 0; a < forCount; a++) {
|
try {
|
||||||
long start = System.currentTimeMillis();
|
|
||||||
AuditLogThread thread = new AuditLogThread();
|
for (int a = 0; a < forCount; a++) {
|
||||||
StringBuffer sb = new StringBuffer();
|
long start = System.currentTimeMillis();
|
||||||
List<ConfigCompile> configCompileList = new ArrayList<ConfigCompile>();
|
AuditLogThread thread = new AuditLogThread();
|
||||||
for (int i = 0; i < saveCount; i++) {
|
StringBuffer sb = new StringBuffer();
|
||||||
configCompileList.add(getConfigCompile(service));
|
List<ConfigCompile> configCompileList = new ArrayList<ConfigCompile>();
|
||||||
|
for (int i = 0; i < saveCount; i++) {
|
||||||
|
configCompileList.add(getConfigCompile(service));
|
||||||
|
}
|
||||||
|
// 保存测试配置
|
||||||
|
configSourcesService.saveMaatConfig(thread, start, configCompileList, sb);
|
||||||
|
List<Long> compileIdList = new ArrayList<Long>();
|
||||||
|
for (ConfigCompile configCompile : configCompileList) {
|
||||||
|
compileIdList.add(configCompile.getCompileId());
|
||||||
|
}
|
||||||
|
FileUtils.addStrToFile(
|
||||||
|
sdf.format(new Date()) + "\t" + "业务类型" + service + "添加" + saveCount + "条数据成功,配置id是" + compileIdList
|
||||||
|
+ "\n" + sdf.format(new Date()) + "\t开始验证添加的数据各字段是否正确\n",
|
||||||
|
Configurations.getStringProperty("maatTestLogPath", ""), true);
|
||||||
|
// 验证数据是否在正确
|
||||||
|
maatTestServiceimpl.getKeys(configCompileList);
|
||||||
|
list.add(testDelMaat(compileIdList.toString().replace("[", "").replace("]", ""), service));
|
||||||
}
|
}
|
||||||
// 保存测试配置
|
|
||||||
configSourcesService.saveMaatConfig(thread, start, configCompileList, sb);
|
// return "http://127.0.0.1:8080/galaxy/service/cfg/v1/testDelMaat?serviceType="
|
||||||
List<Long> compileIdList = new ArrayList<Long>();
|
// + service + "&configId="
|
||||||
for (ConfigCompile configCompile : configCompileList) {
|
// + compileIdList.toString().replace("[", "").replace("]", "");
|
||||||
compileIdList.add(configCompile.getCompileId());
|
} catch (Exception e) {
|
||||||
}
|
// TODO: handle exception
|
||||||
FileUtils.addStrToFile(
|
e.printStackTrace();
|
||||||
sdf.format(new Date()) + "\t" + "业务类型" + service + "添加" + saveCount + "条数据成功,配置id是" + compileIdList
|
|
||||||
+ "\n" + sdf.format(new Date()) + "\t开始验证添加的数据各字段是否正确\n",
|
|
||||||
Configurations.getStringProperty("maatTestLogPath", ""), true);
|
|
||||||
// 验证数据是否在正确
|
|
||||||
maatTestServiceimpl.getKeys(configCompileList);
|
|
||||||
list.add(testDelMaat(compileIdList.toString().replace("[", "").replace("]", ""), service));
|
|
||||||
}
|
}
|
||||||
return list.toString();
|
return list.toString();
|
||||||
// return "http://127.0.0.1:8080/galaxy/service/cfg/v1/testDelMaat?serviceType="
|
|
||||||
// + service + "&configId="
|
|
||||||
// + compileIdList.toString().replace("[", "").replace("]", "");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/cfg/v1/testSaveMaat", method = RequestMethod.GET)
|
@RequestMapping(value = "/cfg/v1/testSaveMaat", method = RequestMethod.GET)
|
||||||
@@ -415,22 +423,30 @@ public class MaatTestController {
|
|||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
AuditLogThread thread = new AuditLogThread();
|
AuditLogThread thread = new AuditLogThread();
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
List<ConfigCompile> configCompileList = new ArrayList<ConfigCompile>();
|
|
||||||
for (int i = 0; i < saveCount; i++) {
|
|
||||||
configCompileList.add(getConfigCompile(service));
|
|
||||||
}
|
|
||||||
// 保存测试配置
|
|
||||||
configSourcesService.saveMaatConfig(thread, start, configCompileList, sb);
|
|
||||||
List<Long> compileIdList = new ArrayList<Long>();
|
List<Long> compileIdList = new ArrayList<Long>();
|
||||||
for (ConfigCompile configCompile : configCompileList) {
|
try {
|
||||||
compileIdList.add(configCompile.getCompileId());
|
List<ConfigCompile> configCompileList = new ArrayList<ConfigCompile>();
|
||||||
|
for (int i = 0; i < saveCount; i++) {
|
||||||
|
configCompileList.add(getConfigCompile(service));
|
||||||
|
}
|
||||||
|
// 保存测试配置
|
||||||
|
|
||||||
|
configSourcesService.saveMaatConfig(thread, start, configCompileList, sb);
|
||||||
|
|
||||||
|
|
||||||
|
for (ConfigCompile configCompile : configCompileList) {
|
||||||
|
compileIdList.add(configCompile.getCompileId());
|
||||||
|
}
|
||||||
|
FileUtils.addStrToFile(
|
||||||
|
sdf.format(new Date()) + "\t" + "业务类型" + service + "添加" + saveCount + "条数据成功,配置id是" + compileIdList
|
||||||
|
+ "\n" + sdf.format(new Date()) + "\t开始验证添加的数据各字段是否正确\n",
|
||||||
|
Configurations.getStringProperty("maatTestLogPath", ""), true);
|
||||||
|
// 验证数据是否在正确
|
||||||
|
maatTestServiceimpl.getKeys(configCompileList);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
FileUtils.addStrToFile(
|
|
||||||
sdf.format(new Date()) + "\t" + "业务类型" + service + "添加" + saveCount + "条数据成功,配置id是" + compileIdList
|
|
||||||
+ "\n" + sdf.format(new Date()) + "\t开始验证添加的数据各字段是否正确\n",
|
|
||||||
Configurations.getStringProperty("maatTestLogPath", ""), true);
|
|
||||||
// 验证数据是否在正确
|
|
||||||
maatTestServiceimpl.getKeys(configCompileList);
|
|
||||||
return "http://127.0.0.1:8080/galaxy/service/cfg/v1/testDelMaat?serviceType=" + service + "&configId="
|
return "http://127.0.0.1:8080/galaxy/service/cfg/v1/testDelMaat?serviceType=" + service + "&configId="
|
||||||
+ compileIdList.toString().replace("[", "").replace("]", "");
|
+ compileIdList.toString().replace("[", "").replace("]", "");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,114 +0,0 @@
|
|||||||
package com.nis.web.dao;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.ConfigCompile;
|
|
||||||
import com.nis.domain.restful.ConfigCompileTest;
|
|
||||||
import com.nis.domain.restful.ConfigState;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @ClassName: ConfigCompileDao
|
|
||||||
* @Description: TODO(编译配置dao)
|
|
||||||
* @author (rkg)
|
|
||||||
* @date 2016年9月6日下午8:45:58
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@MyBatisDao
|
|
||||||
public interface ConfigCompileDao {
|
|
||||||
/**
|
|
||||||
* 添加编译配置信息,并返回主键id
|
|
||||||
*
|
|
||||||
* @param configCompileDao
|
|
||||||
* 编译配置对象
|
|
||||||
* @return 主键id
|
|
||||||
*/
|
|
||||||
public Long saveConfigCompile(ConfigCompile configCompile);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据主键id修改编译配置信息
|
|
||||||
*
|
|
||||||
* @param configCompileDao
|
|
||||||
* 编译配置对象
|
|
||||||
*/
|
|
||||||
public void updateConfigCompile(ConfigCompile configCompile);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据compileId设置配置有效或无效
|
|
||||||
* @param configCompile
|
|
||||||
* @param valid
|
|
||||||
*/
|
|
||||||
public void setCompileInvalid(@Param("compileId")Long compileId,@Param("valid")Integer valid);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据主键compileId查询对应的ConfigCompile
|
|
||||||
*
|
|
||||||
* @param compileId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public ConfigCompile queryConfigCompileById(Long compileId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据tableName查询是否有对应的配置状态记录
|
|
||||||
*
|
|
||||||
* @param tableName
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public List<ConfigState> queryConfigStateByTN(@Param("tableName") String tableName);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据表名更新配置状态操作时间
|
|
||||||
*
|
|
||||||
* @param tableName
|
|
||||||
* @param opTime
|
|
||||||
*/
|
|
||||||
public void updateConfigState(@Param("tableName") String tableName, @Param("opTime") Date opTime);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增配置状态
|
|
||||||
*
|
|
||||||
* @param tableName
|
|
||||||
* @param opTime
|
|
||||||
*/
|
|
||||||
public void saveConfigState(@Param("tableName") String tableName, @Param("opTime") Date opTime);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量新增配置
|
|
||||||
*
|
|
||||||
* @param configCompileList
|
|
||||||
*/
|
|
||||||
public void saveCompileBatch(List<ConfigCompile> configCompileList);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* 条件查询配置信息
|
|
||||||
*
|
|
||||||
* @param configCompile
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public List<ConfigCompileTest> queryAllCompile(@Param("searchEndTime") String searchEndTime,
|
|
||||||
@Param("searchStartTime") String searchStartTime, @Param("service") Integer service,
|
|
||||||
@Param("compileId") Long compileId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据主键compileId查询对应的ConfigCompile
|
|
||||||
*
|
|
||||||
* @param compileIdArr
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public List<ConfigCompileTest> queryConfigCompileByIdArr(@Param("compileIdArr") String compileIdArr);
|
|
||||||
|
|
||||||
public Long getCompileSeq();
|
|
||||||
|
|
||||||
public Long getGroupSeq();
|
|
||||||
|
|
||||||
public Long getRegionSeq();
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package com.nis.web.dao;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.DmbCk;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @ClassName: DmbCkDao.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (dell)
|
|
||||||
* @date 2016年9月9日 上午10:03:33
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@MyBatisDao
|
|
||||||
public interface DmbCkDao extends CrudDao<DmbCk>{
|
|
||||||
int delete(long id);
|
|
||||||
int insert(DmbCk record);
|
|
||||||
int update(DmbCk record);
|
|
||||||
}
|
|
||||||
@@ -1,119 +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.DmbCkDao">
|
|
||||||
<resultMap id="BaseResultMap" type="com.nis.domain.restful.DmbCk">
|
|
||||||
<id column="ID" jdbcType="BIGINT" property="id" />
|
|
||||||
<result column="NAME" jdbcType="VARCHAR" property="name" />
|
|
||||||
<result column="POSITION" jdbcType="VARCHAR" property="position" />
|
|
||||||
<result column="COM_OPTION" jdbcType="VARCHAR" property="comOption" />
|
|
||||||
<result column="CZYID" jdbcType="BIGINT" property="czyid" />
|
|
||||||
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
|
|
||||||
<result property="lastUpdate" jdbcType="TIMESTAMP" column="LAST_UPDATE"/>
|
|
||||||
</resultMap>
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
ID, NAME, POSITION, COM_OPTION, CZYID, OP_TIME,LAST_UPDATE
|
|
||||||
</sql>
|
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List" />
|
|
||||||
from DMB_CK
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</select>
|
|
||||||
<delete id="delete" parameterType="java.lang.Long">
|
|
||||||
delete from DMB_CK
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</delete>
|
|
||||||
<insert id="insert" parameterType="com.nis.domain.restful.DmbCk">
|
|
||||||
<!--
|
|
||||||
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
|
|
||||||
SELECT SEQ_DMB_CK.Nextval as ID from DUAL
|
|
||||||
</selectKey> -->
|
|
||||||
insert into DMB_CK (ID, NAME, POSITION,
|
|
||||||
COM_OPTION, CZYID, OP_TIME,LAST_UPDATE
|
|
||||||
)
|
|
||||||
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR},
|
|
||||||
#{comOption,jdbcType=VARCHAR}, #{czyid,jdbcType=BIGINT}, #{opTime,jdbcType=TIMESTAMP},
|
|
||||||
#{lastUpdate,jdbcType=TIMESTAMP}
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
<!--
|
|
||||||
<insert id="insertSelective" parameterType="com.nis.domain.restful.DmbCk">
|
|
||||||
insert into DMB_CK
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="id != null">
|
|
||||||
ID,
|
|
||||||
</if>
|
|
||||||
<if test="name != null">
|
|
||||||
NAME,
|
|
||||||
</if>
|
|
||||||
<if test="position != null">
|
|
||||||
POSITION,
|
|
||||||
</if>
|
|
||||||
<if test="comOption != null">
|
|
||||||
COM_OPTION,
|
|
||||||
</if>
|
|
||||||
<if test="czyid != null">
|
|
||||||
CZYID,
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME,
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="id != null">
|
|
||||||
#{id,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="name != null">
|
|
||||||
#{name,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="position != null">
|
|
||||||
#{position,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="comOption != null">
|
|
||||||
#{comOption,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="czyid != null">
|
|
||||||
#{czyid,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
#{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
-->
|
|
||||||
<update id="update" parameterType="com.nis.domain.restful.DmbCk">
|
|
||||||
update DMB_CK
|
|
||||||
<set>
|
|
||||||
<if test="name != null">
|
|
||||||
NAME = #{name,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="position != null">
|
|
||||||
POSITION = #{position,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="comOption != null">
|
|
||||||
COM_OPTION = #{comOption,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="czyid != null">
|
|
||||||
CZYID = #{czyid,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
LAST_UPDATE = #{lastUpdate,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</update>
|
|
||||||
<!--
|
|
||||||
<update id="updateByPrimaryKey" parameterType="com.nis.domain.restful.DmbCk">
|
|
||||||
update DMB_CK
|
|
||||||
set NAME = #{name,jdbcType=VARCHAR},
|
|
||||||
POSITION = #{position,jdbcType=VARCHAR},
|
|
||||||
COM_OPTION = #{comOption,jdbcType=VARCHAR},
|
|
||||||
CZYID = #{czyid,jdbcType=BIGINT},
|
|
||||||
OP_TIME = #{opTime,jdbcType=TIMESTAMP}
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</update>
|
|
||||||
-->
|
|
||||||
</mapper>
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package com.nis.web.dao;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.DmbPort;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @ClassName: DmbPortDao.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (dell)
|
|
||||||
* @date 2016年9月9日 上午10:04:55
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@MyBatisDao
|
|
||||||
public interface DmbPortDao extends CrudDao<DmbPort>{
|
|
||||||
int delete(long id);
|
|
||||||
|
|
||||||
int insert(DmbPort record);
|
|
||||||
|
|
||||||
int update(DmbPort record);
|
|
||||||
}
|
|
||||||
@@ -1,176 +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.DmbPortDao">
|
|
||||||
<resultMap id="BaseResultMap" type="com.nis.domain.restful.DmbPort">
|
|
||||||
<id column="ID" jdbcType="BIGINT" property="id" />
|
|
||||||
<result column="ENTRANCE_ID" jdbcType="BIGINT" property="entranceId" />
|
|
||||||
<result column="PORT_NAME" jdbcType="VARCHAR" property="portName" />
|
|
||||||
<result column="IS_USED" jdbcType="INTEGER" property="isUsed" />
|
|
||||||
<result column="IP_DZ" jdbcType="VARCHAR" property="ipDz" />
|
|
||||||
<result column="PORT_EQUIPMENT" jdbcType="VARCHAR" property="portEquipment" />
|
|
||||||
<result column="ODF_PORT" jdbcType="VARCHAR" property="odfPort" />
|
|
||||||
<result column="ADDR" jdbcType="VARCHAR" property="addr" />
|
|
||||||
<result column="CK_PORT" jdbcType="VARCHAR" property="ckPort" />
|
|
||||||
<result column="CZYID" jdbcType="BIGINT" property="czyid" />
|
|
||||||
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
|
|
||||||
<result property="lastUpdate" jdbcType="TIMESTAMP" column="LAST_UPDATE"/>
|
|
||||||
</resultMap>
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
ID, ENTRANCE_ID, PORT_NAME, IS_USED, IP_DZ, PORT_EQUIPMENT, ODF_PORT, ADDR, CK_PORT,
|
|
||||||
CZYID, OP_TIME,LAST_UPDATE
|
|
||||||
</sql>
|
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List" />
|
|
||||||
from DMB_PORT
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</select>
|
|
||||||
<delete id="delete" parameterType="java.lang.Long">
|
|
||||||
delete from DMB_PORT
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</delete>
|
|
||||||
<insert id="insert" parameterType="com.nis.domain.restful.DmbPort">
|
|
||||||
<!--
|
|
||||||
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
|
|
||||||
SELECT SEQ_DMB_PORT.Nextval as ID from DUAL
|
|
||||||
</selectKey> -->
|
|
||||||
insert into DMB_PORT (ID, ENTRANCE_ID, PORT_NAME,
|
|
||||||
IS_USED, IP_DZ, PORT_EQUIPMENT,
|
|
||||||
ODF_PORT, ADDR, CK_PORT,
|
|
||||||
CZYID, OP_TIME,LAST_UPDATE)
|
|
||||||
values (#{id,jdbcType=BIGINT}, #{entranceId,jdbcType=BIGINT}, #{portName,jdbcType=VARCHAR},
|
|
||||||
#{isUsed,jdbcType=INTEGER}, #{ipDz,jdbcType=VARCHAR}, #{portEquipment,jdbcType=VARCHAR},
|
|
||||||
#{odfPort,jdbcType=VARCHAR}, #{addr,jdbcType=VARCHAR}, #{ckPort,jdbcType=VARCHAR},
|
|
||||||
#{czyid,jdbcType=BIGINT}, #{opTime,jdbcType=TIMESTAMP}, #{lastUpdate,jdbcType=TIMESTAMP})
|
|
||||||
</insert>
|
|
||||||
<!--
|
|
||||||
<insert id="insertSelective" parameterType="com.nis.domain.restful.DmbPort">
|
|
||||||
insert into DMB_PORT
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="id != null">
|
|
||||||
ID,
|
|
||||||
</if>
|
|
||||||
<if test="entranceId != null">
|
|
||||||
ENTRANCE_ID,
|
|
||||||
</if>
|
|
||||||
<if test="portName != null">
|
|
||||||
PORT_NAME,
|
|
||||||
</if>
|
|
||||||
<if test="isUsed != null">
|
|
||||||
IS_USED,
|
|
||||||
</if>
|
|
||||||
<if test="ipDz != null">
|
|
||||||
IP_DZ,
|
|
||||||
</if>
|
|
||||||
<if test="portEquipment != null">
|
|
||||||
PORT_EQUIPMENT,
|
|
||||||
</if>
|
|
||||||
<if test="odfPort != null">
|
|
||||||
ODF_PORT,
|
|
||||||
</if>
|
|
||||||
<if test="addr != null">
|
|
||||||
ADDR,
|
|
||||||
</if>
|
|
||||||
<if test="ckPort != null">
|
|
||||||
CK_PORT,
|
|
||||||
</if>
|
|
||||||
<if test="czyid != null">
|
|
||||||
CZYID,
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME,
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="id != null">
|
|
||||||
#{id,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="entranceId != null">
|
|
||||||
#{entranceId,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="portName != null">
|
|
||||||
#{portName,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="isUsed != null">
|
|
||||||
#{isUsed,jdbcType=INTGER},
|
|
||||||
</if>
|
|
||||||
<if test="ipDz != null">
|
|
||||||
#{ipDz,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="portEquipment != null">
|
|
||||||
#{portEquipment,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="odfPort != null">
|
|
||||||
#{odfPort,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="addr != null">
|
|
||||||
#{addr,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="ckPort != null">
|
|
||||||
#{ckPort,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="czyid != null">
|
|
||||||
#{czyid,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
#{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
-->
|
|
||||||
<update id="update" parameterType="com.nis.domain.restful.DmbPort">
|
|
||||||
update DMB_PORT
|
|
||||||
<set>
|
|
||||||
<if test="entranceId != null">
|
|
||||||
ENTRANCE_ID = #{entranceId,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="portName != null">
|
|
||||||
PORT_NAME = #{portName,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="isUsed != null">
|
|
||||||
IS_USED = #{isUsed,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="ipDz != null">
|
|
||||||
IP_DZ = #{ipDz,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="portEquipment != null">
|
|
||||||
PORT_EQUIPMENT = #{portEquipment,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="odfPort != null">
|
|
||||||
ODF_PORT = #{odfPort,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="addr != null">
|
|
||||||
ADDR = #{addr,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="ckPort != null">
|
|
||||||
CK_PORT = #{ckPort,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="czyid != null">
|
|
||||||
CZYID = #{czyid,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
LAST_UPDATE = #{lastUpdate,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</update>
|
|
||||||
<!--
|
|
||||||
<update id="updateByPrimaryKey" parameterType="com.nis.domain.restful.DmbPort">
|
|
||||||
update DMB_PORT
|
|
||||||
set ENTRANCE_ID = #{entranceId,jdbcType=BIGINT},
|
|
||||||
PORT_NAME = #{portName,jdbcType=VARCHAR},
|
|
||||||
IS_USED = #{isUsed,jdbcType=INTEGER},
|
|
||||||
IP_DZ = #{ipDz,jdbcType=VARCHAR},
|
|
||||||
PORT_EQUIPMENT = #{portEquipment,jdbcType=VARCHAR},
|
|
||||||
ODF_PORT = #{odfPort,jdbcType=VARCHAR},
|
|
||||||
ADDR = #{addr,jdbcType=VARCHAR},
|
|
||||||
CK_PORT = #{ckPort,jdbcType=VARCHAR},
|
|
||||||
CZYID = #{czyid,jdbcType=BIGINT},
|
|
||||||
OP_TIME = #{opTime,jdbcType=TIMESTAMP}
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</update>
|
|
||||||
-->
|
|
||||||
</mapper>
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
package com.nis.web.dao;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.DnsFakeInfo;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @ClassName: DnsFakeInfoDao.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (dell)
|
|
||||||
* @date 2016年9月8日 下午8:31:24
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@MyBatisDao
|
|
||||||
public interface DnsFakeInfoDao extends CrudDao<DnsFakeInfo>{
|
|
||||||
int delete(long id);
|
|
||||||
int insert(DnsFakeInfo record);
|
|
||||||
DnsFakeInfo selectByPrimaryKey(long id);
|
|
||||||
int update(DnsFakeInfo record);
|
|
||||||
int updateByPrimaryKey(DnsFakeInfo record);
|
|
||||||
int isValid(long id);
|
|
||||||
int isValidBatch(@Param("idsList")List<Long> idsList,@Param("isValid")int isValid);
|
|
||||||
}
|
|
||||||
@@ -1,182 +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.DnsFakeInfoDao">
|
|
||||||
<resultMap id="BaseResultMap" type="com.nis.domain.restful.DnsFakeInfo">
|
|
||||||
<id column="ID" jdbcType="BIGINT" property="id" />
|
|
||||||
<result column="GROUP_ID" jdbcType="INTEGER" property="groupId" />
|
|
||||||
<result column="INFO" jdbcType="VARCHAR" property="info" />
|
|
||||||
<result column="IS_VALID" jdbcType="INTEGER" property="isValid" />
|
|
||||||
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
|
|
||||||
<result column="YL1" jdbcType="INTEGER" property="yl1" />
|
|
||||||
<result column="YL2" jdbcType="INTEGER" property="yl2" />
|
|
||||||
<result column="YL3" jdbcType="VARCHAR" property="yl3" />
|
|
||||||
<result column="YL4" jdbcType="VARCHAR" property="yl4" />
|
|
||||||
<result column="YL5" jdbcType="VARCHAR" property="yl5" />
|
|
||||||
<result property="lastUpdate" jdbcType="TIMESTAMP" column="LAST_UPDATE"/>
|
|
||||||
</resultMap>
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
ID, GROUP_ID, INFO, IS_VALID, OP_TIME, YL1, YL2, YL3, YL4, YL5,LAST_UPDATE
|
|
||||||
</sql>
|
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List" />
|
|
||||||
from DNS_FAKE_INFO
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</select>
|
|
||||||
<delete id="delete" parameterType="java.lang.Long">
|
|
||||||
delete from DNS_FAKE_INFO
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</delete>
|
|
||||||
<insert id="insert" parameterType="com.nis.domain.restful.DnsFakeInfo">
|
|
||||||
<!--
|
|
||||||
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
|
|
||||||
SELECT SEQ_DNS_FAKE_INFO.Nextval as ID from DUAL
|
|
||||||
</selectKey>
|
|
||||||
-->
|
|
||||||
insert into DNS_FAKE_INFO (ID, GROUP_ID, INFO,
|
|
||||||
IS_VALID, OP_TIME, YL1,
|
|
||||||
YL2, YL3, YL4, YL5,LAST_UPDATE
|
|
||||||
)
|
|
||||||
values (#{id,jdbcType=BIGINT}, #{groupId,jdbcType=INTEGER}, #{info,jdbcType=VARCHAR},
|
|
||||||
#{isValid,jdbcType=INTEGER}, #{opTime,jdbcType=TIMESTAMP}, #{yl1,jdbcType=INTEGER},
|
|
||||||
#{yl2,jdbcType=INTEGER}, #{yl3,jdbcType=VARCHAR}, #{yl4,jdbcType=VARCHAR}, #{yl5,jdbcType=VARCHAR}
|
|
||||||
, #{lastUpdate,jdbcType=TIMESTAMP}
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
<insert id="insertSelective" parameterType="com.nis.domain.restful.DnsFakeInfo">
|
|
||||||
insert into DNS_FAKE_INFO
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="id != null">
|
|
||||||
ID,
|
|
||||||
</if>
|
|
||||||
<if test="groupId != null">
|
|
||||||
GROUP_ID,
|
|
||||||
</if>
|
|
||||||
<if test="info != null">
|
|
||||||
INFO,
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null">
|
|
||||||
IS_VALID,
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME,
|
|
||||||
</if>
|
|
||||||
<if test="yl1 != null">
|
|
||||||
YL1,
|
|
||||||
</if>
|
|
||||||
<if test="yl2 != null">
|
|
||||||
YL2,
|
|
||||||
</if>
|
|
||||||
<if test="yl3 != null">
|
|
||||||
YL3,
|
|
||||||
</if>
|
|
||||||
<if test="yl4 != null">
|
|
||||||
YL4,
|
|
||||||
</if>
|
|
||||||
<if test="yl5 != null">
|
|
||||||
YL5,
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
LAST_UPDATE,
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="id != null">
|
|
||||||
#{id,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="groupId != null">
|
|
||||||
#{groupId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="info != null">
|
|
||||||
#{info,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null">
|
|
||||||
#{isValid,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
#{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="yl1 != null">
|
|
||||||
#{yl1,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="yl2 != null">
|
|
||||||
#{yl2,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="yl3 != null">
|
|
||||||
#{yl3,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="yl4 != null">
|
|
||||||
#{yl4,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="yl5 != null">
|
|
||||||
#{yl5,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
#{lastUpdate,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
<update id="update" parameterType="com.nis.domain.restful.DnsFakeInfo">
|
|
||||||
update DNS_FAKE_INFO
|
|
||||||
<set>
|
|
||||||
<if test="groupId != null">
|
|
||||||
GROUP_ID = #{groupId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="info != null">
|
|
||||||
INFO = #{info,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null">
|
|
||||||
IS_VALID = #{isValid,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="yl1 != null">
|
|
||||||
YL1 = #{yl1,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="yl2 != null">
|
|
||||||
YL2 = #{yl2,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="yl3 != null">
|
|
||||||
YL3 = #{yl3,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="yl4 != null">
|
|
||||||
YL4 = #{yl4,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="yl5 != null">
|
|
||||||
YL5 = #{yl5,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
LAST_UPDATE = #{lastUpdate,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</update>
|
|
||||||
<select id="isValid" parameterType="long" resultType="java.lang.Integer">
|
|
||||||
select IS_VALID FROM DNS_FAKE_INFO
|
|
||||||
WHERE ID = #{id,jdbcType=BIGINT}
|
|
||||||
</select>
|
|
||||||
<select id="isValidBatch" resultType="java.lang.Integer">
|
|
||||||
select count(ID) FROM DNS_FAKE_INFO
|
|
||||||
WHERE ID in(
|
|
||||||
<foreach collection="idsList" item="ids" separator=",">
|
|
||||||
#{ids}
|
|
||||||
</foreach>
|
|
||||||
) and IS_VALID=#{isValid}
|
|
||||||
</select>
|
|
||||||
<!--
|
|
||||||
<update id="updateByPrimaryKey" parameterType="com.nis.domain.restful.DnsFakeInfo">
|
|
||||||
update DNS_FAKE_INFO
|
|
||||||
set GROUP_ID = #{groupId,jdbcType=DECIMAL},
|
|
||||||
INFO = #{info,jdbcType=VARCHAR},
|
|
||||||
IS_VALID = #{isValid,jdbcType=DECIMAL},
|
|
||||||
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
|
|
||||||
YL1 = #{yl1,jdbcType=DECIMAL},
|
|
||||||
YL2 = #{yl2,jdbcType=DECIMAL},
|
|
||||||
YL3 = #{yl3,jdbcType=VARCHAR},
|
|
||||||
YL4 = #{yl4,jdbcType=VARCHAR},
|
|
||||||
YL5 = #{yl5,jdbcType=VARCHAR}
|
|
||||||
where ID = #{id,jdbcType=DECIMAL}
|
|
||||||
</update>
|
|
||||||
-->
|
|
||||||
</mapper>
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsGroupTypeDao.java
|
|
||||||
*@Package com.nis.web.dao
|
|
||||||
*@Description TODO
|
|
||||||
*@author dell
|
|
||||||
*@date 2016年9月7日 下午3:14:24
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.dao;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.DnsFakeIp;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsGroupTypeDao.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (dell)
|
|
||||||
* @date 2016年9月7日 下午3:14:24
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@MyBatisDao
|
|
||||||
public interface DnsFakeIpDao extends CrudDao<DnsFakeIp> {
|
|
||||||
void save(DnsFakeIp dnsFakeIp);
|
|
||||||
void saveBatch(List<DnsFakeIp> dnsFakeIpList);
|
|
||||||
void updateBatch(List<DnsFakeIp> dnsFakeIpList);
|
|
||||||
void delete(long id);
|
|
||||||
int isValid(long id);
|
|
||||||
int isValidBatch(@Param("idsList")List<Long> idsList,@Param("isValid")int isValid);
|
|
||||||
}
|
|
||||||
@@ -1,284 +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.DnsFakeIpDao" >
|
|
||||||
<resultMap type="dnsFakeIp" id="dnsFakeIpMap">
|
|
||||||
<id property="id" column="ID"/>
|
|
||||||
<result property="groupId" column="GROUP_ID"/>
|
|
||||||
<result property="addrType" column="ADDR_TYPE"/>
|
|
||||||
<result property="srcIp" column="SRC_IP"/>
|
|
||||||
<result property="maskSrcIp" column="MASK_SRC_IP"/>
|
|
||||||
<result property="srcPort" column="SRC_PORT"/>
|
|
||||||
<result property="maskSrcPort" column="MASK_SRC_PORT"/>
|
|
||||||
<result property="dstIp" column="DST_IP"/>
|
|
||||||
<result property="maskDstIp" column="MASK_DST_IP"/>
|
|
||||||
<result property="dstPort" column="DST_PORT"/>
|
|
||||||
<result property="maskDstPort" column="MASK_DST_PORT"/>
|
|
||||||
<result property="protocol" column="PROTOCOL"/>
|
|
||||||
<result property="direction" column="DIRECTION"/>
|
|
||||||
<result property="opTime" column="OP_TIME"/>
|
|
||||||
<result property="isValid" column="IS_VALID"/>
|
|
||||||
<result property="yl1" column="YL1"/>
|
|
||||||
<result property="yl2" column="YL2"/>
|
|
||||||
<result property="yl3" column="YL3"/>
|
|
||||||
<result property="yl4" column="YL4"/>
|
|
||||||
<result property="yl5" column="YL5"/>
|
|
||||||
<result property="lastUpdate" jdbcType="TIMESTAMP" column="LAST_UPDATE"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="dnsFakeIpColumns">
|
|
||||||
id,
|
|
||||||
groupId,
|
|
||||||
addrType,
|
|
||||||
srcIp,
|
|
||||||
maskSrcIp,
|
|
||||||
srcPort,
|
|
||||||
maskSrcPort,
|
|
||||||
dstIp,
|
|
||||||
maskDstIp,
|
|
||||||
dstPort,
|
|
||||||
maskDstPort,
|
|
||||||
protocol,
|
|
||||||
direction,
|
|
||||||
opTime,
|
|
||||||
isValid,
|
|
||||||
yl1,
|
|
||||||
yl2,
|
|
||||||
yl3,
|
|
||||||
yl4,
|
|
||||||
yl5,
|
|
||||||
lastUpdate
|
|
||||||
</sql>
|
|
||||||
<!--
|
|
||||||
<insert id="insert" parameterType="dnsFakeIp" >
|
|
||||||
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
|
|
||||||
SELECT SEQ_DNS_FAKE_IP.Nextval as ID from DUAL
|
|
||||||
</selectKey>
|
|
||||||
insert into DNS_FAKE_IP(ID,GROUP_ID,ADDR_TYPE,SRC_IP,MASK_SRC_IP,SRC_PORT,MASK_SRC_PORT,
|
|
||||||
DST_IP,MASK_DST_IP,DST_PORT,MASK_DST_PORT,PROTOCOL,DIRECTION,OP_TIME,IS_VALID,YL1,YL2,YL3,YL4,YL5)
|
|
||||||
values (#{id},#{groupId},#{addrType},#{srcIp},#{maskSrcIp},#{srcPort},#{maskSrcPort},#{dstIp}
|
|
||||||
,#{maskDstIp},#{dstPort},#{maskDstPort},#{protocol},#{direction},#{opTime},#{isValid}
|
|
||||||
,#{yl1},#{yl2},#{yl3},#{yl4},#{yl5})
|
|
||||||
</insert>
|
|
||||||
-->
|
|
||||||
<insert id="insert" parameterType="com.nis.domain.restful.DnsFakeIp">
|
|
||||||
<!--
|
|
||||||
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
|
|
||||||
SELECT SEQ_DNS_FAKE_IP.Nextval as ID from DUAL
|
|
||||||
</selectKey>
|
|
||||||
-->
|
|
||||||
insert into DNS_FAKE_IP
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
ID,
|
|
||||||
<if test="groupId != null">
|
|
||||||
GROUP_ID,
|
|
||||||
</if>
|
|
||||||
<if test="addrType != null">
|
|
||||||
ADDR_TYPE,
|
|
||||||
</if>
|
|
||||||
<if test="srcIp != null">
|
|
||||||
SRC_IP,
|
|
||||||
</if>
|
|
||||||
<if test="maskSrcIp != null">
|
|
||||||
MASK_SRC_IP,
|
|
||||||
</if>
|
|
||||||
<if test="srcPort != null">
|
|
||||||
SRC_PORT,
|
|
||||||
</if>
|
|
||||||
<if test="maskSrcPort != null">
|
|
||||||
MASK_SRC_PORT,
|
|
||||||
</if>
|
|
||||||
<if test="dstIp != null">
|
|
||||||
DST_IP,
|
|
||||||
</if>
|
|
||||||
<if test="maskDstIp != null">
|
|
||||||
MASK_DST_IP,
|
|
||||||
</if>
|
|
||||||
<if test="dstPort != null">
|
|
||||||
DST_PORT,
|
|
||||||
</if>
|
|
||||||
<if test="maskDstPort != null">
|
|
||||||
MASK_DST_PORT,
|
|
||||||
</if>
|
|
||||||
<if test="protocol != null">
|
|
||||||
PROTOCOL,
|
|
||||||
</if>
|
|
||||||
<if test="direction != null">
|
|
||||||
DIRECTION,
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null">
|
|
||||||
IS_VALID,
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME,
|
|
||||||
</if>
|
|
||||||
<if test="yl1 != null">
|
|
||||||
YL1,
|
|
||||||
</if>
|
|
||||||
<if test="yl2 != null">
|
|
||||||
YL2,
|
|
||||||
</if>
|
|
||||||
<if test="yl3 != null">
|
|
||||||
YL3,
|
|
||||||
</if>
|
|
||||||
<if test="yl4 != null">
|
|
||||||
YL4,
|
|
||||||
</if>
|
|
||||||
<if test="yl5 != null">
|
|
||||||
YL5,
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
LAST_UPDATE,
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
#{id,jdbcType=BIGINT},
|
|
||||||
<if test="groupId != null">
|
|
||||||
#{groupId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="addrType != null">
|
|
||||||
#{addrType,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="srcIp != null">
|
|
||||||
#{srcIp,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="maskSrcIp != null">
|
|
||||||
#{maskSrcIp,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="srcPort != null">
|
|
||||||
#{srcPort,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="maskSrcPort != null">
|
|
||||||
#{maskSrcPort,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="dstIp != null">
|
|
||||||
#{dstIp,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="maskDstIp != null">
|
|
||||||
#{maskDstIp,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="dstPort != null">
|
|
||||||
#{dstPort,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="maskDstPort != null">
|
|
||||||
#{maskDstPort,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="protocol != null">
|
|
||||||
#{protocol,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="direction != null">
|
|
||||||
#{direction,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null">
|
|
||||||
#{isValid,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
#{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="yl1 != null">
|
|
||||||
#{yl1,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="yl2 != null">
|
|
||||||
#{yl2,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="yl3 != null">
|
|
||||||
#{yl3,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="yl4 != null">
|
|
||||||
#{yl4,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="yl5 != null">
|
|
||||||
#{yl5,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
#{lastUpdate,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
<update id="update" parameterType="dnsFakeIp">
|
|
||||||
UPDATE DNS_FAKE_IP
|
|
||||||
<set>
|
|
||||||
<if test="groupId != null">
|
|
||||||
GROUP_ID=#{groupId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="addrType != null">
|
|
||||||
ADDR_TYPE=#{addrType,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="srcIp != null">
|
|
||||||
SRC_IP=#{srcIp,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="maskSrcIp != null">
|
|
||||||
MASK_SRC_IP=#{maskSrcIp,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="srcPort != null">
|
|
||||||
SRC_PORT=#{srcPort,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="maskSrcPort != null">
|
|
||||||
MASK_SRC_PORT=#{maskSrcPort,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="dstIp != null">
|
|
||||||
DST_IP=#{dstIp,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="maskDstIp != null">
|
|
||||||
MASK_DST_IP=#{maskDstIp,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="dstPort != null">
|
|
||||||
DST_PORT=#{dstPort,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="maskDstPort != null">
|
|
||||||
MASK_DST_PORT=#{maskDstPort,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="protocol != null">
|
|
||||||
PROTOCOL=#{protocol,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="direction != null">
|
|
||||||
DIRECTION=#{direction,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME=#{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null">
|
|
||||||
IS_VALID=#{isValid,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="yl1 != null">
|
|
||||||
YL1=#{yl1,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="yl2 != null">
|
|
||||||
YL2=#{yl2,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="yl3 != null">
|
|
||||||
YL3=#{yl3,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="yl4 != null">
|
|
||||||
YL4=#{yl4,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="yl5 != null">
|
|
||||||
YL5=#{yl5,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
LAST_UPDATE=#{lastUpdate,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where ID = #{id ,jdbcType=BIGINT }
|
|
||||||
</update>
|
|
||||||
<delete id="delete" parameterType="long">
|
|
||||||
DELETE FROM DNS_FAKE_IP
|
|
||||||
WHERE ID = #{id,jdbcType=BIGINT}
|
|
||||||
</delete>
|
|
||||||
<select id="isValid" parameterType="long" resultType="java.lang.Integer">
|
|
||||||
select IS_VALID FROM DNS_FAKE_IP
|
|
||||||
WHERE ID = #{id,jdbcType=BIGINT}
|
|
||||||
</select>
|
|
||||||
<select id="isValidBatch" resultType="java.lang.Integer">
|
|
||||||
select count(ID) FROM DNS_FAKE_IP
|
|
||||||
WHERE ID in(
|
|
||||||
<foreach collection="idsList" item="ids" separator=",">
|
|
||||||
#{ids}
|
|
||||||
</foreach>
|
|
||||||
) and IS_VALID=#{isValid}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsGroupTypeDao.java
|
|
||||||
*@Package com.nis.web.dao
|
|
||||||
*@Description TODO
|
|
||||||
*@author dell
|
|
||||||
*@date 2016年9月7日 下午3:14:24
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.dao;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.DnsGroupType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsGroupTypeDao.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (dell)
|
|
||||||
* @date 2016年9月7日 下午3:14:24
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@MyBatisDao
|
|
||||||
public interface DnsGroupTypeDao extends CrudDao<DnsGroupType> {
|
|
||||||
List<DnsGroupType> getDnsGroupType(DnsGroupType DnsGroupType);
|
|
||||||
void save(DnsGroupType DnsGroupType);
|
|
||||||
void saveBatch(List<DnsGroupType> DnsGroupTypeList);
|
|
||||||
void updateBatch(List<DnsGroupType> DnsGroupTypeList);
|
|
||||||
void delete(long id);
|
|
||||||
int isValid(long id);
|
|
||||||
int isValidBatch(@Param("idsList")List<Long> idsList,@Param("isValid")int isValid);
|
|
||||||
int isGroupIdUnique(@Param("idsList")List<Integer> idsList);
|
|
||||||
}
|
|
||||||
@@ -1,141 +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.DnsGroupTypeDao" >
|
|
||||||
<resultMap type="dnsGroupType" id="dnsGroupTypeMap">
|
|
||||||
<id property="id" column="ID"/>
|
|
||||||
<result property="groupId" column="GROUP_ID"/>
|
|
||||||
<result property="groupName" column="GROUP_NAME"/>
|
|
||||||
<result property="resTypeId" column="RES_TYPE_ID"/>
|
|
||||||
<result property="opTime" column="OP_TIME"/>
|
|
||||||
<result property="isValid" column="IS_VALID"/>
|
|
||||||
<result property="yl1" column="YL1"/>
|
|
||||||
<result property="yl2" column="YL2"/>
|
|
||||||
<result property="yl3" column="YL3"/>
|
|
||||||
<result property="yl4" column="YL4"/>
|
|
||||||
<result property="yl5" column="YL5"/>
|
|
||||||
<result property="lastUpdate" column="LAST_UPDATE"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="dnsGroupTypeColumns">
|
|
||||||
id,
|
|
||||||
groupId,
|
|
||||||
groupName,
|
|
||||||
resTypeId,
|
|
||||||
opTime,
|
|
||||||
isValid,
|
|
||||||
yl1,
|
|
||||||
yl2,
|
|
||||||
yl3,
|
|
||||||
yl4,
|
|
||||||
yl5,
|
|
||||||
lastUpdate
|
|
||||||
</sql>
|
|
||||||
<!--
|
|
||||||
<select id="get" resultMap="dnsGroupTypeMap">
|
|
||||||
select
|
|
||||||
<include refid="dnsGroupTypeColumns"/>
|
|
||||||
from DNS_GROUP_TYPE
|
|
||||||
WHERE id=#{id}
|
|
||||||
</select>
|
|
||||||
<select id="findList" resultMap="dnsGroupTypeMap">
|
|
||||||
select
|
|
||||||
<choose>
|
|
||||||
<when test="page !=null and page.fields != null and page.fields != ''">
|
|
||||||
${page.fields}
|
|
||||||
</when>
|
|
||||||
<otherwise>
|
|
||||||
<include refid="dnsGroupTypeColumns"/>
|
|
||||||
</otherwise>
|
|
||||||
</choose>
|
|
||||||
from DNS_GROUP_TYPE
|
|
||||||
WHERE 1=1
|
|
||||||
<if test="page !=null and page.where != null and page.where != ''">
|
|
||||||
AND ${page.where}
|
|
||||||
</if>
|
|
||||||
<choose>
|
|
||||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
||||||
ORDER BY ${page.orderBy}
|
|
||||||
</when>
|
|
||||||
<otherwise>
|
|
||||||
ORDER BY id desc
|
|
||||||
</otherwise>
|
|
||||||
</choose>
|
|
||||||
</select>
|
|
||||||
-->
|
|
||||||
<insert id="insert" parameterType="dnsGroupType" >
|
|
||||||
<!--
|
|
||||||
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
|
|
||||||
SELECT SEQ_DNS_GROUP_TYPE.Nextval as ID from DUAL
|
|
||||||
</selectKey>
|
|
||||||
-->
|
|
||||||
insert into DNS_GROUP_TYPE(ID,GROUP_ID,GROUP_NAME,RES_TYPE_ID,OP_TIME,IS_VALID,YL1,YL2,YL3,YL4,YL5,LAST_UPDATE)
|
|
||||||
values (#{id},#{groupId},#{groupName},#{resTypeId},#{opTime},#{isValid},#{yl1},#{yl2},#{yl3},#{yl4},#{yl5},#{lastUpdate})
|
|
||||||
</insert>
|
|
||||||
<update id="update" parameterType="dnsGroupType">
|
|
||||||
UPDATE DNS_GROUP_TYPE
|
|
||||||
<set>
|
|
||||||
<if test="groupId != null">
|
|
||||||
GROUP_ID=#{groupId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="groupName != null">
|
|
||||||
GROUP_NAME=#{groupName,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="resTypeId != null">
|
|
||||||
RES_TYPE_ID=#{resTypeId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME=#{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null">
|
|
||||||
IS_VALID=#{isValid,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="yl1 != null">
|
|
||||||
YL1=#{yl1,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="yl2 != null">
|
|
||||||
YL2=#{yl2,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="yl3 != null">
|
|
||||||
YL3=#{yl3,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="yl4 != null">
|
|
||||||
YL4=#{yl4,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="yl5 != null">
|
|
||||||
YL5=#{yl5,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
LAST_UPDATE=#{lastUpdate,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where ID = #{id ,jdbcType=BIGINT }
|
|
||||||
</update>
|
|
||||||
<delete id="delete" parameterType="long">
|
|
||||||
DELETE FROM DNS_GROUP_TYPE
|
|
||||||
WHERE ID = #{id,jdbcType=BIGINT}
|
|
||||||
</delete>
|
|
||||||
<select id="isValid" parameterType="long" resultType="java.lang.Integer">
|
|
||||||
select IS_VALID FROM DNS_GROUP_TYPE
|
|
||||||
WHERE ID = #{id,jdbcType=BIGINT}
|
|
||||||
</select>
|
|
||||||
<select id="isValidBatch" resultType="java.lang.Integer">
|
|
||||||
select count(ID) FROM DNS_GROUP_TYPE
|
|
||||||
WHERE ID in(
|
|
||||||
<foreach collection="idsList" item="ids" separator=",">
|
|
||||||
#{ids}
|
|
||||||
</foreach>
|
|
||||||
) and IS_VALID=#{isValid}
|
|
||||||
</select>
|
|
||||||
<select id="isGroupIdUnique" resultType="java.lang.Integer">
|
|
||||||
select COUNT(ID) FROM DNS_GROUP_TYPE
|
|
||||||
WHERE GROUP_ID in(
|
|
||||||
<foreach collection="idsList" item="ids" separator=",">
|
|
||||||
#{ids,jdbcType=INTEGER}
|
|
||||||
</foreach>
|
|
||||||
)
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsResponseStrategyDao.java
|
|
||||||
*@Package com.nis.web.dao
|
|
||||||
*@Description TODO
|
|
||||||
*@author dell
|
|
||||||
*@date 2016年9月5日 下午5:45:51
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.dao;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.DnsResponseStrategy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsResponseStrategyDao.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月5日 下午5:45:51
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@MyBatisDao
|
|
||||||
public interface DnsResponseStrategyDao extends CrudDao<DnsResponseStrategy> {
|
|
||||||
|
|
||||||
List<DnsResponseStrategy> getDnsResponseStrategy(DnsResponseStrategy dnsResponseStrategy);
|
|
||||||
|
|
||||||
void save(DnsResponseStrategy dnsResponseStrategy);
|
|
||||||
void saveBatch(List<DnsResponseStrategy> dnsResponseStrategyList);
|
|
||||||
void updateBatch(List<DnsResponseStrategy> dnsResponseStrategyList);
|
|
||||||
void delete(long id);
|
|
||||||
int isValid(long id);
|
|
||||||
int isValidBatch(@Param("idsList")List<Long> idsList,@Param("isValid")int isValid);
|
|
||||||
int isReqStrateIdUnique(@Param("idsList")List<Integer> idsList);
|
|
||||||
}
|
|
||||||
@@ -1,377 +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.DnsResponseStrategyDao" >
|
|
||||||
<resultMap type="dnsResponseStrategy" id="dnsResponseStrategyMap">
|
|
||||||
<id property="id" column="ID"/>
|
|
||||||
<result property="reqStrateId" column="REQ_STRATE_ID"/>
|
|
||||||
<result property="strateName" column="STRATE_NAME"/>
|
|
||||||
<result property="resGroupOneId" column="RES_GROUP_1_ID"/>
|
|
||||||
<result property="resGroupOneNum" column="RES_GROUP_1_NUM"/>
|
|
||||||
<result property="resGroupTwoId" column="RES_GROUP_2_ID"/>
|
|
||||||
<result property="resGroupTwoNum" column="RES_GROUP_2_NUM"/>
|
|
||||||
<result property="resGroupThreeId" column="RES_GROUP_3_ID"/>
|
|
||||||
<result property="resGroupThreeNum" column="RES_GROUP_3_NUM"/>
|
|
||||||
<result property="resGroupFourId" column="RES_GROUP_4_ID"/>
|
|
||||||
<result property="resGroupFourNum" column="RES_GROUP_4_NUM"/>
|
|
||||||
<result property="resGroupFiveId" column="RES_GROUP_5_ID"/>
|
|
||||||
<result property="resGroupFiveNum" column="RES_GROUP_5_NUM"/>
|
|
||||||
<result property="authGroup" column="AUTH_GROUP"/>
|
|
||||||
<result property="addGroup" column="ADD_GROUP"/>
|
|
||||||
<result property="opTime" column="OP_TIME"/>
|
|
||||||
<result property="isValid" column="IS_VALID"/>
|
|
||||||
<result property="yl1" column="YL1"/>
|
|
||||||
<result property="yl2" column="YL2"/>
|
|
||||||
<result property="yl3" column="YL3"/>
|
|
||||||
<result property="yl4" column="YL4"/>
|
|
||||||
<result property="yl5" column="YL5"/>
|
|
||||||
<result property="lastUpdate" column="LAST_UPDATE"/>
|
|
||||||
<result property="minTtl" column="MIN_TTL"/>
|
|
||||||
<result property="maxTtl" column="MAX_TTL"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="dnsResponseStrategyColumns">
|
|
||||||
id,
|
|
||||||
reqStrateId,
|
|
||||||
strateName,
|
|
||||||
resGroupOneId,
|
|
||||||
resGroupOneNum,
|
|
||||||
resGroupTwoId,
|
|
||||||
resGroupTwoNum,
|
|
||||||
resGroupThreeId,
|
|
||||||
resGroupThreeNum,
|
|
||||||
resGroupFourId,
|
|
||||||
resGroupFourNum,
|
|
||||||
resGroupFiveId,
|
|
||||||
resGroupFiveNum,
|
|
||||||
authGroup,
|
|
||||||
addGroup,
|
|
||||||
opTime,
|
|
||||||
isValid,
|
|
||||||
yl1,
|
|
||||||
yl2,
|
|
||||||
yl3,
|
|
||||||
yl4,
|
|
||||||
yl5,
|
|
||||||
lastUpdate,
|
|
||||||
minTtl,
|
|
||||||
maxTtl
|
|
||||||
</sql>
|
|
||||||
<!--
|
|
||||||
<select id="get" resultMap="dnsResponseStrategyMap">
|
|
||||||
select
|
|
||||||
<include refid="dnsResponseStrategyColumns"/>
|
|
||||||
from DNS_RESPONSE_STRATEGY
|
|
||||||
WHERE id=#{id}
|
|
||||||
</select>
|
|
||||||
<select id="findList" resultMap="dnsResponseStrategyMap">
|
|
||||||
select
|
|
||||||
<choose>
|
|
||||||
<when test="page !=null and page.fields != null and page.fields != ''">
|
|
||||||
${page.fields}
|
|
||||||
</when>
|
|
||||||
<otherwise>
|
|
||||||
<include refid="dnsResponseStrategyColumns"/>
|
|
||||||
</otherwise>
|
|
||||||
</choose>
|
|
||||||
from DNS_RESPONSE_STRATEGY
|
|
||||||
WHERE 1=1
|
|
||||||
<if test="page !=null and page.where != null and page.where != ''">
|
|
||||||
AND ${page.where}
|
|
||||||
</if>
|
|
||||||
<choose>
|
|
||||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
||||||
ORDER BY ${page.orderBy}
|
|
||||||
</when>
|
|
||||||
<otherwise>
|
|
||||||
ORDER BY id desc
|
|
||||||
</otherwise>
|
|
||||||
</choose>
|
|
||||||
</select>
|
|
||||||
-->
|
|
||||||
<!--
|
|
||||||
<insert id="insert" parameterType="dnsResponseStrategy" >
|
|
||||||
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
|
|
||||||
SELECT SEQ_DNS_RESPONSE_STRATEGY.Nextval as ID from DUAL
|
|
||||||
</selectKey>
|
|
||||||
insert into DNS_RESPONSE_STRATEGY(ID,REQ_STRATE_ID,STRATE_NAME,RES_GROUP_1_ID,RES_GROUP_1_NUM
|
|
||||||
,RES_GROUP_2_ID,RES_GROUP_2_NUM,AUTH_GROUP,ADD_GROUP,OP_TIME,IS_VALID,YL1,YL2,YL3,YL4,YL5)
|
|
||||||
values (#{id},#{reqStrateId},#{strateName},#{resGroupOneId},#{resGroupOneNum},#{resGroupTwoId},#{resGroupTwoNum},
|
|
||||||
#{authGroup},#{addGroup},#{opTime},#{isValid},#{yl1},#{yl2},#{yl3},#{yl4},#{yl5})
|
|
||||||
</insert>
|
|
||||||
-->
|
|
||||||
<insert id="insert" parameterType="com.nis.domain.restful.DnsResponseStrategy">
|
|
||||||
<!--
|
|
||||||
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
|
|
||||||
SELECT SEQ_DNS_RESPONSE_STRATEGY.Nextval as ID from DUAL
|
|
||||||
</selectKey>
|
|
||||||
-->
|
|
||||||
insert into DNS_RESPONSE_STRATEGY
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
ID,
|
|
||||||
<if test="reqStrateId != null">
|
|
||||||
REQ_STRATE_ID,
|
|
||||||
</if>
|
|
||||||
<if test="strateName != null">
|
|
||||||
STRATE_NAME,
|
|
||||||
</if>
|
|
||||||
<if test="resGroupOneId != null">
|
|
||||||
RES_GROUP_1_ID,
|
|
||||||
</if>
|
|
||||||
<if test="resGroupOneNum != null">
|
|
||||||
RES_GROUP_1_NUM,
|
|
||||||
</if>
|
|
||||||
<if test="resGroupTwoId != null">
|
|
||||||
RES_GROUP_2_ID,
|
|
||||||
</if>
|
|
||||||
<if test="resGroupTwoNum != null">
|
|
||||||
RES_GROUP_2_NUM,
|
|
||||||
</if>
|
|
||||||
<if test="resGroupThreeId != null">
|
|
||||||
RES_GROUP_3_ID,
|
|
||||||
</if>
|
|
||||||
<if test="resGroupThreeNum != null">
|
|
||||||
RES_GROUP_3_NUM,
|
|
||||||
</if>
|
|
||||||
<if test="resGroupFourId != null">
|
|
||||||
RES_GROUP_4_ID,
|
|
||||||
</if>
|
|
||||||
<if test="resGroupFourNum != null">
|
|
||||||
RES_GROUP_4_NUM,
|
|
||||||
</if>
|
|
||||||
<if test="resGroupFiveId != null">
|
|
||||||
RES_GROUP_5_ID,
|
|
||||||
</if>
|
|
||||||
<if test="resGroupFiveNum != null">
|
|
||||||
RES_GROUP_5_NUM,
|
|
||||||
</if>
|
|
||||||
<if test="authGroup != null">
|
|
||||||
AUTH_GROUP,
|
|
||||||
</if>
|
|
||||||
<if test="addGroup != null">
|
|
||||||
ADD_GROUP,
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME,
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null">
|
|
||||||
IS_VALID,
|
|
||||||
</if>
|
|
||||||
<if test="yl1 != null">
|
|
||||||
YL1,
|
|
||||||
</if>
|
|
||||||
<if test="yl2 != null">
|
|
||||||
YL2,
|
|
||||||
</if>
|
|
||||||
<if test="yl3 != null">
|
|
||||||
YL3,
|
|
||||||
</if>
|
|
||||||
<if test="yl4 != null">
|
|
||||||
YL4,
|
|
||||||
</if>
|
|
||||||
<if test="yl5 != null">
|
|
||||||
YL5,
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
LAST_UPDATE,
|
|
||||||
</if>
|
|
||||||
<if test="minTtl != null">
|
|
||||||
MIN_TTL,
|
|
||||||
</if>
|
|
||||||
<if test="maxTtl != null">
|
|
||||||
MAX_TTL,
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
#{id,jdbcType=BIGINT},
|
|
||||||
<if test="reqStrateId != null">
|
|
||||||
#{reqStrateId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="strateName != null">
|
|
||||||
#{strateName,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="resGroupOneId != null">
|
|
||||||
#{resGroupOneId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="resGroupOneNum != null">
|
|
||||||
#{resGroupOneNum,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="resGroupTwoId != null">
|
|
||||||
#{resGroupTwoId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="resGroupTwoNum != null">
|
|
||||||
#{resGroupTwoNum,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="resGroupThreeId != null">
|
|
||||||
#{resGroupThreeId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="resGroupThreeNum != null">
|
|
||||||
#{resGroupThreeNum,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="resGroupFourId != null">
|
|
||||||
#{resGroupFourId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="resGroupFourNum != null">
|
|
||||||
#{resGroupFourNum,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="resGroupFiveId != null">
|
|
||||||
#{resGroupFiveId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="resGroupFiveNum != null">
|
|
||||||
#{resGroupFiveNum,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="authGroup != null">
|
|
||||||
#{authGroup,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="addGroup != null">
|
|
||||||
#{addGroup,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
#{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null">
|
|
||||||
#{isValid,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="yl1 != null">
|
|
||||||
#{yl1,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="yl2 != null">
|
|
||||||
#{yl2,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="yl3 != null">
|
|
||||||
#{yl3,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="yl4 != null">
|
|
||||||
#{yl4,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="yl5 != null">
|
|
||||||
#{yl5,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
#{lastUpdate,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="minTtl != null">
|
|
||||||
#{minTtl,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="maxTtl != null">
|
|
||||||
#{maxTtl,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
<!--
|
|
||||||
<insert id="saveBatch" parameterType="java.util.List">
|
|
||||||
insert into DNS_RESPONSE_STRATEGY(ID,REQ_STRATE_ID,STRATE_NAME,RES_GROUP_1_ID,RES_GROUP_1_NUM
|
|
||||||
,RES_GROUP_2_ID,RES_GROUP_2_NUM,AUTH_GROUP,ADD_GROUP,OP_TIME,IS_VALID,YL1,YL2,YL3,YL4,YL5)
|
|
||||||
<foreach collection="list" item="item" index="index" separator="union all">
|
|
||||||
(select SEQ_DNS_RESPONSE_STRATEGY.Nextval,#{item.reqStrateId,jdbcType=NUMBER },#{item.strateName,jdbcType=VARCHAR2},#{item.resGroupOneId,jdbcType=NUMBER},#{item.resGroupOneNum,jdbcType=NUMBER},#{item.resGroupTwoId,jdbcType=NUMBER},#{item.resGroupTwoNum,jdbcType=NUMBER},
|
|
||||||
#{item.authGroup,jdbcType=NUMBER},#{item.addGroup,jdbcType=NUMBER},#{item.opTime,jdbcType=DATE},#{item.isValid,jdbcType=NUMBER},#{item.yl1,jdbcType=NUMBER},#{item.yl2,jdbcType=NUMBER},#{item.yl3,jdbcType=VARCHAR2},#{item.yl4,jdbcType=VARCHAR2},#{item.yl5,jdbcType=VARCHAR2} from dual)
|
|
||||||
</foreach>
|
|
||||||
</insert>
|
|
||||||
-->
|
|
||||||
<update id="update" parameterType="dnsResponseStrategy">
|
|
||||||
UPDATE DNS_RESPONSE_STRATEGY
|
|
||||||
<set>
|
|
||||||
<if test="reqStrateId != null">
|
|
||||||
REQ_STRATE_ID=#{reqStrateId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="strateName != null">
|
|
||||||
STRATE_NAME=#{strateName,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="resGroupOneId != null">
|
|
||||||
RES_GROUP_1_ID=#{resGroupOneId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="resGroupOneNum != null">
|
|
||||||
RES_GROUP_1_NUM=#{resGroupOneNum,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="resGroupTwoId != null">
|
|
||||||
RES_GROUP_2_ID=#{resGroupTwoId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="resGroupTwoNum != null">
|
|
||||||
RES_GROUP_2_NUM=#{resGroupTwoNum,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="resGroupThreeId != null">
|
|
||||||
RES_GROUP_3_ID=#{resGroupThreeId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="resGroupThreeNum != null">
|
|
||||||
RES_GROUP_3_NUM=#{resGroupThreeNum,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="resGroupFourId != null">
|
|
||||||
RES_GROUP_4_ID=#{resGroupFourId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="resGroupFourNum != null">
|
|
||||||
RES_GROUP_4_NUM=#{resGroupFourNum,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="resGroupFiveId != null">
|
|
||||||
RES_GROUP_5_ID=#{resGroupFiveId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="resGroupFiveNum != null">
|
|
||||||
RES_GROUP_5_NUM=#{resGroupFiveNum,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="authGroup != null">
|
|
||||||
AUTH_GROUP=#{authGroup,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="addGroup != null">
|
|
||||||
ADD_GROUP=#{addGroup,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME=#{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null">
|
|
||||||
IS_VALID=#{isValid,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="yl1 != null">
|
|
||||||
YL1=#{yl1,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="yl2 != null">
|
|
||||||
YL2=#{yl2,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="yl3 != null">
|
|
||||||
YL3=#{yl3,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="yl4 != null">
|
|
||||||
YL4=#{yl4,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="yl5 != null">
|
|
||||||
YL5=#{yl5,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
LAST_UPDATE=#{lastUpdate,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="minTtl != null">
|
|
||||||
MIN_TTL=#{minTtl,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="maxTtl != null">
|
|
||||||
MAX_TTL=#{maxTtl,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where ID = #{id ,jdbcType=BIGINT }
|
|
||||||
</update>
|
|
||||||
<delete id="delete" parameterType="long">
|
|
||||||
DELETE FROM DNS_RESPONSE_STRATEGY
|
|
||||||
WHERE ID = #{id,jdbcType=BIGINT}
|
|
||||||
</delete>
|
|
||||||
<select id="isValid" parameterType="long" resultType="java.lang.Integer">
|
|
||||||
select IS_VALID FROM DNS_RESPONSE_STRATEGY
|
|
||||||
WHERE ID = #{id,jdbcType=BIGINT}
|
|
||||||
</select>
|
|
||||||
<select id="isReqStrateIdUnique" resultType="java.lang.Integer">
|
|
||||||
select COUNT(ID) FROM DNS_RESPONSE_STRATEGY
|
|
||||||
WHERE REQ_STRATE_ID in(
|
|
||||||
<foreach collection="idsList" item="ids" separator=",">
|
|
||||||
#{ids,jdbcType=INTEGER}
|
|
||||||
</foreach>
|
|
||||||
)
|
|
||||||
</select>
|
|
||||||
<select id="isValidBatch" resultType="java.lang.Integer">
|
|
||||||
select count(ID) FROM DNS_RESPONSE_STRATEGY
|
|
||||||
WHERE ID in(
|
|
||||||
<foreach collection="idsList" item="ids" separator=",">
|
|
||||||
#{ids}
|
|
||||||
</foreach>
|
|
||||||
) and IS_VALID=#{isValid}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package com.nis.web.dao;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.EncryptProtoRandom;
|
|
||||||
@MyBatisDao
|
|
||||||
public interface EncryptProtoRandomDao extends CrudDao<EncryptProtoRandom>{
|
|
||||||
int delete(Long id);
|
|
||||||
int insert(EncryptProtoRandom record);
|
|
||||||
int update(EncryptProtoRandom record);
|
|
||||||
}
|
|
||||||
@@ -1,112 +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.EncryptProtoRandomDao">
|
|
||||||
<resultMap id="BaseResultMap" type="com.nis.domain.restful.EncryptProtoRandom">
|
|
||||||
<id column="ID" jdbcType="BIGINT" property="id" />
|
|
||||||
<result column="RANDOM_VALUE" jdbcType="INTEGER" property="randomValue" />
|
|
||||||
<result column="PROTO" jdbcType="INTEGER" property="proto" />
|
|
||||||
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
|
|
||||||
<result column="IS_VALID" jdbcType="INTEGER" property="isValid" />
|
|
||||||
<result column="PROC_SEQ" jdbcType="INTEGER" property="procSeq" />
|
|
||||||
<result column="LAST_UPDATE" jdbcType="TIMESTAMP" property="lastUpdate" />
|
|
||||||
</resultMap>
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
ID, RANDOM_VALUE, PROTO, OP_TIME, IS_VALID, PROC_SEQ, LAST_UPDATE
|
|
||||||
</sql>
|
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List" />
|
|
||||||
from ENCRYPT_PROTO_RANDOM
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</select>
|
|
||||||
<delete id="delete" parameterType="java.lang.Long">
|
|
||||||
delete from ENCRYPT_PROTO_RANDOM
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</delete>
|
|
||||||
<!--
|
|
||||||
<insert id="insert" parameterType="com.nis.domain.restful.EncryptProtoRandom">
|
|
||||||
insert into ENCRYPT_PROTO_RANDOM (ID, RANDOM_VALUE, PROTO,
|
|
||||||
OP_TIME, IS_VALID, PROC_SEQ,
|
|
||||||
LAST_UPDATE)
|
|
||||||
values (#{id,jdbcType=INTEGER}, #{randomValue,jdbcType=INTEGER}, #{proto,jdbcType=INTEGER},
|
|
||||||
#{opTime,jdbcType=TIMESTAMP}, #{isValid,jdbcType=INTEGER}, #{procSeq,jdbcType=INTEGER},
|
|
||||||
#{lastUpdate,jdbcType=TIMESTAMP})
|
|
||||||
</insert>
|
|
||||||
-->
|
|
||||||
<insert id="insert" parameterType="com.nis.domain.restful.EncryptProtoRandom">
|
|
||||||
<!--
|
|
||||||
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
|
|
||||||
SELECT SEQ_ENCRYPT_PROTO_RANDOM.Nextval as ID from DUAL
|
|
||||||
</selectKey>
|
|
||||||
-->
|
|
||||||
insert into ENCRYPT_PROTO_RANDOM
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
ID,
|
|
||||||
<if test="randomValue != null">
|
|
||||||
RANDOM_VALUE,
|
|
||||||
</if>
|
|
||||||
<if test="proto != null">
|
|
||||||
PROTO,
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME,
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null">
|
|
||||||
IS_VALID,
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
LAST_UPDATE,
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
#{id,jdbcType=BIGINT},
|
|
||||||
<if test="randomValue != null">
|
|
||||||
#{randomValue,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="proto != null">
|
|
||||||
#{proto,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
#{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null">
|
|
||||||
#{isValid,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
#{lastUpdate,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
<update id="update" parameterType="com.nis.domain.restful.EncryptProtoRandom">
|
|
||||||
update ENCRYPT_PROTO_RANDOM
|
|
||||||
<set>
|
|
||||||
<if test="randomValue != null">
|
|
||||||
RANDOM_VALUE = #{randomValue,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="proto != null">
|
|
||||||
PROTO = #{proto,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null">
|
|
||||||
IS_VALID = #{isValid,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
LAST_UPDATE = #{lastUpdate,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</update>
|
|
||||||
<!--
|
|
||||||
<update id="updateByPrimaryKey" parameterType="com.nis.domain.restful.EncryptProtoRandom">
|
|
||||||
update ENCRYPT_PROTO_RANDOM
|
|
||||||
set RANDOM_VALUE = #{randomValue,jdbcType=INTEGER},
|
|
||||||
PROTO = #{proto,jdbcType=INTEGER},
|
|
||||||
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
|
|
||||||
IS_VALID = #{isValid,jdbcType=INTEGER},
|
|
||||||
LAST_UPDATE = #{lastUpdate,jdbcType=TIMESTAMP}
|
|
||||||
where ID = #{id,jdbcType=INTEGER}
|
|
||||||
</update>
|
|
||||||
-->
|
|
||||||
</mapper>
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
package com.nis.web.dao;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.FakeIpConfigCompile;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @ClassName: FakeIpConfigCompileDao.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月8日 下午3:23:07
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@MyBatisDao
|
|
||||||
public interface FakeIpConfigCompileDao extends CrudDao<FakeIpConfigCompile> {
|
|
||||||
int delete(Long compileId);
|
|
||||||
long getCompileId();
|
|
||||||
int insert(FakeIpConfigCompile record);
|
|
||||||
|
|
||||||
int insertSelective(FakeIpConfigCompile record);
|
|
||||||
|
|
||||||
FakeIpConfigCompile selectByPrimaryKey(Long compileId);
|
|
||||||
|
|
||||||
int updateByPrimaryKeySelective(FakeIpConfigCompile record);
|
|
||||||
|
|
||||||
int updateByPrimaryKey(FakeIpConfigCompile record);
|
|
||||||
}
|
|
||||||
@@ -1,170 +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.FakeIpConfigCompileDao">
|
|
||||||
<resultMap id="BaseResultMap" type="com.nis.domain.restful.FakeIpConfigCompile">
|
|
||||||
<id column="COMPILE_ID" jdbcType="BIGINT" property="compileId" />
|
|
||||||
<result column="SERVICE" jdbcType="INTEGER" property="service" />
|
|
||||||
<result column="ACTION" jdbcType="INTEGER" property="action" />
|
|
||||||
<result column="DO_BLACKLIST" jdbcType="INTEGER" property="doBlacklist" />
|
|
||||||
<result column="DO_LOG" jdbcType="INTEGER" property="doLog" />
|
|
||||||
<result column="EFFECTIVE_RANGE" jdbcType="VARCHAR" property="effectiveRange" />
|
|
||||||
<result column="USER_REGION" jdbcType="VARCHAR" property="userRegion" />
|
|
||||||
<result column="IS_VALID" jdbcType="INTEGER" property="isValid" />
|
|
||||||
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
|
|
||||||
<result column="GROUP_NUM" jdbcType="INTEGER" property="groupNum" />
|
|
||||||
<result property="lastUpdate" jdbcType="TIMESTAMP" column="LAST_UPDATE"/>
|
|
||||||
<result property="activeSys" jdbcType="INTEGER" column="ACTIVE_SYS"/>
|
|
||||||
</resultMap>
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
COMPILE_ID, SERVICE, ACTION, DO_BLACKLIST, DO_LOG, EFFECTIVE_RANGE, USER_REGION,
|
|
||||||
IS_VALID, OP_TIME, GROUP_NUM,LAST_UPDATE,ACTIVE_SYS
|
|
||||||
</sql>
|
|
||||||
<!--
|
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List" />
|
|
||||||
from FAKE_IP_CONFIG_COMPILE
|
|
||||||
where COMPILE_ID = #{compileId,jdbcType=BIGINT}
|
|
||||||
</select>
|
|
||||||
-->
|
|
||||||
<delete id="delete" parameterType="java.lang.Long">
|
|
||||||
delete from FAKE_IP_CONFIG_COMPILE
|
|
||||||
where COMPILE_ID = #{compileId,jdbcType=BIGINT}
|
|
||||||
</delete>
|
|
||||||
<select resultType="java.lang.Long" id="getCompileId" flushCache="true" useCache="false">
|
|
||||||
select SEQ_FAKE_IP_CONFIG_COMPILE.Nextval as ID from DUAL
|
|
||||||
</select>
|
|
||||||
<insert id="insert" parameterType="com.nis.domain.restful.FakeIpConfigCompile">
|
|
||||||
insert into FAKE_IP_CONFIG_COMPILE (COMPILE_ID, SERVICE, ACTION,
|
|
||||||
DO_BLACKLIST, DO_LOG, EFFECTIVE_RANGE,
|
|
||||||
USER_REGION, IS_VALID, OP_TIME,
|
|
||||||
GROUP_NUM,LAST_UPDATE,ACTIVE_SYS)
|
|
||||||
values (#{compileId,jdbcType=BIGINT}, #{service,jdbcType=INTEGER}, #{action,jdbcType=INTEGER},
|
|
||||||
#{doBlacklist,jdbcType=INTEGER}, #{doLog,jdbcType=INTEGER}, #{effectiveRange,jdbcType=VARCHAR},
|
|
||||||
#{userRegion,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER}, #{opTime,jdbcType=TIMESTAMP},
|
|
||||||
#{groupNum,jdbcType=INTEGER}, #{lastUpdate,jdbcType=TIMESTAMP},#{activeSys,jdbcType=INTEGER})
|
|
||||||
</insert>
|
|
||||||
<!--
|
|
||||||
<insert id="insertSelective" parameterType="com.nis.domain.restful.FakeIpConfigCompile">
|
|
||||||
insert into FAKE_IP_CONFIG_COMPILE
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="compileId != null">
|
|
||||||
COMPILE_ID,
|
|
||||||
</if>
|
|
||||||
<if test="service != null">
|
|
||||||
SERVICE,
|
|
||||||
</if>
|
|
||||||
<if test="action != null">
|
|
||||||
ACTION,
|
|
||||||
</if>
|
|
||||||
<if test="doBlacklist != null">
|
|
||||||
DO_BLACKLIST,
|
|
||||||
</if>
|
|
||||||
<if test="doLog != null">
|
|
||||||
DO_LOG,
|
|
||||||
</if>
|
|
||||||
<if test="effectiveRange != null">
|
|
||||||
EFFECTIVE_RANGE,
|
|
||||||
</if>
|
|
||||||
<if test="userRegion != null">
|
|
||||||
USER_REGION,
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null">
|
|
||||||
IS_VALID,
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME,
|
|
||||||
</if>
|
|
||||||
<if test="groupNum != null">
|
|
||||||
GROUP_NUM,
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="compileId != null">
|
|
||||||
#{compileId,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="service != null">
|
|
||||||
#{service,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="action != null">
|
|
||||||
#{action,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="doBlacklist != null">
|
|
||||||
#{doBlacklist,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="doLog != null">
|
|
||||||
#{doLog,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="effectiveRange != null">
|
|
||||||
#{effectiveRange,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="userRegion != null">
|
|
||||||
#{userRegion,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null">
|
|
||||||
#{isValid,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
#{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="groupNum != null">
|
|
||||||
#{groupNum,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
-->
|
|
||||||
<update id="update" parameterType="com.nis.domain.restful.FakeIpConfigCompile">
|
|
||||||
update FAKE_IP_CONFIG_COMPILE
|
|
||||||
<set>
|
|
||||||
<if test="service != null">
|
|
||||||
SERVICE = #{service,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="action != null">
|
|
||||||
ACTION = #{action,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="doBlacklist != null">
|
|
||||||
DO_BLACKLIST = #{doBlacklist,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="doLog != null">
|
|
||||||
DO_LOG = #{doLog,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="effectiveRange != null">
|
|
||||||
EFFECTIVE_RANGE = #{effectiveRange,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="userRegion != null">
|
|
||||||
USER_REGION = #{userRegion,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null">
|
|
||||||
IS_VALID = #{isValid,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="groupNum != null">
|
|
||||||
GROUP_NUM = #{groupNum,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
LAST_UPDATE = #{lastUpdate,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="activeSys != null">
|
|
||||||
ACTIVE_SYS = #{activeSys,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where COMPILE_ID = #{compileId,jdbcType=BIGINT}
|
|
||||||
</update>
|
|
||||||
<!--
|
|
||||||
<update id="updateByPrimaryKey" parameterType="com.nis.domain.restful.FakeIpConfigCompile">
|
|
||||||
update FAKE_IP_CONFIG_COMPILE
|
|
||||||
set SERVICE = #{service,jdbcType=DECIMAL},
|
|
||||||
ACTION = #{action,jdbcType=DECIMAL},
|
|
||||||
DO_BLACKLIST = #{doBlacklist,jdbcType=DECIMAL},
|
|
||||||
DO_LOG = #{doLog,jdbcType=DECIMAL},
|
|
||||||
EFFECTIVE_RANGE = #{effectiveRange,jdbcType=VARCHAR},
|
|
||||||
USER_REGION = #{userRegion,jdbcType=VARCHAR},
|
|
||||||
IS_VALID = #{isValid,jdbcType=DECIMAL},
|
|
||||||
OP_TIME = #{opTime,jdbcType=DATE},
|
|
||||||
GROUP_NUM = #{groupNum,jdbcType=DECIMAL}
|
|
||||||
where COMPILE_ID = #{compileId,jdbcType=DECIMAL}
|
|
||||||
</update>
|
|
||||||
-->
|
|
||||||
</mapper>
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package com.nis.web.dao;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.FakeIpConfigGroup;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @ClassName: FakeIpConfigGroupDao.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月8日 下午3:25:17
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@MyBatisDao
|
|
||||||
public interface FakeIpConfigGroupDao extends CrudDao<FakeIpConfigGroup>{
|
|
||||||
int insert(FakeIpConfigGroup record);
|
|
||||||
// int delete(long record);
|
|
||||||
int insertSelective(FakeIpConfigGroup record);
|
|
||||||
}
|
|
||||||
@@ -1,51 +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.FakeIpConfigGroupDao">
|
|
||||||
<resultMap id="BaseResultMap" type="com.nis.domain.restful.FakeIpConfigGroup">
|
|
||||||
<result column="GROUP_ID" jdbcType="BIGINT" property="groupId" />
|
|
||||||
<result column="COMPILE_ID" jdbcType="BIGINT" property="compileId" />
|
|
||||||
<result column="IS_VALID" jdbcType="INTEGER" property="isValid" />
|
|
||||||
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
|
|
||||||
<result property="lastUpdate" jdbcType="TIMESTAMP" column="LAST_UPDATE"/>
|
|
||||||
<result property="id" jdbcType="BIGINT" column="ID"/>
|
|
||||||
</resultMap>
|
|
||||||
<insert id="insert" parameterType="com.nis.domain.restful.FakeIpConfigGroup">
|
|
||||||
insert into FAKE_IP_CONFIG_GROUP (GROUP_ID, COMPILE_ID, IS_VALID,
|
|
||||||
OP_TIME,LAST_UPDATE,ID)
|
|
||||||
values (#{groupId,jdbcType=BIGINT}, #{compileId,jdbcType=BIGINT}, #{isValid,jdbcType=INTEGER},
|
|
||||||
#{opTime,jdbcType=TIMESTAMP},#{lastUpdate,jdbcType=TIMESTAMP},SEQ_CONFIG_GROUP.Nextval)
|
|
||||||
</insert>
|
|
||||||
<!--
|
|
||||||
<insert id="insertSelective" parameterType="com.nis.domain.restful.FakeIpConfigGroup">
|
|
||||||
insert into FAKE_IP_CONFIG_GROUP
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="groupId != null">
|
|
||||||
GROUP_ID,
|
|
||||||
</if>
|
|
||||||
<if test="compileId != null">
|
|
||||||
COMPILE_ID,
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null">
|
|
||||||
IS_VALID,
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME,
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="groupId != null">
|
|
||||||
#{groupId,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="compileId != null">
|
|
||||||
#{compileId,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null">
|
|
||||||
#{isValid,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
#{opTime,jdbcType=DATE},
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
-->
|
|
||||||
</mapper>
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package com.nis.web.dao;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.FwqInfo;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @ClassName: FwqInfoDao.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (dell)
|
|
||||||
* @date 2016年9月9日 上午10:01:09
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@MyBatisDao
|
|
||||||
public interface FwqInfoDao extends CrudDao<FwqInfo>{
|
|
||||||
int delete(long id);
|
|
||||||
|
|
||||||
int insert(FwqInfo record);
|
|
||||||
|
|
||||||
int update(FwqInfo record);
|
|
||||||
}
|
|
||||||
@@ -1,106 +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.FwqInfoDao">
|
|
||||||
<resultMap id="fwqInfoResultMap" type="com.nis.domain.restful.FwqInfo">
|
|
||||||
<id column="ID" jdbcType="BIGINT" property="id" />
|
|
||||||
<result column="NAME" jdbcType="VARCHAR" property="name" />
|
|
||||||
<result column="ENTRANCE_ID" jdbcType="BIGINT" property="entranceId" />
|
|
||||||
<result column="CZYID" jdbcType="BIGINT" property="czyid" />
|
|
||||||
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
|
|
||||||
<result property="lastUpdate" jdbcType="TIMESTAMP" column="LAST_UPDATE"/>
|
|
||||||
</resultMap>
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
ID, NAME, ENTRANCE_ID, CZYID, OP_TIME,LAST_UPDATE
|
|
||||||
</sql>
|
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="fwqInfoResultMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List" />
|
|
||||||
from FWQ_INFO
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</select>
|
|
||||||
<delete id="delete" parameterType="java.lang.Long">
|
|
||||||
delete from FWQ_INFO
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</delete>
|
|
||||||
<insert id="insert" parameterType="com.nis.domain.restful.FwqInfo">
|
|
||||||
<!--
|
|
||||||
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
|
|
||||||
SELECT SEQ_FWQ_INFO.Nextval as ID from DUAL
|
|
||||||
</selectKey>
|
|
||||||
-->
|
|
||||||
insert into FWQ_INFO (ID, NAME, ENTRANCE_ID,
|
|
||||||
CZYID, OP_TIME,LAST_UPDATE)
|
|
||||||
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{entranceId,jdbcType=BIGINT},
|
|
||||||
#{czyid,jdbcType=BIGINT}, #{opTime,jdbcType=TIMESTAMP},#{lastUpdate,jdbcType=TIMESTAMP})
|
|
||||||
</insert>
|
|
||||||
<!--
|
|
||||||
<insert id="insertSelective" parameterType="com.nis.domain.restful.FwqInfo">
|
|
||||||
insert into FWQ_INFO
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="id != null">
|
|
||||||
ID,
|
|
||||||
</if>
|
|
||||||
<if test="name != null">
|
|
||||||
NAME,
|
|
||||||
</if>
|
|
||||||
<if test="entranceId != null">
|
|
||||||
ENTRANCE_ID,
|
|
||||||
</if>
|
|
||||||
<if test="czyid != null">
|
|
||||||
CZYID,
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME,
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="id != null">
|
|
||||||
#{id,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="name != null">
|
|
||||||
#{name,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="entranceId != null">
|
|
||||||
#{entranceId,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="czyid != null">
|
|
||||||
#{czyid,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
#{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
-->
|
|
||||||
<update id="update" parameterType="com.nis.domain.restful.FwqInfo">
|
|
||||||
update FWQ_INFO
|
|
||||||
<set>
|
|
||||||
<if test="name != null">
|
|
||||||
NAME = #{name,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="entranceId != null">
|
|
||||||
ENTRANCE_ID = #{entranceId,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="czyid != null">
|
|
||||||
CZYID = #{czyid,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
LAST_UPDATE = #{lastUpdate,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</update>
|
|
||||||
<!--
|
|
||||||
<update id="updateByPrimaryKey" parameterType="com.nis.domain.restful.FwqInfo">
|
|
||||||
update FWQ_INFO
|
|
||||||
set NAME = #{name,jdbcType=VARCHAR},
|
|
||||||
ENTRANCE_ID = #{entranceId,jdbcType=BIGINT},
|
|
||||||
CZYID = #{czyid,jdbcType=BIGINT},
|
|
||||||
OP_TIME = #{opTime,jdbcType=TIMESTAMP}
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</update>
|
|
||||||
-->
|
|
||||||
</mapper>
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
package com.nis.web.dao;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.IpRegion;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @ClassName: IpRegionDao
|
|
||||||
* @Description: TODO(ip类域配置dao)
|
|
||||||
* @author (rkg)
|
|
||||||
* @date 2016年9月6日下午8:49:52
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@MyBatisDao
|
|
||||||
public interface IpRegionDao {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存ip类域配置信息,并返回主键id
|
|
||||||
*
|
|
||||||
* @param ipRegion
|
|
||||||
* ip类域配置
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Long saveIpRegion(IpRegion ipRegion);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据主键id修改ip类域配置信息
|
|
||||||
*
|
|
||||||
* @param ipRegion
|
|
||||||
*/
|
|
||||||
public void updateIpRegion(IpRegion ipRegion);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据主键regionId查询ip域配置
|
|
||||||
*
|
|
||||||
* @param ipRegion
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public IpRegion queryIpRegionById(IpRegion ipRegion);
|
|
||||||
/**
|
|
||||||
* 根据groupId获取该分组下所有的ip类域配置
|
|
||||||
* @param tableName
|
|
||||||
* @param groupIdArr
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public List<IpRegion> queryIpRegionByGroupId(@Param("tableName")String tableName,@Param("groupIdArr")Long[] groupIdArr);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 往指定ip域表中批量添加数据
|
|
||||||
* @param tableName
|
|
||||||
* @param ipRegionList
|
|
||||||
*/
|
|
||||||
public void saveIpRegionBatch(@Param("tableName")String tableName,@Param("ipRegionList")List<IpRegion> ipRegionList);
|
|
||||||
}
|
|
||||||
@@ -1,221 +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.IpRegionDao">
|
|
||||||
<resultMap id="BaseResultMap" type="com.nis.domain.restful.IpRegion">
|
|
||||||
<result column="REGION_ID" jdbcType="BIGINT" property="regionId" />
|
|
||||||
<result column="GROUP_ID" jdbcType="BIGINT" property="groupId" />
|
|
||||||
<result column="ADDR_TYPE" jdbcType="INTEGER" property="addrType" />
|
|
||||||
<result column="SRC_IP" jdbcType="VARCHAR" property="srcIp" />
|
|
||||||
<result column="MASK_SRC_IP" jdbcType="VARCHAR" property="maskSrcIp" />
|
|
||||||
<result column="SRC_PORT" jdbcType="VARCHAR" property="srcPort" />
|
|
||||||
<result column="MASK_SRC_PORT" jdbcType="VARCHAR" property="maskSrcPort" />
|
|
||||||
<result column="DST_IP" jdbcType="VARCHAR" property="dstIp" />
|
|
||||||
<result column="MASK_DST_IP" jdbcType="VARCHAR" property="maskDstIp" />
|
|
||||||
<result column="DST_PORT" jdbcType="VARCHAR" property="dstPort" />
|
|
||||||
<result column="MASK_DST_PORT" jdbcType="VARCHAR" property="maskDstPort" />
|
|
||||||
<result column="PROTOCOL" jdbcType="INTEGER" property="protocol" />
|
|
||||||
<result column="DIRECTION" jdbcType="INTEGER" property="direction" />
|
|
||||||
<result column="IS_VALID" jdbcType="INTEGER" property="isValid" />
|
|
||||||
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
|
|
||||||
<result column="LAST_UPDATE" jdbcType="TIMESTAMP" property="lastUpdate" />
|
|
||||||
<result column="PROC_SEQ" jdbcType="BIGINT" property="procSeq" />
|
|
||||||
</resultMap>
|
|
||||||
<sql id="ipRegionSql">
|
|
||||||
REGION_ID,GROUP_ID,
|
|
||||||
ADDR_TYPE,SRC_IP,MASK_SRC_IP,SRC_PORT,MASK_SRC_PORT,DST_IP,
|
|
||||||
MASK_DST_IP,DST_PORT,MASK_DST_PORT,PROTOCOL,DIRECTION,IS_VALID,OP_TIME,LAST_UPDATE,PROC_SEQ
|
|
||||||
</sql>
|
|
||||||
<select id="queryIpRegionById" parameterType="com.nis.domain.restful.IpRegion"
|
|
||||||
resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
<include refid="ipRegionSql" />
|
|
||||||
from ${tableName} where REGION_ID = #{regionId,jdbcType=BIGINT}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
|
||||||
<select id="queryIpRegionByGroupId" resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
<include refid="ipRegionSql" />
|
|
||||||
from ${tableName} where GROUP_ID in
|
|
||||||
<foreach item="item" index="index" collection="groupIdArr" open="("
|
|
||||||
separator="," close=")">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<insert id="saveIpRegionBatch">
|
|
||||||
<!-- insert /*+append*/ into ${tableName} -->
|
|
||||||
insert into ${tableName}
|
|
||||||
(REGION_ID,
|
|
||||||
GROUP_ID,
|
|
||||||
ADDR_TYPE,
|
|
||||||
SRC_IP,
|
|
||||||
MASK_SRC_IP,
|
|
||||||
SRC_PORT,
|
|
||||||
MASK_SRC_PORT,
|
|
||||||
DST_IP,
|
|
||||||
MASK_DST_IP,
|
|
||||||
DST_PORT,
|
|
||||||
MASK_DST_PORT,
|
|
||||||
PROTOCOL,
|
|
||||||
DIRECTION,
|
|
||||||
IS_VALID,
|
|
||||||
OP_TIME,LAST_UPDATE
|
|
||||||
<!-- ,PROC_SEQ -->
|
|
||||||
)
|
|
||||||
<foreach collection="ipRegionList" item="item" index="index" open="("
|
|
||||||
close=")" separator="union">
|
|
||||||
select
|
|
||||||
#{item.regionId,jdbcType=BIGINT},
|
|
||||||
#{item.groupId,jdbcType=BIGINT},
|
|
||||||
#{item.addrType,jdbcType=INTEGER},
|
|
||||||
#{item.srcIp,jdbcType=VARCHAR},
|
|
||||||
#{item.maskSrcIp,jdbcType=VARCHAR},
|
|
||||||
#{item.srcPort,jdbcType=VARCHAR},
|
|
||||||
#{item.maskSrcPort,jdbcType=VARCHAR},
|
|
||||||
#{item.dstIp,jdbcType=VARCHAR},
|
|
||||||
#{item.maskDstIp,jdbcType=VARCHAR},
|
|
||||||
#{item.dstPort,jdbcType=VARCHAR},
|
|
||||||
#{item.maskDstPort,jdbcType=VARCHAR},
|
|
||||||
#{item.protocol,jdbcType=INTEGER},
|
|
||||||
#{item.direction,jdbcType=INTEGER},
|
|
||||||
#{item.isValid,jdbcType=INTEGER},
|
|
||||||
#{item.opTime,jdbcType=TIMESTAMP},
|
|
||||||
sysdate
|
|
||||||
<!-- #{item.procSeq,jdbcType=BIGINT} -->
|
|
||||||
from dual
|
|
||||||
</foreach>
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<insert id="saveIpRegion" parameterType="com.nis.domain.restful.IpRegion">
|
|
||||||
<!-- <selectKey keyProperty="regionId" resultType="java.lang.Long" -->
|
|
||||||
<!-- order="BEFORE"> 取消使用序列,界面会将id传过来 -->
|
|
||||||
<!-- select seq_regionId.nextval from dual -->
|
|
||||||
<!-- </selectKey> -->
|
|
||||||
|
|
||||||
insert into ${tableName}
|
|
||||||
(REGION_ID,
|
|
||||||
GROUP_ID,
|
|
||||||
ADDR_TYPE,
|
|
||||||
SRC_IP,
|
|
||||||
MASK_SRC_IP,
|
|
||||||
SRC_PORT,
|
|
||||||
MASK_SRC_PORT,
|
|
||||||
DST_IP,
|
|
||||||
MASK_DST_IP,
|
|
||||||
DST_PORT,
|
|
||||||
MASK_DST_PORT,
|
|
||||||
PROTOCOL,
|
|
||||||
DIRECTION,
|
|
||||||
IS_VALID,
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
LAST_UPDATE,
|
|
||||||
</if>
|
|
||||||
OP_TIME
|
|
||||||
)
|
|
||||||
values
|
|
||||||
(#{regionId,jdbcType=BIGINT},
|
|
||||||
#{groupId,jdbcType=BIGINT},
|
|
||||||
#{addrType,jdbcType=INTEGER},
|
|
||||||
#{srcIp,jdbcType=VARCHAR},
|
|
||||||
#{maskSrcIp,jdbcType=VARCHAR},
|
|
||||||
#{srcPort,jdbcType=VARCHAR},
|
|
||||||
#{maskSrcPort,jdbcType=VARCHAR},
|
|
||||||
#{dstIp,jdbcType=VARCHAR},
|
|
||||||
#{maskDstIp,jdbcType=VARCHAR},
|
|
||||||
#{dstPort,jdbcType=VARCHAR},
|
|
||||||
#{maskDstPort,jdbcType=VARCHAR},
|
|
||||||
#{protocol,jdbcType=INTEGER},
|
|
||||||
#{direction,jdbcType=INTEGER},
|
|
||||||
#{isValid,jdbcType=INTEGER},
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
#{lastUpdate,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
#{opTime,jdbcType=TIMESTAMP}
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="updateIpRegion" parameterType="com.nis.domain.restful.IpRegion">
|
|
||||||
UPDATE ${tableName}
|
|
||||||
<set>
|
|
||||||
<if test="isValid != null">
|
|
||||||
IS_VALID=#{isValid,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME=#{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
LAST_UPDATE=#{lastUpdate,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where REGION_ID=#{regionId}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
|
||||||
<update id="updateIpRegion" parameterType="com.nis.domain.restful.IpRegion">
|
|
||||||
UPDATE ${tableName}
|
|
||||||
<set>
|
|
||||||
<if test="groupId != null">
|
|
||||||
GROUP_ID=#{groupId,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="addrType != null">
|
|
||||||
ADDR_TYPE=#{addrType,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="srcIp != null and srcIp !=''">
|
|
||||||
SRC_IP=#{srcIp,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test="maskSrcIp != null and maskSrcIp !=''">
|
|
||||||
MASK_SRC_IP=#{maskSrcIp,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="srcPort != null and srcPort !=''">
|
|
||||||
SRC_PORT=#{srcPort,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="maskSrcPort != null and maskSrcPort !=''">
|
|
||||||
MASK_SRC_PORT=#{maskSrcPort,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="dstIp != null and dstIp !=''">
|
|
||||||
DST_IP=#{dstIp,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="maskDstIp != null and maskDstIp !=''">
|
|
||||||
MASK_DST_IP=#{maskDstIp,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="dstPort != null and dstPort !=''">
|
|
||||||
DST_PORT=#{dstPort,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="maskDstPort != null and maskDstPort !=''">
|
|
||||||
MASK_DST_PORT=#{maskDstPort,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="protocol != null">
|
|
||||||
PROTOCOL=#{protocol,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="direction != null">
|
|
||||||
DIRECTION=#{direction,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null">
|
|
||||||
IS_VALID=#{isValid,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME=#{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where REGION_ID=#{regionId}
|
|
||||||
</update>
|
|
||||||
-->
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package com.nis.web.dao;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.JdjInfo;
|
|
||||||
/**
|
|
||||||
* @ClassName: JdjInfoDao.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (dell)
|
|
||||||
* @date 2016年9月9日 上午10:02:33
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@MyBatisDao
|
|
||||||
public interface JdjInfoDao extends CrudDao<JdjInfo>{
|
|
||||||
int delete(long id);
|
|
||||||
|
|
||||||
int insert(JdjInfo record);
|
|
||||||
|
|
||||||
int update(JdjInfo record);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,135 +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.JdjInfoDao">
|
|
||||||
<resultMap id="BaseResultMap" type="com.nis.domain.restful.JdjInfo">
|
|
||||||
<id column="ID" jdbcType="BIGINT" property="id" />
|
|
||||||
<result column="NAME" jdbcType="VARCHAR" property="name" />
|
|
||||||
<result column="FWQ_ID" jdbcType="BIGINT" property="fwqId" />
|
|
||||||
<result column="JC_IP" jdbcType="VARCHAR" property="jcIp" />
|
|
||||||
<result column="FD_IP" jdbcType="VARCHAR" property="fdIp" />
|
|
||||||
<result column="CZYID" jdbcType="BIGINT" property="czyid" />
|
|
||||||
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
|
|
||||||
<result property="lastUpdate" jdbcType="TIMESTAMP" column="LAST_UPDATE"/>
|
|
||||||
</resultMap>
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
ID, NAME, FWQ_ID, JC_IP, FD_IP, CZYID, OP_TIME,LAST_UPDATE
|
|
||||||
</sql>
|
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List" />
|
|
||||||
from JDJ_INFO
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</select>
|
|
||||||
<delete id="delete" parameterType="java.lang.Long">
|
|
||||||
delete from JDJ_INFO
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</delete>
|
|
||||||
<!--
|
|
||||||
<insert id="insert" parameterType="com.nis.domain.restful.JdjInfo">
|
|
||||||
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
|
|
||||||
SELECT SEQ_JDJ_INFO.Nextval as ID from DUAL
|
|
||||||
</selectKey>
|
|
||||||
insert into JDJ_INFO (ID, NAME, FWQ_ID,
|
|
||||||
JC_IP, FD_IP, CZYID,
|
|
||||||
OP_TIME)
|
|
||||||
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{fwqId,jdbcType=BIGINT},
|
|
||||||
#{jcIp,jdbcType=VARCHAR}, #{fdIp,jdbcType=VARCHAR}, #{czyid,jdbcType=BIGINT},
|
|
||||||
#{opTime,jdbcType=TIMESTAMP})
|
|
||||||
</insert>
|
|
||||||
-->
|
|
||||||
<insert id="insert" parameterType="com.nis.domain.restful.JdjInfo">
|
|
||||||
<!--
|
|
||||||
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
|
|
||||||
SELECT SEQ_JDJ_INFO.Nextval as ID from DUAL
|
|
||||||
</selectKey> -->
|
|
||||||
insert into JDJ_INFO
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
ID,
|
|
||||||
<if test="name != null">
|
|
||||||
NAME,
|
|
||||||
</if>
|
|
||||||
<if test="fwqId != null">
|
|
||||||
FWQ_ID,
|
|
||||||
</if>
|
|
||||||
<if test="jcIp != null">
|
|
||||||
JC_IP,
|
|
||||||
</if>
|
|
||||||
<if test="fdIp != null">
|
|
||||||
FD_IP,
|
|
||||||
</if>
|
|
||||||
<if test="czyid != null">
|
|
||||||
CZYID,
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME,
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
LAST_UPDATE,
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
#{id,jdbcType=BIGINT},
|
|
||||||
<if test="name != null">
|
|
||||||
#{name,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="fwqId != null">
|
|
||||||
#{fwqId,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="jcIp != null">
|
|
||||||
#{jcIp,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="fdIp != null">
|
|
||||||
#{fdIp,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="czyid != null">
|
|
||||||
#{czyid,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
#{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
#{lastUpdate,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="update" parameterType="com.nis.domain.restful.JdjInfo">
|
|
||||||
update JDJ_INFO
|
|
||||||
<set>
|
|
||||||
<if test="name != null">
|
|
||||||
NAME = #{name,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="fwqId != null">
|
|
||||||
FWQ_ID = #{fwqId,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="jcIp != null">
|
|
||||||
JC_IP = #{jcIp,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="fdIp != null">
|
|
||||||
FD_IP = #{fdIp,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="czyid != null">
|
|
||||||
CZYID = #{czyid,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
LAST_UPDATE = #{lastUpdate,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</update>
|
|
||||||
<!--
|
|
||||||
<update id="updateByPrimaryKey" parameterType="com.nis.domain.restful.JdjInfo">
|
|
||||||
update JDJ_INFO
|
|
||||||
set NAME = #{name,jdbcType=VARCHAR},
|
|
||||||
FWQ_ID = #{fwqId,jdbcType=BIGINT},
|
|
||||||
JC_IP = #{jcIp,jdbcType=VARCHAR},
|
|
||||||
FD_IP = #{fdIp,jdbcType=VARCHAR},
|
|
||||||
CZYID = #{czyid,jdbcType=BIGINT},
|
|
||||||
OP_TIME = #{opTime,jdbcType=TIMESTAMP}
|
|
||||||
where ID = #{id,jdbcType=BIGINT}
|
|
||||||
</update>
|
|
||||||
-->
|
|
||||||
</mapper>
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
package com.nis.web.dao;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.NumRegion;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @ClassName: NumRegionDao
|
|
||||||
* @Description: TODO(数值类域配置dao)
|
|
||||||
* @author (rkg)
|
|
||||||
* @date 2016年9月6日下午8:50:11
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@MyBatisDao
|
|
||||||
public interface NumRegionDao {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存数值类域配置信息,并返回主键id
|
|
||||||
*
|
|
||||||
* @param numRegion
|
|
||||||
* 数值类域配置
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Long saveNumRegion(NumRegion numRegion);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据主键id修改数值类域配置信息
|
|
||||||
*
|
|
||||||
* @param numRegion
|
|
||||||
* 数值类域配置
|
|
||||||
*/
|
|
||||||
public void updateNumRegion(NumRegion numRegion);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据主键regionId查询NumRegion
|
|
||||||
*
|
|
||||||
* @param numRegion
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public NumRegion queryNumRegionById(NumRegion numRegion);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据groupId获取该分组下所有的数值类域配置
|
|
||||||
*
|
|
||||||
* @param tableName获取表名
|
|
||||||
* @param groupIdArr
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public List<NumRegion> queryNumRegionByGroupId(@Param("tableName")String tableName,@Param("groupIdArr")Long[] groupIdArr);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 向数值域配置表中批量添加数据
|
|
||||||
* @param tableName
|
|
||||||
* @param numRegionList
|
|
||||||
*/
|
|
||||||
public void saveNumRegionBatch(@Param("tableName")String tableName,@Param("numRegionList")List<NumRegion> numRegionList);
|
|
||||||
}
|
|
||||||
@@ -1,134 +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.NumRegionDao">
|
|
||||||
<resultMap id="BaseResultMap" type="com.nis.domain.restful.NumRegion">
|
|
||||||
<result column="REGION_ID" jdbcType="BIGINT" property="regionId" />
|
|
||||||
<result column="GROUP_ID" jdbcType="BIGINT" property="groupId" />
|
|
||||||
<result column="LOW_BOUNDARY" jdbcType="BIGINT" property="lowBoundary" />
|
|
||||||
<result column="UP_BOUNDARY" jdbcType="BIGINT" property="upBoundary" />
|
|
||||||
<result column="IS_VALID" jdbcType="INTEGER" property="isValid" />
|
|
||||||
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
|
|
||||||
<result column="LAST_UPDATE" jdbcType="TIMESTAMP" property="lastUpdate" />
|
|
||||||
<result column="PROC_SEQ" jdbcType="BIGINT" property="procSeq" />
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="numRegionSql">
|
|
||||||
REGION_ID,GROUP_ID,LOW_BOUNDARY,UP_BOUNDARY,IS_VALID,OP_TIME,LAST_UPDATE,PROC_SEQ
|
|
||||||
</sql>
|
|
||||||
<select id="queryNumRegionById" parameterType="com.nis.domain.restful.NumRegion"
|
|
||||||
resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
<include refid="numRegionSql" />
|
|
||||||
from ${tableName} where REGION_ID = #{regionId ,jdbcType=BIGINT }
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="queryNumRegionByGroupId" resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
<include refid="numRegionSql" />
|
|
||||||
from ${tableName} where GROUP_ID in
|
|
||||||
<foreach item="item" index="index" collection="groupIdArr" open="("
|
|
||||||
separator="," close=")">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<insert id="saveNumRegionBatch">
|
|
||||||
<!-- insert /*+append*/ into ${tableName} -->
|
|
||||||
insert into ${tableName}
|
|
||||||
(REGION_ID ,
|
|
||||||
GROUP_ID ,
|
|
||||||
LOW_BOUNDARY ,
|
|
||||||
UP_BOUNDARY ,
|
|
||||||
IS_VALID ,
|
|
||||||
OP_TIME,LAST_UPDATE
|
|
||||||
<!-- ,PROC_SEQ -->
|
|
||||||
)
|
|
||||||
<foreach collection="numRegionList" item="item" index="index"
|
|
||||||
open="(" close=")" separator="union">
|
|
||||||
select
|
|
||||||
#{item.regionId,jdbcType=BIGINT},
|
|
||||||
#{item.groupId,jdbcType=BIGINT},
|
|
||||||
#{item.lowBoundary,jdbcType=BIGINT},
|
|
||||||
#{item.upBoundary,jdbcType=BIGINT},
|
|
||||||
#{item.isValid,jdbcType=INTEGER},
|
|
||||||
#{item.opTime,jdbcType=TIMESTAMP},
|
|
||||||
sysdate
|
|
||||||
<!-- ,#{item.procSeq,jdbcType=BIGINT} -->
|
|
||||||
from dual
|
|
||||||
</foreach>
|
|
||||||
</insert>
|
|
||||||
<insert id="saveNumRegion" parameterType="com.nis.domain.restful.NumRegion">
|
|
||||||
<!-- <selectKey keyProperty="regionId" resultType="java.lang.Long" -->
|
|
||||||
<!-- order="BEFORE"> 取消使用序列,界面会将id传过来 -->
|
|
||||||
<!-- select seq_regionId.nextval from dual -->
|
|
||||||
<!-- </selectKey> -->
|
|
||||||
insert into ${tableName}
|
|
||||||
(REGION_ID ,
|
|
||||||
GROUP_ID ,
|
|
||||||
LOW_BOUNDARY ,
|
|
||||||
UP_BOUNDARY ,
|
|
||||||
IS_VALID ,
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
LAST_UPDATE,
|
|
||||||
</if>
|
|
||||||
OP_TIME
|
|
||||||
)
|
|
||||||
values
|
|
||||||
(#{regionId,jdbcType=BIGINT},
|
|
||||||
#{groupId,jdbcType=BIGINT},
|
|
||||||
#{lowBoundary,jdbcType=BIGINT},
|
|
||||||
#{upBoundary,jdbcType=BIGINT},
|
|
||||||
#{isValid,jdbcType=INTEGER},
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
#{lastUpdate,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
#{opTime,jdbcType=TIMESTAMP}
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
|
|
||||||
<update id="updateNumRegion" parameterType="com.nis.domain.restful.NumRegion">
|
|
||||||
UPDATE ${tableName}
|
|
||||||
<set>
|
|
||||||
<if test="isValid != null">
|
|
||||||
IS_VALID=#{isValid , jdbcType=INTEGER },
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME= #{ opTime , jdbcType=TIMESTAMP },
|
|
||||||
</if>
|
|
||||||
<if test="lastUpdate != null">
|
|
||||||
LAST_UPDATE=#{lastUpdate,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where REGION_ID=#{regionId}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
|
||||||
|
|
||||||
<update id="updateNumRegion" parameterType="com.nis.domain.restful.NumRegion">
|
|
||||||
UPDATE ${tableName}
|
|
||||||
<set>
|
|
||||||
<if test="groupId != null">
|
|
||||||
GROUP_ID=#{groupId , jdbcType=BIGINT },
|
|
||||||
</if>
|
|
||||||
<if test="lowBoundary != null">
|
|
||||||
LOW_BOUNDARY=#{lowBoundary,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="upBoundary != null">
|
|
||||||
UP_BOUNDARY=#{upBoundary,jdbcType=BIGINT},
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null">
|
|
||||||
IS_VALID=#{isValid , jdbcType=INTEGER },
|
|
||||||
</if>
|
|
||||||
<if test="opTime != null">
|
|
||||||
OP_TIME= #{ opTime , jdbcType=TIMESTAMP },
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where REGION_ID=#{regionId}
|
|
||||||
</update>
|
|
||||||
-->
|
|
||||||
</mapper>
|
|
||||||
@@ -17,11 +17,8 @@ import org.apache.ibatis.session.SqlSessionFactory;
|
|||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
import com.nis.domain.DfJitLogEntity;
|
|
||||||
import com.nis.domain.DfReportEntity;
|
|
||||||
import com.nis.domain.LogEntity;
|
import com.nis.domain.LogEntity;
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.StatLogEntity;
|
|
||||||
import com.nis.domain.restful.NtcReportEntity;
|
import com.nis.domain.restful.NtcReportEntity;
|
||||||
import com.nis.restful.RestBusinessCode;
|
import com.nis.restful.RestBusinessCode;
|
||||||
import com.nis.restful.RestServiceException;
|
import com.nis.restful.RestServiceException;
|
||||||
@@ -342,259 +339,7 @@ public abstract class BaseLogService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* wx 报表查询条件检查
|
|
||||||
*
|
|
||||||
* @param clazz
|
|
||||||
* 需要检验的实体名称[需要保证resultMap的id命名方式为[className]Map]
|
|
||||||
* @param page
|
|
||||||
* 需要校验的page对象
|
|
||||||
*/
|
|
||||||
public void queryConditionCheck(AuditLogThread thread, long start, StatLogEntity entity, Class clazz,
|
|
||||||
Page page) {
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (!StringUtil.isBlank(entity.getSearchStatStartTime())) {
|
|
||||||
sdf.parse(entity.getSearchStatStartTime());
|
|
||||||
}
|
|
||||||
} catch (ParseException e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
logger.error(e);
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchStatStartTime参数格式错误",
|
|
||||||
RestBusinessCode.param_formate_error.getValue());
|
|
||||||
} catch (Exception e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
logger.error(e);
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchStatStartTime参数格式错误");
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (!StringUtil.isBlank(entity.getSearchStatEndTime())) {
|
|
||||||
sdf.parse(entity.getSearchStatEndTime());
|
|
||||||
}
|
|
||||||
} catch (ParseException e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
logger.error(e);
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchStatEndTime参数格式错误",
|
|
||||||
RestBusinessCode.param_formate_error.getValue());
|
|
||||||
} catch (Exception e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
logger.error(e);
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchStatEndTime参数错误");
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
if (!StringUtil.isBlank(entity.getSearchService())) {
|
|
||||||
Integer.parseInt(entity.getSearchService());
|
|
||||||
}
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
logger.error(e);
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchService参数格式错误",
|
|
||||||
RestBusinessCode.param_formate_error.getValue());
|
|
||||||
} catch (Exception e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
logger.error(e);
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchService参数错误");
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
checkCloumnIsExist(thread, start, clazz, page);
|
|
||||||
} catch (RestServiceException e) {
|
|
||||||
logger.error(e);
|
|
||||||
throw e;
|
|
||||||
} catch (Exception e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
logger.error(e);
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "请求参数错误");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 管控实时统计公共查询字段验证
|
|
||||||
*
|
|
||||||
* @param entity
|
|
||||||
*/
|
|
||||||
public void queryConditionCheck(AuditLogThread thread, long start, DfJitLogEntity<?> entity, Class clazz,
|
|
||||||
Page page) {
|
|
||||||
try {
|
|
||||||
if (!StringUtil.isBlank(entity.getSearchReportEndTime())) {
|
|
||||||
sdf.parse(entity.getSearchReportEndTime());
|
|
||||||
}
|
|
||||||
} catch (ParseException e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchReportEndTime参数格式错误",
|
|
||||||
RestBusinessCode.param_formate_error.getValue());
|
|
||||||
} catch (Exception e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchReportEndTime参数格式格式");
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
if (!StringUtil.isBlank(entity.getSearchReportStartTime())) {
|
|
||||||
sdf.parse(entity.getSearchReportStartTime());
|
|
||||||
}
|
|
||||||
} catch (ParseException e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchReportStartTime参数格式错误",
|
|
||||||
RestBusinessCode.param_formate_error.getValue());
|
|
||||||
} catch (Exception e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchReportStartTime参数错误");
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (!StringUtil.isBlank(entity.getSearchService())) {
|
|
||||||
Integer.parseInt(entity.getSearchService());
|
|
||||||
}
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchService参数格式错误",
|
|
||||||
RestBusinessCode.param_formate_error.getValue());
|
|
||||||
} catch (Exception e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchService参数错误");
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
String searchAttrType = getSearchField(clazz, entity, "searchAttrType");
|
|
||||||
if (!StringUtil.isBlank(searchAttrType)) {
|
|
||||||
Integer.parseInt(searchAttrType);
|
|
||||||
}
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, start, "searchAttrType参数格式错误",
|
|
||||||
RestBusinessCode.param_formate_error.getValue());
|
|
||||||
} catch (Exception e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, start, "searchAttrType参数错误");
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
String searchLwhh = getSearchField(clazz, entity, "searchLwhh");
|
|
||||||
if (!StringUtil.isBlank(searchLwhh)) {
|
|
||||||
Integer.parseInt(searchLwhh);
|
|
||||||
}
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, start, "searchLwhh参数格式错误",
|
|
||||||
RestBusinessCode.param_formate_error.getValue());
|
|
||||||
} catch (Exception e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, start, "searchLwhh参数错误");
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
checkCloumnIsExist(thread, start, clazz, page);
|
|
||||||
} catch (RestServiceException e) {
|
|
||||||
logger.error(e);
|
|
||||||
throw e;
|
|
||||||
} catch (Exception e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
logger.error(e);
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "请求参数错误");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 实时统计公共查询字段验证
|
|
||||||
*
|
|
||||||
* @param entity
|
|
||||||
*/
|
|
||||||
public void queryConditionCheck(AuditLogThread thread, long start, DfReportEntity entity, Class clazz,
|
|
||||||
Page page) {
|
|
||||||
try {
|
|
||||||
if (!StringUtil.isBlank(entity.getSearchReportEndTime())) {
|
|
||||||
sdf.parse(entity.getSearchReportEndTime());
|
|
||||||
}
|
|
||||||
} catch (ParseException e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, start, "searchReportEndTime参数格式错误",
|
|
||||||
RestBusinessCode.param_formate_error.getValue());
|
|
||||||
} catch (Exception e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, start, "searchReportEndTime参数格式格式");
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (!StringUtil.isBlank(entity.getSearchReportStartTime())) {
|
|
||||||
sdf.parse(entity.getSearchReportStartTime());
|
|
||||||
}
|
|
||||||
} catch (ParseException e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, start, "searchReportStartTime参数格式错误",
|
|
||||||
RestBusinessCode.param_formate_error.getValue());
|
|
||||||
} catch (Exception e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, start, "searchReportStartTime参数错误");
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
String searchAttrType = getSearchField(clazz, entity, "searchAttrType");
|
|
||||||
if (!StringUtil.isBlank(searchAttrType)) {
|
|
||||||
Integer.parseInt(searchAttrType);
|
|
||||||
}
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, start, "searchAttrType参数格式错误",
|
|
||||||
RestBusinessCode.param_formate_error.getValue());
|
|
||||||
} catch (Exception e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, start, "searchAttrType参数错误");
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
String searchLwhh = getSearchField(clazz, entity, "searchLwhh");
|
|
||||||
if (!StringUtil.isBlank(searchLwhh)) {
|
|
||||||
Integer.parseInt(searchLwhh);
|
|
||||||
}
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, start, "searchLwhh参数格式错误",
|
|
||||||
RestBusinessCode.param_formate_error.getValue());
|
|
||||||
} catch (Exception e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, start, "searchLwhh参数错误");
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
String searchId = getSearchField(clazz, entity, "searchId");
|
|
||||||
if (!StringUtil.isBlank(searchId)) {
|
|
||||||
Integer.parseInt(searchId);
|
|
||||||
}
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, start, "searchId参数格式错误",
|
|
||||||
RestBusinessCode.param_formate_error.getValue());
|
|
||||||
} catch (Exception e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, start, "searchId参数错误");
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
String searchService = getSearchField(clazz, entity, "searchService");
|
|
||||||
if (!StringUtil.isBlank(searchService)) {
|
|
||||||
Integer.parseInt(searchService);
|
|
||||||
}
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, start, "searchService参数格式错误",
|
|
||||||
RestBusinessCode.param_formate_error.getValue());
|
|
||||||
} catch (Exception e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
throw new RestServiceException(thread, start, "searchService参数错误");
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
checkCloumnIsExist(thread, start, clazz, page);
|
|
||||||
} catch (RestServiceException e) {
|
|
||||||
logger.error(e);
|
|
||||||
throw e;
|
|
||||||
} catch (Exception e) {
|
|
||||||
thread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
|
||||||
logger.error(e);
|
|
||||||
throw new RestServiceException(thread, start, "请求参数错误");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @Title: getJedisKey
|
* @Title: getJedisKey
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,53 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DmbCkService.java
|
|
||||||
*@Package com.nis.web.service.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author wx
|
|
||||||
*@date 2016年9月7日 下午3:28:44
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.service.restful;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.nis.domain.Page;
|
|
||||||
import com.nis.domain.restful.DmbCk;
|
|
||||||
import com.nis.web.dao.DmbCkDao;
|
|
||||||
import com.nis.web.service.CrudService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DmbCkService.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月7日 下午3:28:44
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class DmbCkService extends CrudService<DmbCkDao, DmbCk> {
|
|
||||||
@Autowired
|
|
||||||
public DmbCkDao dmbCkDao;
|
|
||||||
public Page<DmbCk> getDmbCk(Page<DmbCk> page, DmbCk entity) {
|
|
||||||
return findPage(page, entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public DmbCk findById(long id) {
|
|
||||||
return get(id);
|
|
||||||
}
|
|
||||||
public void saveDmbCkBatch(List<DmbCk> entity) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.saveBatch(entity,DmbCkDao.class);
|
|
||||||
}
|
|
||||||
public void updateDmbCkBatch(List<DmbCk> entity) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.updateBatch(entity, DmbCkDao.class);
|
|
||||||
}
|
|
||||||
public void removeDmbCk(long id) {
|
|
||||||
dmbCkDao.delete(id);
|
|
||||||
}
|
|
||||||
public void removeDmbCkBatch(List<DmbCk> entity) {
|
|
||||||
super.deleteBatch(entity, DmbCkDao.class);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DmbPortService.java
|
|
||||||
*@Package com.nis.web.service.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author wx
|
|
||||||
*@date 2016年9月7日 下午3:28:44
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.service.restful;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.nis.domain.Page;
|
|
||||||
import com.nis.domain.restful.DmbPort;
|
|
||||||
import com.nis.web.dao.DmbPortDao;
|
|
||||||
import com.nis.web.service.CrudService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DmbPortService.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月7日 下午3:28:44
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class DmbPortService extends CrudService<DmbPortDao, DmbPort> {
|
|
||||||
@Autowired
|
|
||||||
public DmbPortDao dmbPortDao;
|
|
||||||
public Page<DmbPort> getDmbPort(Page<DmbPort> page, DmbPort entity) {
|
|
||||||
return findPage(page, entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public DmbPort findById(long id) {
|
|
||||||
return get(id);
|
|
||||||
}
|
|
||||||
public void saveDmbPortBatch(List<DmbPort> entity) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.saveBatch(entity,DmbPortDao.class);
|
|
||||||
}
|
|
||||||
public void updateDmbPortBatch(List<DmbPort> entity) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.updateBatch(entity, DmbPortDao.class);
|
|
||||||
}
|
|
||||||
public void removeDmbPort(long id) {
|
|
||||||
dmbPortDao.delete(id);
|
|
||||||
}
|
|
||||||
public void removeDmbPortBatch(List<DmbPort> entity) {
|
|
||||||
super.deleteBatch(entity, DmbPortDao.class);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsFakeInfoService.java
|
|
||||||
*@Package com.nis.web.service.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author wx
|
|
||||||
*@date 2016年9月7日 下午3:28:44
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.service.restful;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.nis.domain.Page;
|
|
||||||
import com.nis.domain.restful.DnsFakeInfo;
|
|
||||||
import com.nis.util.Constants;
|
|
||||||
import com.nis.web.dao.DnsFakeInfoDao;
|
|
||||||
import com.nis.web.service.CrudService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsFakeInfoService.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月7日 下午3:28:44
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class DnsFakeInfoService extends CrudService<DnsFakeInfoDao, DnsFakeInfo> {
|
|
||||||
@Autowired
|
|
||||||
public DnsFakeInfoDao dnsFakeInfoDao;
|
|
||||||
public Page<DnsFakeInfo> getDnsFakeInfo(Page<DnsFakeInfo> page, DnsFakeInfo entity) {
|
|
||||||
return findPage(page, entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public DnsFakeInfo findById(long id) {
|
|
||||||
return get(id);
|
|
||||||
}
|
|
||||||
public void saveDnsFakeInfoBatch(List<DnsFakeInfo> entity) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.saveBatch(entity,DnsFakeInfoDao.class);
|
|
||||||
}
|
|
||||||
public void updateDnsFakeInfoBatch(List<DnsFakeInfo> entity) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.updateBatch(entity, DnsFakeInfoDao.class);
|
|
||||||
}
|
|
||||||
public void removeDnsFakeInfo(long id) {
|
|
||||||
dnsFakeInfoDao.delete(id);
|
|
||||||
}
|
|
||||||
public void removeDnsFakeInfoBatch(List<DnsFakeInfo> entity) {
|
|
||||||
super.deleteBatch(entity, DnsFakeInfoDao.class);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* isValid(单条有效验证)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*boolean
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public boolean isValid(long id){
|
|
||||||
return dnsFakeInfoDao.isValid(id)==Integer.parseInt(Constants.YES);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* isValid(多条有效验证)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param entity
|
|
||||||
* @return
|
|
||||||
*boolean
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public boolean isValid(List<DnsFakeInfo> entity){
|
|
||||||
boolean vaild=false;
|
|
||||||
List<Long> idsList=new ArrayList<Long>();
|
|
||||||
for(DnsFakeInfo DnsFakeInfo : entity){
|
|
||||||
idsList.add(DnsFakeInfo.getId());
|
|
||||||
if(idsList.size()%1000==0&&idsList.size()!=0){
|
|
||||||
int count=dnsFakeInfoDao.isValidBatch(idsList,Integer.parseInt(Constants.YES));
|
|
||||||
idsList.clear();
|
|
||||||
if(count>0){
|
|
||||||
vaild=true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(idsList.size()>0){
|
|
||||||
int count=dnsFakeInfoDao.isValidBatch(idsList,Integer.parseInt(Constants.YES));
|
|
||||||
idsList.clear();
|
|
||||||
if(count>0)vaild=true;
|
|
||||||
}
|
|
||||||
return vaild;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,163 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsFakeIpService.java
|
|
||||||
*@Package com.nis.web.service.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author wx
|
|
||||||
*@date 2016年9月7日 下午3:28:44
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.service.restful;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
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 com.nis.domain.Page;
|
|
||||||
import com.nis.domain.restful.DnsFakeIp;
|
|
||||||
import com.nis.domain.restful.FakeIpConfigCompile;
|
|
||||||
import com.nis.domain.restful.FakeIpConfigGroup;
|
|
||||||
import com.nis.util.Constants;
|
|
||||||
import com.nis.web.dao.CrudDao;
|
|
||||||
import com.nis.web.dao.DnsFakeIpDao;
|
|
||||||
import com.nis.web.dao.FakeIpConfigCompileDao;
|
|
||||||
import com.nis.web.dao.FakeIpConfigGroupDao;
|
|
||||||
import com.nis.web.service.CrudService;
|
|
||||||
import com.nis.web.service.SpringContextHolder;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsFakeIpService.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月7日 下午3:28:44
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class DnsFakeIpService extends CrudService<DnsFakeIpDao, DnsFakeIp> {
|
|
||||||
@Autowired
|
|
||||||
public DnsFakeIpDao dnsFakeIpDao;
|
|
||||||
@Autowired
|
|
||||||
public FakeIpConfigCompileDao fakeIpConfigCompileDao;
|
|
||||||
@Autowired
|
|
||||||
public FakeIpConfigGroupDao fakeIpConfigGroupDao;
|
|
||||||
public Page<DnsFakeIp> getDnsFakeIp(Page<DnsFakeIp> page, DnsFakeIp entity) {
|
|
||||||
return findPage(page, entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public DnsFakeIp findById(long id) {
|
|
||||||
return get(id);
|
|
||||||
}
|
|
||||||
public void saveDnsFakeIpBatch(List<DnsFakeIp> entity) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
this.saveBatch(entity,DnsFakeIpDao.class);
|
|
||||||
}
|
|
||||||
public void updateDnsFakeIpBatch(List<DnsFakeIp> entity) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.updateBatch(entity, DnsFakeIpDao.class);
|
|
||||||
}
|
|
||||||
public void removeDnsFakeIp(long id) {
|
|
||||||
dnsFakeIpDao.delete(id);
|
|
||||||
}
|
|
||||||
public void removeDnsFakeIpBatch(List<DnsFakeIp> entity) {
|
|
||||||
super.deleteBatch(entity, DnsFakeIpDao.class);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* isValid(单条有效验证)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*boolean
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public boolean isValid(long id){
|
|
||||||
return dnsFakeIpDao.isValid(id)==Integer.parseInt(Constants.YES);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* isValid(多条有效验证)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param entity
|
|
||||||
* @return
|
|
||||||
*boolean
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public boolean isValid(List<DnsFakeIp> entity){
|
|
||||||
boolean vaild=false;
|
|
||||||
List<Long> idsList=new ArrayList<Long>();
|
|
||||||
for(DnsFakeIp DnsFakeIp : entity){
|
|
||||||
idsList.add(DnsFakeIp.getId());
|
|
||||||
if(idsList.size()%1000==0&&idsList.size()!=0){
|
|
||||||
int count=dnsFakeIpDao.isValidBatch(idsList,Integer.parseInt(Constants.YES));
|
|
||||||
idsList.clear();
|
|
||||||
if(count>0){
|
|
||||||
vaild=true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(idsList.size()>0){
|
|
||||||
int count=dnsFakeIpDao.isValidBatch(idsList,Integer.parseInt(Constants.YES));
|
|
||||||
idsList.clear();
|
|
||||||
if(count>0)vaild=true;
|
|
||||||
}
|
|
||||||
return vaild;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see com.nis.web.service.CrudService#saveBatch(java.util.List, java.lang.Class)
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
|
||||||
public void saveBatch(List<DnsFakeIp> data, @SuppressWarnings("rawtypes") Class mClass) {
|
|
||||||
Date now=new Date();
|
|
||||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
|
||||||
SqlSession batchSqlSession = null;
|
|
||||||
try{
|
|
||||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
|
||||||
for(int index = 0; index < data.size();index++){
|
|
||||||
DnsFakeIp t = data.get(index);
|
|
||||||
((DnsFakeIpDao) batchSqlSession.getMapper(mClass)).insert(t);
|
|
||||||
if(t.getGroupId()==0||t.getGroupId()==1){
|
|
||||||
//先生成编译,获得编译号
|
|
||||||
FakeIpConfigCompile fakeIpConfigCompile=new FakeIpConfigCompile();
|
|
||||||
long compileId=fakeIpConfigCompileDao.getCompileId();
|
|
||||||
fakeIpConfigCompile.setLastUpdate(now);
|
|
||||||
System.out.println(compileId);
|
|
||||||
fakeIpConfigCompile.setCompileId(compileId);
|
|
||||||
if(t.getGroupId()==0){
|
|
||||||
fakeIpConfigCompile.setAction(2);
|
|
||||||
}else if(t.getGroupId()==1)
|
|
||||||
fakeIpConfigCompile.setAction(1);
|
|
||||||
fakeIpConfigCompile.setOpTime(t.getOpTime());
|
|
||||||
fakeIpConfigCompile.setActiveSys(3);
|
|
||||||
((FakeIpConfigCompileDao) batchSqlSession.getMapper(FakeIpConfigCompileDao.class)).insert(fakeIpConfigCompile);
|
|
||||||
//生成分组
|
|
||||||
FakeIpConfigGroup fakeIpConfigGroup=new FakeIpConfigGroup();
|
|
||||||
fakeIpConfigGroup.setLastUpdate(now);
|
|
||||||
fakeIpConfigGroup.setGroupId(t.getGroupId());
|
|
||||||
fakeIpConfigGroup.setCompileId(compileId);
|
|
||||||
fakeIpConfigGroup.setOpTime(t.getOpTime());
|
|
||||||
((FakeIpConfigGroupDao) batchSqlSession.getMapper(FakeIpConfigGroupDao.class)).insert(fakeIpConfigGroup);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
batchSqlSession.commit();
|
|
||||||
// }catch (Exception e){
|
|
||||||
// batchSqlSession.rollback();
|
|
||||||
// throw e;
|
|
||||||
}finally {
|
|
||||||
if(batchSqlSession != null){
|
|
||||||
batchSqlSession.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,152 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsGroupTypeService.java
|
|
||||||
*@Package com.nis.web.service.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author dell
|
|
||||||
*@date 2016年9月7日 下午3:28:44
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.service.restful;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.nis.web.service.AuditLogThread;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.nis.domain.Page;
|
|
||||||
import com.nis.domain.restful.DnsGroupType;
|
|
||||||
import com.nis.restful.RestBusinessCode;
|
|
||||||
import com.nis.restful.RestServiceException;
|
|
||||||
import com.nis.util.Constants;
|
|
||||||
import com.nis.web.dao.DnsGroupTypeDao;
|
|
||||||
import com.nis.web.service.CrudService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsGroupTypeService.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月7日 下午3:28:44
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class DnsGroupTypeService extends CrudService<DnsGroupTypeDao, DnsGroupType> {
|
|
||||||
@Autowired
|
|
||||||
public DnsGroupTypeDao dnsGroupTypeDao;
|
|
||||||
public Page<DnsGroupType> getDnsGroupType(Page<DnsGroupType> page, DnsGroupType entity) {
|
|
||||||
return findPage(page, entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public DnsGroupType findById(long id) {
|
|
||||||
return get(id);
|
|
||||||
}
|
|
||||||
public void saveDnsGroupTypeBatch(AuditLogThread thread, long start, List<DnsGroupType> entity) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
List<Integer> idsList=new ArrayList<>();
|
|
||||||
for(DnsGroupType e:entity){
|
|
||||||
if(e.getGroupId()!=null)
|
|
||||||
idsList.add(e.getGroupId());
|
|
||||||
}
|
|
||||||
if(idsList.size()>0){
|
|
||||||
boolean unique=this.groupIdValidation(idsList);
|
|
||||||
if(!unique)
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis(), "分组号不唯一", RestBusinessCode.not_unique.getValue());
|
|
||||||
}
|
|
||||||
super.saveBatch(entity,DnsGroupTypeDao.class);
|
|
||||||
}
|
|
||||||
public void updateDnsGroupTypeBatch(AuditLogThread thread, long start, List<DnsGroupType> entity) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
// List<Integer> idsList=new ArrayList<>();
|
|
||||||
// for(DnsGroupType e:entity){
|
|
||||||
// if(e.getGroupId()!=null)
|
|
||||||
// idsList.add(e.getGroupId());
|
|
||||||
// }
|
|
||||||
// if(idsList.size()>0){
|
|
||||||
// boolean unique=this.groupIdValidation(idsList);
|
|
||||||
// if(!unique)
|
|
||||||
// throw new RestServiceException(thread, System.currentTimeMillis(), "分组号不唯一", RestBusinessCode.not_unique.getValue());
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
super.updateBatch(entity, DnsGroupTypeDao.class);
|
|
||||||
}
|
|
||||||
public void removeDnsGroupType(long id) {
|
|
||||||
dnsGroupTypeDao.delete(id);
|
|
||||||
}
|
|
||||||
public void removeDnsGroupTypeBatch(List<DnsGroupType> entity) {
|
|
||||||
super.deleteBatch(entity, DnsGroupTypeDao.class);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* isValid(单条有效验证)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*boolean
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public boolean isValid(long id){
|
|
||||||
return dnsGroupTypeDao.isValid(id)==Integer.parseInt(Constants.YES);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* isValid(多条有效验证)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param entity
|
|
||||||
* @return
|
|
||||||
*boolean
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public boolean isValid(List<DnsGroupType> entity){
|
|
||||||
boolean vaild=false;
|
|
||||||
List<Long> idsList=new ArrayList<Long>();
|
|
||||||
for(DnsGroupType dnsGroupType : entity){
|
|
||||||
idsList.add(dnsGroupType.getId());
|
|
||||||
if(idsList.size()%1000==0&&idsList.size()!=0){
|
|
||||||
int count=dnsGroupTypeDao.isValidBatch(idsList,Integer.parseInt(Constants.YES));
|
|
||||||
idsList.clear();
|
|
||||||
if(count>0){
|
|
||||||
vaild=true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(idsList.size()>0){
|
|
||||||
int count=dnsGroupTypeDao.isValidBatch(idsList,Integer.parseInt(Constants.YES));
|
|
||||||
idsList.clear();
|
|
||||||
if(count>0)vaild=true;
|
|
||||||
}
|
|
||||||
return vaild;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 验证字段唯一性
|
|
||||||
* reqStrateIdValidation(这里用一句话描述这个方法的作用)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @return
|
|
||||||
*boolean
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public boolean groupIdValidation(List<Integer> idsList){
|
|
||||||
int count=0;
|
|
||||||
if(idsList.size()>=1000){
|
|
||||||
int i=0;
|
|
||||||
for(;i<idsList.size()/1000;i++){
|
|
||||||
List<Integer> subList=idsList.subList(i*1000,(i+1)*1000);
|
|
||||||
count=dnsGroupTypeDao.isGroupIdUnique(subList);
|
|
||||||
if(count>0){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(idsList.size()>(i*1000)){
|
|
||||||
List<Integer> subList=idsList.subList(i*1000,idsList.size());
|
|
||||||
count=dnsGroupTypeDao.isGroupIdUnique(subList);
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
count=dnsGroupTypeDao.isGroupIdUnique(idsList);
|
|
||||||
}
|
|
||||||
return count==0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,218 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsResponseStrategy.java
|
|
||||||
*@Package com.nis.web.controller.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author dell
|
|
||||||
*@date 2016年9月5日 下午3:37:54
|
|
||||||
*@version 1.0
|
|
||||||
*/
|
|
||||||
package com.nis.web.service.restful;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.nis.domain.Page;
|
|
||||||
import com.nis.domain.restful.DnsResponseStrategy;
|
|
||||||
import com.nis.restful.RestBusinessCode;
|
|
||||||
import com.nis.restful.RestServiceException;
|
|
||||||
import com.nis.util.Constants;
|
|
||||||
import com.nis.web.dao.DnsResponseStrategyDao;
|
|
||||||
import com.nis.web.service.CrudService;
|
|
||||||
import com.nis.web.service.AuditLogThread;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsResponseStrategy.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (dell)
|
|
||||||
* @date 2016年9月5日 下午3:37:54
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class DnsResponseStrategyService extends CrudService<DnsResponseStrategyDao, DnsResponseStrategy> {
|
|
||||||
@Autowired
|
|
||||||
public DnsResponseStrategyDao dnsResponseStrategyDao;
|
|
||||||
public Page<DnsResponseStrategy> getDnsResponseStrategy(Page<DnsResponseStrategy> page, DnsResponseStrategy dnsResponseStrategy) {
|
|
||||||
return findPage(page, dnsResponseStrategy);
|
|
||||||
}
|
|
||||||
|
|
||||||
public DnsResponseStrategy findById(long id) {
|
|
||||||
return get(id);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* saveDnsResponseStrategyBatch(多条插入)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param entity
|
|
||||||
*void
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public void saveDnsResponseStrategyBatch(List<DnsResponseStrategy> entity) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.saveBatch(entity,DnsResponseStrategyDao.class);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* saveDnsResponseStrategyBatch(多条插入)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param entity
|
|
||||||
*void
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public void saveDnsResponseStrategyBatch(AuditLogThread thread, long start, List<DnsResponseStrategy> entity) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
List idsList=new ArrayList<>();
|
|
||||||
for(DnsResponseStrategy e:entity){
|
|
||||||
if(e.getReqStrateId()!=null)
|
|
||||||
idsList.add(e.getReqStrateId());
|
|
||||||
}
|
|
||||||
if(idsList.size()>0){
|
|
||||||
boolean uinque=this.reqStrateIdValidation(idsList);
|
|
||||||
if(!uinque){
|
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis(), "请求策略号不唯一", RestBusinessCode.not_unique.getValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
super.saveBatch(entity,DnsResponseStrategyDao.class);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* updateDnsResponseStrategyBatch(多条更新)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param entity
|
|
||||||
*void
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public void updateDnsResponseStrategyBatch(List<DnsResponseStrategy> entity) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
super.updateBatch(entity, DnsResponseStrategyDao.class);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* updateDnsResponseStrategyBatch(多条更新)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param entity
|
|
||||||
*void
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public void updateDnsResponseStrategyBatch(AuditLogThread thread, long start, List<DnsResponseStrategy> entity) {
|
|
||||||
// List idsList=new ArrayList<>();
|
|
||||||
// for(DnsResponseStrategy e:entity){
|
|
||||||
// if(e.getReqStrateId()!=null)
|
|
||||||
// idsList.add(e.getReqStrateId());
|
|
||||||
// }
|
|
||||||
// if(idsList.size()>0){
|
|
||||||
// boolean uinque=this.reqStrateIdValidation(idsList);
|
|
||||||
// if(!uinque){
|
|
||||||
// throw new RestServiceException(thread, System.currentTimeMillis(), "请求策略号不唯一", RestBusinessCode.not_unique.getValue());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.updateBatch(entity, DnsResponseStrategyDao.class);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* removeDnsResponseStrategy(单条删除)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param id
|
|
||||||
*void
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public void removeDnsResponseStrategy(long id) {
|
|
||||||
dnsResponseStrategyDao.delete(id);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* removeDnsResponseStrategyBatch(多条删除)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param entity
|
|
||||||
*void
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public void removeDnsResponseStrategyBatch(List<DnsResponseStrategy> entity) {
|
|
||||||
super.deleteBatch(entity, DnsResponseStrategyDao.class);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* isValid(单条有效验证)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*boolean
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public boolean isValid(long id){
|
|
||||||
return dnsResponseStrategyDao.isValid(id)==Integer.parseInt(Constants.YES);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* isValid(多条有效验证)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @param entity
|
|
||||||
* @return
|
|
||||||
*boolean
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public boolean isValid(List<DnsResponseStrategy> entity){
|
|
||||||
boolean vaild=false;
|
|
||||||
List<Long> idsList=new ArrayList<Long>();
|
|
||||||
for(DnsResponseStrategy dnsResponseStrategy : entity){
|
|
||||||
idsList.add(dnsResponseStrategy.getId());
|
|
||||||
if(idsList.size()%1000==0&&idsList.size()!=0){
|
|
||||||
int count=dnsResponseStrategyDao.isValidBatch(idsList,Integer.parseInt(Constants.YES));
|
|
||||||
idsList.clear();
|
|
||||||
if(count>0){
|
|
||||||
vaild=true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(idsList.size()>0){
|
|
||||||
int count=dnsResponseStrategyDao.isValidBatch(idsList,Integer.parseInt(Constants.YES));
|
|
||||||
idsList.clear();
|
|
||||||
if(count>0)vaild=true;
|
|
||||||
}
|
|
||||||
return vaild;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 验证字段唯一性
|
|
||||||
* reqStrateIdValidation(这里用一句话描述这个方法的作用)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @return
|
|
||||||
*boolean
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public boolean reqStrateIdValidation(List<Integer> idsList){
|
|
||||||
int count=0;
|
|
||||||
if(idsList.size()>=1000){
|
|
||||||
int i=0;
|
|
||||||
for(;i<idsList.size()/1000;i++){
|
|
||||||
List<Integer> subList=idsList.subList(i*1000,(i+1)*1000);
|
|
||||||
count=dnsResponseStrategyDao.isReqStrateIdUnique(subList);
|
|
||||||
if(count>0){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(idsList.size()>(i*1000)){
|
|
||||||
List<Integer> subList=idsList.subList(i*1000,idsList.size());
|
|
||||||
count=dnsResponseStrategyDao.isReqStrateIdUnique(subList);
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
count=dnsResponseStrategyDao.isReqStrateIdUnique(idsList);
|
|
||||||
}
|
|
||||||
return count==0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: EncryptProtoRandomService.java
|
|
||||||
*@Package com.nis.web.service.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author wx
|
|
||||||
*@date 2016年9月7日 下午3:28:44
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.service.restful;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.nis.domain.Page;
|
|
||||||
import com.nis.domain.restful.EncryptProtoRandom;
|
|
||||||
import com.nis.web.dao.EncryptProtoRandomDao;
|
|
||||||
import com.nis.web.service.CrudService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: EncryptProtoRandomService.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月7日 下午3:28:44
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class EncryptProtoRandomService extends CrudService<EncryptProtoRandomDao, EncryptProtoRandom> {
|
|
||||||
@Autowired
|
|
||||||
public EncryptProtoRandomDao encryptProtoRandomDao;
|
|
||||||
public Page<EncryptProtoRandom> getEncryptProtoRandom(Page<EncryptProtoRandom> page, EncryptProtoRandom entity) {
|
|
||||||
return findPage(page, entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EncryptProtoRandom findById(long id) {
|
|
||||||
return get(id);
|
|
||||||
}
|
|
||||||
public void saveEncryptProtoRandomBatch(List<EncryptProtoRandom> entity) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.saveBatch(entity,EncryptProtoRandomDao.class);
|
|
||||||
}
|
|
||||||
public void updateEncryptProtoRandomBatch(List<EncryptProtoRandom> entity) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.updateBatch(entity, EncryptProtoRandomDao.class);
|
|
||||||
}
|
|
||||||
public void removeEncryptProtoRandom(Long id) {
|
|
||||||
encryptProtoRandomDao.delete(id);
|
|
||||||
}
|
|
||||||
public void removeEncryptProtoRandomBatch(List<EncryptProtoRandom> entity) {
|
|
||||||
super.deleteBatch(entity, EncryptProtoRandomDao.class);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsFakeIpService.java
|
|
||||||
*@Package com.nis.web.service.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author wx
|
|
||||||
*@date 2016年9月7日 下午3:28:44
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.service.restful;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.FakeIpConfigCompile;
|
|
||||||
import com.nis.web.dao.FakeIpConfigCompileDao;
|
|
||||||
import com.nis.web.service.CrudService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsFakeIpService.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月7日 下午3:28:44
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class FakeIpConfigCompileService extends CrudService<FakeIpConfigCompileDao, FakeIpConfigCompile> {
|
|
||||||
@Autowired
|
|
||||||
public FakeIpConfigCompileDao fakeIpConfigCompileDao;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: DnsFakeIpService.java
|
|
||||||
*@Package com.nis.web.service.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author wx
|
|
||||||
*@date 2016年9月7日 下午3:28:44
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.service.restful;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.FakeIpConfigGroup;
|
|
||||||
import com.nis.web.dao.FakeIpConfigGroupDao;
|
|
||||||
import com.nis.web.service.CrudService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: DnsFakeIpService.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月7日 下午3:28:44
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class FakeIpConfigGroupService extends CrudService<FakeIpConfigGroupDao, FakeIpConfigGroup> {
|
|
||||||
@Autowired
|
|
||||||
public FakeIpConfigGroupDao fakeIpConfigGroupDao;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: FwqInfoService.java
|
|
||||||
*@Package com.nis.web.service.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author wx
|
|
||||||
*@date 2016年9月7日 下午3:28:44
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.service.restful;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.nis.domain.Page;
|
|
||||||
import com.nis.domain.restful.FwqInfo;
|
|
||||||
import com.nis.web.dao.FwqInfoDao;
|
|
||||||
import com.nis.web.service.CrudService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: FwqInfoService.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月7日 下午3:28:44
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class FwqInfoService extends CrudService<FwqInfoDao, FwqInfo> {
|
|
||||||
@Autowired
|
|
||||||
public FwqInfoDao fwqInfoDao;
|
|
||||||
public Page<FwqInfo> getFwqInfo(Page<FwqInfo> page, FwqInfo entity) {
|
|
||||||
return findPage(page, entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public FwqInfo findById(long id) {
|
|
||||||
return get(id);
|
|
||||||
}
|
|
||||||
public void saveFwqInfoBatch(List<FwqInfo> entity) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.saveBatch(entity,FwqInfoDao.class);
|
|
||||||
}
|
|
||||||
public void updateFwqInfoBatch(List<FwqInfo> entity) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.updateBatch(entity, FwqInfoDao.class);
|
|
||||||
}
|
|
||||||
public void removeFwqInfo(long id) {
|
|
||||||
fwqInfoDao.delete(id);
|
|
||||||
}
|
|
||||||
public void removeFwqInfoBatch(List<FwqInfo> entity) {
|
|
||||||
super.deleteBatch(entity, FwqInfoDao.class);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
/**
|
|
||||||
*@Title: JdjInfoService.java
|
|
||||||
*@Package com.nis.web.service.restful
|
|
||||||
*@Description TODO
|
|
||||||
*@author wx
|
|
||||||
*@date 2016年9月7日 下午3:28:44
|
|
||||||
*@version 版本号
|
|
||||||
*/
|
|
||||||
package com.nis.web.service.restful;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.nis.domain.Page;
|
|
||||||
import com.nis.domain.restful.JdjInfo;
|
|
||||||
import com.nis.web.dao.JdjInfoDao;
|
|
||||||
import com.nis.web.service.CrudService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: JdjInfoService.java
|
|
||||||
* @Description: TODO
|
|
||||||
* @author (wx)
|
|
||||||
* @date 2016年9月7日 下午3:28:44
|
|
||||||
* @version V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class JdjInfoService extends CrudService<JdjInfoDao, JdjInfo> {
|
|
||||||
@Autowired
|
|
||||||
public JdjInfoDao jdjInfoDao;
|
|
||||||
public Page<JdjInfo> getJdjInfo(Page<JdjInfo> page, JdjInfo entity) {
|
|
||||||
return findPage(page, entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public JdjInfo findById(long id) {
|
|
||||||
return get(id);
|
|
||||||
}
|
|
||||||
public void saveJdjInfoBatch(List<JdjInfo> entity) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.saveBatch(entity,JdjInfoDao.class);
|
|
||||||
}
|
|
||||||
public void updateJdjInfoBatch(List<JdjInfo> entity) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.updateBatch(entity, JdjInfoDao.class);
|
|
||||||
}
|
|
||||||
public void removeJdjInfo(long id) {
|
|
||||||
jdjInfoDao.delete(id);
|
|
||||||
}
|
|
||||||
public void removeJdjInfoBatch(List<JdjInfo> entity) {
|
|
||||||
super.deleteBatch(entity, JdjInfoDao.class);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,665 +0,0 @@
|
|||||||
package com.nis.web.service.restful;
|
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.PreparedStatement;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.CountDownLatch;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.ConfigCompile;
|
|
||||||
import com.nis.domain.restful.ConfigGroupRelation;
|
|
||||||
import com.nis.domain.restful.DigestRegion;
|
|
||||||
import com.nis.domain.restful.IpRegion;
|
|
||||||
import com.nis.domain.restful.NumRegion;
|
|
||||||
import com.nis.domain.restful.StrRegion;
|
|
||||||
import com.nis.util.Configurations;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* jdbc测试批量插入
|
|
||||||
*
|
|
||||||
* @author RenKaiGe-Office
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class SaveCompileByJDBCThread implements Runnable {
|
|
||||||
private static Logger logger = Logger.getLogger(SaveCompileByJDBCThread.class);
|
|
||||||
private static Long start;
|
|
||||||
private CountDownLatch latch;
|
|
||||||
private Boolean isStrongStr;
|
|
||||||
private String tableName;
|
|
||||||
private Connection conn;
|
|
||||||
private List<ConfigCompile> compileList;
|
|
||||||
private List<ConfigGroupRelation> groupList;
|
|
||||||
private List<IpRegion> ipRegionList;
|
|
||||||
private List<NumRegion> numRegionList;
|
|
||||||
private List<StrRegion> strRegionList;
|
|
||||||
private List<DigestRegion> digestRegionList;
|
|
||||||
|
|
||||||
private Method method = null;
|
|
||||||
public SaveCompileByJDBCThread() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
public SaveCompileByJDBCThread(Connection conn, CountDownLatch latch, Long start) {
|
|
||||||
super();
|
|
||||||
this.conn = conn;
|
|
||||||
this.latch = latch;
|
|
||||||
this.start = start;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SaveCompileByJDBCThread(String tableName, Connection conn, CountDownLatch latch, Long start) {
|
|
||||||
super();
|
|
||||||
this.tableName = tableName;
|
|
||||||
this.conn = conn;
|
|
||||||
this.latch = latch;
|
|
||||||
this.start = start;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SaveCompileByJDBCThread(boolean isStrongStr, String tableName, Connection conn, CountDownLatch latch,
|
|
||||||
Long start) {
|
|
||||||
super();
|
|
||||||
this.isStrongStr = isStrongStr;
|
|
||||||
this.tableName = tableName;
|
|
||||||
this.conn = conn;
|
|
||||||
this.latch = latch;
|
|
||||||
this.start = start;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getStart() {
|
|
||||||
return start;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStart(Long start) {
|
|
||||||
this.start = start;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CountDownLatch getLatch() {
|
|
||||||
return latch;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLatch(CountDownLatch latch) {
|
|
||||||
this.latch = latch;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getIsStrongStr() {
|
|
||||||
return isStrongStr;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsStrongStr(Boolean isStrongStr) {
|
|
||||||
this.isStrongStr = isStrongStr;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTableName() {
|
|
||||||
return tableName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTableName(String tableName) {
|
|
||||||
this.tableName = tableName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Connection getConn() {
|
|
||||||
return conn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConn(Connection conn) {
|
|
||||||
this.conn = conn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ConfigCompile> getCompileList() {
|
|
||||||
return compileList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCompileList(List<ConfigCompile> compileList) {
|
|
||||||
this.compileList = compileList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ConfigGroupRelation> getGroupList() {
|
|
||||||
return groupList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGroupList(List<ConfigGroupRelation> groupList) {
|
|
||||||
this.groupList = groupList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<IpRegion> getIpRegionList() {
|
|
||||||
return ipRegionList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIpRegionList(List<IpRegion> ipRegionList) {
|
|
||||||
this.ipRegionList = ipRegionList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<NumRegion> getNumRegionList() {
|
|
||||||
return numRegionList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNumRegionList(List<NumRegion> numRegionList) {
|
|
||||||
this.numRegionList = numRegionList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<StrRegion> getStrRegionList() {
|
|
||||||
return strRegionList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStrRegionList(List<StrRegion> strRegionList) {
|
|
||||||
this.strRegionList = strRegionList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<DigestRegion> getDigestRegionList() {
|
|
||||||
return digestRegionList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDigestRegionList(List<DigestRegion> digestRegionList) {
|
|
||||||
this.digestRegionList = digestRegionList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static java.sql.Timestamp utileDate2TimeStamp(java.util.Date udate) {
|
|
||||||
java.sql.Timestamp sqlDate = null;
|
|
||||||
long t = udate.getTime();
|
|
||||||
sqlDate = new java.sql.Timestamp(t);
|
|
||||||
return sqlDate;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void saveCompile(List<ConfigCompile> compileList, Connection conn, List<Exception> msgList) {
|
|
||||||
if (null != compileList && compileList.size() > 0) {
|
|
||||||
try {
|
|
||||||
String tabName = Configurations.getStringProperty("compileTabName", "CONFIG_COMPILE");
|
|
||||||
String fieldName = Configurations.getStringProperty("compileFieldName", "COMPILE_ID");
|
|
||||||
|
|
||||||
conn.setAutoCommit(false);
|
|
||||||
PreparedStatement ps = conn.prepareStatement(getSqlStr(tabName, fieldName));
|
|
||||||
for (ConfigCompile compile : compileList) {
|
|
||||||
setPsParams(fieldName.split(","),ps,compile);
|
|
||||||
ps.addBatch();
|
|
||||||
}
|
|
||||||
|
|
||||||
//zdx2017-10-25
|
|
||||||
// sb.append(
|
|
||||||
// "insert into CONFIG_COMPILE (COMPILE_ID ,SERVICE ,ACTION , CONT_TYPE, ATTR_TYPE, CONT_LABEL, Task_id, Guarantee_ID, AFFAIR_ID, TOPIC_ID, DO_BLACKLIST ,DO_LOG ,EFFECTIVE_RANGE , ACTIVE_SYS, CONFIG_PERCENT ,CONFIG_OPTION ,START_TIME ,END_TIME , USER_REGION, IS_VALID,GROUP_NUM,FATHER_CFG_ID ,OP_TIME,LAST_UPDATE ) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, sysdate)");
|
|
||||||
// conn.setAutoCommit(false);
|
|
||||||
// PreparedStatement ps = conn.prepareStatement(sb.toString());
|
|
||||||
// for (ConfigCompile compile : compileList) {
|
|
||||||
// Object[] obj = new Object[] { compile.getCompileId(), compile.getService(), compile.getAction(),
|
|
||||||
// compile.getContType(), compile.getAttrType(), compile.getContLabel(), compile.getTaskId(),
|
|
||||||
// compile.getGuaranteeId(), compile.getAffAirId(), compile.getTopIcId(),
|
|
||||||
// compile.getDoBlackList(), compile.getDoLog(), compile.getEffectiveRange(),
|
|
||||||
// compile.getActiveSys(), compile.getConfigPercent(), compile.getConfigOption(),
|
|
||||||
// compile.getStartTime(), compile.getEndTime(), compile.getUserRegion(), compile.getIsValid(),
|
|
||||||
// compile.getGroupNum(), compile.getFatherCfgId(), compile.getOpTime() };
|
|
||||||
//
|
|
||||||
// for (int x = 0; x < obj.length; x++) {
|
|
||||||
// if (x == 16) {
|
|
||||||
// ps.setTimestamp(x + 1, utileDate2TimeStamp(compile.getStartTime()));
|
|
||||||
// } else if (x == 17) {
|
|
||||||
// ps.setTimestamp(x + 1, utileDate2TimeStamp(compile.getEndTime()));
|
|
||||||
// } else if (x == 22) {
|
|
||||||
// ps.setTimestamp(x + 1, utileDate2TimeStamp(compile.getOpTime()));
|
|
||||||
// } else {
|
|
||||||
// ps.setObject(x + 1, obj[x]);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// ps.addBatch();
|
|
||||||
// }
|
|
||||||
ps.executeBatch();
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error(e);
|
|
||||||
msgList.add(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void saveGroup(List<ConfigGroupRelation> groupList, Connection conn, List<Exception> msgList) {
|
|
||||||
|
|
||||||
if (null != groupList && groupList.size() > 0) {
|
|
||||||
try {
|
|
||||||
StringBuffer sb = new StringBuffer();
|
|
||||||
String tabName = Configurations.getStringProperty("groupTabName", "CONFIG_GROUP");
|
|
||||||
String fieldName = Configurations.getStringProperty("groupFieldName", "ID");
|
|
||||||
String groupSeqName = Configurations.getStringProperty("groupSeqName", "SEQ_CONFIG_GROUP");
|
|
||||||
sb.append("insert into ").append(tabName);
|
|
||||||
sb.append("(").append(fieldName);
|
|
||||||
//是否包含更新时间字段 值为数据库当前时间
|
|
||||||
if (Configurations.getBooleanProperty("hasLastUpdate", true)) {
|
|
||||||
sb.append(", LAST_UPDATE");
|
|
||||||
}
|
|
||||||
sb.append(") values ( ");
|
|
||||||
conn.setAutoCommit(false);
|
|
||||||
String fieldNameObj [] = fieldName.split(",");
|
|
||||||
for (int i = 0; i < fieldNameObj.length; i++) {
|
|
||||||
//第一个字段必须是分组表主键
|
|
||||||
if (i==0) {
|
|
||||||
sb.append(groupSeqName).append(".nextval");
|
|
||||||
}else{
|
|
||||||
sb.append("?");
|
|
||||||
}
|
|
||||||
if (i+1<fieldNameObj.length) {
|
|
||||||
sb.append(",");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//是否包含更新时间字段 值为数据库当前时间
|
|
||||||
if (Configurations.getBooleanProperty("hasLastUpdate", true)) {
|
|
||||||
sb.append(", sysdate");
|
|
||||||
}
|
|
||||||
sb.append(")");
|
|
||||||
conn.setAutoCommit(false);
|
|
||||||
|
|
||||||
PreparedStatement ps = conn.prepareStatement(sb.toString());
|
|
||||||
|
|
||||||
for (ConfigGroupRelation group : groupList) {
|
|
||||||
//setPsParams(fieldNameObj,ps,group);
|
|
||||||
|
|
||||||
Object[] obj = new Object[fieldNameObj.length] ;
|
|
||||||
|
|
||||||
for (int i = 1; i < fieldNameObj.length; i++) {
|
|
||||||
String name = fieldNameObj[i].toLowerCase().trim();
|
|
||||||
name = name.substring(0,1).toUpperCase()+name.substring(1);
|
|
||||||
if (name.indexOf("_")>-1) {
|
|
||||||
// name = name.substring(0, name.indexOf("_"))+name.substring(name.indexOf("_")+1,name.indexOf("_")+2).toUpperCase()+name.substring(name.indexOf("_")+2);
|
|
||||||
// }
|
|
||||||
|
|
||||||
while (name.indexOf("_")>-1) {
|
|
||||||
name = name.substring(0, name.indexOf("_"))+name.substring(name.indexOf("_")+1,name.indexOf("_")+2).toUpperCase()+name.substring(name.indexOf("_")+2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Method method = group.getClass().getMethod("get"+name);
|
|
||||||
obj[i]= method.invoke(group);
|
|
||||||
}
|
|
||||||
for (int x = 1; x < obj.length; x++) {
|
|
||||||
|
|
||||||
if (obj[x] instanceof Date) {
|
|
||||||
ps.setObject(x, utileDate2TimeStamp((Date) obj[x]));
|
|
||||||
}else {
|
|
||||||
ps.setObject(x , obj[x]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ps.addBatch();
|
|
||||||
}
|
|
||||||
ps.executeBatch();
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error(e);
|
|
||||||
e.printStackTrace();
|
|
||||||
msgList.add(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//zdx2017-10-25
|
|
||||||
// if (null != groupList && groupList.size() > 0) {
|
|
||||||
// try {
|
|
||||||
// StringBuffer sb = new StringBuffer();
|
|
||||||
// sb.append(
|
|
||||||
// "insert into CONFIG_GROUP (ID,GROUP_ID, COMPILE_ID, IS_VALID, LAST_UPDATE, OP_TIME ) values ( seq_config_group.nextval, ?, ?, ?, sysdate, ?) ");
|
|
||||||
// conn.setAutoCommit(false);
|
|
||||||
// PreparedStatement ps = conn.prepareStatement(sb.toString());
|
|
||||||
// for (ConfigGroupRelation group : groupList) {
|
|
||||||
// Object[] obj = new Object[] { group.getGroupId(), group.getCompileId(), group.getIsValid(),
|
|
||||||
// group.getOpTime() };
|
|
||||||
// for (int x = 0; x < obj.length; x++) {
|
|
||||||
// if (x == 3) {
|
|
||||||
// ps.setTimestamp(x + 1, utileDate2TimeStamp(group.getOpTime()));
|
|
||||||
// } else {
|
|
||||||
// ps.setObject(x + 1, obj[x]);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// ps.addBatch();
|
|
||||||
// }
|
|
||||||
// ps.executeBatch();
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// logger.error(e);
|
|
||||||
// msgList.add(e);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void saveIPRegion(String name, List<IpRegion> ipRegionList, Connection conn,
|
|
||||||
List<Exception> msgList) {
|
|
||||||
|
|
||||||
if (null != ipRegionList && ipRegionList.size() > 0) {
|
|
||||||
try {
|
|
||||||
String fieldName = Configurations.getStringProperty("ipRegionFieldName", "REGION_ID");
|
|
||||||
conn.setAutoCommit(false);
|
|
||||||
PreparedStatement ps = conn.prepareStatement(getSqlStr(name, fieldName));
|
|
||||||
for (IpRegion ipRegion : ipRegionList) {
|
|
||||||
setPsParams(fieldName.split(","),ps,ipRegion);
|
|
||||||
ps.addBatch();
|
|
||||||
}
|
|
||||||
ps.executeBatch();
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error(e);
|
|
||||||
msgList.add(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//zdx2017-10-25
|
|
||||||
// if (null != ipRegionList && ipRegionList.size() > 0) {
|
|
||||||
// try {
|
|
||||||
// StringBuffer sb = new StringBuffer();
|
|
||||||
// sb.append("insert into ");
|
|
||||||
// sb.append(name);
|
|
||||||
// sb.append(
|
|
||||||
// "(REGION_ID, GROUP_ID, ADDR_TYPE, SRC_IP, MASK_SRC_IP, SRC_PORT, MASK_SRC_PORT, DST_IP, MASK_DST_IP, DST_PORT, MASK_DST_PORT, PROTOCOL, DIRECTION, IS_VALID, OP_TIME,LAST_UPDATE ) values( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, sysdate) ");
|
|
||||||
// conn.setAutoCommit(false);
|
|
||||||
// PreparedStatement ps = conn.prepareStatement(sb.toString());
|
|
||||||
// for (IpRegion ipRegion : ipRegionList) {
|
|
||||||
// Object[] obj = new Object[] { ipRegion.getRegionId(), ipRegion.getGroupId(), ipRegion.getAddrType(),
|
|
||||||
// ipRegion.getSrcIp(), ipRegion.getMaskSrcIp(), ipRegion.getSrcPort(),
|
|
||||||
// ipRegion.getMaskSrcPort(), ipRegion.getDstIp(), ipRegion.getMaskDstIp(),
|
|
||||||
// ipRegion.getDstPort(), ipRegion.getMaskDstPort(), ipRegion.getProtocol(),
|
|
||||||
// ipRegion.getDirection(), ipRegion.getIsValid(), ipRegion.getOpTime()
|
|
||||||
//
|
|
||||||
// };
|
|
||||||
// for (int x = 0; x < obj.length; x++) {
|
|
||||||
// if (x == 14) {
|
|
||||||
// ps.setTimestamp(x + 1, utileDate2TimeStamp(ipRegion.getOpTime()));
|
|
||||||
// } else {
|
|
||||||
// ps.setObject(x + 1, obj[x]);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// ps.addBatch();
|
|
||||||
// }
|
|
||||||
// ps.executeBatch();
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// logger.error(e);
|
|
||||||
// msgList.add(e);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void saveNumRegion(String name, List<NumRegion> numRegionList, Connection conn,
|
|
||||||
List<Exception> msgList) {
|
|
||||||
if (null != numRegionList && numRegionList.size() > 0) {
|
|
||||||
try {
|
|
||||||
String fieldName = Configurations.getStringProperty("numRegionFieldName", "REGION_ID");
|
|
||||||
conn.setAutoCommit(false);
|
|
||||||
PreparedStatement ps = conn.prepareStatement(getSqlStr(name, fieldName));
|
|
||||||
for (NumRegion numRegion : numRegionList) {
|
|
||||||
setPsParams(fieldName.split(","),ps,numRegion);
|
|
||||||
ps.addBatch();
|
|
||||||
}
|
|
||||||
|
|
||||||
ps.executeBatch();
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error(e);
|
|
||||||
msgList.add(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//zdx2017-10-25
|
|
||||||
// if (null != numRegionList && numRegionList.size() > 0) {
|
|
||||||
// try {
|
|
||||||
// StringBuffer sb = new StringBuffer();
|
|
||||||
// sb.append("insert into ");
|
|
||||||
// sb.append(name);
|
|
||||||
// sb.append(
|
|
||||||
// " (REGION_ID,GROUP_ID,LOW_BOUNDARY,UP_BOUNDARY,IS_VALID,OP_TIME,LAST_UPDATE) values(?, ?, ?, ?, ?, ?, sysdate)");
|
|
||||||
// conn.setAutoCommit(false);
|
|
||||||
// PreparedStatement ps = conn.prepareStatement(sb.toString());
|
|
||||||
// for (NumRegion numRegion : numRegionList) {
|
|
||||||
// Object[] obj = new Object[] { numRegion.getRegionId(), numRegion.getGroupId(),
|
|
||||||
// numRegion.getLowBoundary(), numRegion.getUpBoundary(), numRegion.getIsValid(),
|
|
||||||
// numRegion.getOpTime() };
|
|
||||||
// for (int x = 0; x < obj.length; x++) {
|
|
||||||
// if (x == 5) {
|
|
||||||
// ps.setTimestamp(x + 1, utileDate2TimeStamp(numRegion.getOpTime()));
|
|
||||||
// } else {
|
|
||||||
// ps.setObject(x + 1, obj[x]);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// ps.addBatch();
|
|
||||||
// }
|
|
||||||
// ps.executeBatch();
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// logger.error(e);
|
|
||||||
// msgList.add(e);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void saveStrongStrRegion(String name, List<StrRegion> strRegionList, Connection conn,
|
|
||||||
List<Exception> msgList) {
|
|
||||||
|
|
||||||
if (null != strRegionList && strRegionList.size() > 0) {
|
|
||||||
try {
|
|
||||||
String fieldName = Configurations.getStringProperty("strongStrRegionFieldName", "REGION_ID");
|
|
||||||
conn.setAutoCommit(false);
|
|
||||||
PreparedStatement ps = conn.prepareStatement(getSqlStr(name, fieldName));
|
|
||||||
for (StrRegion strRegion : strRegionList) {
|
|
||||||
setPsParams(fieldName.split(","),ps,strRegion);
|
|
||||||
ps.addBatch();
|
|
||||||
}
|
|
||||||
ps.executeBatch();
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error(e);
|
|
||||||
msgList.add(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//zdx2017-10-25
|
|
||||||
// if (null != strRegionList && strRegionList.size() > 0) {
|
|
||||||
// try {
|
|
||||||
// StringBuffer sb = new StringBuffer();
|
|
||||||
// sb.append("insert into ");
|
|
||||||
// sb.append(name);
|
|
||||||
// sb.append(
|
|
||||||
// "(REGION_ID, GROUP_ID, DISTRICT, KEYWORDS, EXPR_TYPE, MATCH_METHOD , IS_HEXBIN, IS_VALID, OP_TIME,LAST_UPDATE ) values(?, ?, ?, ?, ?, ?, ?, ?, ?, sysdate) ");
|
|
||||||
// conn.setAutoCommit(false);
|
|
||||||
// PreparedStatement ps = conn.prepareStatement(sb.toString());
|
|
||||||
//
|
|
||||||
// for (StrRegion strRegion : strRegionList) {
|
|
||||||
// Object[] obj = new Object[] { strRegion.getRegionId(), strRegion.getGroupId(),
|
|
||||||
// strRegion.getDistrict(), strRegion.getKeywords(), strRegion.getExprType(),
|
|
||||||
// strRegion.getMatchMethod(), strRegion.getIsHexbin(), strRegion.getIsValid(),
|
|
||||||
// strRegion.getOpTime() };
|
|
||||||
// for (int x = 0; x < obj.length; x++) {
|
|
||||||
// if (x == 8) {
|
|
||||||
// ps.setTimestamp(x + 1, utileDate2TimeStamp(strRegion.getOpTime()));
|
|
||||||
// } else {
|
|
||||||
// ps.setObject(x + 1, obj[x]);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// ps.addBatch();
|
|
||||||
// }
|
|
||||||
// ps.executeBatch();
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// logger.error(e);
|
|
||||||
// msgList.add(e);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void saveStrRegion(String name, List<StrRegion> strRegionList, Connection conn,
|
|
||||||
List<Exception> msgList) {
|
|
||||||
|
|
||||||
if (null != strRegionList && strRegionList.size() > 0) {
|
|
||||||
try {
|
|
||||||
String fieldName = Configurations.getStringProperty("strRegionFieldName", "REGION_ID");
|
|
||||||
conn.setAutoCommit(false);
|
|
||||||
PreparedStatement ps = conn.prepareStatement(getSqlStr(name, fieldName));
|
|
||||||
for (StrRegion strRegion : strRegionList) {
|
|
||||||
setPsParams(fieldName.split(","),ps,strRegion);
|
|
||||||
ps.addBatch();
|
|
||||||
}
|
|
||||||
ps.executeBatch();
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error(e);
|
|
||||||
msgList.add(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
//zdx2017-10-25
|
|
||||||
// if (null != strRegionList && strRegionList.size() > 0) {
|
|
||||||
// try {
|
|
||||||
// StringBuffer sb = new StringBuffer();
|
|
||||||
// sb.append("insert into ");
|
|
||||||
// sb.append(name);
|
|
||||||
// sb.append(
|
|
||||||
// "(REGION_ID, GROUP_ID, KEYWORDS, EXPR_TYPE, MATCH_METHOD , IS_HEXBIN, IS_VALID, OP_TIME,LAST_UPDATE ) values( ?, ?, ?, ?, ?, ?, ?, ?, sysdate) ");
|
|
||||||
// conn.setAutoCommit(false);
|
|
||||||
// PreparedStatement ps = conn.prepareStatement(sb.toString());
|
|
||||||
//
|
|
||||||
// for (StrRegion strRegion : strRegionList) {
|
|
||||||
// Object[] obj = new Object[] { strRegion.getRegionId(), strRegion.getGroupId(),
|
|
||||||
// strRegion.getKeywords(), strRegion.getExprType(), strRegion.getMatchMethod(),
|
|
||||||
// strRegion.getIsHexbin(), strRegion.getIsValid(), strRegion.getOpTime() };
|
|
||||||
// for (int x = 0; x < obj.length; x++) {
|
|
||||||
// if (x == 7) {
|
|
||||||
// ps.setTimestamp(x + 1, utileDate2TimeStamp(strRegion.getOpTime()));
|
|
||||||
// } else {
|
|
||||||
// ps.setObject(x + 1, obj[x]);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// ps.addBatch();
|
|
||||||
// }
|
|
||||||
// ps.executeBatch();
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// logger.error(e);
|
|
||||||
// msgList.add(e);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void saveDigestRegion(String name, List<DigestRegion> digestRegionList, Connection conn,
|
|
||||||
List<Exception> msgList) {
|
|
||||||
if (null != digestRegionList && digestRegionList.size() > 0) {
|
|
||||||
try {
|
|
||||||
String fieldName = Configurations.getStringProperty("digestRegionFieldName", "REGION_ID");
|
|
||||||
conn.setAutoCommit(false);
|
|
||||||
PreparedStatement ps = conn.prepareStatement(getSqlStr(name, fieldName));
|
|
||||||
for (DigestRegion numRegion : digestRegionList) {
|
|
||||||
setPsParams(fieldName.split(","),ps,numRegion);
|
|
||||||
ps.addBatch();
|
|
||||||
}
|
|
||||||
ps.executeBatch();
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error(e);
|
|
||||||
msgList.add(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Description:根据表名和字段名称构建sql
|
|
||||||
* @author (zdx)
|
|
||||||
* @date 2017年10月26日 上午9:50:16
|
|
||||||
* @param tabName
|
|
||||||
* @param fieldName
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private static String getSqlStr(String tabName,String fieldName){
|
|
||||||
|
|
||||||
StringBuffer sb = new StringBuffer();
|
|
||||||
sb.append("insert into ");
|
|
||||||
sb.append(tabName);
|
|
||||||
sb.append("(").append(fieldName);
|
|
||||||
|
|
||||||
//是否包含更新时间字段 值为数据库当前时间
|
|
||||||
if (Configurations.getBooleanProperty("hasLastUpdate", true)) {
|
|
||||||
sb.append(", LAST_UPDATE");
|
|
||||||
}
|
|
||||||
sb.append(") values (");
|
|
||||||
|
|
||||||
String fieldNameObj [] = fieldName.split(",");
|
|
||||||
for (int i = 0; i < fieldNameObj.length; i++) {
|
|
||||||
sb.append("?");
|
|
||||||
if (i+1<fieldNameObj.length) {
|
|
||||||
sb.append(",");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//是否包含更新时间字段 值为数据库当前时间
|
|
||||||
if (Configurations.getBooleanProperty("hasLastUpdate", true)) {
|
|
||||||
sb.append(", sysdate");
|
|
||||||
}
|
|
||||||
|
|
||||||
sb.append(") ");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @Description: 向PreparedStatement设置参数
|
|
||||||
* @author (zdx)
|
|
||||||
* @date 2017年10月26日 上午9:47:33
|
|
||||||
* @param fieldNameObj
|
|
||||||
* @param ps
|
|
||||||
* @param object
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
private static void setPsParams(String [] fieldNameObj,PreparedStatement ps,Object object) throws Exception{
|
|
||||||
Object[] obj = new Object[fieldNameObj.length] ;
|
|
||||||
|
|
||||||
for (int i = 0; i < fieldNameObj.length; i++) {
|
|
||||||
String name = fieldNameObj[i].toLowerCase().trim();
|
|
||||||
name = name.substring(0,1).toUpperCase()+name.substring(1);
|
|
||||||
if (name.indexOf("_")>-1) {
|
|
||||||
// name = name.substring(0, name.indexOf("_"))+name.substring(name.indexOf("_")+1,name.indexOf("_")+2).toUpperCase()+name.substring(name.indexOf("_")+2);
|
|
||||||
// }
|
|
||||||
|
|
||||||
while (name.indexOf("_")>-1) {
|
|
||||||
name = name.substring(0, name.indexOf("_"))+name.substring(name.indexOf("_")+1,name.indexOf("_")+2).toUpperCase()+name.substring(name.indexOf("_")+2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//需要特殊处理字段名
|
|
||||||
if (name.equals("DoBlacklist")) {
|
|
||||||
name = "DoBlackList";
|
|
||||||
}else if (name.equals("AffairId")) {
|
|
||||||
name = "AffAirId";
|
|
||||||
}else if (name.equals("TopicId")) {
|
|
||||||
name = "TopIcId";
|
|
||||||
}
|
|
||||||
|
|
||||||
Method method = object.getClass().getMethod("get"+name);
|
|
||||||
obj[i]= method.invoke(object);
|
|
||||||
}
|
|
||||||
for (int x = 0; x < obj.length; x++) {
|
|
||||||
|
|
||||||
if (obj[x] instanceof Date) {
|
|
||||||
ps.setObject(x + 1, utileDate2TimeStamp((Date) obj[x]));
|
|
||||||
}else {
|
|
||||||
ps.setObject(x + 1, obj[x]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
List<Exception> msgList = ConfigSourcesService.getMsgList();
|
|
||||||
synchronized (msgList) {
|
|
||||||
try {
|
|
||||||
if (null != compileList && compileList.size() > 0) {
|
|
||||||
saveCompile(compileList, conn, msgList);
|
|
||||||
} else if (null != groupList && groupList.size() > 0) {
|
|
||||||
saveGroup(groupList, conn, msgList);
|
|
||||||
} else if (null != ipRegionList && ipRegionList.size() > 0) {
|
|
||||||
saveIPRegion(tableName, ipRegionList, conn, msgList);
|
|
||||||
} else if (null != strRegionList && strRegionList.size() > 0) {
|
|
||||||
if (null != isStrongStr && isStrongStr) {
|
|
||||||
saveStrongStrRegion(tableName, strRegionList, conn, msgList);
|
|
||||||
} else {
|
|
||||||
saveStrRegion(tableName, strRegionList, conn, msgList);
|
|
||||||
}
|
|
||||||
} else if (null != numRegionList && numRegionList.size() > 0) {
|
|
||||||
saveNumRegion(tableName, numRegionList, conn, msgList);
|
|
||||||
} else if (null != digestRegionList && digestRegionList.size() > 0) {
|
|
||||||
saveDigestRegion(tableName, digestRegionList, conn, msgList);
|
|
||||||
}
|
|
||||||
latch.countDown();
|
|
||||||
System.out.println("latchCount=======================" + latch.getCount());
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,570 +0,0 @@
|
|||||||
package com.nis.web.service.restful;
|
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.PreparedStatement;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.CountDownLatch;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
|
|
||||||
import com.nis.domain.restful.ConfigCompile;
|
|
||||||
import com.nis.domain.restful.ConfigGroupRelation;
|
|
||||||
import com.nis.domain.restful.DigestRegion;
|
|
||||||
import com.nis.domain.restful.IpRegion;
|
|
||||||
import com.nis.domain.restful.NumRegion;
|
|
||||||
import com.nis.domain.restful.StrRegion;
|
|
||||||
import com.nis.util.Configurations;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* jdbc测试批量插入
|
|
||||||
*
|
|
||||||
* @author RenKaiGe-Office
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class UpdateCompileByJDBCThread implements Runnable {
|
|
||||||
private static Logger logger = Logger.getLogger(SaveCompileByJDBCThread.class);
|
|
||||||
private static Long start;
|
|
||||||
private CountDownLatch latch;
|
|
||||||
private String tableName;
|
|
||||||
private Connection conn;
|
|
||||||
private List<ConfigCompile> compileList;
|
|
||||||
private List<ConfigGroupRelation> groupList;
|
|
||||||
private List<IpRegion> ipRegionList;
|
|
||||||
private List<NumRegion> numRegionList;
|
|
||||||
private List<StrRegion> strRegionList;
|
|
||||||
private List<DigestRegion> digestRegionList;
|
|
||||||
private Date opTime;
|
|
||||||
|
|
||||||
public UpdateCompileByJDBCThread() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
public UpdateCompileByJDBCThread(Connection conn, CountDownLatch latch, Long start, Date opTime) {
|
|
||||||
super();
|
|
||||||
this.conn = conn;
|
|
||||||
this.latch = latch;
|
|
||||||
this.start = start;
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public UpdateCompileByJDBCThread(String tableName, Connection conn, CountDownLatch latch, Long start, Date opTime) {
|
|
||||||
super();
|
|
||||||
this.tableName = tableName;
|
|
||||||
this.conn = conn;
|
|
||||||
this.latch = latch;
|
|
||||||
this.start = start;
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getOpTime() {
|
|
||||||
return opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOpTime(Date opTime) {
|
|
||||||
this.opTime = opTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getStart() {
|
|
||||||
return start;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStart(Long start) {
|
|
||||||
this.start = start;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CountDownLatch getLatch() {
|
|
||||||
return latch;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLatch(CountDownLatch latch) {
|
|
||||||
this.latch = latch;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTableName() {
|
|
||||||
return tableName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTableName(String tableName) {
|
|
||||||
this.tableName = tableName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Connection getConn() {
|
|
||||||
return conn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConn(Connection conn) {
|
|
||||||
this.conn = conn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ConfigCompile> getCompileList() {
|
|
||||||
return compileList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCompileList(List<ConfigCompile> compileList) {
|
|
||||||
this.compileList = compileList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ConfigGroupRelation> getGroupList() {
|
|
||||||
return groupList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGroupList(List<ConfigGroupRelation> groupList) {
|
|
||||||
this.groupList = groupList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<IpRegion> getIpRegionList() {
|
|
||||||
return ipRegionList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIpRegionList(List<IpRegion> ipRegionList) {
|
|
||||||
this.ipRegionList = ipRegionList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<NumRegion> getNumRegionList() {
|
|
||||||
return numRegionList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNumRegionList(List<NumRegion> numRegionList) {
|
|
||||||
this.numRegionList = numRegionList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<StrRegion> getStrRegionList() {
|
|
||||||
return strRegionList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStrRegionList(List<StrRegion> strRegionList) {
|
|
||||||
this.strRegionList = strRegionList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<DigestRegion> getDigestRegionList() {
|
|
||||||
return digestRegionList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDigestRegionList(List<DigestRegion> digestRegionList) {
|
|
||||||
this.digestRegionList = digestRegionList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized static java.sql.Timestamp utileDate2TimeStamp(java.util.Date udate) {
|
|
||||||
java.sql.Timestamp sqlDate = null;
|
|
||||||
long t = udate.getTime();
|
|
||||||
sqlDate = new java.sql.Timestamp(t);
|
|
||||||
return sqlDate;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void updateCompile(List<ConfigCompile> compileList, Connection conn, Date opTime,
|
|
||||||
List<Exception> msgList) {
|
|
||||||
if (null != compileList && compileList.size() > 0) {
|
|
||||||
try {
|
|
||||||
StringBuffer sb = new StringBuffer();
|
|
||||||
String tabName = Configurations.getStringProperty("compileTabName", "CONFIG_COMPILE");
|
|
||||||
String fieldName = Configurations.getStringProperty("updateFields", "IS_VALID");
|
|
||||||
String condition= Configurations.getStringProperty("compileUpdateCondition", "COMPILE_ID");
|
|
||||||
sb.append("update ").append(tabName).append(" set ");
|
|
||||||
|
|
||||||
String fieldNameObj [] = fieldName.split(",");
|
|
||||||
//加上where条件的参数名称
|
|
||||||
String newParamsStr = fieldName+","+condition;
|
|
||||||
for (int i = 0; i < fieldNameObj.length; i++) {
|
|
||||||
sb.append(fieldNameObj[i]+"=?");
|
|
||||||
if (i+1<fieldNameObj.length) {
|
|
||||||
sb.append(",");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//是否包含更新时间字段 值为数据库当前时间
|
|
||||||
if (Configurations.getBooleanProperty("hasLastUpdate", true)) {
|
|
||||||
sb.append(", LAST_UPDATE= sysdate");
|
|
||||||
}
|
|
||||||
sb.append(" where ");
|
|
||||||
String [] condObjs = condition.split(",");
|
|
||||||
for (int i = 0; i < condObjs.length; i++) {
|
|
||||||
sb.append(condObjs[i]+"=?");
|
|
||||||
if (i+1<condObjs.length) {
|
|
||||||
sb.append(" and ");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
conn.setAutoCommit(false);
|
|
||||||
PreparedStatement ps = conn.prepareStatement(sb.toString());
|
|
||||||
|
|
||||||
|
|
||||||
for (ConfigCompile compile : compileList) {
|
|
||||||
setPsParams(newParamsStr.split(","),ps,compile);
|
|
||||||
ps.addBatch();
|
|
||||||
}
|
|
||||||
ps.executeBatch();
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error(e);
|
|
||||||
msgList.add(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void updateGroup(List<ConfigGroupRelation> groupList, Connection conn, Date opTime,
|
|
||||||
List<Exception> msgList) {
|
|
||||||
if (null != groupList && groupList.size() > 0) {
|
|
||||||
try {
|
|
||||||
StringBuffer sb = new StringBuffer();
|
|
||||||
|
|
||||||
String tabName = Configurations.getStringProperty("groupTabName", "CONFIG_GROUP");
|
|
||||||
String fieldName = Configurations.getStringProperty("updateFields", "IS_VALID");
|
|
||||||
String condition = Configurations.getStringProperty("groupUpdateCondition", "GROUP_ID");
|
|
||||||
|
|
||||||
sb.append(" update ").append(tabName);
|
|
||||||
sb.append(" set ");
|
|
||||||
String fieldNameObj [] = fieldName.split(",");
|
|
||||||
//加上where条件的参数名称
|
|
||||||
String newParamsStr = fieldName+","+condition;
|
|
||||||
for (int i = 0; i < fieldNameObj.length; i++) {
|
|
||||||
sb.append(fieldNameObj[i]+"=?");
|
|
||||||
if (i+1<fieldNameObj.length) {
|
|
||||||
sb.append(",");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//是否包含更新时间字段 值为数据库当前时间
|
|
||||||
if (Configurations.getBooleanProperty("hasLastUpdate", true)) {
|
|
||||||
sb.append(", LAST_UPDATE= sysdate");
|
|
||||||
}
|
|
||||||
// + "where GROUP_ID=? and COMPILE_ID=? ");
|
|
||||||
sb.append(" where ");
|
|
||||||
String [] condObjs = condition.split(",");
|
|
||||||
for (int i = 0; i < condObjs.length; i++) {
|
|
||||||
sb.append(condObjs[i]+"=?");
|
|
||||||
if (i+1<condObjs.length) {
|
|
||||||
sb.append(" and ");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
conn.setAutoCommit(false);
|
|
||||||
PreparedStatement ps = conn.prepareStatement(sb.toString());
|
|
||||||
for (ConfigGroupRelation group : groupList) {
|
|
||||||
setPsParams(newParamsStr.split(","), ps, group);
|
|
||||||
ps.addBatch();
|
|
||||||
}
|
|
||||||
ps.executeBatch();
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error(e);
|
|
||||||
msgList.add(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void updateIPRegion(String name, List<IpRegion> ipRegionList, Connection conn, Date opTime,
|
|
||||||
List<Exception> msgList) {
|
|
||||||
if (null != ipRegionList && ipRegionList.size() > 0) {
|
|
||||||
try {
|
|
||||||
StringBuffer sb = new StringBuffer();
|
|
||||||
|
|
||||||
|
|
||||||
String fieldName = Configurations.getStringProperty("updateFields", "IS_VALID");
|
|
||||||
String condition = Configurations.getStringProperty("regionId", "REGION_ID");
|
|
||||||
sb.append("update ");
|
|
||||||
sb.append(name);
|
|
||||||
sb.append(" set ");
|
|
||||||
|
|
||||||
String fieldNameObj [] = fieldName.split(",");
|
|
||||||
//加上where条件的参数名称
|
|
||||||
String newParamsStr = fieldName+","+condition;
|
|
||||||
for (int i = 0; i < fieldNameObj.length; i++) {
|
|
||||||
sb.append(fieldNameObj[i]+"=?");
|
|
||||||
if (i+1<fieldNameObj.length) {
|
|
||||||
sb.append(",");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//是否包含更新时间字段 值为数据库当前时间
|
|
||||||
if (Configurations.getBooleanProperty("hasLastUpdate", true)) {
|
|
||||||
sb.append(", LAST_UPDATE= sysdate");
|
|
||||||
}
|
|
||||||
// + "where GROUP_ID=? and COMPILE_ID=? ");
|
|
||||||
sb.append(" where ");
|
|
||||||
String [] condObjs = condition.split(",");
|
|
||||||
for (int i = 0; i < condObjs.length; i++) {
|
|
||||||
sb.append(condObjs[i]+"=?");
|
|
||||||
if (i+1<condObjs.length) {
|
|
||||||
sb.append(" and ");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
conn.setAutoCommit(false);
|
|
||||||
PreparedStatement ps = conn.prepareStatement(sb.toString());
|
|
||||||
for (IpRegion ipRegion : ipRegionList) {
|
|
||||||
setPsParams(newParamsStr.split(","), ps, ipRegion);
|
|
||||||
ps.addBatch();
|
|
||||||
}
|
|
||||||
ps.executeBatch();
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error(e);
|
|
||||||
msgList.add(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void updateNumRegion(String name, List<NumRegion> numRegionList, Connection conn, Date opTime,
|
|
||||||
List<Exception> msgList) {
|
|
||||||
if (null != numRegionList && numRegionList.size() > 0) {
|
|
||||||
try {
|
|
||||||
StringBuffer sb = new StringBuffer();
|
|
||||||
String fieldName = Configurations.getStringProperty("updateFields", "IS_VALID");
|
|
||||||
String condition = Configurations.getStringProperty("regionId", "REGION_ID");
|
|
||||||
sb.append("update ");
|
|
||||||
sb.append(name);
|
|
||||||
sb.append(" set ");
|
|
||||||
|
|
||||||
String fieldNameObj [] = fieldName.split(",");
|
|
||||||
//加上where条件的参数名称
|
|
||||||
String newParamsStr = fieldName+","+condition;
|
|
||||||
for (int i = 0; i < fieldNameObj.length; i++) {
|
|
||||||
sb.append(fieldNameObj[i]+"=?");
|
|
||||||
if (i+1<fieldNameObj.length) {
|
|
||||||
sb.append(",");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//是否包含更新时间字段 值为数据库当前时间
|
|
||||||
if (Configurations.getBooleanProperty("hasLastUpdate", true)) {
|
|
||||||
sb.append(", LAST_UPDATE= sysdate");
|
|
||||||
}
|
|
||||||
// + "where GROUP_ID=? and COMPILE_ID=? ");
|
|
||||||
sb.append(" where ");
|
|
||||||
String [] condObjs = condition.split(",");
|
|
||||||
for (int i = 0; i < condObjs.length; i++) {
|
|
||||||
sb.append(condObjs[i]+"=?");
|
|
||||||
if (i+1<condObjs.length) {
|
|
||||||
sb.append(" and ");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
conn.setAutoCommit(false);
|
|
||||||
PreparedStatement ps = conn.prepareStatement(sb.toString());
|
|
||||||
for (NumRegion numRegion : numRegionList) {
|
|
||||||
setPsParams(newParamsStr.split(","), ps, numRegion);
|
|
||||||
ps.addBatch();
|
|
||||||
}
|
|
||||||
ps.executeBatch();
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error(e);
|
|
||||||
msgList.add(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void updateStrRegion(String name, List<StrRegion> strRegionList, Connection conn, Date opTime,
|
|
||||||
List<Exception> msgList) {
|
|
||||||
if (null != strRegionList && strRegionList.size() > 0) {
|
|
||||||
try {
|
|
||||||
StringBuffer sb = new StringBuffer();
|
|
||||||
String fieldName = Configurations.getStringProperty("updateFields", "IS_VALID");
|
|
||||||
String condition = Configurations.getStringProperty("regionId", "REGION_ID");
|
|
||||||
sb.append("update ");
|
|
||||||
sb.append(name);
|
|
||||||
sb.append(" set ");
|
|
||||||
|
|
||||||
String fieldNameObj [] = fieldName.split(",");
|
|
||||||
//加上where条件的参数名称
|
|
||||||
String newParamsStr = fieldName+","+condition;
|
|
||||||
for (int i = 0; i < fieldNameObj.length; i++) {
|
|
||||||
sb.append(fieldNameObj[i]+"=?");
|
|
||||||
if (i+1<fieldNameObj.length) {
|
|
||||||
sb.append(",");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//是否包含更新时间字段 值为数据库当前时间
|
|
||||||
if (Configurations.getBooleanProperty("hasLastUpdate", true)) {
|
|
||||||
sb.append(", LAST_UPDATE= sysdate");
|
|
||||||
}
|
|
||||||
// + "where GROUP_ID=? and COMPILE_ID=? ");
|
|
||||||
sb.append(" where ");
|
|
||||||
String [] condObjs = condition.split(",");
|
|
||||||
for (int i = 0; i < condObjs.length; i++) {
|
|
||||||
sb.append(condObjs[i]+"=?");
|
|
||||||
if (i+1<condObjs.length) {
|
|
||||||
sb.append(" and ");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
conn.setAutoCommit(false);
|
|
||||||
PreparedStatement ps = conn.prepareStatement(sb.toString());
|
|
||||||
for (StrRegion strRegion : strRegionList) {
|
|
||||||
setPsParams(newParamsStr.split(","), ps, strRegion);
|
|
||||||
ps.addBatch();
|
|
||||||
}
|
|
||||||
ps.executeBatch();
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error(e);
|
|
||||||
msgList.add(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void updateDigestRegion(String name, List<DigestRegion> digestRegionList, Connection conn, Date opTime,
|
|
||||||
List<Exception> msgList) {
|
|
||||||
if (null != digestRegionList && digestRegionList.size() > 0) {
|
|
||||||
try {
|
|
||||||
StringBuffer sb = new StringBuffer();
|
|
||||||
String fieldName = Configurations.getStringProperty("updateFields", "IS_VALID");
|
|
||||||
String condition = Configurations.getStringProperty("regionId", "REGION_ID");
|
|
||||||
sb.append("update ");
|
|
||||||
sb.append(name);
|
|
||||||
sb.append(" set ");
|
|
||||||
|
|
||||||
String fieldNameObj [] = fieldName.split(",");
|
|
||||||
//加上where条件的参数名称
|
|
||||||
String newParamsStr = fieldName+","+condition;
|
|
||||||
for (int i = 0; i < fieldNameObj.length; i++) {
|
|
||||||
sb.append(fieldNameObj[i]+"=?");
|
|
||||||
if (i+1<fieldNameObj.length) {
|
|
||||||
sb.append(",");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//是否包含更新时间字段 值为数据库当前时间
|
|
||||||
if (Configurations.getBooleanProperty("hasLastUpdate", true)) {
|
|
||||||
sb.append(", LAST_UPDATE= sysdate");
|
|
||||||
}
|
|
||||||
// + "where GROUP_ID=? and COMPILE_ID=? ");
|
|
||||||
sb.append(" where ");
|
|
||||||
String [] condObjs = condition.split(",");
|
|
||||||
for (int i = 0; i < condObjs.length; i++) {
|
|
||||||
sb.append(condObjs[i]+"=?");
|
|
||||||
if (i+1<condObjs.length) {
|
|
||||||
sb.append(" and ");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
conn.setAutoCommit(false);
|
|
||||||
PreparedStatement ps = conn.prepareStatement(sb.toString());
|
|
||||||
for (DigestRegion digestRegion : digestRegionList) {
|
|
||||||
setPsParams(newParamsStr.split(","), ps, digestRegion);
|
|
||||||
ps.addBatch();
|
|
||||||
}
|
|
||||||
ps.executeBatch();
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error(e);
|
|
||||||
msgList.add(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @Description: 向PreparedStatement设置参数
|
|
||||||
* @author (zdx)
|
|
||||||
* @date 2017年10月26日 上午9:47:33
|
|
||||||
* @param fieldNameObj
|
|
||||||
* @param ps
|
|
||||||
* @param object
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
private static void setPsParams(String [] fieldNameObj,PreparedStatement ps,Object object) throws Exception{
|
|
||||||
Object[] obj = new Object[fieldNameObj.length] ;
|
|
||||||
|
|
||||||
for (int i = 0; i < fieldNameObj.length; i++) {
|
|
||||||
String name = fieldNameObj[i].toLowerCase().trim();
|
|
||||||
name = name.substring(0,1).toUpperCase()+name.substring(1);
|
|
||||||
if (name.indexOf("_")>-1) {
|
|
||||||
// name = name.substring(0, name.indexOf("_"))+name.substring(name.indexOf("_")+1,name.indexOf("_")+2).toUpperCase()+name.substring(name.indexOf("_")+2);
|
|
||||||
// }
|
|
||||||
|
|
||||||
while (name.indexOf("_")>-1) {
|
|
||||||
name = name.substring(0, name.indexOf("_"))+name.substring(name.indexOf("_")+1,name.indexOf("_")+2).toUpperCase()+name.substring(name.indexOf("_")+2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//需要特殊处理字段名
|
|
||||||
if (name.equals("DoBlacklist")) {
|
|
||||||
name = "DoBlackList";
|
|
||||||
}else if (name.equals("AffairId")) {
|
|
||||||
name = "AffAirId";
|
|
||||||
}else if (name.equals("TopicId")) {
|
|
||||||
name = "TopIcId";
|
|
||||||
}
|
|
||||||
|
|
||||||
Method method = object.getClass().getMethod("get"+name);
|
|
||||||
obj[i]= method.invoke(object);
|
|
||||||
}
|
|
||||||
for (int x = 0; x < obj.length; x++) {
|
|
||||||
|
|
||||||
if (obj[x] instanceof Date) {
|
|
||||||
ps.setObject(x + 1, utileDate2TimeStamp((Date) obj[x]));
|
|
||||||
}else {
|
|
||||||
ps.setObject(x + 1, obj[x]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Description: 根据compileId更新与之对应的group关系表的生效状态
|
|
||||||
* @author (zdx)
|
|
||||||
* @date 2017年8月16日 上午9:46:44
|
|
||||||
* @param compileList
|
|
||||||
* @param conn
|
|
||||||
* @param opTime
|
|
||||||
* @param msgList
|
|
||||||
*/
|
|
||||||
public static void updateGroupByCompileId(List<ConfigCompile> compileList, Connection conn, Date opTime,
|
|
||||||
List<Exception> msgList) {
|
|
||||||
if (null != compileList && compileList.size() > 0) {
|
|
||||||
try {
|
|
||||||
StringBuffer sb = new StringBuffer();
|
|
||||||
String tabName = Configurations.getStringProperty("groupTabName", "CONFIG_GROUP");
|
|
||||||
sb.append("update "+tabName+" set IS_VALID=?,op_time=?,LAST_UPDATE=sysdate where COMPILE_ID=? ");
|
|
||||||
conn.setAutoCommit(false);
|
|
||||||
PreparedStatement ps = conn.prepareStatement(sb.toString());
|
|
||||||
for (ConfigCompile compile : compileList) {
|
|
||||||
Object[] obj = new Object[] { compile.getIsValid(), opTime,compile.getCompileId() };
|
|
||||||
for (int x = 0; x < obj.length; x++) {
|
|
||||||
if (x == 1) {
|
|
||||||
ps.setTimestamp(x + 1, utileDate2TimeStamp(opTime));
|
|
||||||
} else {
|
|
||||||
ps.setObject(x + 1, obj[x]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ps.addBatch();
|
|
||||||
}
|
|
||||||
ps.executeBatch();
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error(e);
|
|
||||||
msgList.add(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
List<Exception> msgList = ConfigSourcesService.getMsgList();
|
|
||||||
synchronized (msgList) {
|
|
||||||
try {
|
|
||||||
if (null != compileList && compileList.size() > 0) {
|
|
||||||
updateCompile(compileList, conn, opTime, msgList);
|
|
||||||
} else if (null != groupList && groupList.size() > 0) {
|
|
||||||
updateGroup(groupList, conn, opTime, msgList);
|
|
||||||
} else if (null != ipRegionList && ipRegionList.size() > 0) {
|
|
||||||
updateIPRegion(tableName, ipRegionList, conn, opTime, msgList);
|
|
||||||
} else if (null != strRegionList && strRegionList.size() > 0) {
|
|
||||||
updateStrRegion(tableName, strRegionList, conn, opTime, msgList);
|
|
||||||
} else if (null != numRegionList && numRegionList.size() > 0) {
|
|
||||||
updateNumRegion(tableName, numRegionList, conn, opTime, msgList);
|
|
||||||
} else if (null != digestRegionList && digestRegionList.size() > 0) {
|
|
||||||
updateDigestRegion(tableName, digestRegionList, conn, opTime, msgList);
|
|
||||||
}
|
|
||||||
|
|
||||||
if((null !=compileList && compileList.size() > 0)&&(null != groupList && groupList.size()==0)){
|
|
||||||
updateGroupByCompileId(compileList, conn, opTime, msgList);
|
|
||||||
}
|
|
||||||
|
|
||||||
if((null !=compileList && compileList.size() > 0)&&(null != groupList && groupList.size()==0)){
|
|
||||||
updateGroupByCompileId(compileList, conn, opTime, msgList);
|
|
||||||
}
|
|
||||||
latch.countDown();
|
|
||||||
// System.out.println("latchCount=======================" +
|
|
||||||
// latch.getCount());
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
<t:field fieldType="Port" srcName="maskDstPort" dstName="mask_dst_port" isRequired="true" range="0-65535"/>
|
<t:field fieldType="Port" srcName="maskDstPort" dstName="mask_dst_port" isRequired="true" range="0-65535"/>
|
||||||
<t:field fieldType="Number" srcName="protocol" dstName="protocol" isRequired="true" defaultVal="0"/>
|
<t:field fieldType="Number" srcName="protocol" dstName="protocol" isRequired="true" defaultVal="0"/>
|
||||||
<t:field fieldType="Number" srcName="direction" dstName="direction" isRequired="true" range="0-1"/>
|
<t:field fieldType="Number" srcName="direction" dstName="direction" isRequired="true" range="0-1"/>
|
||||||
<t:field fieldType="Number" srcName="isValid" dstName="is_valid" isRequired="true" range="0-1"/>
|
<t:field fieldType="Number" srcName="isValid" dstName="is_valid" isRequired="true" regexp="[1]"/>
|
||||||
<t:field fieldType="Date" srcName="opTime" dstName="op_time" isRequired="true"/>
|
<t:field fieldType="Date" srcName="opTime" dstName="op_time" isRequired="true"/>
|
||||||
</t:commonSource>
|
</t:commonSource>
|
||||||
<!--
|
<!--
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
<t:field fieldType="String" srcName="dstFile" dstName="dst_file" isRequired="true"/>
|
<t:field fieldType="String" srcName="dstFile" dstName="dst_file" isRequired="true"/>
|
||||||
<t:field fieldType="String" srcName="dstFileMd5" dstName="dst_file_md5" isRequired="true"/>
|
<t:field fieldType="String" srcName="dstFileMd5" dstName="dst_file_md5" isRequired="true"/>
|
||||||
<t:field fieldType="Number" srcName="level" dstName="level" range="0-100" defaultVal="0"/>
|
<t:field fieldType="Number" srcName="level" dstName="level" range="0-100" defaultVal="0"/>
|
||||||
<t:field fieldType="Number" srcName="isValid" dstName="is_valid" isRequired="true" range="0-1"/>
|
<t:field fieldType="Number" srcName="isValid" dstName="is_valid" isRequired="true" regexp="[1]"/>
|
||||||
<t:field fieldType="Date" srcName="opTime" dstName="op_time" isRequired="true"/>
|
<t:field fieldType="Date" srcName="opTime" dstName="op_time" isRequired="true"/>
|
||||||
<t:field fieldType="String" srcName="dstFile" dstName="file_id" isRequired="true"/>
|
<t:field fieldType="String" srcName="dstFile" dstName="file_id" isRequired="true"/>
|
||||||
</t:commonSource>
|
</t:commonSource>
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
<t:field fieldType="Number" srcName="cfgId" dstName="cfg_id" isRequired="true" />
|
<t:field fieldType="Number" srcName="cfgId" dstName="cfg_id" isRequired="true" />
|
||||||
<t:field fieldType="String" srcName="description" dstName="description" isRequired="true"/>
|
<t:field fieldType="String" srcName="description" dstName="description" isRequired="true"/>
|
||||||
<t:field fieldType="Number" srcName="level" dstName="level" range="0-100" defaultVal="0"/>
|
<t:field fieldType="Number" srcName="level" dstName="level" range="0-100" defaultVal="0"/>
|
||||||
<t:field fieldType="Number" srcName="isValid" dstName="is_valid" isRequired="true" range="0-1"/>
|
<t:field fieldType="Number" srcName="isValid" dstName="is_valid" isRequired="true" regexp="[1]"/>
|
||||||
</t:commonSource>
|
</t:commonSource>
|
||||||
<!--
|
<!--
|
||||||
#0x340 IP复用地址池配置(回调) 832=0:IR_STATIC_IP_POOL_CB
|
#0x340 IP复用地址池配置(回调) 832=0:IR_STATIC_IP_POOL_CB
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
<t:field fieldType="Number" srcName="direction" dstName="direction" isRequired="true" regexp="[0|1|2]"/>
|
<t:field fieldType="Number" srcName="direction" dstName="direction" isRequired="true" regexp="[0|1|2]"/>
|
||||||
<t:field fieldType="String" srcName="userRegion" dstName="user_region"/>
|
<t:field fieldType="String" srcName="userRegion" dstName="user_region"/>
|
||||||
<t:field fieldType="Number" srcName="location" dstName="location" isRequired="true" regexp="[0|1]"/>
|
<t:field fieldType="Number" srcName="location" dstName="location" isRequired="true" regexp="[0|1]"/>
|
||||||
<t:field fieldType="Number" srcName="isValid" dstName="is_valid" isRequired="true" range="0-1"/>
|
<t:field fieldType="Number" srcName="isValid" dstName="is_valid" isRequired="true" regexp="[1]"/>
|
||||||
<t:field fieldType="Date" srcName="opTime" dstName="op_time" isRequired="true"/>
|
<t:field fieldType="Date" srcName="opTime" dstName="op_time" isRequired="true"/>
|
||||||
</t:commonSource>
|
</t:commonSource>
|
||||||
<!--
|
<!--
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
<t:field fieldType="Port" srcName="maskDstPort" dstName="mask_dst_port" isRequired="true" range="0-65535"/>
|
<t:field fieldType="Port" srcName="maskDstPort" dstName="mask_dst_port" isRequired="true" range="0-65535"/>
|
||||||
<t:field fieldType="Number" srcName="protocol" dstName="protocol" isRequired="true"/>
|
<t:field fieldType="Number" srcName="protocol" dstName="protocol" isRequired="true"/>
|
||||||
<t:field fieldType="Number" srcName="direction" dstName="direction" isRequired="true" range="0-1"/>
|
<t:field fieldType="Number" srcName="direction" dstName="direction" isRequired="true" range="0-1"/>
|
||||||
<t:field fieldType="Number" srcName="isValid" dstName="is_valid" isRequired="true" range="0-1"/>
|
<t:field fieldType="Number" srcName="isValid" dstName="is_valid" isRequired="true" regexp="[1]"/>
|
||||||
<t:field fieldType="Date" srcName="opTime" dstName="op_time" isRequired="true"/>
|
<t:field fieldType="Date" srcName="opTime" dstName="op_time" isRequired="true"/>
|
||||||
</t:commonSource>
|
</t:commonSource>
|
||||||
<!--
|
<!--
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
<t:field fieldType="Number" srcName="resGroup5Num" dstName="res_group_5_num" defaultVal="0"/>
|
<t:field fieldType="Number" srcName="resGroup5Num" dstName="res_group_5_num" defaultVal="0"/>
|
||||||
<t:field fieldType="Number" srcName="minTtl" dstName="min_ttl" isRequired="true"/>
|
<t:field fieldType="Number" srcName="minTtl" dstName="min_ttl" isRequired="true"/>
|
||||||
<t:field fieldType="Number" srcName="maxTtl" dstName="max_ttl" isRequired="true"/>
|
<t:field fieldType="Number" srcName="maxTtl" dstName="max_ttl" isRequired="true"/>
|
||||||
<t:field fieldType="Number" srcName="isValid" dstName="is_valid" isRequired="true" range="0-1"/>
|
<t:field fieldType="Number" srcName="isValid" dstName="is_valid" isRequired="true" regexp="[1]"/>
|
||||||
<t:field fieldType="Date" srcName="opTime" dstName="op_time" isRequired="true"/>
|
<t:field fieldType="Date" srcName="opTime" dstName="op_time" isRequired="true"/>
|
||||||
</t:commonSource>
|
</t:commonSource>
|
||||||
</t:commonSources>
|
</t:commonSources>
|
||||||
|
|||||||
Reference in New Issue
Block a user