Merge branch 'Release-1.3' of http://192.168.10.125/galaxy/galaxy-service.git into Release-1.3
This commit is contained in:
@@ -13,6 +13,8 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.nis.util.JsonDateDeserializer;
|
||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
@@ -50,11 +52,11 @@ public class ConfigCompile implements Serializable {
|
||||
private Integer doLog;
|
||||
@ApiModelProperty(value = "生效范围", required = true)
|
||||
private String effectiveRange;
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "开始时间", required = true)
|
||||
private Date startTime;
|
||||
@ApiModelProperty(value = "结束时间", required = true)
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
@ApiModelProperty(value = "用户自定义域", required = true)
|
||||
private String userRegion;
|
||||
@@ -65,7 +67,7 @@ public class ConfigCompile implements Serializable {
|
||||
@ApiModelProperty(value = "父配置ID", required = true)
|
||||
private Long fatherCfgId;
|
||||
@ApiModelProperty(value = "操作时间", required = true)
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date opTime;
|
||||
|
||||
@ApiModelProperty(value = "编译分组关系列表", required = true)
|
||||
@@ -79,13 +81,13 @@ public class ConfigCompile implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "数值域分组列表", required = true)
|
||||
private List<NumRegion> numRegionList;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "摘要域分组列表", required = true)
|
||||
private List<DigestRegion> digestRegionList;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "生效范围IP域分组列表", required = true)
|
||||
private List<IpRegion> ipClientRangeList;
|
||||
|
||||
|
||||
public Long getCompileId() {
|
||||
return compileId;
|
||||
}
|
||||
@@ -193,10 +195,10 @@ public class ConfigCompile implements Serializable {
|
||||
this.effectiveRange = effectiveRange;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return startTime
|
||||
*/
|
||||
@JsonDeserialize(using = JsonDateDeserializer.class)
|
||||
public Date getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
@@ -205,6 +207,7 @@ public class ConfigCompile implements Serializable {
|
||||
* @param startTime
|
||||
* 要设置的 startTime
|
||||
*/
|
||||
@JsonDeserialize(using = JsonDateDeserializer.class)
|
||||
public void setStartTime(Date startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
@@ -212,6 +215,7 @@ public class ConfigCompile implements Serializable {
|
||||
/**
|
||||
* @return endTime
|
||||
*/
|
||||
@JsonDeserialize(using = JsonDateDeserializer.class)
|
||||
public Date getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
@@ -220,6 +224,7 @@ public class ConfigCompile implements Serializable {
|
||||
* @param endTime
|
||||
* 要设置的 endTime
|
||||
*/
|
||||
@JsonDeserialize(using = JsonDateDeserializer.class)
|
||||
public void setEndTime(Date endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
@@ -287,6 +292,7 @@ public class ConfigCompile implements Serializable {
|
||||
/**
|
||||
* @return opTime
|
||||
*/
|
||||
@JsonDeserialize(using = JsonDateDeserializer.class)
|
||||
public Date getOpTime() {
|
||||
return opTime;
|
||||
}
|
||||
@@ -295,6 +301,7 @@ public class ConfigCompile implements Serializable {
|
||||
* @param opTime
|
||||
* 要设置的 opTime
|
||||
*/
|
||||
@JsonDeserialize(using = JsonDateDeserializer.class)
|
||||
public void setOpTime(Date opTime) {
|
||||
this.opTime = opTime;
|
||||
}
|
||||
@@ -359,7 +366,7 @@ public class ConfigCompile implements Serializable {
|
||||
public void setNumRegionList(List<NumRegion> numRegionList) {
|
||||
this.numRegionList = numRegionList;
|
||||
}
|
||||
|
||||
|
||||
public List<DigestRegion> getDigestRegionList() {
|
||||
return digestRegionList;
|
||||
}
|
||||
@@ -391,5 +398,5 @@ public class ConfigCompile implements Serializable {
|
||||
public void setIpClientRangeList(List<IpRegion> ipClientRangeList) {
|
||||
this.ipClientRangeList = ipClientRangeList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ public class GroupReuse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
// ASN-IP阻断和监测不用传service和ipregion.userRegion字段,当是app协议ip业务时需要传入ipregion.userRegion字段
|
||||
@ApiModelProperty(value = "业务ID", required = true)
|
||||
private Integer service;
|
||||
// @ApiModelProperty(value = "业务ID", required = true)
|
||||
// private Integer service;
|
||||
|
||||
@ApiModelProperty(value = "字符串域分组列表", access = "", required = true)
|
||||
private List<StrRegion> strRegionList;
|
||||
@@ -83,11 +83,4 @@ public class GroupReuse implements Serializable {
|
||||
this.numRegionList = numRegionList;
|
||||
}
|
||||
|
||||
public Integer getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
public void setService(Integer service) {
|
||||
this.service = service;
|
||||
}
|
||||
}
|
||||
|
||||
30
src/main/java/com/nis/domain/restful/NtcKeywordsUrlLog.java
Normal file
30
src/main/java/com/nis/domain/restful/NtcKeywordsUrlLog.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.nis.domain.restful;
|
||||
|
||||
import com.nis.domain.LogEntity;
|
||||
|
||||
public class NtcKeywordsUrlLog extends LogEntity<NtcKeywordsUrlLog> {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String url;
|
||||
private String website;
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getWebsite() {
|
||||
return website;
|
||||
}
|
||||
|
||||
public void setWebsite(String website) {
|
||||
this.website = website;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -98,14 +98,14 @@ public class GroupReuseVal {
|
||||
for (IpRegion ipRegion : ipRegionList) {
|
||||
// if (groupReuse.getIsValid() != 0 &&
|
||||
// !regionGroupIdList.contains(ipRegion.getGroupId())) {
|
||||
if (!StringUtil.isEmpty(groupReuse.getService())) {
|
||||
if (groupReuse.getService().intValue()!=1028) {
|
||||
throw new RestServiceException("ipRegionList中的regionId为"
|
||||
+ ipRegion.getRegionId()
|
||||
+ "的域配置的service只能为空或1028",
|
||||
RestBusinessCode.ReUseServiceRange
|
||||
.getValue());
|
||||
}
|
||||
// if (!StringUtil.isEmpty(groupReuse.getService())) {
|
||||
// if (groupReuse.getService().intValue()!=1028) {
|
||||
// throw new RestServiceException("ipRegionList中的regionId为"
|
||||
// + ipRegion.getRegionId()
|
||||
// + "的域配置的service只能为空或1028",
|
||||
// RestBusinessCode.ReUseServiceRange
|
||||
// .getValue());
|
||||
// }
|
||||
if (StringUtil.isEmpty(ipRegion.getUserRegion())) {
|
||||
throw new RestServiceException("ipRegionList中的regionId为"
|
||||
+ ipRegion.getRegionId()
|
||||
@@ -113,7 +113,7 @@ public class GroupReuseVal {
|
||||
RestBusinessCode.ReUseUserRegionIsNull
|
||||
.getValue());
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
if (!StringUtil.isEmpty(ipRegion.getTableName())
|
||||
&& !groupReuseRegionMap.get("ipRegion").contains(ipRegion.getTableName())) {
|
||||
|
||||
@@ -8,7 +8,6 @@ import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zdjizhi.utils.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -25,6 +24,7 @@ import com.nis.domain.restful.NtcFtpLog;
|
||||
import com.nis.domain.restful.NtcHttpLog;
|
||||
import com.nis.domain.restful.NtcIpLog;
|
||||
import com.nis.domain.restful.NtcIpsecLog;
|
||||
import com.nis.domain.restful.NtcKeywordsUrlLog;
|
||||
import com.nis.domain.restful.NtcL2tpLog;
|
||||
import com.nis.domain.restful.NtcMailLog;
|
||||
import com.nis.domain.restful.NtcOpenvpnLog;
|
||||
@@ -35,11 +35,10 @@ import com.nis.domain.restful.NtcSslLog;
|
||||
import com.nis.domain.restful.NtcStreamingMediaLog;
|
||||
import com.nis.domain.restful.NtcVoipLog;
|
||||
import com.nis.restful.RestServiceException;
|
||||
import com.nis.util.Configurations;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DateUtils;
|
||||
import com.nis.util.LogJDBCByDruid;
|
||||
import com.nis.util.JsonMapper;
|
||||
import com.nis.util.LogJDBCByDruid;
|
||||
import com.nis.web.controller.BaseRestController;
|
||||
import com.nis.web.service.AuditLogThread;
|
||||
import com.nis.web.service.HiveSqlService;
|
||||
@@ -47,6 +46,7 @@ import com.nis.web.service.ServicesRequestLogService;
|
||||
import com.nis.web.service.restful.NtcLogService;
|
||||
import com.wordnik.swagger.annotations.Api;
|
||||
import com.wordnik.swagger.annotations.ApiOperation;
|
||||
import com.zdjizhi.utils.StringUtil;
|
||||
|
||||
/**
|
||||
* @ClassName:NtcLogSearchController
|
||||
@@ -1079,6 +1079,60 @@ public class NtcLogSearchController extends BaseRestController {
|
||||
logPage, 0);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/ntcKeywordsUrlLogs", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "NTC关键字转URL日志查询", httpMethod = "GET", notes = "对日志功能“NTC关键字转URL日志”提供数据基础查询服务")
|
||||
public Map<String, ?> ntcKeywordsUrlLogs(Page page, NtcKeywordsUrlLog ntcKeywordsUrlLog, Model model, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
long start = System.currentTimeMillis();
|
||||
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
|
||||
request, null);
|
||||
|
||||
Page<NtcStreamingMediaLog> logPage = null;
|
||||
try {
|
||||
resetTime(ntcKeywordsUrlLog);
|
||||
ntcLogService.queryConditionCheck(auditLogThread, start, ntcKeywordsUrlLog, NtcKeywordsUrlLog.class, page);
|
||||
logPage = new Page<NtcStreamingMediaLog>();
|
||||
logPage.setPageNo(page.getPageNo());
|
||||
logPage.setPageSize(page.getPageSize());
|
||||
String orderBy = "";
|
||||
if (null != page.getOrderBy() && !page.getOrderBy().equals("")) {
|
||||
orderBy = Page.getOrderBySql(NtcStreamingMediaLog.class.getSimpleName(), page.getOrderBy());
|
||||
} else {
|
||||
orderBy = "found_Time";
|
||||
}
|
||||
String sql = HiveSqlService.getSql(page, ntcKeywordsUrlLog,
|
||||
getTableName(NtcKeywordsUrlLog.class.getSimpleName() + "HiveTable", "NTC_KEYWORDS_URL_LOG"),
|
||||
getCol2Col(), orderBy, null);
|
||||
Map<String, List<Object>> tableMapping = new LogJDBCByDruid().tableMapping(page, null, sql, NtcStreamingMediaLog.class, "foundTime",
|
||||
"recvTime");
|
||||
if (tableMapping == null) {
|
||||
logPage.setList(new ArrayList());
|
||||
} else {
|
||||
List list = tableMapping.get("obj");
|
||||
if (list.size() > 0) {
|
||||
String jsonString = JsonMapper.toJsonString(list);
|
||||
List<NtcStreamingMediaLog> List = (java.util.List<NtcStreamingMediaLog>) JsonMapper.fromJsonList(jsonString,
|
||||
NtcStreamingMediaLog.class);
|
||||
logPage.setList(List);
|
||||
logPage.setCount(List.size());
|
||||
|
||||
} else {
|
||||
logPage.setList(new ArrayList());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
||||
logger.error(e);
|
||||
if (!(e instanceof RestServiceException)) {
|
||||
e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "NTC关键字转URL日志检索失败");
|
||||
}
|
||||
throw ((RestServiceException) e);
|
||||
}
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "NTC关键字转URL日志检索成功",
|
||||
logPage, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
*判断开始和结束时间是否为null,如果为null则初始化时间
|
||||
* @param entity
|
||||
|
||||
@@ -1229,4 +1229,34 @@
|
||||
<result column="fd_type" jdbcType="INTEGER" property="fdType" />
|
||||
<result column="protocol" jdbcType="VARCHAR" property="protocol" />
|
||||
</resultMap>
|
||||
<resultMap id="NtcKeywordsUrlLogMap" type="com.nis.domain.restful.NtcKeywordsUrlLog">
|
||||
<result column="cfg_id" jdbcType="BIGINT" property="cfgId" />
|
||||
<result column="found_Time" jdbcType="TIMESTAMP" property="foundTime" />
|
||||
<result column="recv_Time" jdbcType="TIMESTAMP" property="recvTime" />
|
||||
<result column="trans_proto" jdbcType="VARCHAR" property="transProto" />
|
||||
<result column="addr_type" jdbcType="INTEGER" property="addrType" />
|
||||
<result column="d_ip" jdbcType="VARCHAR" property="dIp" />
|
||||
<result column="s_ip" jdbcType="VARCHAR" property="sIp" />
|
||||
<result column="d_port" jdbcType="VARCHAR" property="dPort" />
|
||||
<result column="s_port" jdbcType="VARCHAR" property="sPort" />
|
||||
<result column="service" jdbcType="INTEGER" property="service" />
|
||||
<result column="entrance_id" jdbcType="BIGINT" property="entranceId" />
|
||||
<result column="device_id" jdbcType="INTEGER" property="deviceId" />
|
||||
<result column="direction" jdbcType="INTEGER" property="direction" />
|
||||
<result column="stream_dir" jdbcType="INTEGER" property="streamDir" />
|
||||
<result column="cap_ip" jdbcType="VARCHAR" property="capIp" />
|
||||
<result column="addr_list" jdbcType="VARCHAR" property="addrList" />
|
||||
<result column="user_region" jdbcType="VARCHAR" property="userRegion" />
|
||||
<result column="server_locate" jdbcType="VARCHAR" property="serverLocate" />
|
||||
<result column="client_locate" jdbcType="VARCHAR" property="clientLocate" />
|
||||
<result column="s_asn" jdbcType="VARCHAR" property="sAsn" />
|
||||
<result column="d_asn" jdbcType="VARCHAR" property="dAsn" />
|
||||
<result column="s_subscribe_id" jdbcType="VARCHAR" property="sSubscribeId" />
|
||||
<result column="d_subscribe_id" jdbcType="VARCHAR" property="dSubscribeId" />
|
||||
<result column="scene_file" jdbcType="VARCHAR" property="sceneFile" />
|
||||
|
||||
<result column="url" jdbcType="VARCHAR" property="url" />
|
||||
<result column="website" jdbcType="VARCHAR" property="website" />
|
||||
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -1445,7 +1445,7 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
}
|
||||
|
||||
private void addTmpReion(List<Map<String, String>> regionMapList, MaatXmlConfig maatXmlConfig,
|
||||
Transaction transaction, int type, int tmpStorageReuseRegionDB, int idRelaRedisDBIndex, Integer service) {
|
||||
Transaction transaction, int type, int tmpStorageReuseRegionDB, int idRelaRedisDBIndex, Integer service1) {
|
||||
if (regionMapList != null && regionMapList.size() > 0) {
|
||||
for (Map<String, String> map : regionMapList) {
|
||||
List<MaatXmlExpr> expressionList = maatXmlConfig.getExpressionList();
|
||||
@@ -1488,8 +1488,9 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||
for (String valStr : valSplit) {
|
||||
if (!StringUtils.isEmpty(valStr) && valStr.trim().startsWith("[")) {
|
||||
valStr = valStr.trim().replace("[", "").replace("]", "");
|
||||
if (service != null && service.intValue() == 1028
|
||||
&& valStr.toLowerCase().equals("op_time") && type == 12) {
|
||||
// if (service != null && service.intValue() == 1028
|
||||
// && valStr.toLowerCase().equals("op_time") && type == 12) {
|
||||
if (valStr.toLowerCase().equals("op_time") && type == 12) {
|
||||
String user_region = map.get("user_region");
|
||||
valBF.append(user_region + "\t");
|
||||
}
|
||||
|
||||
@@ -864,7 +864,7 @@ public class ConfigSourcesService extends BaseService {
|
||||
} else {
|
||||
maatConfig.getIpRegionMapList().addAll(dstMapList);
|
||||
}
|
||||
maatConfig.setService(groupReuse.getService());
|
||||
//maatConfig.setService(groupReuse.getService());
|
||||
list.add(maatConfig);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,11 @@ public class TrafficNmsServerStatisticService {
|
||||
public void saveNmsInfo(List<TrafficNmsServerStatistic> trafficNmsServerList) {
|
||||
for (TrafficNmsServerStatistic trafficNmsServerStatistic : trafficNmsServerList) {
|
||||
trafficNmsServerStatisticDao.insert(trafficNmsServerStatistic);
|
||||
trafficNmsServerStatisticDao.insertAbnormalMachine(trafficNmsServerStatistic.getId(),
|
||||
trafficNmsServerStatistic.getAbnormalMachineList());
|
||||
if (trafficNmsServerStatistic.getAbnormalMachineList() != null
|
||||
&& trafficNmsServerStatistic.getAbnormalMachineList().size() > 0) {
|
||||
trafficNmsServerStatisticDao.insertAbnormalMachine(trafficNmsServerStatistic.getId(),
|
||||
trafficNmsServerStatistic.getAbnormalMachineList());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user