diff --git a/src/main/java/com/nis/web/controller/restful/ConfigSourcesController.java b/src/main/java/com/nis/web/controller/restful/ConfigSourcesController.java index b4e34d5..be4e954 100644 --- a/src/main/java/com/nis/web/controller/restful/ConfigSourcesController.java +++ b/src/main/java/com/nis/web/controller/restful/ConfigSourcesController.java @@ -81,6 +81,9 @@ public class ConfigSourcesController extends BaseRestController { if (getLock(requestId)) { if (null != configSource && null != configSource.getConfigCompileList() && configSource.getConfigCompileList().size() > 0) { + if (configSource.getConfigCompileList()!=null&&configSource.getConfigCompileList().size()>Constants.MAX_LIST_SIZE) { + thread.setContent("批量提交数量超过"+Constants.MAX_LIST_SIZE+"条,不记录请求内容"); + } checkOpAction(thread, System.currentTimeMillis() - start, configSource.getOpAction(), Constants.OPACTION_POST); // 验证配置编译数据 @@ -131,6 +134,9 @@ public class ConfigSourcesController extends BaseRestController { if (null != configSource && null != configSource.getConfigCompileList() && configSource.getConfigCompileList().size() > 0) { int opAction = configSource.getOpAction(); + if (configSource.getConfigCompileList()!=null&&configSource.getConfigCompileList().size()>Constants.MAX_LIST_SIZE) { + thread.setContent("批量提交数量超过"+Constants.MAX_LIST_SIZE+"条,不记录请求内容"); + } checkOpAction(thread, System.currentTimeMillis() - start, opAction, 2); configSourcesService.updateConfigSources(thread, start, configSource.getConfigCompileList(), configSource.getOpTime(), sb); diff --git a/src/main/java/com/nis/web/controller/restful/MaatTestController.java b/src/main/java/com/nis/web/controller/restful/MaatTestController.java index c3f4c02..56114df 100644 --- a/src/main/java/com/nis/web/controller/restful/MaatTestController.java +++ b/src/main/java/com/nis/web/controller/restful/MaatTestController.java @@ -578,7 +578,7 @@ public class MaatTestController { } else if (srcName.toLowerCase().equals("cfgid") || srcName.toLowerCase().equals("keyringid") || srcName.toLowerCase().equals("fileid")) { - Long incrId = configRedisService.getIncrId("seq_compileid"); + Long incrId = configRedisService.getIncrId("SEQ_COMPILEID"); compileIdList.add(incrId); jsonString.append(incrId); } else { diff --git a/src/main/java/com/nis/web/service/AuditLogThread.java b/src/main/java/com/nis/web/service/AuditLogThread.java index f589231..b8db811 100644 --- a/src/main/java/com/nis/web/service/AuditLogThread.java +++ b/src/main/java/com/nis/web/service/AuditLogThread.java @@ -50,7 +50,6 @@ public class AuditLogThread implements Runnable { private int businessCode; private String exceptionInfo; private String traceCode; - private Boolean saveContentFlag=true;//是否保存请求内容 /* * (non-Javadoc) * @@ -63,7 +62,7 @@ public class AuditLogThread implements Runnable { CustomerContextHolder.setCustomerType(CustomerContextHolder.DATA_SOURCE_A);// 开启数据源B if (service != null) { service.saveRequestLog(remoteAddr, requestURI, queryString, contextPath, operator, version, opAction, - opTime, content, requestTime, consumerTime, businessCode, exceptionInfo, traceCode,saveContentFlag); + opTime, content, requestTime, consumerTime, businessCode, exceptionInfo, traceCode); } else { logger.error("service 为空!"); } @@ -430,12 +429,4 @@ public class AuditLogThread implements Runnable { public void setTraceCode(String traceCode) { this.traceCode = traceCode; } - - public Boolean getSaveContentFlag() { - return saveContentFlag; - } - - public void setSaveContentFlag(Boolean saveContentFlag) { - this.saveContentFlag = saveContentFlag; - } } diff --git a/src/main/java/com/nis/web/service/ServicesRequestLogService.java b/src/main/java/com/nis/web/service/ServicesRequestLogService.java index 80cc552..a960373 100644 --- a/src/main/java/com/nis/web/service/ServicesRequestLogService.java +++ b/src/main/java/com/nis/web/service/ServicesRequestLogService.java @@ -92,7 +92,7 @@ public class ServicesRequestLogService { */ public void saveRequestLog(String requestAddr, String requestURI, String queryString, String contextPath, String operator, String version, int opAction, Date opTime, Object content, Date requestTime, - long consumerTime, int businessCode, String exceptionInfo, String traceCode,Boolean saveContentFlag) { + long consumerTime, int businessCode, String exceptionInfo, String traceCode) { logger.info("开始记录日志---"); logger.info("请求IP---" + requestAddr); logger.info("请求路径---" + requestURI); @@ -171,13 +171,9 @@ public class ServicesRequestLogService { if ("file".equals(type)) {// 文件上传 log.setRequestContent(content.toString()); } else { - if(!saveContentFlag){ - log.setRequestContent("批量提交数量超过"+Constants.MAX_LIST_SIZE+",不记录请求内容"); - } if (content != null) { log.setRequestContent(content.toString()); } - } } diff --git a/src/main/java/com/nis/web/service/restful/ConfigSourcesService.java b/src/main/java/com/nis/web/service/restful/ConfigSourcesService.java index 1758443..086e5a2 100644 --- a/src/main/java/com/nis/web/service/restful/ConfigSourcesService.java +++ b/src/main/java/com/nis/web/service/restful/ConfigSourcesService.java @@ -127,9 +127,6 @@ public class ConfigSourcesService extends BaseService { Map> maatMap = new HashMap>(); Map> configMap = new HashMap>(); - if (configCompileList!=null&&configCompileList.size()>Constants.MAX_LIST_SIZE) { - thread.setSaveContentFlag(false); - } for (ConfigCompile configCompile : configCompileList) { Integer service = Integer.valueOf(configCompile.getService().toString()); MaatConfig maatConfig = new MaatConfig(); @@ -326,9 +323,6 @@ public class ConfigSourcesService extends BaseService { public void updateConfigSources(AuditLogThread thread, long start, List compileList, Date opTime, StringBuffer sb) throws Exception { Map> compileMap = new HashMap>(); - if (compileList!=null&&compileList.size()>Constants.MAX_LIST_SIZE) { - thread.setSaveContentFlag(false); - } if (null != compileList && compileList.size() > 0) { for (ConfigCompile config : compileList) { checkCompileOptForUpdate(config); @@ -423,7 +417,7 @@ public class ConfigSourcesService extends BaseService { RestBusinessCode.CBParamFormateError.getValue()); } if (jsonObjectList!=null&&jsonObjectList.size()>Constants.MAX_LIST_SIZE) { - thread.setSaveContentFlag(false); + thread.setContent("批量提交数量超过"+Constants.MAX_LIST_SIZE+"条,不记录请求内容"); } Map>> dstMaps = new HashMap>>(); for (int i = 0; i < jsonObjectList.size(); i++) { @@ -645,7 +639,7 @@ public class ConfigSourcesService extends BaseService { RestBusinessCode.CBParamFormateError.getValue()); } if (jsonObjectList!=null&&jsonObjectList.size()>Constants.MAX_LIST_SIZE) { - thread.setSaveContentFlag(false); + thread.setContent("批量提交数量超过"+Constants.MAX_LIST_SIZE+"条,不记录请求内容"); } // Map> cfgMap = new HashMap>(); @@ -879,12 +873,6 @@ public class ConfigSourcesService extends BaseService { maatConfig.getIpRegionMapList().addAll(dstMapList); } - if ((maatConfig.getStrRegionMapList()!=null&&maatConfig.getStrRegionMapList().size()>Constants.MAX_LIST_SIZE) - ||(maatConfig.getStrStrRegionMapList()!=null&&maatConfig.getStrStrRegionMapList().size()>Constants.MAX_LIST_SIZE) - ||(maatConfig.getIpRegionMapList()!=null&&maatConfig.getIpRegionMapList().size()>Constants.MAX_LIST_SIZE) - ||(maatConfig.getNumRegionMapList()!=null&&maatConfig.getNumRegionMapList().size()>Constants.MAX_LIST_SIZE)) { - thread.setSaveContentFlag(false); - } //maatConfig.setService(groupReuse.getService()); list.add(maatConfig); } @@ -958,7 +946,7 @@ public class ConfigSourcesService extends BaseService { } logger.info("调用接口删除Redis中分组复用的域配置接口"); if (reuseMap!=null&&reuseMap.size()>Constants.MAX_LIST_SIZE) { - thread.setSaveContentFlag(false); + thread.setContent("批量提交数量超过"+Constants.MAX_LIST_SIZE+"条,不记录请求内容"); } // 所有的都删除成功返回true if (!configRedisService.delGroupReuseConfig(reuseMap)) { diff --git a/src/main/resources/applicationConfig-rule.properties b/src/main/resources/applicationConfig-rule.properties index f1af9a3..c163087 100644 --- a/src/main/resources/applicationConfig-rule.properties +++ b/src/main/resources/applicationConfig-rule.properties @@ -345,7 +345,7 @@ tapRedisDb=5 #0x205 基于PXY IP替换 517 #0x402 APP DOMAIN特征发现 1026 #0x404 APP IP特征 1028 -maat2Valve=33:strRegion@ACTION&SERVICE&USER_REGION;512:ipRegion@ACTION&SERVICE&USER_REGION;513:strRegion@ACTION&SERVICE&USER_REGION;514:ipRegion@ACTION&SERVICE&USER_REGION;515:strRegion@ACTION&SERVICE&USER_REGION;517:ipRegion@ACTION&SERVICE&USER_REGION;1026:strRegion|strStrRegion@ACTION&SERVICE&USER_REGION;1028:ipRegion@ACTION&SERVICE&USER_REGION;5:ipRegion@COMPILE_ID&USER_REGION +maat2Valve=33:strRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;512:ipRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;513:strRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;514:ipRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;515:strRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;517:ipRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;1026:strRegion|strStrRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;1028:ipRegion@ACTION&SERVICE&USER_REGION&EFFECTIVE_RANGE;5:ipRegion@COMPILE_ID&USER_REGION&EFFECTIVE_RANGE ##记录哪些service可以被分组复用(只有maat类配置可以被分组复用) #业务ID:域类型1@表名,表名|域类型2@表名;业务ID:域类型1@表名,表名|域类型2@表名 diff --git a/src/main/resources/commonSources/applicationConfig-parser.xml b/src/main/resources/commonSources/applicationConfig-parser.xml index cf008c4..7336c54 100644 --- a/src/main/resources/commonSources/applicationConfig-parser.xml +++ b/src/main/resources/commonSources/applicationConfig-parser.xml @@ -27,6 +27,7 @@ +