String property = env.getProperty("slbHttp.delGoodsRedis");
String productId = Convert.toStr(slGwjProduct.getId());
try {
HashMap<String, Object> paramMap = new HashMap<>();
paramMap.put("productId", productId);
log.info("调用远程开始:{}", paramMap);
String postRst = HttpUtil.post(property, paramMap);
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(postRst);
Boolean success = Convert.toBool(jsonObject.get("success"));
String message1 = Convert.toStr(jsonObject.get("message"));
log.info("调用远程返参信息:{}",message1);
if(success){
log.info("调用远程接口成功!");
}else{
log.info("调用远程接口失败!");
}
HttpUtil远程调用
最新推荐文章于 2024-08-15 14:47:41 发布