| | |
| | | |
| | | |
| | | /** |
| | | * 服务调度 |
| | | * cmd 服务调度 |
| | | * |
| | | * @param reqJson 请求报文json |
| | | * @param headers |
| | |
| | | |
| | | ResponseEntity<String> responseEntity = null; |
| | | |
| | | //1.0 创建数据流 appId serviceCode |
| | | //todo 1.0 创建数据流 appId serviceCode |
| | | cmdDataFlowContext = DataFlowFactory.newInstance(CmdDataFlow.class).builder(reqJson, headers); |
| | | |
| | | |
| | | //6.0 调用下游系统 |
| | | //todo 2.0 调用下游系统 |
| | | invokeBusinessSystem(cmdDataFlowContext); |
| | | |
| | | responseEntity = cmdDataFlowContext.getResponseEntity(); |
| | |
| | | |
| | | |
| | | /** |
| | | * 6.0 调用下游系统 |
| | | * 2.0 调用下游系统 |
| | | * |
| | | * @param cmdDataFlowContext |
| | | * @throws BusinessException |
| | | */ |
| | | private void invokeBusinessSystem(ICmdDataFlowContext cmdDataFlowContext) throws Exception { |
| | | //todo 发布 cmd 事件 |
| | | ServiceCmdEventPublishing.multicastEvent(cmdDataFlowContext); |
| | | } |
| | | |
| | |
| | | private void saveLogMessage(String requestJson, String responseJson) { |
| | | |
| | | try { |
| | | if (MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_LOG_ON_OFF))) { |
| | | if (MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.DOMAIN_SYSTEM_SWITCH,MappingConstant.KEY_LOG_ON_OFF))) { |
| | | JSONObject log = new JSONObject(); |
| | | log.put("request", requestJson); |
| | | log.put("response", responseJson); |
| | |
| | | */ |
| | | private void saveCostTimeLogMessage(DataFlow cmdDataFlowContext) { |
| | | try { |
| | | if (MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_COST_TIME_ON_OFF))) { |
| | | if (MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.DOMAIN_SYSTEM_SWITCH,MappingConstant.KEY_COST_TIME_ON_OFF))) { |
| | | List<DataFlowLinksCost> cmdDataFlowContextLinksCosts = cmdDataFlowContext.getLinksCostDates(); |
| | | JSONObject costDate = new JSONObject(); |
| | | JSONArray costDates = new JSONArray(); |