This commit is contained in:
zhanghongqing
2018-12-12 16:34:17 +08:00
7 changed files with 557 additions and 432 deletions

View File

@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.nis.domain.Page;
import com.nis.domain.restful.NtcAppLog;
import com.nis.domain.restful.NtcBgpLog;
import com.nis.domain.restful.NtcCollectRadiusLog;
import com.nis.domain.restful.NtcCollectVoipLog;
import com.nis.domain.restful.NtcDdosLog;
import com.nis.domain.restful.NtcDnsLog;
@@ -584,4 +585,38 @@ public class NtcLogSearchController extends BaseRestController {
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "VoIp泛收日志检索成功", page,
0);
}
@RequestMapping(value = "/ntcCollectRadiusLogs", method = RequestMethod.GET)
@ApiOperation(value = "RADIUS泛收日志查询", httpMethod = "GET", notes = "对日志功能“RADIUS泛收日志查询”提供数据基础查询服务")
public Map<String, ?> ntcCollectRadiusLogs(Page page, NtcCollectRadiusLog ntcCollectRadiusLog, Model model,
HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis();
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request,
null);
try {
if (StringUtil.isEmpty(ntcCollectRadiusLog.getSearchFoundStartTime())
&& StringUtil.isEmpty(ntcCollectRadiusLog.getSearchFoundEndTime())) {
Map<String, String> map = DateUtils.getLocalTime(null,
null, Constants.LOG_LOCAL_TIME, "minute");
ntcCollectRadiusLog.setSearchFoundStartTime(map.get("startTime"));
ntcCollectRadiusLog.setSearchFoundEndTime(map.get("endTime"));
}
ntcLogService.queryConditionCheck(auditLogThread, start,ntcCollectRadiusLog, NtcCollectRadiusLog.class, page);
logDataService.getData(page, ntcCollectRadiusLog);
} catch (Exception e) {
e.printStackTrace();
auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
logger.error(ExceptionUtil.getExceptionMsg(e));
if (!(e instanceof RestServiceException)) {
throw new ServiceRuntimeException(auditLogThread, System.currentTimeMillis() - start,
"RADIUS泛收日志检索失败:" + e.getMessage(), RestBusinessCode.service_runtime_error.getValue());
}else{
throw ((RestServiceException) e);
}
}
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "RADIUS泛收日志检索成功", page,
0);
}
}

View File

@@ -1434,4 +1434,40 @@
<result column="user_agent" jdbcType="VARCHAR" property="userAgent" />
<result column="server" jdbcType="VARCHAR" property="server" />
</resultMap>
<resultMap id="NtcCollectRadiusLogMap" type="com.nis.domain.restful.NtcCollectRadiusLog">
<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="link_id" jdbcType="BIGINT" property="linkId" />
<result column="encap_type" jdbcType="INTEGER" property="encapType" />
<result column="inner_smac" jdbcType="VARCHAR" property="innerSmac" />
<result column="inner_dmac" jdbcType="VARCHAR" property="innerDmac" />
<result column="code" jdbcType="INTEGER" property="code" />
<result column="nas_ip" jdbcType="VARCHAR" property="nasIp" />
<result column="framed_ip" jdbcType="VARCHAR" property="framedIp" />
<result column="account" jdbcType="VARCHAR" property="account" />
</resultMap>
</mapper>