增加 sign签名,和请求返回报文加密处理,以及文档补充
| | |
| | | public String flushGet(HttpServletRequest request) { |
| | | |
| | | return ResponseTemplateUtil.createOrderResponseJson(ResponseConstant.NO_TRANSACTION_ID, |
| | | ResponseConstant.NO_NEED_SIGN,ResponseConstant.RESULT_CODE_ERROR,"不支持Get方法请求").toJSONString(); |
| | | ResponseConstant.RESULT_CODE_ERROR,"不支持Get方法请求").toJSONString(); |
| | | } |
| | | |
| | | @RequestMapping(path = "/cacheApi/flush",method= RequestMethod.POST) |
| | |
| | | }catch (Exception e){ |
| | | logger.error("刷新缓存异常",e); |
| | | return ResponseTemplateUtil.createOrderResponseJson(ResponseConstant.NO_TRANSACTION_ID, |
| | | ResponseConstant.NO_NEED_SIGN,ResponseConstant.RESULT_CODE_ERROR,e.getMessage()+e).toJSONString(); |
| | | ResponseConstant.RESULT_CODE_ERROR,e.getMessage()+e).toJSONString(); |
| | | } |
| | | return ResponseTemplateUtil.createOrderResponseJson(ResponseConstant.NO_TRANSACTION_ID, |
| | | ResponseConstant.NO_NEED_SIGN,ResponseConstant.RESULT_CODE_SUCCESS,"成功").toJSONString(); |
| | | ResponseConstant.RESULT_CODE_SUCCESS,"成功").toJSONString(); |
| | | } |
| | | |
| | | public ICenterServiceCacheSMO getCenterServiceCacheSMOImpl() { |
| | |
| | | @RequestMapping(path = "/httpApi/service",method= RequestMethod.GET) |
| | | public String serviceGet(HttpServletRequest request) { |
| | | return ResponseTemplateUtil.createOrderResponseJson(ResponseConstant.NO_TRANSACTION_ID, |
| | | ResponseConstant.NO_NEED_SIGN,ResponseConstant.RESULT_CODE_ERROR,"不支持Get方法请求").toJSONString(); |
| | | ResponseConstant.RESULT_CODE_ERROR,"不支持Get方法请求").toJSONString(); |
| | | } |
| | | |
| | | @RequestMapping(path = "/httpApi/service",method= RequestMethod.POST) |
| | |
| | | }catch (Exception e){ |
| | | logger.error("请求订单异常",e); |
| | | return ResponseTemplateUtil.createOrderResponseJson(ResponseConstant.NO_TRANSACTION_ID, |
| | | ResponseConstant.NO_NEED_SIGN,ResponseConstant.RESULT_CODE_ERROR,e.getMessage()+e).toJSONString(); |
| | | ResponseConstant.RESULT_CODE_ERROR,e.getMessage()+e).toJSONString(); |
| | | } |
| | | } |
| | | |
| | |
| | | JSONObject orders = responseJson.getJSONObject("orders"); |
| | | JSONArray business = responseJson.getJSONArray("business"); |
| | | if(dataFlow == null || dataFlow.getAppRoutes() == null || dataFlow.getAppRoutes().size() == 0) { |
| | | orders.put("sign", AuthenticationFactory.md5(orders.getString("transactionId"), orders.getString("responseTime"), |
| | | business.toJSONString(), MappingCache.getValue(MappingConstant.KEY_DEFAULT_SECURITY_CODE))); |
| | | /*orders.put("sign", AuthenticationFactory.md5(orders.getString("transactionId"), orders.getString("responseTime"), |
| | | business.toJSONString(), MappingCache.getValue(MappingConstant.KEY_DEFAULT_SECURITY_CODE)));*/ |
| | | orders.put("sign",""); |
| | | }else { |
| | | orders.put("sign", AuthenticationFactory.md5(orders.getString("transactionId"), orders.getString("responseTime"), |
| | | business.toJSONString(), dataFlow.getAppRoutes().get(0).getSecurityCode())); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 加载公钥 |
| | | * 加载私钥 |
| | | * @param privateKeyPem |
| | | * @param algorithm |
| | | * @return |
| | |
| | | } |
| | | |
| | | /** |
| | | * 加载私钥 |
| | | * 加载公钥 |
| | | * @param publicPemData |
| | | * @param algorithm |
| | | * @return |